Add 'update' command
authorJack Miller <jack@codezen.org>
Sun, 16 Nov 2014 01:50:48 +0000 (19:50 -0600)
committerJack Miller <jack@codezen.org>
Sun, 16 Nov 2014 02:21:29 +0000 (20:21 -0600)
This will sync items without throwing away all of the state, the same
mechanism that the update.* config options control.

In addition \ and F5 binds now use this. Refresh is still C-r

canto_curses/config.py
canto_curses/gui.py

index f5480f2..ba50416 100644 (file)
@@ -406,8 +406,8 @@ class CantoCursesConfig(SubThread):
                     ":" : "command",
                     "q" : "quit",
                     "?" : "help",
-                    "\\" : "refresh",
-                    "f5" : "refresh",
+                    "\\" : "update",
+                    "f5" : "update",
                     "C-r" : "refresh",
                 }
             },
index 26b7713..2e195fc 100644 (file)
@@ -113,6 +113,7 @@ class CantoCursesGui(CommandHandler):
         rootlog.addHandler(self.glog_handler)
 
         register_command(self, "refresh", self.cmd_refresh, [], "Refetch everything from the daemon")
+        register_command(self, "update", self.cmd_update, [], "Sync with daemon")
         register_command(self, "quit", self.cmd_quit, [], "Quit canto-curses")
         register_alias(self, "q", "quit")
 
@@ -151,6 +152,9 @@ class CantoCursesGui(CommandHandler):
             tag_updater.update()
             self.force_sync()
 
+    def cmd_update(self):
+        self.force_sync()
+
     def cmd_quit(self):
         self.alive = False