diff --git a/plugins/gtkgui/config.py b/plugins/gtkgui/config.py
index 39a1710ff..972b66799 100644
--- a/plugins/gtkgui/config.py
+++ b/plugins/gtkgui/config.py
@@ -1167,8 +1167,8 @@ class accounts_window:
sel = self.accounts_treeview.get_selection()
(model, iter) = sel.get_selected()
account = model.get_value(iter, 0)
- window = confirm_Window(_("Are you sure you want to remove this account (%s) ?") % account)
- if window.wait() == gtk.RESPONSE_OK:
+ window = confirm_window(_("Are you sure you want to remove this account (%s) ?") % account)
+ if window.wait() == gtk.RESPONSE_YES:
if self.plugin.connected[account]:
self.plugin.send('STATUS', account, ('offline', 'offline'))
del self.plugin.accounts[account]
diff --git a/plugins/gtkgui/dialogs.py b/plugins/gtkgui/dialogs.py
index 3995d6fb1..be908c6fa 100644
--- a/plugins/gtkgui/dialogs.py
+++ b/plugins/gtkgui/dialogs.py
@@ -398,17 +398,17 @@ class about_Window: #FIXME: (nk) pygtk2.6 has a built-in window for that
xml.signal_connect('on_close_clicked', self.on_close)
-class confirm_Window:
+class confirm_window:
"""Class for confirmation window"""
def wait(self):
- out = self.win.run()
- self.win.destroy()
- return out
+ response = self.window.run()
+ self.window.destroy()
+ return response
def __init__(self, label):
- xml = gtk.glade.XML(GTKGUI_GLADE, 'Confirm', APP)
- xml.get_widget('label_confirm').set_text(label)
- self.win = xml.get_widget('Confirm')
+ self.window = gtk.MessageDialog(None,\
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,\
+ gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, label)
class subscription_request_Window:
"""Class for authorization window :
diff --git a/plugins/gtkgui/gtkgui.glade b/plugins/gtkgui/gtkgui.glade
index 2ed6e3c00..8f29dafec 100644
--- a/plugins/gtkgui/gtkgui.glade
+++ b/plugins/gtkgui/gtkgui.glade
@@ -2548,92 +2548,6 @@ on the server as a vCard
-
- 5
- True
- Sure ?
- GTK_WINDOW_TOPLEVEL
- GTK_WIN_POS_NONE
- False
- True
- False
- True
- False
- False
- GDK_WINDOW_TYPE_HINT_DIALOG
- GDK_GRAVITY_NORTH_WEST
- True
-
-
-
- True
- False
- 0
-
-
-
- True
- GTK_BUTTONBOX_END
-
-
-
- True
- True
- True
- gtk-cancel
- True
- GTK_RELIEF_NORMAL
- True
- -6
-
-
-
-
-
- True
- True
- True
- gtk-ok
- True
- GTK_RELIEF_NORMAL
- True
- -5
-
-
-
-
- 5
- False
- True
- GTK_PACK_END
-
-
-
-
-
- True
-
- False
- False
- GTK_JUSTIFY_LEFT
- True
- False
- 0.5
- 0.5
- 0
- 0
- okbutton
-
-
- 10
- True
- True
-
-
-
-
-
-
5
True
diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py
index 8d5b70317..c37b23058 100644
--- a/plugins/gtkgui/gtkgui.py
+++ b/plugins/gtkgui/gtkgui.py
@@ -1579,8 +1579,8 @@ class roster_Window:
def on_remove_agent(self, widget, jid, account):
"""When an agent is requested to log in or off"""
- window = confirm_Window(_("Are you sure you want to remove the agent %s from your roster ?") % jid)
- if window.wait() == gtk.RESPONSE_OK:
+ window = confirm_window(_("Are you sure you want to remove the agent %s from your roster ?") % jid)
+ if window.wait() == gtk.RESPONSE_YES:
self.plugin.send('UNSUB_AGENT', account, jid)
for u in self.contacts[account][jid]:
self.remove_user(u, account)
@@ -1804,8 +1804,8 @@ class roster_Window:
def on_req_usub(self, widget, user, account):
"""Remove a user"""
- window = confirm_Window(_("Are you sure you want to remove %s (%s) from your roster ?") % (user.name, user.jid))
- if window.wait() == gtk.RESPONSE_OK:
+ window = confirm_window(_("Are you sure you want to remove %s (%s) from your roster ?") % (user.name, user.jid))
+ if window.wait() == gtk.RESPONSE_YES:
self.plugin.send('UNSUB', account, user.jid)
for u in self.contacts[account][user.jid]:
self.remove_user(u, account)