Browse Source

Specifiy value for window restore list

master
Nils 4 years ago
parent
commit
fccaf46efc
  1. 14
      qtgui/mainwindow.py

14
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)

Loading…
Cancel
Save