From fccaf46efcfeaa2613e14689b51102fcf1f0f971 Mon Sep 17 00:00:00 2001 From: Nils <> Date: Mon, 20 Apr 2020 23:39:46 +0200 Subject: [PATCH] Specifiy value for window restore list --- qtgui/mainwindow.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/qtgui/mainwindow.py b/qtgui/mainwindow.py index c4ba40d..6db3800 100644 --- a/qtgui/mainwindow.py +++ b/qtgui/mainwindow.py @@ -95,7 +95,7 @@ class RecentlyOpenedSessions(object): assert len(self.data) <= 3, len(self.data) - def get(self): + def get(self)->list: sessionList = api.sessionList() self.data = [n for n in self.data if n in sessionList] return self.data @@ -356,9 +356,17 @@ class MainWindow(QtWidgets.QMainWindow): "tab": lambda i: self.ui.tabbyCat.setCurrentIndex(int(i)), } + types = { + "recentlyOpenedSessions": list, + "tab": int, + } + for key in settings.allKeys(): - if key in actions: #if not it doesn't matter. this is all uncritical. - actions[key](settings.value(key)) + if key in actions: #if not it doesn't matter. this is all uncritical. + if key in types: + actions[key](settings.value(key), type=types[key]) + else: + actions[key](settings.value(key)) if self.systemTray.available and settings.contains("visible") and settings.value("visible") == "false": self.setVisible(False)