[omemo] Fix index-out-of-bounds error if no account is configured
This commit is contained in:
@@ -77,7 +77,7 @@ class OMEMOConfigDialog(GajimPluginConfigDialog):
|
||||
def update_account_combobox(self):
|
||||
if self.plugin_active is False:
|
||||
return
|
||||
if self._ui.account_store:
|
||||
if len(self._ui.account_store):
|
||||
self._ui.account_combobox.set_active(0)
|
||||
else:
|
||||
self.account_combobox_changed_cb(self._ui.account_combobox)
|
||||
@@ -130,7 +130,7 @@ class OMEMOConfigDialog(GajimPluginConfigDialog):
|
||||
def update_context_list(self):
|
||||
self._ui.deviceid_store.clear()
|
||||
|
||||
if not self._ui.account_store:
|
||||
if not len(self._ui.account_store):
|
||||
self._ui.ID.set_markup('')
|
||||
self._ui.fingerprint_label.set_markup('')
|
||||
self._ui.refresh.set_sensitive(False)
|
||||
|
||||
@@ -270,6 +270,7 @@
|
||||
<object class="GtkButton" id="cleardevice_button">
|
||||
<property name="label" translatable="yes">_Clear Devices</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">This clears your device list from the server.
|
||||
@@ -292,6 +293,7 @@ It is advised to go online with all of your actively used devices after clearing
|
||||
<property name="label">gtk-refresh</property>
|
||||
<property name="width_request">160</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
|
||||
Reference in New Issue
Block a user