[Sugar-devel] [PATCH] FEATURE REQUEST : Write_to_journal_anytime

anubhav at seeta.in anubhav at seeta.in
Tue Nov 30 00:49:42 EST 2010


From: Anubhav Aggarwal <anubhav at seeta.in>

Now an icon is added in the palletes which calls a popup to enter the name
decscription and tags , this popup earlier came only at the closing of the
activity (http://wiki.sugarlabs.org/go/Features/Write_to_journal_anytime) 
---
 src/jarabe/model/shell.py   |    3 +++
 src/jarabe/view/palettes.py |    8 ++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/jarabe/model/shell.py b/src/jarabe/model/shell.py
index db0e050..55a3c23 100644
--- a/src/jarabe/model/shell.py
+++ b/src/jarabe/model/shell.py
@@ -114,6 +114,9 @@ class Activity(gobject.GObject):
 
         return self._service
 
+    def call_name_alert(self):
+        self._service.CallNameAlert()
+
     def get_title(self):
         """Retrieve the application's root window's suggested title"""
         if self._window:
diff --git a/src/jarabe/view/palettes.py b/src/jarabe/view/palettes.py
index 43612d4..d2ba026 100644
--- a/src/jarabe/view/palettes.py
+++ b/src/jarabe/view/palettes.py
@@ -89,6 +89,11 @@ class CurrentActivityPalette(BasePalette):
         menu_item.connect('activate', self.__view_source__cb)
         self.menu.append(menu_item)
         menu_item.show()
+
+        menu_item = MenuItem(_('Write to journal'), 'activity-journal')
+        menu_item.connect('activate', self.__write_to_journal_cb)
+        self.menu.append(menu_item)
+        menu_item.show()
 
         separator = gtk.SeparatorMenuItem()
         self.menu.append(separator)
@@ -99,6 +104,9 @@ class CurrentActivityPalette(BasePalette):
         self.menu.append(menu_item)
         menu_item.show()
 
+    def __write_to_journal_cb(self, menu_item):
+        self._home_activity.call_name_alert()
+
     def __resume_activate_cb(self, menu_item):
         self._home_activity.get_window().activate(gtk.get_current_event_time())
 
-- 
1.7.0.4



More information about the Sugar-devel mailing list