[ui][panel] not terminating the application when the panel is closed

This commit is contained in:
Vinícius Moreira
2020-02-07 16:18:04 -03:00
parent 94d5a113a1
commit e811c7252a
2 changed files with 4 additions and 2 deletions

View File

@@ -76,7 +76,7 @@ def main():
manager.prepare()
app = QApplication(sys.argv)
app.setQuitOnLastWindowClosed(False)
app.setQuitOnLastWindowClosed(False) # otherwise windows opened through the tray icon kill the aplication when closed
app.setApplicationName(__app_name__)
app.setApplicationVersion(__version__)
app_icon = util.get_default_icon()[1]

View File

@@ -3,7 +3,7 @@ import time
from pathlib import Path
from typing import List, Type, Set
from PyQt5.QtCore import QEvent, Qt, QSize, pyqtSignal
from PyQt5.QtCore import QEvent, Qt, QSize, pyqtSignal, QCoreApplication
from PyQt5.QtGui import QIcon, QWindowStateChangeEvent
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QCheckBox, QHeaderView, QToolBar, \
QLabel, QPlainTextEdit, QLineEdit, QProgressBar, QPushButton, QComboBox, QApplication, QListView, QSizePolicy
@@ -504,6 +504,8 @@ class ManageWindow(QWidget):
event.ignore()
self.hide()
self._handle_console_option(False)
else:
QCoreApplication.exit() # needed because QuitOnLastWindowClosed is disabled
def _handle_console(self, checked: bool):