Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2009-01-19 15:57:59 (GMT)
committer Simon Schampijer <simon@schampijer.de>2009-01-19 15:57:59 (GMT)
commit9e3a8ab007dc6b5ad3429bae5b2e7979139c6eb8 (patch)
tree786851174d93dd36330983bf74bf48fe39710c56 /src
parent817a981288bc87f521447a13a22ee293a0dedf07 (diff)
enhancements to the naming alert
- focus the title entry - add accelerator for the 'Keep' button which is enter/return
Diffstat (limited to 'src')
-rw-r--r--src/sugar/activity/namingalert.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/sugar/activity/namingalert.py b/src/sugar/activity/namingalert.py
index 8470542..400d4ab 100644
--- a/src/sugar/activity/namingalert.py
+++ b/src/sugar/activity/namingalert.py
@@ -62,8 +62,8 @@ class NamingToolbar(gtk.Toolbar):
self._add_separator(True)
- self._keep_button = ToolButton('dialog-ok')
- self._keep_button.set_tooltip(_('Keep'))
+ self._keep_button = ToolButton('dialog-ok', tooltip=_('Keep'))
+ self._keep_button.props.accelerator = 'Return'
self._keep_button.connect('clicked', self.__keep_button_clicked_cb)
self.insert(self._keep_button, -1)
self._keep_button.show()
@@ -142,6 +142,10 @@ class NamingAlert(gtk.Window):
self._description = None
self._tags = None
+ accel_group = gtk.AccelGroup()
+ self.set_data('sugar-accel-group', accel_group)
+ self.add_accel_group(accel_group)
+
self.set_border_width(style.LINE_WIDTH)
offset = style.GRID_CELL_SIZE
width = gtk.gdk.screen_width() - offset * 2
@@ -174,6 +178,9 @@ class NamingAlert(gtk.Window):
body = self._create_body()
self._root.append(body, hippo.PACK_EXPAND)
+ widget = self._title.get_property('widget')
+ widget.grab_focus()
+
def _create_body(self):
body = hippo.CanvasBox()
body.props.orientation = hippo.ORIENTATION_VERTICAL
@@ -240,7 +247,7 @@ class NamingAlert(gtk.Window):
title.set_background(style.COLOR_WHITE.get_html())
title.props.text = self._activity.metadata.get('title', _('Untitled'))
return title
-
+
def _create_description(self):
vbox = hippo.CanvasBox()
vbox.props.spacing = style.DEFAULT_SPACING