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