From 42a1f01e6fbb738f8a045d1560fba378ed065956 Mon Sep 17 00:00:00 2001 From: Guthrie McAfee Armstrong Date: Sat, 4 Jun 2022 19:16:01 -0400 Subject: [PATCH] Access methods statically in dangerzone.gui.common --- dangerzone/gui/common.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/dangerzone/gui/common.py b/dangerzone/gui/common.py index 0e0ad3b..f450c60 100644 --- a/dangerzone/gui/common.py +++ b/dangerzone/gui/common.py @@ -79,6 +79,7 @@ class GuiCommon(object): @staticmethod def _find_pdf_viewers(): + """Dict of PDF viewers installed on the machine, empty if system is not Linux.""" pdf_viewers = {} if platform.system() == "Linux": # Find all .desktop files @@ -111,18 +112,13 @@ class GuiCommon(object): class Alert(QtWidgets.QDialog): def __init__( self, - gui_common: GuiCommon, - global_common: GlobalCommon, message: str, ok_text="Ok", extra_button_text=None, ): super(Alert, self).__init__() - self.global_common = global_common - self.gui_common = gui_common - self.setWindowTitle("dangerzone") - self.setWindowIcon(self.gui_common.get_window_icon()) + self.setWindowIcon(GuiCommon.get_window_icon()) self.setModal(True) flags = ( # TODO Mypy: unsupported left operand type for | ("WindowType") @@ -137,7 +133,7 @@ class Alert(QtWidgets.QDialog): logo = QtWidgets.QLabel() logo.setPixmap( QtGui.QPixmap.fromImage( - QtGui.QImage(self.global_common.get_resource_path("icon.png")) + QtGui.QImage(GlobalCommon.get_resource_path("icon.png")) ) )