mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
save/restore toolbar state
This commit is contained in:
parent
cfaf9388c3
commit
8e621c03fb
2 changed files with 5 additions and 2 deletions
|
@ -57,6 +57,7 @@ class Config(dict):
|
||||||
'saveAfterAddingNum': 1,
|
'saveAfterAddingNum': 1,
|
||||||
'saveOnClose': True,
|
'saveOnClose': True,
|
||||||
'mainWindowGeom': None,
|
'mainWindowGeom': None,
|
||||||
|
'mainWindowState': None,
|
||||||
'suppressUpdate': False,
|
'suppressUpdate': False,
|
||||||
'suppressEstimates': False,
|
'suppressEstimates': False,
|
||||||
'showLastCardInterval': False,
|
'showLastCardInterval': False,
|
||||||
|
|
|
@ -49,8 +49,6 @@ class AnkiQt(QMainWindow):
|
||||||
self.setupTray()
|
self.setupTray()
|
||||||
self.connectMenuActions()
|
self.connectMenuActions()
|
||||||
ui.splash.update()
|
ui.splash.update()
|
||||||
if self.config['mainWindowGeom']:
|
|
||||||
self.restoreGeometry(self.config['mainWindowGeom'])
|
|
||||||
self.setupViews()
|
self.setupViews()
|
||||||
self.setupEditor()
|
self.setupEditor()
|
||||||
self.setupStudyScreen()
|
self.setupStudyScreen()
|
||||||
|
@ -58,6 +56,9 @@ class AnkiQt(QMainWindow):
|
||||||
self.setupAnchors()
|
self.setupAnchors()
|
||||||
self.setupToolbar()
|
self.setupToolbar()
|
||||||
self.setupProgressInfo()
|
self.setupProgressInfo()
|
||||||
|
if self.config['mainWindowState']:
|
||||||
|
self.restoreGeometry(self.config['mainWindowGeom'])
|
||||||
|
self.restoreState(self.config['mainWindowState'])
|
||||||
if sys.platform.startswith("darwin"):
|
if sys.platform.startswith("darwin"):
|
||||||
self.setUnifiedTitleAndToolBarOnMac(True)
|
self.setUnifiedTitleAndToolBarOnMac(True)
|
||||||
pass
|
pass
|
||||||
|
@ -925,6 +926,7 @@ your deck."""))
|
||||||
runHook("quit")
|
runHook("quit")
|
||||||
self.help.hide()
|
self.help.hide()
|
||||||
self.config['mainWindowGeom'] = self.saveGeometry()
|
self.config['mainWindowGeom'] = self.saveGeometry()
|
||||||
|
self.config['mainWindowState'] = self.saveState()
|
||||||
# save config
|
# save config
|
||||||
try:
|
try:
|
||||||
self.config.save()
|
self.config.save()
|
||||||
|
|
Loading…
Reference in a new issue