Access methods statically in dangerzone.gui.common

This commit is contained in:
Guthrie McAfee Armstrong 2022-06-04 19:16:01 -04:00
parent 30065371e3
commit 42a1f01e6f
No known key found for this signature in database
GPG key ID: ED4DAE89F08242D2

View file

@ -79,6 +79,7 @@ class GuiCommon(object):
@staticmethod @staticmethod
def _find_pdf_viewers(): def _find_pdf_viewers():
"""Dict of PDF viewers installed on the machine, empty if system is not Linux."""
pdf_viewers = {} pdf_viewers = {}
if platform.system() == "Linux": if platform.system() == "Linux":
# Find all .desktop files # Find all .desktop files
@ -111,18 +112,13 @@ class GuiCommon(object):
class Alert(QtWidgets.QDialog): class Alert(QtWidgets.QDialog):
def __init__( def __init__(
self, self,
gui_common: GuiCommon,
global_common: GlobalCommon,
message: str, message: str,
ok_text="Ok", ok_text="Ok",
extra_button_text=None, extra_button_text=None,
): ):
super(Alert, self).__init__() super(Alert, self).__init__()
self.global_common = global_common
self.gui_common = gui_common
self.setWindowTitle("dangerzone") self.setWindowTitle("dangerzone")
self.setWindowIcon(self.gui_common.get_window_icon()) self.setWindowIcon(GuiCommon.get_window_icon())
self.setModal(True) self.setModal(True)
flags = ( # TODO Mypy: unsupported left operand type for | ("WindowType") flags = ( # TODO Mypy: unsupported left operand type for | ("WindowType")
@ -137,7 +133,7 @@ class Alert(QtWidgets.QDialog):
logo = QtWidgets.QLabel() logo = QtWidgets.QLabel()
logo.setPixmap( logo.setPixmap(
QtGui.QPixmap.fromImage( QtGui.QPixmap.fromImage(
QtGui.QImage(self.global_common.get_resource_path("icon.png")) QtGui.QImage(GlobalCommon.get_resource_path("icon.png"))
) )
) )