mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make the beta GUI fork in linux.
This commit is contained in:
parent
bcfc7d978a
commit
2968917a46
@ -21,6 +21,7 @@ __appname__ = 'libprs500'
|
|||||||
import sys, os, logging, mechanize
|
import sys, os, logging, mechanize
|
||||||
iswindows = 'win32' in sys.platform.lower()
|
iswindows = 'win32' in sys.platform.lower()
|
||||||
isosx = 'darwin' in sys.platform.lower()
|
isosx = 'darwin' in sys.platform.lower()
|
||||||
|
islinux = not(iswindows or isosx)
|
||||||
|
|
||||||
if iswindows:
|
if iswindows:
|
||||||
try:
|
try:
|
||||||
|
@ -21,7 +21,7 @@ from PyQt4.QtGui import QPixmap, QColor, QPainter, QMenu, QIcon, QMessageBox, \
|
|||||||
QToolButton, QDialog
|
QToolButton, QDialog
|
||||||
from PyQt4.QtSvg import QSvgRenderer
|
from PyQt4.QtSvg import QSvgRenderer
|
||||||
|
|
||||||
from libprs500 import __version__, __appname__
|
from libprs500 import __version__, __appname__, islinux
|
||||||
from libprs500.ptempfile import PersistentTemporaryFile
|
from libprs500.ptempfile import PersistentTemporaryFile
|
||||||
from libprs500.ebooks.metadata.meta import get_metadata
|
from libprs500.ebooks.metadata.meta import get_metadata
|
||||||
from libprs500.ebooks.lrf.web.convert_from import main as web2lrf
|
from libprs500.ebooks.lrf.web.convert_from import main as web2lrf
|
||||||
@ -679,18 +679,21 @@ class Main(QObject, Ui_MainWindow):
|
|||||||
d = ConversionErrorDialog(self.window, 'ERROR: Unhandled exception', msg)
|
d = ConversionErrorDialog(self.window, 'ERROR: Unhandled exception', msg)
|
||||||
d.exec_()
|
d.exec_()
|
||||||
|
|
||||||
def main():
|
def main(args=sys.argv):
|
||||||
from PyQt4.Qt import QApplication, QMainWindow
|
from PyQt4.Qt import QApplication, QMainWindow
|
||||||
app = QApplication(sys.argv)
|
pid = os.fork() if islinux else -1
|
||||||
window = QMainWindow()
|
if pid <= 0:
|
||||||
window.setWindowTitle(APP_TITLE)
|
app = QApplication(args)
|
||||||
QCoreApplication.setOrganizationName("KovidsBrain")
|
window = QMainWindow()
|
||||||
QCoreApplication.setApplicationName(APP_TITLE)
|
window.setWindowTitle(APP_TITLE)
|
||||||
|
QCoreApplication.setOrganizationName("KovidsBrain")
|
||||||
initialize_file_icon_provider()
|
QCoreApplication.setApplicationName(APP_TITLE)
|
||||||
main = Main(window)
|
|
||||||
sys.excepthook = main.unhandled_exception
|
initialize_file_icon_provider()
|
||||||
return app.exec_()
|
main = Main(window)
|
||||||
|
sys.excepthook = main.unhandled_exception
|
||||||
|
return app.exec_()
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user