Skip to content

Commit

Permalink
Fix Annolid Window Settings Restoration
Browse files Browse the repository at this point in the history
Ensure that Annolid window settings are correctly restored upon application launch. For instance, if the user relocates the toolbar to the top, it will persist in that position in subsequent launches
  • Loading branch information
healthonrails committed Apr 18, 2024
1 parent 07ce1a1 commit 3617100
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions annolid/gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,12 @@ def __init__(self,
self.statusBar().show()
self.setWindowTitle(__appname__)
self.settings = QtCore.QSettings("Annolid", 'Annolid')
# Restore application settings.
self.recentFiles = self.settings.value("recentFiles", []) or []
position = self.settings.value("window/position", QtCore.QPoint(0, 0))
state = self.settings.value("window/state", QtCore.QByteArray())
self.move(position)

self.video_results_folder = None
self.seekbar = None
self.audio_widget = None
Expand Down Expand Up @@ -2560,6 +2566,7 @@ def main():
str(Path(__file__).resolve().parent / "icons/icon_annolid.png"))
app.setWindowIcon(annolid_icon)
win = AnnolidWindow(config=config)
logger.info("Qt config file: %s" % win.settings.fileName())

win.show()
win.raise_()
Expand Down

0 comments on commit 3617100

Please sign in to comment.