[Sugar-devel] [PATCH TamTamMini] Add description item to the toolbar if available - SL# 3525
godiard at sugarlabs.org
godiard at sugarlabs.org
Thu Apr 26 10:03:30 EDT 2012
From: Gonzalo Odiard <godiard at gmail.com>
The activity have a custom toolbar, then need add the DescriptionItem
to implement the feature "Write to Journal Anytime"
http://wiki.sugarlabs.org/go/Features/Write_to_journal_anytime
Signed-off-by: Gonzalo Odiard <gonzalo at laptop.org>
---
TamTamMini.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/TamTamMini.py b/TamTamMini.py
index 02d614d..5d94cc3 100644
--- a/TamTamMini.py
+++ b/TamTamMini.py
@@ -76,6 +76,17 @@ class TamTamMini(activity.Activity):
self.toolbox = ToolbarBox()
self.toolbox.toolbar.insert(widgets.ActivityButton(self), -1)
self.toolbox.toolbar.insert(widgets.TitleEntry(self), -1)
+
+ try:
+ from sugar.activity.widgets import DescriptionItem
+ except ImportError:
+ logging.debug('DescriptionItem button is not available,' +
+ 'toolkit version < 0.96')
+ else:
+ description_item = DescriptionItem(self)
+ self.toolbox.toolbar.insert(description_item, -1)
+ description_item.show()
+
self.toolbox.toolbar.insert(widgets.ShareButton(self), -1)
else:
self.toolbox = activity.ActivityToolbox(self)
--
1.7.10
More information about the Sugar-devel
mailing list