mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 23:53:27 +02:00
Make the beta GUI fork in linux.
This commit is contained in:
parent
bcfc7d978a
commit
2968917a46
2 changed files with 16 additions and 12 deletions
|
|
@ -21,6 +21,7 @@
|
|||
import sys, os, logging, mechanize
|
||||
iswindows = 'win32' in sys.platform.lower()
|
||||
isosx = 'darwin' in sys.platform.lower()
|
||||
islinux = not(iswindows or isosx)
|
||||
|
||||
if iswindows:
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
QToolButton, QDialog
|
||||
from PyQt4.QtSvg import QSvgRenderer
|
||||
|
||||
from libprs500 import __version__, __appname__
|
||||
from libprs500 import __version__, __appname__, islinux
|
||||
from libprs500.ptempfile import PersistentTemporaryFile
|
||||
from libprs500.ebooks.metadata.meta import get_metadata
|
||||
from libprs500.ebooks.lrf.web.convert_from import main as web2lrf
|
||||
|
|
@ -679,18 +679,21 @@ def unhandled_exception(self, type, value, tb):
|
|||
d = ConversionErrorDialog(self.window, 'ERROR: Unhandled exception', msg)
|
||||
d.exec_()
|
||||
|
||||
def main():
|
||||
def main(args=sys.argv):
|
||||
from PyQt4.Qt import QApplication, QMainWindow
|
||||
app = QApplication(sys.argv)
|
||||
window = QMainWindow()
|
||||
window.setWindowTitle(APP_TITLE)
|
||||
QCoreApplication.setOrganizationName("KovidsBrain")
|
||||
QCoreApplication.setApplicationName(APP_TITLE)
|
||||
|
||||
initialize_file_icon_provider()
|
||||
main = Main(window)
|
||||
sys.excepthook = main.unhandled_exception
|
||||
return app.exec_()
|
||||
pid = os.fork() if islinux else -1
|
||||
if pid <= 0:
|
||||
app = QApplication(args)
|
||||
window = QMainWindow()
|
||||
window.setWindowTitle(APP_TITLE)
|
||||
QCoreApplication.setOrganizationName("KovidsBrain")
|
||||
QCoreApplication.setApplicationName(APP_TITLE)
|
||||
|
||||
initialize_file_icon_provider()
|
||||
main = Main(window)
|
||||
sys.excepthook = main.unhandled_exception
|
||||
return app.exec_()
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
Loading…
Reference in a new issue