Show the favorite option on photos only if the owner of the photo is not the authenti...
authorThomas Schmidt <tschmidt@debian.org>
Sun, 18 Oct 2009 12:38:22 +0000 (14:38 +0200)
committerThomas Schmidt <tschmidt@debian.org>
Sun, 18 Oct 2009 12:38:22 +0000 (14:38 +0200)
canola-flickr/flickr/model.py
debian/changelog

index d909523..36cc997 100644 (file)
@@ -870,7 +870,18 @@ class OptionsModel(OptionsModelFolder):
 class ViewerOptionsModel(OptionsModel):
     terra_type = "Model/Options/Folder/Player/Flickr/Image"
     title = "Photo options"
-    children_order = [ "/SlideshowMode", "/SlideshowTime", "/Info", "/ExifInfo", "/CommentsList", "/Favorite"]
+
+    def __init__(self, parent, screen_controller=None):
+        OptionsModelFolder.__init__(self, parent, screen_controller)
+
+        self.children_order = [
+                    "/SlideshowMode",
+                    "/SlideshowTime",
+                    "/Info",
+                    "/ExifInfo",
+                    "/CommentsList",
+                    "/Favorite",
+                ]
 
 class InfoOptionModel(OptionsModel):
     terra_type = "Model/Options/Folder/Player/Flickr/Image/Info"
@@ -884,9 +895,15 @@ class FavoriteOptionModel(OptionsModel):
     terra_type = "Model/Options/Folder/Player/Flickr/Image/Favorite"
 
     def __init__(self, parent):
+        photo = parent.get_photo()
+
+        # show Favorite option only in case the photo owner is not the authenticated user
+        if photo.owner.nsid == flickr_manager.user.nsid:
+            return
+
         OptionsModel.__init__(self, parent)
-        self.photo          = self.get_photo()
-        self.is_favorite    = flickr_manager.is_favorite(self.photo)
+        self.photo          = photo
+        self.is_favorite    = flickr_manager.is_favorite(photo)
         self.checked        = self.is_favorite
         self.set_title()
 
index 19b9031..ef67c86 100644 (file)
@@ -8,8 +8,10 @@ canola-flickr-plugin (0.1.3-1) UNRELEASED; urgency=low
   * Added new icons for the graphite, flatred and flatblack themes (closes:
     bugs.maemo.org #4108)
   * Made it possible to hide the plugin via the canola settings
+  * Show the favorite option on photos only if the owner of the photo is not
+    the authenticated user
 
- -- Thomas Schmidt <tschmidt@debian.org>  Fri, 16 Oct 2009 22:04:42 +0200
+ -- Thomas Schmidt <tschmidt@debian.org>  Sun, 18 Oct 2009 14:37:21 +0200
 
 canola-flickr-plugin (0.1.2+beta11-1) diablo; urgency=low