mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Rename gui.common.GuiCommon class to gui.logic.DangerzoneGui
Rename the `gui.common` module and `gui.common.GuiCommon` class to `gui.logic` and `gui.logic.DangerzoneGui` respectively. We keep as is the original names of the variables that hold instances of this class, since they will change in subsequent commits. This change is part of the initial refactor to make the DangerzoneGui class handle the GUI logic of the Dangerzone project.
This commit is contained in:
parent
cb8130042e
commit
dca290fb6b
4 changed files with 15 additions and 15 deletions
|
@ -13,7 +13,7 @@ from PySide2 import QtCore, QtGui, QtWidgets
|
|||
from .. import args, errors
|
||||
from ..document import Document
|
||||
from ..logic import DangerzoneCore
|
||||
from .common import GuiCommon
|
||||
from .logic import DangerzoneGui
|
||||
from .main_window import MainWindow
|
||||
from .systray import SysTray
|
||||
|
||||
|
@ -72,7 +72,7 @@ def gui_main(filename: Optional[str]) -> bool:
|
|||
|
||||
# Common objects
|
||||
dangerzone = DangerzoneCore()
|
||||
gui_common = GuiCommon(app, dangerzone)
|
||||
gui_common = DangerzoneGui(app, dangerzone)
|
||||
|
||||
# Allow Ctrl-C to smoothly quit the program instead of throwing an exception
|
||||
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
||||
|
|
|
@ -24,9 +24,9 @@ from ..util import get_resource_path
|
|||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class GuiCommon(object):
|
||||
class DangerzoneGui(object):
|
||||
"""
|
||||
The GuiCommon class is a singleton of shared functionality for the GUI
|
||||
The DangerzoneGui class is a singleton of shared functionality for the GUI
|
||||
"""
|
||||
|
||||
def __init__(self, app: QtWidgets.QApplication, dangerzone: DangerzoneCore) -> None:
|
||||
|
@ -115,7 +115,7 @@ class GuiCommon(object):
|
|||
class Alert(QtWidgets.QDialog):
|
||||
def __init__(
|
||||
self,
|
||||
gui_common: GuiCommon,
|
||||
dangerzone_gui: DangerzoneGui,
|
||||
dangerzone: DangerzoneCore,
|
||||
message: str,
|
||||
ok_text: str = "Ok",
|
||||
|
@ -123,10 +123,10 @@ class Alert(QtWidgets.QDialog):
|
|||
) -> None:
|
||||
super(Alert, self).__init__()
|
||||
self.dangerzone = dangerzone
|
||||
self.gui_common = gui_common
|
||||
self.dangerzone_gui = dangerzone_gui
|
||||
|
||||
self.setWindowTitle("dangerzone")
|
||||
self.setWindowIcon(self.gui_common.get_window_icon())
|
||||
self.setWindowIcon(self.dangerzone_gui.get_window_icon())
|
||||
self.setModal(True)
|
||||
|
||||
flags = (
|
|
@ -15,7 +15,7 @@ from ..container import convert
|
|||
from ..document import Document
|
||||
from ..logic import DangerzoneCore
|
||||
from ..util import get_resource_path, get_subprocess_startupinfo
|
||||
from .common import GuiCommon
|
||||
from .logic import DangerzoneGui
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -26,7 +26,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||
def __init__(
|
||||
self,
|
||||
dangerzone: DangerzoneCore,
|
||||
gui_common: GuiCommon,
|
||||
gui_common: DangerzoneGui,
|
||||
window_id: str,
|
||||
document: Document,
|
||||
) -> None:
|
||||
|
@ -124,7 +124,7 @@ class WaitingWidget(QtWidgets.QWidget):
|
|||
# - "install_container"
|
||||
finished = QtCore.Signal()
|
||||
|
||||
def __init__(self, dangerzone: DangerzoneCore, gui_common: GuiCommon) -> None:
|
||||
def __init__(self, dangerzone: DangerzoneCore, gui_common: DangerzoneGui) -> None:
|
||||
super(WaitingWidget, self).__init__()
|
||||
self.dangerzone = dangerzone
|
||||
self.gui_common = gui_common
|
||||
|
@ -210,7 +210,7 @@ class ContentWidget(QtWidgets.QWidget):
|
|||
close_window = QtCore.Signal()
|
||||
|
||||
def __init__(
|
||||
self, dangerzone: DangerzoneCore, gui_common: GuiCommon, document: Document
|
||||
self, dangerzone: DangerzoneCore, gui_common: DangerzoneGui, document: Document
|
||||
) -> None:
|
||||
super(ContentWidget, self).__init__()
|
||||
|
||||
|
@ -309,7 +309,7 @@ class SettingsWidget(QtWidgets.QWidget):
|
|||
close_window = QtCore.Signal()
|
||||
|
||||
def __init__(
|
||||
self, dangerzone: DangerzoneCore, gui_common: GuiCommon, document: Document
|
||||
self, dangerzone: DangerzoneCore, gui_common: DangerzoneGui, document: Document
|
||||
) -> None:
|
||||
super(SettingsWidget, self).__init__()
|
||||
self.dangerzone = dangerzone
|
||||
|
@ -547,7 +547,7 @@ class ConvertWidget(QtWidgets.QWidget):
|
|||
close_window = QtCore.Signal()
|
||||
|
||||
def __init__(
|
||||
self, dangerzone: DangerzoneCore, gui_common: GuiCommon, document: Document
|
||||
self, dangerzone: DangerzoneCore, gui_common: DangerzoneGui, document: Document
|
||||
) -> None:
|
||||
super(ConvertWidget, self).__init__()
|
||||
self.dangerzone = dangerzone
|
||||
|
|
|
@ -4,7 +4,7 @@ from typing import TYPE_CHECKING
|
|||
from PySide2 import QtWidgets
|
||||
|
||||
from ..logic import DangerzoneCore
|
||||
from .common import GuiCommon
|
||||
from .logic import DangerzoneGui
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from . import ApplicationWrapper
|
||||
|
@ -14,7 +14,7 @@ class SysTray(QtWidgets.QSystemTrayIcon):
|
|||
def __init__(
|
||||
self,
|
||||
dangerzone: DangerzoneCore,
|
||||
gui_common: GuiCommon,
|
||||
gui_common: DangerzoneGui,
|
||||
app: QtWidgets.QApplication,
|
||||
app_wrapper: "ApplicationWrapper",
|
||||
) -> None:
|
||||
|
|
Loading…
Reference in a new issue