Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgnacio Rodríguez <ignacio@sugarlabs.org>2013-02-16 01:57:27 (GMT)
committer Ignacio Rodríguez <ignacio@sugarlabs.org>2013-02-16 01:57:27 (GMT)
commit8ffba057b2fd31ef1e08883aa804724106726f98 (patch)
treee9e703de7b50350e59027a668c59e0bba80d475d
parentd16c0dd5c096a94f788e8c638077772d5857deed (diff)
Alert for download
-rw-r--r--activity.py2
-rw-r--r--canvas.py17
2 files changed, 17 insertions, 2 deletions
diff --git a/activity.py b/activity.py
index 31294ee..d000a3f 100644
--- a/activity.py
+++ b/activity.py
@@ -3,6 +3,7 @@
# activity.py by:
# Agustin Zubiaga <aguz@sugarlabs.org>
+# Ignacio Rodríguez <ignacio@sugarlabs.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -73,6 +74,7 @@ class InstallActivity(activity.Activity):
downloads_list.set_tooltip(_("Show the downloads list"))
downloads_list.props.group = store_list
+
self.downloads_icon = DownloadsIcon()
downloads_list.set_icon_widget(self.downloads_icon)
diff --git a/canvas.py b/canvas.py
index 7edcf1f..bdd3aef 100644
--- a/canvas.py
+++ b/canvas.py
@@ -117,6 +117,7 @@ class List(gtk.TreeView):
self._model = gtk.ListStore(str, str, str, str)
self.set_model(self._model)
+ self._activity = parent
self.set_rules_hint(True)
self.icon = CellRendererIcon(self)
@@ -151,6 +152,7 @@ class List(gtk.TreeView):
self.append_column(self.status_column)
self.download_list = DownloadList()
+ self.connect("row-activated", self._download)
self._parent = parent
self.thread = None
@@ -167,8 +169,19 @@ class List(gtk.TreeView):
def down(self):
self.current -= 1
- def _download(self):
- pass
+ def _download(self, widget, row, col):
+ # FIXME: Traduction to english please.
+ model = widget.get_model()
+ name = str(model[row][1]).replace("<b>", "").replace("</b>", "")
+ _logger.debug("Started download of activity:" + name)
+ self._alert = NotifyAlert()
+ self._alert.props.msg = _("La actividad %s comenzo a descargarse") %\
+ name
+ self._alert.props.title = _("Descarga comenzada")
+ self._activity.add_alert(self._alert)
+ self._alert.connect('response', lambda x,
+ i: self._activity.remove_alert(x))
+ return True
def stop_search(self, *args):
self.stopped = True