Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/GetIABooksActivity.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@sugarlabs.org>2011-03-23 15:19:27 (GMT)
committer Gonzalo Odiard <godiard@sugarlabs.org>2011-03-23 15:19:27 (GMT)
commit0bf3985720c2902bef822c67313991af78621c40 (patch)
treea5a851dc3d5e4d0236f5661cff651d091a23fae8 /GetIABooksActivity.py
parent00fd70c220788a86a6ad4a5f826e23c5dc2f02eb (diff)
Make configurable show cover images or not.
Diffstat (limited to 'GetIABooksActivity.py')
-rwxr-xr-xGetIABooksActivity.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/GetIABooksActivity.py b/GetIABooksActivity.py
index 9402b3f..e74d4f4 100755
--- a/GetIABooksActivity.py
+++ b/GetIABooksActivity.py
@@ -294,9 +294,6 @@ class GetIABooksActivity(activity.Activity):
self.textview.show()
self.scrolled.show()
- self.image = gtk.Image()
- self.add_default_image()
-
vbox_download = gtk.VBox()
hbox_format = gtk.HBox()
@@ -319,7 +316,11 @@ class GetIABooksActivity(activity.Activity):
vbox_download.pack_start(self._download, False, False, 10)
bottom_hbox = gtk.HBox()
- bottom_hbox.pack_start(self.image, False, False, 10)
+
+ if self.show_images:
+ self.image = gtk.Image()
+ self.add_default_image()
+ bottom_hbox.pack_start(self.image, False, False, 10)
bottom_hbox.pack_start(self.scrolled, True, True, 10)
bottom_hbox.pack_start(vbox_download, False, False, 10)
bottom_hbox.show_all()
@@ -379,13 +380,14 @@ class GetIABooksActivity(activity.Activity):
self.enable_button(True)
# Cover Image
- self.exist_cover_image = False
- url_image = self.selected_book.get_image_url()
- logging.error('url_image %s' % url_image)
- if url_image:
- self.download_image(url_image.values()[0])
- else:
- self.add_default_image()
+ if self.show_images:
+ self.exist_cover_image = False
+ url_image = self.selected_book.get_image_url()
+ logging.error('url_image %s' % url_image)
+ if url_image:
+ self.download_image(url_image.values()[0])
+ else:
+ self.add_default_image()
def download_image(self, url):
path = os.path.join(self.get_activity_root(), 'instance',