Fix app closing on closing last window
This commit is contained in:
parent
5b2253ae72
commit
75bac84888
@ -15,7 +15,7 @@ classifiers =
|
||||
package_dir =
|
||||
= src
|
||||
packages = find:
|
||||
python_requires = >=3.6
|
||||
python_requires = >=3.8
|
||||
install_requires =
|
||||
requests
|
||||
requests-futures
|
||||
|
@ -20,6 +20,7 @@ from fime.util import get_screen_height, get_icon
|
||||
class App:
|
||||
def __init__(self):
|
||||
self.app = QtWidgets.QApplication(sys.argv)
|
||||
self.app.setQuitOnLastWindowClosed(False)
|
||||
|
||||
data = Data()
|
||||
self.tasks = Tasks(data)
|
||||
@ -28,7 +29,7 @@ class App:
|
||||
|
||||
icon = get_icon("appointment-new")
|
||||
|
||||
self.menu = QtWidgets.QMenu()
|
||||
self.menu = QtWidgets.QMenu(None)
|
||||
|
||||
self.import_task = ImportTask(None)
|
||||
self.import_task.accepted.connect(self.new_task_imported)
|
||||
@ -116,7 +117,8 @@ class App:
|
||||
exit_action = self.menu.addAction("Close")
|
||||
exit_action.triggered.connect(self.app.quit)
|
||||
|
||||
def sigterm_handler(self, _signo, _frame):
|
||||
def sigterm_handler(self, signo, _frame):
|
||||
print(f'handling signal "{signal.strsignal(signo)}"')
|
||||
self.app.quit()
|
||||
|
||||
def run(self):
|
||||
|
Loading…
Reference in New Issue
Block a user