Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/colors.py
diff options
context:
space:
mode:
authorWade Brainerd <wadetb@gmail.com>2009-12-07 17:40:37 (GMT)
committer Wade Brainerd <wadetb@gmail.com>2009-12-07 17:40:37 (GMT)
commit2ec1c9462dd41c1aefa0a66b84fbf04725100488 (patch)
tree176c5ea323de3bc315b4aa84d2d4c9cbbc587e1a /colors.py
parentf39f6f9d154d6b12bdb48f1297f5c31e62a166bc (diff)
Add link to Colors gallery.
Diffstat (limited to 'colors.py')
-rwxr-xr-xcolors.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/colors.py b/colors.py
index 2a9cc56..d0da1da 100755
--- a/colors.py
+++ b/colors.py
@@ -632,6 +632,17 @@ class Colors(activity.Activity, ExportedGObject):
btn.connect('clicked', self.on_sample)
samplebox.insert(btn, -1)
self.samplebtns.append(btn)
+
+ self.webbtn = toolbutton.ToolButton('web')
+ self.webbtn.set_tooltip(_("Colors! Gallery"))
+ self.webbtn.connect('clicked', self.on_web)
+
+ self.samplesep = gtk.SeparatorToolItem()
+ self.samplesep.set_draw(False)
+ self.samplesep.set_expand(True)
+
+ samplebox.insert(self.samplesep, -1)
+ samplebox.insert(self.webbtn, -1)
toolbar = activity.ActivityToolbox(self)
toolbar.add_toolbar(_("Paint"),paintbox)
@@ -1977,6 +1988,25 @@ class Colors(activity.Activity, ExportedGObject):
pass
#-----------------------------------------------------------------------------------------------------------------
+ # Open Web page to find more paintings.
+
+ def on_web(self, event):
+ # Create the new journal entry
+ fileObject = datastore.create()
+ fileObject.metadata['title'] = _('Colors! Gallery')
+ fileObject.metadata['mime_type'] = 'text/uri-list'
+ fileObject.metadata['icon-color'] = self.metadata['icon-color']
+ fileObject.file_path = os.path.join(self.get_activity_root(), 'instance', '%i' % time.time())
+ fd = open(fileObject.file_path, 'w')
+ try:
+ fd.write("http://colors.collectingsmiles.com/")
+ finally:
+ fd.close()
+ datastore.write(fileObject, transfer_ownership=True)
+ fileObject.destroy()
+ del fileObject
+
+ #-----------------------------------------------------------------------------------------------------------------
# PNG Export to Journal
def on_export_png(self, event):