From 1a82ed0ca3e6f68d3a5fb79118c4a41ee5a7e15f Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 20 Apr 2005 16:35:40 +0000 Subject: [PATCH] when we create a new account, plugin.windows[account] doesn't exists --- src/config.py | 7 ++++++- src/roster_window.py | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/config.py b/src/config.py index 54a8afbe4..fca0a0e1e 100644 --- a/src/config.py +++ b/src/config.py @@ -913,7 +913,12 @@ class Account_modification_window: '''Class for account informations''' def on_account_modification_window_destroy(self, widget): '''close window''' - del self.plugin.windows[self.account]['account_modification'] + if self.plugin.windows.has_key(self.account): + if self.plugin.windows[self.account].has_key('account_modification') + del self.plugin.windows[self.account]['account_modification'] + return + if self.plugin.windows.has_key('account_modification'): + del self.plugin.windows['account_modification'] def on_cancel_button_clicked(self, widget): self.window.destroy() diff --git a/src/roster_window.py b/src/roster_window.py index 52acca7bb..0d1533888 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -533,10 +533,10 @@ class Roster_window: menu.reposition() def on_edit_account(self, widget, account): - if self.plugin.windows.has_key('account_modification'): - self.plugin.windows['account_modification'].window.present() + if self.plugin.windows[account].has_key('account_modification'): + self.plugin.windows[account]['account_modification'].window.present() else: - self.plugin.windows['account_modification'] = \ + self.plugin.windows[account]['account_modification'] = \ config.Account_modification_window(self.plugin, account) def mk_menu_account(self, event, iter):