[POS-commit] r1788 - in stoqlib/trunk/stoqlib/gui: . glade
Bruno Rafael Garcia
brg at async.com.br
Mon Dec 5 19:13:42 BRST 2005
Author: brg
Date: Mon Dec 5 19:13:42 2005
New Revision: 1788
Modified:
stoqlib/trunk/stoqlib/gui/dialogs.py
stoqlib/trunk/stoqlib/gui/editors.py
stoqlib/trunk/stoqlib/gui/glade/AdditionListSlave.glade
stoqlib/trunk/stoqlib/gui/gtkadds.py
stoqlib/trunk/stoqlib/gui/search.py
stoqlib/trunk/stoqlib/gui/slaves.py
Log:
Some fixes related to widget focus and shortcuts.
r=evandro
Modified: stoqlib/trunk/stoqlib/gui/dialogs.py
==============================================================================
--- stoqlib/trunk/stoqlib/gui/dialogs.py (original)
+++ stoqlib/trunk/stoqlib/gui/dialogs.py Mon Dec 5 19:13:42 2005
@@ -163,6 +163,7 @@
if hide_footer:
self.ok_button.hide()
self.cancel_button.hide()
+ self.ok_button.set_use_underline(True)
def setup_keyactions(self):
self.keyactions = {gtk.keysyms.Escape: self.cancel}
Modified: stoqlib/trunk/stoqlib/gui/editors.py
==============================================================================
--- stoqlib/trunk/stoqlib/gui/editors.py (original)
+++ stoqlib/trunk/stoqlib/gui/editors.py Mon Dec 5 19:13:42 2005
@@ -186,6 +186,7 @@
self.attr_name = attr_name
BaseEditor.__init__(self, conn, model)
+ self.notes.set_accepts_tab(False)
#
# BaseEditor hooks
Modified: stoqlib/trunk/stoqlib/gui/glade/AdditionListSlave.glade
==============================================================================
--- stoqlib/trunk/stoqlib/gui/glade/AdditionListSlave.glade (original)
+++ stoqlib/trunk/stoqlib/gui/glade/AdditionListSlave.glade Mon Dec 5 19:13:42 2005
@@ -51,7 +51,8 @@
</child>
<child>
<widget class="GtkLabel" id="GtkLabel1">
- <property name="label" context="yes" translatable="yes">Add...</property>
+ <property name="label" context="yes" translatable="yes">_Add...</property>
+ <property name="use_underline">True</property>
<property name="visible">True</property>
</widget>
<packing>
@@ -85,7 +86,8 @@
</child>
<child>
<widget class="GtkLabel" id="GtkLabel1">
- <property name="label" context="yes" translatable="yes">Delete</property>
+ <property name="label" context="yes" translatable="yes">_Delete</property>
+ <property name="use_underline">True</property>
<property name="visible">True</property>
</widget>
<packing>
Modified: stoqlib/trunk/stoqlib/gui/gtkadds.py
==============================================================================
--- stoqlib/trunk/stoqlib/gui/gtkadds.py (original)
+++ stoqlib/trunk/stoqlib/gui/gtkadds.py Mon Dec 5 19:13:42 2005
@@ -55,12 +55,12 @@
image.set_from_stock(icon, gtk.ICON_SIZE_LARGE_TOOLBAR)
if text:
label.set_text(text)
-
+
def change_button_appearance(button, icon=None, text=None):
alignment = button.get_children()[0]
hbox = alignment.get_children()[0]
image, label = hbox.get_children()
if icon:
image.set_from_stock(icon, gtk.ICON_SIZE_BUTTON)
- if text or text == '':
- label.set_text(text)
+ if text is not None:
+ label.set_text_with_mnemonic(text)
Modified: stoqlib/trunk/stoqlib/gui/search.py
==============================================================================
--- stoqlib/trunk/stoqlib/gui/search.py (original)
+++ stoqlib/trunk/stoqlib/gui/search.py Mon Dec 5 19:13:42 2005
@@ -309,6 +309,12 @@
self._slave_callback = search_callback
self._split_field_types()
+ def set_focus(self):
+ if self.searching_by_date:
+ self._slave.get_slave().search_entry.grab_focus()
+ else:
+ self._slave.search_entry.grab_focus()
+
def set_result_strings(self, singular_form, plural_form):
"""This method defines strings to be used in the
search_results_label of SearchEntry class.
@@ -623,7 +629,7 @@
BasicDialog._initialize(self, hide_footer=hide_footer,
main_label_text=self.main_label_text,
title=title, size=self.size)
- self.set_ok_label(_('Select Items'))
+ self.set_ok_label(_('Se_lect Items'))
self.table = table
self.search_table = search_table or self.table
self.parent_conn = parent_conn
@@ -633,6 +639,7 @@
self.setup_slaves()
def setup_slaves(self, **kwargs):
+ self.disable_ok()
self.klist_slave = BaseListSlave(parent=self)
self.attach_slave('main', self.klist_slave)
self.klist = self.klist_slave.klist
@@ -727,6 +734,7 @@
self.klist.clear()
if not objs:
+ self.disable_ok()
self.update_widgets()
return
@@ -741,6 +749,7 @@
if count:
self.klist.add_list(objs)
self.klist.select(objs[0])
+ self.enable_ok()
self.update_widgets()
def update_widgets(self, *args):
Modified: stoqlib/trunk/stoqlib/gui/slaves.py
==============================================================================
--- stoqlib/trunk/stoqlib/gui/slaves.py (original)
+++ stoqlib/trunk/stoqlib/gui/slaves.py Mon Dec 5 19:13:42 2005
@@ -38,6 +38,7 @@
self.model = model
self.model_type = self.model_type or type(model)
BaseEditorSlave.__init__(self, conn, self.model)
+ self.notes.set_accepts_tab(False)
def setup_proxies(self):
self.proxy = self.add_proxy(self.model, self.widgets)
More information about the POS-commit
mailing list