mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-30 21:41:57 -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
|
||||
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
|
||||
if islinux and args[0].endswith(u'calibre'):
|
||||
args = list(args)
|
||||
args[0] += '-gui'
|
||||
if override_program_name:
|
||||
args = [override_program_name] + args[1:]
|
||||
qargs = [i.encode('utf-8') if isinstance(i, unicode) else i for i in args]
|
||||
QApplication.__init__(self, qargs)
|
||||
global gui_thread, qt_app
|
||||
|
@ -309,7 +309,8 @@ def main(args=sys.argv, logger=None):
|
||||
return 1
|
||||
pid = os.fork() if (islinux or isbsd) else -1
|
||||
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')))
|
||||
QCoreApplication.setOrganizationName(ORG_NAME)
|
||||
QCoreApplication.setApplicationName(APP_UID)
|
||||
|
@ -8,7 +8,7 @@ from PyQt4.Qt import (QCoreApplication, QIcon, QObject, QTimer,
|
||||
QPixmap, QSplashScreen, QApplication)
|
||||
|
||||
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)
|
||||
from calibre.utils.ipc import gui_socket_address, RC
|
||||
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'])
|
||||
QCoreApplication.setOrganizationName(ORG_NAME)
|
||||
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())
|
||||
app.setWindowIcon(QIcon(I('lt.png')))
|
||||
return app, opts, args, actions
|
||||
|
@ -1006,7 +1006,8 @@ def main(args=sys.argv):
|
||||
except:
|
||||
open_at = None
|
||||
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')))
|
||||
QApplication.setOrganizationName(ORG_NAME)
|
||||
QApplication.setApplicationName(APP_UID)
|
||||
|
Loading…
x
Reference in New Issue
Block a user