diff --git a/plugins/gtkgui/dialogs.py b/plugins/gtkgui/dialogs.py index a70436c59..460f17526 100644 --- a/plugins/gtkgui/dialogs.py +++ b/plugins/gtkgui/dialogs.py @@ -4,6 +4,7 @@ ## - Yann Le Boulanger ## - Vincent Hanquez ## - Nikos Kouremenos +## - Alex Podaras ## ## Copyright (C) 2003-2005 Gajim Team ## @@ -17,8 +18,6 @@ ## GNU General Public License for more details. ## -import pygtk -pygtk.require('2.0') import gtk import gtk.glade import gobject @@ -153,7 +152,7 @@ class vcard_information_window: def on_publish_button_clicked(self, widget): if not self.plugin.connected[self.account]: - warning_dialog(_("You must be connected to publish your informations")) + Warning_dialog(_("You must be connected to publish your informations")) return vcard = self.make_vcard() nick = '' @@ -168,7 +167,7 @@ class vcard_information_window: if self.plugin.connected[self.account]: self.plugin.send('ASK_VCARD', self.account, self.jid) else: - warning_dialog(_('You must be connected to get your informations')) + Warning_dialog(_('You must be connected to get your informations')) def change_to_vcard(self): self.xml.get_widget('information_notebook').remove_page(0) @@ -299,7 +298,7 @@ class choose_gpg_key_dialog: class away_message_dialog: """Class for away_message_dialogWindow""" def run(self): - """Wait for Ok button to be pressed and return away messsage""" + """Wait for OK button to be pressed and return away messsage""" rep = self.window.run() if rep == gtk.RESPONSE_OK: beg, end = self.message_buffer.get_bounds() @@ -357,7 +356,7 @@ class add_contact_window: if not jid: return if jid.find('@') < 0: - warning_dialog(_("The contact's name must be something like login@hostname")) + Warning_dialog(_("The contact's name must be something like login@hostname")) return message_buffer = self.xml.get_widget('message_textview').get_buffer() start_iter = message_buffer.get_start_iter() @@ -414,7 +413,7 @@ class add_contact_window: def __init__(self, plugin, account, jid=None): if not plugin.connected[account]: - warning_dialog(_('You must be connected to add a contact')) + Warning_dialog(_('You must be connected to add a contact')) return self.plugin = plugin self.account = account @@ -475,7 +474,7 @@ class about_window: #FIXME REWRITE: (nk) pygtk2.6 has a built-in window for that self.plugin.windows['about'] = self # add us to open windows -class confirm_dialog: +class Confirmation_dialog: """Class for confirmation dialog""" def get_response(self): response = self.dialog.run() @@ -487,7 +486,7 @@ class confirm_dialog: gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,\ gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, label) -class warning_dialog: +class Warning_dialog: """Class for warning dialog""" def on_response(self, dialog, response_id): dialog.destroy() @@ -499,7 +498,7 @@ class warning_dialog: dialog.connect('response', self.on_response) dialog.show() -class information_dialog: +class Information_dialog: """Class for information dialog""" def on_response(self, dialog, response_id): dialog.destroy() @@ -511,7 +510,7 @@ class information_dialog: dialog.connect('response', self.on_response) dialog.show() -class error_dialog: +class Error_dialog: """Class for error dialog""" def on_response(self, dialog, response_id): dialog.destroy() @@ -576,7 +575,7 @@ class join_groupchat_window: def __init__(self, plugin, account, server='', room = ''): if not plugin.connected[account]: - warning_dialog(_('You must be connected to join a group chat on this server')) + Warning_dialog(_('You must be connected to join a group chat on this server')) return self.plugin = plugin self.account = account @@ -589,10 +588,10 @@ class join_groupchat_window: self.xml.signal_autoconnect(self) self.plugin.windows['join_gc'] = self # now add us to open windows -class New_message_window: - def on_delete_event(self, widget): +class New_message_dialog: + def on_delete_event(self, widget, event): """close window""" - del self.plugin.windows['new_msg'] + del self.plugin.windows['new_message'] def on_cancel_button_clicked(self, widget): """When Cancel button is clicked""" @@ -617,29 +616,30 @@ class New_message_window: def __init__(self, plugin, account): if not plugin.connected[account]: - warning_dialog(_('You must be connected to send a message to a contact')) + Warning_dialog(_('You must be connected to send a message to a contact')) return self.plugin = plugin self.account = account - self.xml = gtk.glade.XML(GTKGUI_GLADE, 'new_message_window', APP) - self.window = self.xml.get_widget('new_message_window') + self.xml = gtk.glade.XML(GTKGUI_GLADE, 'new_message_dialog', APP) + self.window = self.xml.get_widget('new_message_dialog') + self.jid_entry = self.xml.get_widget('jid_entry') self.xml.signal_autoconnect(self) self.plugin.windows['new_message'] = self # now add us to open windows class Change_password_dialog: def run(self): - """Wait for Ok button to be pressed and return away messsage""" + """Wait for OK button to be pressed and return new password""" end = False while not end: rep = self.dialog.run() if rep == gtk.RESPONSE_OK: password1 = self.password1_entry.get_text() if not password1: - warning_dialog(_('Your password cannot be empty')) + Warning_dialog(_('Your password cannot be empty')) continue password2 = self.password2_entry.get_text() if password1 != password2: - warning_dialog(_('Your passwords are not the same')) + Warning_dialog(_('Your passwords are not the same')) continue message = password1 else: @@ -650,7 +650,7 @@ class Change_password_dialog: def __init__(self, plugin, account): if not plugin.connected[account]: - warning_dialog(_('You must be connected to change your password')) + Warning_dialog(_('You must be connected to change your password')) return self.plugin = plugin self.account = account diff --git a/plugins/gtkgui/gtkgui.glade b/plugins/gtkgui/gtkgui.glade index 980accb26..a5b74f999 100644 --- a/plugins/gtkgui/gtkgui.glade +++ b/plugins/gtkgui/gtkgui.glade @@ -4,6 +4,8 @@ + 130 + 200 True Gajim GTK_WINDOW_TOPLEVEL @@ -315,13 +317,13 @@ 4 + 200 True Accounts GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - 200 - True + False False True False @@ -525,7 +527,7 @@ GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - True + False False True False @@ -653,7 +655,7 @@ Alex Podaras (bigpod@jabber.org) GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - True + False False True False @@ -1887,7 +1889,7 @@ on the server as a vCard GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - True + False False True False @@ -2266,14 +2268,14 @@ on the server as a vCard 4 + 400 + 200 True Subscription request GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - 400 - 200 - True + False False True False @@ -2531,14 +2533,14 @@ on the server as a vCard 4 + 400 + 250 True Agents browser GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - 400 - 250 - True + False False True False @@ -2795,13 +2797,13 @@ on the server as a vCard 4 + 300 + 200 True Register to GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - 300 - 200 True False True @@ -5209,7 +5211,7 @@ Custom GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - True + False False True False @@ -7176,7 +7178,7 @@ Custom GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - True + False False True False @@ -7509,7 +7511,7 @@ Custom GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - True + False False True False @@ -7782,7 +7784,7 @@ Custom GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False - True + False False True False @@ -7935,6 +7937,7 @@ Custom True True + True Chat GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE @@ -7942,7 +7945,7 @@ Custom 400 320 True - True + False True False False @@ -8176,6 +8179,7 @@ Custom True + True 170 @@ -8284,203 +8288,6 @@ Custom - - 4 - 461 - 163 - True - New Message - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - - - - - True - False - 0 - - - - True - False - 10 - - - - True - gtk-dialog-question - 6 - 0.5 - 0.5 - 0 - 0 - - - 0 - True - True - - - - - - True - Enter the user ID of the contact you would like to -send a chat message to - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 5 - False - False - - - - - 0 - True - True - - - - - - True - True - True - True - True - 0 - - True - * - True - - - 0 - False - False - - - - - - True - GTK_BUTTONBOX_END - 10 - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - True - GTK_RELIEF_NORMAL - True - - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-ok - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Chat - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - - - - - - 0 - True - True - - - - - - 4 True @@ -8893,4 +8700,218 @@ send a chat message to + + 4 + 460 + 160 + True + New Message + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + False + + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + + True + True + True + True + GTK_RELIEF_NORMAL + True + 0 + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-ok + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + _Chat + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + + + 0 + False + True + GTK_PACK_END + + + + + + 5 + True + False + 0 + + + + True + False + 10 + + + + True + gtk-dialog-question + 6 + 0.5 + 0.5 + 0 + 0 + + + 0 + True + True + + + + + + True + Enter the user ID of the contact you would like to +send a chat message to + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 5 + False + False + + + + + 0 + True + True + + + + + + True + True + True + True + True + 0 + + True + * + True + + + 0 + False + False + + + + + 0 + True + True + + + + + + diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py index 3a9fe1cd3..ba8c947ae 100644 --- a/plugins/gtkgui/gtkgui.py +++ b/plugins/gtkgui/gtkgui.py @@ -4,6 +4,7 @@ ## - Yann Le Boulanger ## - Vincent Hanquez ## - Nikos Kouremenos +## - Alex Podaras ## ## Copyright (C) 2003-2005 Gajim Team ## @@ -1693,7 +1694,7 @@ class roster_window: def on_remove_agent(self, widget, jid, account): """When an agent is requested to log in or off""" - window = confirm_dialog(_("Are you sure you want to remove the agent %s from your roster ?") % jid) + window = Confirmation_dialog(_('Are you sure you want to remove the agent %s from your roster?') % jid) if window.get_response() == gtk.RESPONSE_YES: self.plugin.send('UNSUB_AGENT', account, jid) for u in self.contacts[account][jid]: @@ -1943,7 +1944,7 @@ class roster_window: def on_req_usub(self, widget, user, account): """Remove a user""" - window = confirm_dialog(_("Are you sure you want to remove %s (%s) from your roster ?") % (user.name, user.jid)) + window = Confirmation_dialog(_("Are you sure you want to remove %s (%s) from your roster?") % (user.name, user.jid)) if window.get_response() == gtk.RESPONSE_YES: self.plugin.send('UNSUB', account, user.jid) for u in self.contacts[account][user.jid]: @@ -2031,7 +2032,7 @@ class roster_window: return accounts = self.plugin.accounts.keys() if len(accounts) == 0: - error_dialog(_("You must setup an account before connecting to jabber network.")) + Error_dialog(_("You must setup an account before connecting to jabber network.")) self.set_cb() return status = model[active][0] @@ -2175,8 +2176,8 @@ class roster_window: def on_new_message_menuitem_activate(self, widget, account): """When new message menuitem is activated: - call the new_message_window class""" - New_message_window(self.plugin, account) + call the New_message_dialog class""" + New_message_dialog(self.plugin, account) def on_about_menuitem_activate(self, widget): """When about is selected : @@ -2873,7 +2874,7 @@ class plugin: self.roster.draw_roster() def handle_event_warning(self, unused, msg): - warning_dialog(msg) + Warning_dialog(msg) def handle_event_status(self, account, status): #('STATUS', account, status) @@ -3000,10 +3001,10 @@ class plugin: 'online', 'to', '', array[1], 0, '') self.roster.contacts[account][jid] = [user1] self.roster.add_user_to_roster(jid, account) - information_dialog(_("You are now authorized by %s") % jid) + Information_dialog(_("You are now authorized by %s") % jid) def handle_event_unsubscribed(self, account, jid): - information_dialog(_("You are now unsubscribed by %s") % jid) + Information_dialog(_("You are now unsubscribed by %s") % jid) def handle_event_agents(self, account, agents): #('AGENTS', account, agents) @@ -3019,7 +3020,7 @@ class plugin: def handle_event_reg_agent_info(self, account, array): #('REG_AGENTS_INFO', account, (agent, infos)) if not array[1].has_key('instructions'): - error_dialog(_("error contacting %s") % array[0]) + Error_dialog(_("error contacting %s") % array[0]) else: agent_registration_window(array[0], array[1], self, account) @@ -3111,7 +3112,7 @@ class plugin: '%s has set the subject to %s' % (jids[1], array[1]), jid) def handle_event_bad_passphrase(self, account, array): - warning_dialog(_("Your GPG passphrase is wrong, so you are connected without your GPG key.")) + Warning_dialog(_("Your GPG passphrase is wrong, so you are connected without your GPG key.")) def handle_event_gpg_secrete_keys(self, account, keys): keys['None'] = 'None'