[postr] Add default license used on Flickr
- From: Germán Poó Caamaño <gpoo src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [postr] Add default license used on Flickr
- Date: Fri, 13 Nov 2009 03:25:45 +0000 (UTC)
commit 9e2e16359ee245b0b57dffcc2ae6c104a0d2bd45
Author: Germán Póo-Caamaño <gpoo gnome org>
Date: Fri Nov 13 00:21:55 2009 -0300
Add default license used on Flickr
There is no way to get the default license used on Flickr,
but it is posible to set it as None and it does the trick.
Otherwise, postr sent the license choosen by the user
explicitely.
src/LicenseCombo.py | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/LicenseCombo.py b/src/LicenseCombo.py
index fb2ab4d..ae606d6 100644
--- a/src/LicenseCombo.py
+++ b/src/LicenseCombo.py
@@ -23,7 +23,7 @@ class LicenseCombo(gtk.ComboBox):
self.flickr = flickr
self.model = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_INT)
- #self.model.set(self.model.append(), 0, "All rights reserved", 1, 0)
+ self.model.set(self.model.append(), 0, _("Default"), 1, -1)
self.set_model(self.model)
self.set_active(-1)
@@ -57,7 +57,16 @@ class LicenseCombo(gtk.ComboBox):
def get_license_for_iter(self, it):
if it is None: return None
- return self.model.get_value(it, 1)
+
+ '''There is no way yet to get the default license using the
+ API provided by Flickr. However, if we return None, Flickr
+ will set the default defined by the user. In our case,
+ Default was defined as -1.'''
+ value = self.model.get_value(it, 1)
+ if value == -1:
+ return None
+ else:
+ return value
def get_active_license(self):
return self.get_license_for_iter(self.get_active_iter())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]