[Commits] (morgen) Now the "Sync Collection" menu item updates to
reflect the currently selected
commits at osafoundation.org
commits at osafoundation.org
Mon Aug 23 16:50:43 PDT 2004
Commit by: morgen
Modified files:
chandler/parcels/osaf/views/main/Main.py 1.41 1.42
Log message:
Now the "Sync Collection" menu item updates to reflect the currently selected
sidebar collection. Also, it's disabled if the collection hasn't been
published.
ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/views/main/Main.py.diff?r1=text&tr1=1.41&r2=text&tr2=1.42
Index: chandler/parcels/osaf/views/main/Main.py
diff -u chandler/parcels/osaf/views/main/Main.py:1.41 chandler/parcels/osaf/views/main/Main.py:1.42
--- chandler/parcels/osaf/views/main/Main.py:1.41 Mon Aug 23 16:28:03 2004
+++ chandler/parcels/osaf/views/main/Main.py Mon Aug 23 16:50:42 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.41 $"
-__date__ = "$Date: 2004/08/23 23:28:03 $"
+__version__ = "$Revision: 1.42 $"
+__date__ = "$Date: 2004/08/23 23:50:42 $"
__copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -220,22 +220,38 @@
if collection is not None:
osaf.framework.sharing.Sharing.manualPublishCollection(collection)
+ def onShareCollectionEventUpdateUI (self, notification):
+ """
+ Update the menu to reflect the selected collection name
+ """
+ collection = self.getSidebarSelectedCollection ()
+ notification.data ['Enable'] = collection is not None
+ if collection:
+ menuTitle = 'Share collection "%s"' \
+ % collection.displayName
+ else:
+ menuTitle = 'Share a collection'
+ notification.data ['Text'] = menuTitle
+
def onSyncCollectionEvent (self, notification):
# Triggered from "Test | Sync collection..."
collection = self.getSidebarSelectedCollection ()
if collection is not None:
osaf.framework.sharing.Sharing.syncCollection(collection)
- def onShareCollectionEventUpdateUI (self, notification):
+ def onSyncCollectionEventUpdateUI (self, notification):
"""
Update the menu to reflect the selected collection name
"""
collection = self.getSidebarSelectedCollection ()
- notification.data ['Enable'] = collection is not None
+ if collection is not None and collection.hasAttributeValue('sharedURL'):
+ notification.data ['Enable'] = True
+ else:
+ notification.data ['Enable'] = False
if collection:
- menuTitle = 'Share collection "%s"' \
+ menuTitle = 'Sync collection "%s"' \
% collection.displayName
else:
- menuTitle = 'Share a collection'
+ menuTitle = 'Sync a collection'
notification.data ['Text'] = menuTitle
More information about the Commits
mailing list