From 0c1072320508483a646e78fa772c1fcec35155be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Sun, 6 Oct 2019 21:51:04 +0200 Subject: [PATCH] Fixed incorrect QApplication start that led to missing icons Using QIcon object before initializing QApplication leads to missing theme icons. fixes QubesOS/qubes-issues#5354 --- qubesmanager/backup.py | 4 ++-- qubesmanager/qube_manager.py | 2 +- qubesmanager/template_manager.py | 2 +- qubesmanager/utils.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qubesmanager/backup.py b/qubesmanager/backup.py index 97a02d9..5defb46 100644 --- a/qubesmanager/backup.py +++ b/qubesmanager/backup.py @@ -25,7 +25,7 @@ from qubesadmin import exc from qubesadmin import utils as admin_utils from qubes.storage.file import get_disk_usage -from PyQt5 import QtCore, QtWidgets, QtGui # pylint: disable=import-error +from PyQt5 import QtCore, QtWidgets # pylint: disable=import-error from . import ui_backupdlg # pylint: disable=no-name-in-module from . import multiselectwidget @@ -386,7 +386,7 @@ class BackupVMsWindow(ui_backupdlg.Ui_Backup, QtWidgets.QWizard): def main(): utils.run_asynchronous("Qubes Backup VMs", - QtGui.QIcon.fromTheme("qubes-manager"), + "qubes-manager", BackupVMsWindow) diff --git a/qubesmanager/qube_manager.py b/qubesmanager/qube_manager.py index 34d423c..fc409b2 100644 --- a/qubesmanager/qube_manager.py +++ b/qubesmanager/qube_manager.py @@ -1301,7 +1301,7 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtWidgets.QMainWindow): def main(): manager_utils.run_asynchronous( "Qube Manager", - QtGui.QIcon.fromTheme("qubes-manager"), + "qubes-manager", VmManagerWindow) diff --git a/qubesmanager/template_manager.py b/qubesmanager/template_manager.py index cc85837..0cde1c8 100644 --- a/qubesmanager/template_manager.py +++ b/qubesmanager/template_manager.py @@ -379,7 +379,7 @@ class VMRow: def main(): utils.run_asynchronous("Template Manager", - QtGui.QIcon.fromTheme("qubes-manager"), + "qubes-manager", TemplateManagerWindow) diff --git a/qubesmanager/utils.py b/qubesmanager/utils.py index 0a19226..2c17903 100644 --- a/qubesmanager/utils.py +++ b/qubesmanager/utils.py @@ -262,12 +262,12 @@ def handle_exception(exc_type, exc_value, exc_traceback): msg_box.exec_() -def run_asynchronous(app_name, icon, window_class): +def run_asynchronous(app_name, icon_name, window_class): qt_app = QtWidgets.QApplication(sys.argv) qt_app.setOrganizationName("The Qubes Project") qt_app.setOrganizationDomain("http://qubes-os.org") qt_app.setApplicationName(app_name) - qt_app.setWindowIcon(icon) + qt_app.setWindowIcon(QIcon.fromTheme(icon_name)) qt_app.lastWindowClosed.connect(loop_shutdown) qubes_app = qubesadmin.Qubes()