mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Remove systray
Having the application in the systray is no longer needed, since the new_window() logic no longer applies.
This commit is contained in:
parent
814b8b9d0f
commit
6f8eb96b35
2 changed files with 0 additions and 40 deletions
|
@ -16,7 +16,6 @@ from ..document import Document
|
|||
from ..util import get_resource_path
|
||||
from .logic import DangerzoneGui
|
||||
from .main_window import MainWindow
|
||||
from .systray import SysTray
|
||||
|
||||
|
||||
class Application(QtWidgets.QApplication):
|
||||
|
@ -81,9 +80,6 @@ def gui_main(filenames: Optional[List[str]]) -> bool:
|
|||
# Allow Ctrl-C to smoothly quit the program instead of throwing an exception
|
||||
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
||||
|
||||
# Create the system tray
|
||||
systray = SysTray(dangerzone, app)
|
||||
|
||||
closed_windows: Dict[str, MainWindow] = {}
|
||||
windows: Dict[str, MainWindow] = {}
|
||||
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
import platform
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from PySide2 import QtWidgets
|
||||
|
||||
from .logic import DangerzoneGui
|
||||
|
||||
|
||||
class SysTray(QtWidgets.QSystemTrayIcon):
|
||||
def __init__(
|
||||
self,
|
||||
dangerzone: DangerzoneGui,
|
||||
app: QtWidgets.QApplication,
|
||||
) -> None:
|
||||
super(SysTray, self).__init__()
|
||||
self.dangerzone = dangerzone
|
||||
self.app = app
|
||||
|
||||
self.setIcon(self.dangerzone.get_window_icon())
|
||||
|
||||
menu = QtWidgets.QMenu()
|
||||
|
||||
self.new_action = menu.addAction("New window")
|
||||
self.new_action.triggered.connect(self.new_window)
|
||||
|
||||
self.quit_action = menu.addAction("Quit")
|
||||
self.quit_action.triggered.connect(self.quit_clicked)
|
||||
|
||||
self.setContextMenu(menu)
|
||||
self.show()
|
||||
|
||||
def new_window(self) -> None:
|
||||
self.new_window.emit()
|
||||
|
||||
def quit_clicked(self) -> None:
|
||||
self.app.quit()
|
Loading…
Reference in a new issue