Am Montag, den 17.01.2011, 14:46 +0100 schrieb Patrick Ohly: 
> I implemented a different solution, one which IMHO is more elegant than
> hiding *.old configs in the D-Bus call: in the renamed config, the
> ConsumerReady flag is reset to 0. That way the decision whether the
> migrated config is shown to users is left to the UI, instead of
> hard-coding it in the syncevo-dbus-server.
> 
> The expectation is that a GUI for average users will hide both templates
> and existing configs unless they explicitly have ConsumerReady = 1.
> 
> However, this is not exactly how the GTK sync-UI works at the moment.
> Jussi, do you remember why existing configs are exempt from the
> "ConsumerReady" check?
> 
> We might have done it so that users can configure a non-supported server
> and then have it show up in the sync-ui, but then they might as well set
> ConsumerReady = 1 in the configuration. It would be consistent with
> templates.
> 
> I suspect other GUIs also ignore it. I can update the GTK sync-ui.
> Frederik, would a similar change make sense and be possible in Genesis?

I think your suggestion makes sense. I always understood ConsumerReady
to only make sense in a template context, that’s why I currently don’t
handle it in Genesis. But using it to hide unwanted configs seems to be
a smart idea.

My only issue with it is that it isn’t backwards compatible. So if I
implement what you suggest, configs that were created based on
non-supported templates with the current sync-ui won’t show up in
Genesis any longer. So I feel I should at least wait until the next
SyncEvolution release which explicitly sets ConsumerReady = 1, so
re-editing the config in sync-ui would make it show up in Genesis again.

Attached, I have a patch that implements this behaviour for Genesis. Is
this what you had in mind?

Regards,
Frederik



=== modified file 'bin/genesis-sync'
--- bin/genesis-sync	2010-09-28 20:10:40 +0000
+++ bin/genesis-sync	2011-01-17 15:58:41 +0000
@@ -285,9 +285,13 @@
         self.servers = self._syncevo_server.GetConfigs(False)
         self.servers.sort()
         for server in self.servers:
-            menu_item = gtk.MenuItem(_('Synchronize with "%s"') % server)
-            menu_item.connect('activate', self.sync, server)
-            menu.append(menu_item)
+            config = self._syncevo_server.GetConfig(server, False)
+            if config['']['ConsumerReady'] == '1':
+                # Only display configs that are consumer ready
+                # Backups are hidden by setting this to 0
+                menu_item = gtk.MenuItem(_('Synchronize with "%s"') % server)
+                menu_item.connect('activate', self.sync, server)
+                menu.append(menu_item)
         # Separator
         menu_item = gtk.SeparatorMenuItem()
         menu.append(menu_item)

_______________________________________________
SyncEvolution mailing list
[email protected]
http://lists.syncevolution.org/listinfo/syncevolution

Reply via email to