do not allow more than one modification windows for the same account

This commit is contained in:
Nikos Kouremenos 2005-04-17 20:18:50 +00:00
parent b7fc77d3dc
commit 7f8e130d19
2 changed files with 14 additions and 13 deletions

View File

@ -1340,11 +1340,12 @@ class Accounts_window:
def on_new_button_clicked(self, widget): def on_new_button_clicked(self, widget):
"""When new button is clicked : open an account information window""" """When new button is clicked : open an account information window"""
if not self.plugin.windows.has_key('account_modification_window'): if self.plugin.windows.has_key('account_modification_window'):
self.plugin.windows['account_modification'].window.present()
else:
self.plugin.windows['account_modification'] = \ self.plugin.windows['account_modification'] = \
Account_modification_window(self.plugin, '') Account_modification_window(self.plugin, '')
else:
self.plugin.windows['account_modification'].window.present()
def on_delete_button_clicked(self, widget): def on_delete_button_clicked(self, widget):
"""When delete button is clicked : """When delete button is clicked :
@ -1369,15 +1370,15 @@ class Accounts_window:
def on_modify_button_clicked(self, widget): def on_modify_button_clicked(self, widget):
"""When modify button is clicked: """When modify button is clicked:
open the account information window for this account""" open/show the account modification window for this account"""
if not self.plugin.windows.has_key('account_modification_window'):
sel = self.accounts_treeview.get_selection() sel = self.accounts_treeview.get_selection()
(model, iter) = sel.get_selected() (model, iter) = sel.get_selected()
account = model.get_value(iter, 0) account = model.get_value(iter, 0)
self.plugin.windows['account_modification'] = \ if self.plugin.windows[account].has_key('account_modification_window'):
Account_modification_window(self.plugin, account) # may it messes with this one self.plugin.windows[account]['account_modification'].window.present()
else: else:
self.plugin.windows['account_modification'].window.present() self.plugin.windows[account]['account_modification'] = \
Account_modification_window(self.plugin, account)
def on_sync_with_global_status_checkbutton_toggled(self, widget): def on_sync_with_global_status_checkbutton_toggled(self, widget):
if widget.get_active(): if widget.get_active():

View File

@ -2026,7 +2026,7 @@
<child> <child>
<widget class="GtkLabel" id="label192"> <widget class="GtkLabel" id="label192">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Subscribe</property> <property name="label" translatable="yes">_Subscribe</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="use_markup">False</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property> <property name="justify">GTK_JUSTIFY_LEFT</property>