in join_gc, when typing '@' focus goes to server_entry, and back in room_entry when I press backspace in enpty server_entry

This commit is contained in:
Yann Leboulanger 2005-11-25 22:23:58 +00:00
parent 378555434a
commit c8a921aee4
2 changed files with 29 additions and 12 deletions

View File

@ -677,6 +677,21 @@ _('You can not join a group chat unless you are connected.')).get_response()
if event.keyval == gtk.keysyms.Escape: # ESCAPE
widget.destroy()
def on_room_entry_key_press_event(self, widget, event):
# Check for pressed @ and jump to server_entry if found
if event.keyval == gtk.keysyms.at:
self.xml.get_widget('server_entry').grab_focus()
return True
def on_server_entry_key_press_event(self, widget, event):
# If backspace is pressed in empty server_entry, return to the room entry
backspace = event.keyval == gtk.keysyms.BackSpace
server_entry = self.xml.get_widget('server_entry')
empty = len(server_entry.get_text()) == 0
if backspace and empty:
self.xml.get_widget('room_entry').grab_focus()
return True
def on_recently_combobox_changed(self, widget):
model = widget.get_model()
iter = widget.get_active_iter()

View File

@ -9835,6 +9835,7 @@ topic</property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">True</property>
<signal name="key_press_event" handler="on_server_entry_key_press_event" last_modification_time="Fri, 25 Nov 2005 22:09:39 GMT"/>
</widget>
<packing>
<property name="left_attach">1</property>
@ -9857,6 +9858,7 @@ topic</property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">True</property>
<signal name="key_press_event" handler="on_room_entry_key_press_event" last_modification_time="Fri, 25 Nov 2005 22:07:30 GMT"/>
</widget>
<packing>
<property name="left_attach">1</property>
@ -16195,7 +16197,7 @@ Banner</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1266">
<widget class="GtkImage" id="image1277">
<property name="visible">True</property>
<property name="stock">gtk-jump-to</property>
<property name="icon_size">1</property>
@ -16215,7 +16217,7 @@ Banner</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1267">
<widget class="GtkImage" id="image1278">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
@ -16234,7 +16236,7 @@ Banner</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1268">
<widget class="GtkImage" id="image1279">
<property name="visible">True</property>
<property name="stock">gtk-refresh</property>
<property name="icon_size">1</property>
@ -16268,7 +16270,7 @@ Banner</property>
<signal name="activate" handler="on_send_file_menuitem_activate" last_modification_time="Thu, 01 Sep 2005 23:13:17 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1269">
<widget class="GtkImage" id="image1280">
<property name="visible">True</property>
<property name="stock">gtk-file</property>
<property name="icon_size">1</property>
@ -16288,7 +16290,7 @@ Banner</property>
<signal name="activate" handler="on_assign_openpgp_key_menuitem_activate" last_modification_time="Thu, 30 Jun 2005 22:57:59 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1270">
<widget class="GtkImage" id="image1281">
<property name="visible">True</property>
<property name="stock">gtk-dialog-authentication</property>
<property name="icon_size">1</property>
@ -16313,7 +16315,7 @@ Banner</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1271">
<widget class="GtkImage" id="image1282">
<property name="visible">True</property>
<property name="stock">gtk-dialog-question</property>
<property name="icon_size">1</property>
@ -16334,7 +16336,7 @@ Banner</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1272">
<widget class="GtkImage" id="image1283">
<property name="visible">True</property>
<property name="stock">gtk-go-up</property>
<property name="icon_size">1</property>
@ -16354,7 +16356,7 @@ Banner</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1273">
<widget class="GtkImage" id="image1284">
<property name="visible">True</property>
<property name="stock">gtk-go-down</property>
<property name="icon_size">1</property>
@ -16375,7 +16377,7 @@ Banner</property>
<signal name="activate" handler="revoke_authorization_to_menuitem" last_modification_time="Fri, 25 Nov 2005 21:26:31 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1274">
<widget class="GtkImage" id="image1285">
<property name="visible">True</property>
<property name="stock">gtk-stop</property>
<property name="icon_size">1</property>
@ -16398,7 +16400,7 @@ Banner</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1275">
<widget class="GtkImage" id="image1286">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>
@ -16417,7 +16419,7 @@ Banner</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1276">
<widget class="GtkImage" id="image1287">
<property name="visible">True</property>
<property name="stock">gtk-remove</property>
<property name="icon_size">1</property>
@ -16449,7 +16451,7 @@ Banner</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image1277">
<widget class="GtkImage" id="image1288">
<property name="visible">True</property>
<property name="stock">gtk-justify-fill</property>
<property name="icon_size">1</property>