Fixes account box with one account is shown

This commit is contained in:
Sophie Herold 2018-07-06 22:29:04 +02:00 committed by Philipp Hörist
parent 3438b06069
commit 0750d6f6ef
2 changed files with 35 additions and 49 deletions

View File

@ -101,7 +101,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">9</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
@ -118,14 +118,16 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">9</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="account_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="halign">end</property>
<property name="margin_bottom">12</property>
<property name="label" translatable="yes">Account</property>
<property name="justify">right</property>
<style>
@ -150,7 +152,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
@ -166,7 +168,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
@ -183,7 +185,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
@ -195,7 +197,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
@ -209,21 +211,6 @@
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="height_request">6</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
@ -241,7 +228,22 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">7</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="height_request">6</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
@ -256,7 +258,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">8</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
@ -273,28 +275,15 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="height_request">6</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="account_combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="margin_bottom">12</property>
<property name="model">account_liststore</property>
<property name="id_column">0</property>
<signal name="changed" handler="_on_account_combo_changed" swapped="no"/>
@ -320,7 +309,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
@ -386,7 +375,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
@ -404,7 +393,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
@ -413,9 +402,6 @@
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>

View File

@ -2375,10 +2375,10 @@ class JoinGroupchatWindow(Gtk.ApplicationWindow):
app.ged.register_event_handler('agent-info-error-received', ged.GUI1,
self._nec_agent_info_error_received)
# Show account combobox if there is more than one account
if len(accounts) > 1:
self.account_combo.show()
self.account_label.show()
# Hide account combobox if there is only one account
if len(accounts) == 1:
self.account_combo.hide()
self.account_label.hide()
self.account_combo.set_active_id(self.account)