mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
Set WM_CLASS for the viewers as well
This commit is contained in:
parent
9ad9e6e391
commit
e7e0aea695
@ -734,11 +734,11 @@ gui_thread = None
|
|||||||
qt_app = None
|
qt_app = None
|
||||||
class Application(QApplication):
|
class Application(QApplication):
|
||||||
|
|
||||||
def __init__(self, args, force_calibre_style=False):
|
def __init__(self, args, force_calibre_style=False,
|
||||||
|
override_program_name=None):
|
||||||
self.file_event_hook = None
|
self.file_event_hook = None
|
||||||
if islinux and args[0].endswith(u'calibre'):
|
if override_program_name:
|
||||||
args = list(args)
|
args = [override_program_name] + args[1:]
|
||||||
args[0] += '-gui'
|
|
||||||
qargs = [i.encode('utf-8') if isinstance(i, unicode) else i for i in args]
|
qargs = [i.encode('utf-8') if isinstance(i, unicode) else i for i in args]
|
||||||
QApplication.__init__(self, qargs)
|
QApplication.__init__(self, qargs)
|
||||||
global gui_thread, qt_app
|
global gui_thread, qt_app
|
||||||
|
@ -309,7 +309,8 @@ def main(args=sys.argv, logger=None):
|
|||||||
return 1
|
return 1
|
||||||
pid = os.fork() if (islinux or isbsd) else -1
|
pid = os.fork() if (islinux or isbsd) else -1
|
||||||
if pid <= 0:
|
if pid <= 0:
|
||||||
app = Application(args)
|
override = 'calibre-lrf-viewer' if islinux else None
|
||||||
|
app = Application(args, override_program_name=override)
|
||||||
app.setWindowIcon(QIcon(I('viewer.png')))
|
app.setWindowIcon(QIcon(I('viewer.png')))
|
||||||
QCoreApplication.setOrganizationName(ORG_NAME)
|
QCoreApplication.setOrganizationName(ORG_NAME)
|
||||||
QCoreApplication.setApplicationName(APP_UID)
|
QCoreApplication.setApplicationName(APP_UID)
|
||||||
|
@ -8,7 +8,7 @@ from PyQt4.Qt import (QCoreApplication, QIcon, QObject, QTimer,
|
|||||||
QPixmap, QSplashScreen, QApplication)
|
QPixmap, QSplashScreen, QApplication)
|
||||||
|
|
||||||
from calibre import prints, plugins, force_unicode
|
from calibre import prints, plugins, force_unicode
|
||||||
from calibre.constants import (iswindows, __appname__, isosx, DEBUG,
|
from calibre.constants import (iswindows, __appname__, isosx, DEBUG, islinux,
|
||||||
filesystem_encoding)
|
filesystem_encoding)
|
||||||
from calibre.utils.ipc import gui_socket_address, RC
|
from calibre.utils.ipc import gui_socket_address, RC
|
||||||
from calibre.gui2 import (ORG_NAME, APP_UID, initialize_file_icon_provider,
|
from calibre.gui2 import (ORG_NAME, APP_UID, initialize_file_icon_provider,
|
||||||
@ -58,7 +58,8 @@ def init_qt(args):
|
|||||||
prints('Using library at', prefs['library_path'])
|
prints('Using library at', prefs['library_path'])
|
||||||
QCoreApplication.setOrganizationName(ORG_NAME)
|
QCoreApplication.setOrganizationName(ORG_NAME)
|
||||||
QCoreApplication.setApplicationName(APP_UID)
|
QCoreApplication.setApplicationName(APP_UID)
|
||||||
app = Application(args)
|
override = 'calibre-gui' if islinux else None
|
||||||
|
app = Application(args, override_program_name=override)
|
||||||
actions = tuple(Main.create_application_menubar())
|
actions = tuple(Main.create_application_menubar())
|
||||||
app.setWindowIcon(QIcon(I('lt.png')))
|
app.setWindowIcon(QIcon(I('lt.png')))
|
||||||
return app, opts, args, actions
|
return app, opts, args, actions
|
||||||
|
@ -1006,7 +1006,8 @@ def main(args=sys.argv):
|
|||||||
except:
|
except:
|
||||||
open_at = None
|
open_at = None
|
||||||
if pid <= 0:
|
if pid <= 0:
|
||||||
app = Application(args)
|
override = 'calibre-ebook-viewer' if islinux else None
|
||||||
|
app = Application(args, override_program_name=override)
|
||||||
app.setWindowIcon(QIcon(I('viewer.png')))
|
app.setWindowIcon(QIcon(I('viewer.png')))
|
||||||
QApplication.setOrganizationName(ORG_NAME)
|
QApplication.setOrganizationName(ORG_NAME)
|
||||||
QApplication.setApplicationName(APP_UID)
|
QApplication.setApplicationName(APP_UID)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user