Skip to content

Commit

Permalink
Fixed incorrect QApplication start that led to missing icons
Browse files Browse the repository at this point in the history
Using QIcon object before initializing QApplication leads to
missing theme icons.

fixes QubesOS/qubes-issues#5354
  • Loading branch information
marmarta committed Oct 6, 2019
1 parent 12481fd commit 0c10723
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions qubesmanager/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
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

Expand Down Expand Up @@ -386,7 +386,7 @@ def backup_location_changed(self, new_dir=None):

def main():
utils.run_asynchronous("Qubes Backup VMs",
QtGui.QIcon.fromTheme("qubes-manager"),
"qubes-manager",
BackupVMsWindow)


Expand Down
2 changes: 1 addition & 1 deletion qubesmanager/qube_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ def show_log(self, action):
def main():
manager_utils.run_asynchronous(
"Qube Manager",
QtGui.QIcon.fromTheme("qubes-manager"),
"qubes-manager",
VmManagerWindow)


Expand Down
2 changes: 1 addition & 1 deletion qubesmanager/template_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def vm_state_change(self, is_running, row=None):

def main():
utils.run_asynchronous("Template Manager",
QtGui.QIcon.fromTheme("qubes-manager"),
"qubes-manager",
TemplateManagerWindow)


Expand Down
4 changes: 2 additions & 2 deletions qubesmanager/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 0c10723

Please sign in to comment.