diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-01-12 17:18:43 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-01-12 17:18:43 +0100 |
commit | 8f2f697f7ed52b7e1c7a17411b2de526b6490691 (patch) | |
tree | 3a7d1596e5246581dc0f1a1d0efd9d325bfe6b1f | |
parent | 233d8541c0ddfadd5905ba99acf700eb6462af2b (diff) | |
download | tagit-8f2f697f7ed52b7e1c7a17411b2de526b6490691.tar.gz tagit-8f2f697f7ed52b7e1c7a17411b2de526b6490691.tar.bz2 tagit-8f2f697f7ed52b7e1c7a17411b2de526b6490691.zip |
removed save and sync functionality since they no longer apply
-rw-r--r-- | tagit/actions/__init__.py | 5 | ||||
-rw-r--r-- | tagit/apps/port-config.yaml | 5 | ||||
-rw-r--r-- | tagit/config/user-defaults.json | 5 | ||||
-rw-r--r-- | tagit/config/user-defaults.yaml | 5 | ||||
-rw-r--r-- | tagit/widgets/session.py | 9 | ||||
-rw-r--r-- | tagit/windows/desktop.py | 40 |
6 files changed, 1 insertions, 68 deletions
diff --git a/tagit/actions/__init__.py b/tagit/actions/__init__.py index 876ca1f..034c4a1 100644 --- a/tagit/actions/__init__.py +++ b/tagit/actions/__init__.py @@ -79,9 +79,6 @@ class ActionBuilder(BuilderBase): #'UpdateObjects': library.UpdateObjects, #'AutoImport': library.AutoImport, #'ImportObjects': library.ImportObjects, - #'AutoSync': library.AutoSync, - #'SyncSelectedObjects': library.SyncSelectedObjects, - #'SyncObjects': library.SyncObjects, #'ItemExport': library.ItemExport, ## misc 'ShellDrop': misc.ShellDrop, @@ -115,8 +112,6 @@ class ActionBuilder(BuilderBase): #'SortOrder': search.SortOrder, ## session #'LoadSession': session.LoadSession, - #'SaveSession': session.SaveSession, - #'SaveSessionAs': session.SaveSessionAs, #'CreateSession': session.CreateSession, #'CreateTempSession': session.CreateTempSession, #'ReloadSession': session.ReloadSession, diff --git a/tagit/apps/port-config.yaml b/tagit/apps/port-config.yaml index 7ca03ae..501eacd 100644 --- a/tagit/apps/port-config.yaml +++ b/tagit/apps/port-config.yaml @@ -63,8 +63,6 @@ ui: # - SelectAdditive # - SelectSubtractive # session: - # - SaveSession - # - SaveSessionAs # - ItemExport # - ImportObjects # tagging: @@ -93,11 +91,8 @@ ui: # - LoadSession # - ReloadSession # - ImportObjects - # - SaveSession - # - SaveSessionAs # - ItemExport # - UpdateSelectedObjects - # - SyncSelectedObjects # - ShowHelp # - ShowSettings #Hints: {} diff --git a/tagit/config/user-defaults.json b/tagit/config/user-defaults.json index 5a39311..1ff7ab4 100644 --- a/tagit/config/user-defaults.json +++ b/tagit/config/user-defaults.json @@ -49,11 +49,8 @@ "LoadSession", "ReloadSession", "ImportObjects", - "SaveSession", - "SaveSessionAs", "ItemExport", "UpdateSelectedObjects", - "SyncSelectedObjects", "ShowHelp", "ShowSettings" ] @@ -89,8 +86,6 @@ "ShowConsole" ], "session": [ - "SaveSession", - "SaveSessionAs", "ItemExport", "ImportObjects" ], diff --git a/tagit/config/user-defaults.yaml b/tagit/config/user-defaults.yaml index 62b8ed6..3ec23d0 100644 --- a/tagit/config/user-defaults.yaml +++ b/tagit/config/user-defaults.yaml @@ -61,8 +61,6 @@ ui: - SelectAdditive - SelectSubtractive session: - - SaveSession - - SaveSessionAs - ItemExport - ImportObjects tagging: @@ -91,11 +89,8 @@ ui: - LoadSession - ReloadSession - ImportObjects - - SaveSession - - SaveSessionAs - ItemExport - UpdateSelectedObjects - - SyncSelectedObjects - ShowHelp - ShowSettings Hints: {} diff --git a/tagit/widgets/session.py b/tagit/widgets/session.py index 30833b7..a7c7355 100644 --- a/tagit/widgets/session.py +++ b/tagit/widgets/session.py @@ -45,15 +45,6 @@ class Session(Widget): def __exit__(self, exc_type, exc_value, traceback): pass - def save(self): - """Save the session.""" - # save config and storage - if self.cfg.file_connected(): - self.cfg.diff(load_settings()).save() - - if self.storage.file_connected(): - self.storage.save() - def clone(self, cfg): """Clone the session and load the clone.""" # clone storages to new location diff --git a/tagit/windows/desktop.py b/tagit/windows/desktop.py index 5128454..0b28230 100644 --- a/tagit/windows/desktop.py +++ b/tagit/windows/desktop.py @@ -101,29 +101,10 @@ class MainWindow(FloatLayout): def autoupdate(self, *args): self.trigger('AutoUpdate') - def autosync(self, *args): - self.trigger('AutoSync') - - def autosave(self, *args): - if not self.session.storage.file_connected(): - return - - try: - self.trigger('SaveLibrary') - logger.info('Database: Autosaved') - except Exception as e: - logger.error(f'Database: Autosave failed ({e})') - ## startup and shutdown def on_startup(self): - # start autosave - autosave = self.session.cfg('storage', 'library', 'autosave') - if autosave > 0: - # autosave is in minutes - Clock.schedule_interval(self.autosave, autosave * 60) - # start index autoindex = self.session.cfg('storage', 'index', 'autoindex') autoindex = 0 if autoindex == float('inf') else autoindex @@ -138,13 +119,6 @@ class MainWindow(FloatLayout): # autoupdate is in minutes Clock.schedule_interval(self.autoupdate, autoupdate * 60) - # start sync - autosync = self.session.cfg('storage', 'index', 'autosync') - autosync = 0 if autosync == float('inf') else autosync - if autosync > 0: - # autosync is in minutes - Clock.schedule_interval(self.autosync, autosync * 60) - # trigger operations on startup if self.session.cfg('storage', 'index', 'index_on_startup'): self.autoindex() @@ -152,9 +126,6 @@ class MainWindow(FloatLayout): if self.session.cfg('storage', 'index', 'update_on_startup'): self.autoupdate() - if self.session.cfg('storage', 'index', 'sync_on_startup'): - self.autosync() - # switch to starting plane - if it's the dashboard no action is needed if self.session.cfg('ui', 'standalone', 'plane') == 'browsing': self.trigger('ShowBrowsing') @@ -204,7 +175,7 @@ class MainWindow(FloatLayout): return False # FIXME: mb/port if self.session.storage.changed() and not self.session.cfg('session', 'debug'): - # save and close + # close self.trigger('CloseSessionAndExit') return True # close w/o saving @@ -222,27 +193,18 @@ Since you see this message, it's time to configure tagit. It's a good idea to ge ## config ## -config.declare(('storage', 'library', 'autosave'), config.Float(), 0, - __name__, 'Autosave', 'Time interval in minutes at which the library is saved to disk while running the GUI. A value of 0 means that the feature is disabled.') - config.declare(('storage', 'index', 'autoindex'), config.Float(), 0, __name__, 'Autoindex', 'Time interval in minutes at which indexing is triggered while running the GUI. A value of 0 means that the feature is disabled. Also configure the index watchlist.') config.declare(('storage', 'index', 'autoupdate'), config.Float(), 0, __name__, 'Autoupdate', 'Time interval in minutes at which updating is triggered while running the GUI. A value of 0 means that the feature is disabled.') -config.declare(('storage', 'index', 'autosync'), config.Float(), 0, - __name__, 'Autosync', 'Time interval in minutes at which synchronization is triggered while running the GUI. A value of 0 means that the feature is disabled.') - config.declare(('storage', 'index', 'index_on_startup'), config.Bool(), False, __name__, 'Index on startup', 'Trigger indexing when the GUI is started. Also configure the index watchlist') config.declare(('storage', 'index', 'update_on_startup'), config.Bool(), False, __name__, 'Update on startup', 'Trigger updating when the GUI is started.') -config.declare(('storage', 'index', 'sync_on_startup'), config.Bool(), False, - __name__, 'Sync on startup', 'Trigger synchronization when the GUI is started.') - config.declare(('session', 'first_start'), config.Bool(), True, __name__, 'First start', 'Show the welcome message typically shown when tagit is started the first time.') |