fix account creation

This commit is contained in:
Yann Leboulanger 2015-01-02 13:37:47 +01:00
parent 8969c874ff
commit 70d6d4e033
2 changed files with 72 additions and 34 deletions

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface>
<!-- interface-requires gtk+ 3.0 -->
<requires lib="gtk+" version="3.10"/>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
@ -22,6 +23,20 @@
</row>
</data>
</object>
<object class="GtkListStore" id="server_liststore">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkEntryCompletion" id="server_entrycompletion">
<property name="model">server_liststore</property>
<property name="text_column">0</property>
</object>
<object class="GtkEntryCompletion" id="server_entrycompletion1">
<property name="model">server_liststore</property>
<property name="text_column">0</property>
</object>
<object class="GtkWindow" id="account_creation_wizard_window">
<property name="can_focus">False</property>
<property name="border_width">12</property>
@ -30,15 +45,15 @@
<property name="type_hint">dialog</property>
<signal name="destroy" handler="on_wizard_window_destroy" swapped="no"/>
<child>
<object class="GtkVBox" id="vbox77">
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkNotebook" id="notebook">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show_tabs">False</property>
<property name="show_border">False</property>
<child>
<object class="GtkVBox" id="vbox78">
@ -85,6 +100,7 @@ to the Jabber network.</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@ -208,7 +224,7 @@ to the Jabber network.</property>
<property name="tooltip_text" translatable="yes">If checked, Gajim will remember the password for this account</property>
<property name="use_underline">True</property>
<property name="focus_on_click">False</property>
<property name="xalign">0.5</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_save_password_checkbutton_toggled" swapped="no"/>
@ -283,7 +299,21 @@ to the Jabber network.</property>
</packing>
</child>
<child>
<placeholder/>
<object class="GtkComboBoxText" id="server_comboboxtext">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="server_comboboxtext_entry">
<property name="can_focus">True</property>
<property name="completion">server_entrycompletion</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
</packing>
</child>
</object>
<packing>
@ -328,7 +358,7 @@ to the Jabber network.</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox2997">
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
@ -346,10 +376,28 @@ to the Jabber network.</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="server_comboboxtext1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_entry">True</property>
<child internal-child="entry">
<object class="GtkEntry" id="server_comboboxtext_entry1">
<property name="can_focus">True</property>
<property name="completion">server_entrycompletion1</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
@ -563,7 +611,7 @@ to the Jabber network.</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="stock">gtk-dialog-warning</property>
<property name="icon-size">5</property>
<property name="icon_size">5</property>
</object>
<packing>
<property name="expand">False</property>
@ -720,6 +768,7 @@ Please wait...</property>
<property name="xalign">0.10000000149011612</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
<property name="max_width_chars">100</property>
</object>
<packing>
<property name="expand">True</property>
@ -791,7 +840,7 @@ Please wait...</property>
</packing>
</child>
<child>
<object class="GtkHButtonBox" id="hbuttonbox19">
<object class="GtkButtonBox" id="buttonbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">12</property>
@ -890,18 +939,4 @@ Please wait...</property>
</object>
</child>
</object>
<object class="GtkListStore" id="server_liststore">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkEntryCompletion" id="server_entrycompletion">
<property name="model">server_liststore</property>
<property name="text_column">0</property>
</object>
<object class="GtkEntryCompletion" id="server_entrycompletion1">
<property name="model">server_liststore</property>
<property name="text_column">0</property>
</object>
</interface>

View File

@ -3532,13 +3532,13 @@ class AccountCreationWizardWindow:
self.window = self.xml.get_object('account_creation_wizard_window')
self.window.set_transient_for(gajim.interface.roster.window)
# Connect events from comboboxentry.get_child()
server_comboboxentry = self.xml.get_object('server_comboboxentry')
entry = server_comboboxentry.get_child()
# Connect events from comboboxtext_entry
server_comboboxtext = self.xml.get_object('server_comboboxtext')
entry = self.xml.get_object('server_comboboxtext_entry')
entry.connect('key_press_event',
self.on_server_comboboxentry_key_press_event, server_comboboxentry)
# Do the same for the other server comboboxentry
server_comboboxentry1 = self.xml.get_object('server_comboboxentry1')
self.on_server_comboboxentry_key_press_event, server_comboboxtext)
server_comboboxtext1 = self.xml.get_object('server_comboboxtext1')
self.update_proxy_list()
@ -3549,6 +3549,9 @@ class AccountCreationWizardWindow:
for server in servers:
servers_model.append((server,))
server_comboboxtext.set_model(servers_model)
server_comboboxtext1.set_model(servers_model)
# Generic widgets
self.notebook = self.xml.get_object('notebook')
self.cancel_button = self.xml.get_object('cancel_button')
@ -3689,7 +3692,7 @@ class AccountCreationWizardWindow:
'You must provide a username to configure this account.')
dialogs.ErrorDialog(pritext, sectext)
return
server = self.xml.get_object('server_comboboxentry').get_child().\
server = self.xml.get_object('server_comboboxtext_entry').\
get_text().strip()
savepass = self.xml.get_object('save_password_checkbutton').\
get_active()
@ -3722,7 +3725,7 @@ class AccountCreationWizardWindow:
self.show_finish_page()
elif cur_page == 2:
# We are creating a new account
server = self.xml.get_object('server_comboboxentry1').get_child().\
server = self.xml.get_object('server_comboboxtext_entry1').\
get_text()
if not server:
@ -3977,9 +3980,9 @@ class AccountCreationWizardWindow:
def on_username_entry_key_press_event(self, widget, event):
# Check for pressed @ and jump to combobox if found
if event.keyval == Gdk.KEY_at:
combobox = self.xml.get_object('server_comboboxentry')
combobox.grab_focus()
combobox.get_child().set_position(-1)
entry = self.xml.get_object('server_comboboxtext_entry')
entry.grab_focus()
entry.set_position(-1)
return True
def on_server_comboboxentry_key_press_event(self, widget, event, combobox):