[Sugar-devel] [PATCH] add restart option configurable via gconf (#1206)
James Cameron
quozl at laptop.org
Mon Oct 11 21:13:49 EDT 2010
Nepal requested reordering and removal of restart, which was patched for
them in 0.82 and implemented in 0.84.
Paraguay and Uruguay detected the change in 0.84 and requested the
restart option be restored.
This patch restores the restart option as a configurable option, using
the gconf key /desktop/sugar/show_restart, default true.
Refer to http://bugs.sugarlabs.org/ticket/1206 for discussion.
---
data/sugar.schemas.in | 12 ++++++++++++
src/jarabe/view/buddymenu.py | 6 ++++++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/data/sugar.schemas.in b/data/sugar.schemas.in
index cfa7edf..474753b 100644
--- a/data/sugar.schemas.in
+++ b/data/sugar.schemas.in
@@ -192,6 +192,18 @@
</schema>
<schema>
+ <key>/schemas/desktop/sugar/show_restart</key>
+ <applyto>/desktop/sugar/show_restart</applyto>
+ <owner>sugar</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short>Show Restart</short>
+ <long>If TRUE, Sugar will show a "Restart" option.</long>
+ </locale>
+ </schema>
+
+ <schema>
<key>/schemas/desktop/sugar/peripherals/keyboard/layouts</key>
<applyto>/desktop/sugar/peripherals/keyboard/layouts</applyto>
<owner>sugar</owner>
diff --git a/src/jarabe/view/buddymenu.py b/src/jarabe/view/buddymenu.py
index 0ba6cc1..8ea2598 100644
--- a/src/jarabe/view/buddymenu.py
+++ b/src/jarabe/view/buddymenu.py
@@ -86,6 +86,12 @@ class BuddyMenu(Palette):
client = gconf.client_get_default()
+ if client.get_bool('/desktop/sugar/show_restart'):
+ item = MenuItem(_('Restart'), 'system-restart')
+ item.connect('activate', self.__reboot_activate_cb)
+ self.menu.append(item)
+ item.show()
+
if client.get_bool('/desktop/sugar/show_logout'):
item = MenuItem(_('Logout'), 'system-logout')
item.connect('activate', self.__logout_activate_cb)
--
1.7.1
--
James Cameron
http://quozl.linux.org.au/
More information about the Sugar-devel
mailing list