From 2295a319ce398aa028d1e99eaee0aeae27fa374f Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Sun, 27 Mar 2005 19:39:50 +0000 Subject: [PATCH] show_all/hide for roster and accounts window, better strings when multiple accounts [has a bug], changelog is better now --- Changelog | 31 +++++++++++++++++++++++++++- plugins/gtkgui/config.py | 10 ++++----- plugins/gtkgui/dialogs.py | 6 +++++- plugins/gtkgui/gtkgui.glade | 5 ++--- plugins/gtkgui/gtkgui.py | 6 ++++-- plugins/gtkgui/roster_window.py | 36 ++++++++++++--------------------- plugins/gtkgui/systray.py | 6 +++--- 7 files changed, 61 insertions(+), 39 deletions(-) diff --git a/Changelog b/Changelog index c1564e19d..ed46f67ed 100644 --- a/Changelog +++ b/Changelog @@ -7,7 +7,7 @@ What's new since 0.5.1: * URL, mailto and ascii formatin (* / _) detection * Better transports detection, group management, and many minor additions/bugfixes -0.5.1 release of Gajim ! (27 february 2005) +0.5.1 release of Gajim ! (27 February 2005) Version 0.5.1 of Gajim is now Available. What's new since 0.5: @@ -37,3 +37,32 @@ What's new since 0.3: * GUI improvements * Bugfixes +gajim (0.3) unstable (18 December 2004) + + * GUI improvements + * group chat support with MUC (JEP 45) + * New agent browser (JEP 30) + * GnuPG support + * Autoconnect at startup + * New socket plugin + +gajim (0.2.1) unstable (1 July 2004) + + * bugfixes : when configfile is incomplete + * icon in systray with popup menu (for linux) + * "auto away even if not online" option + * always show contacts with unread messages + * new imageCellRenderer to show animated gifs + * allow agents unregistration + +gajim (0.2) unstable (8 June 2004) + + * bugfix for french translation + * multi-resource support + * auto away support (for linux) + * invisible support + * priority support + +gajim (0.1) unstable (21 May 2004) + + * Initial release. diff --git a/plugins/gtkgui/config.py b/plugins/gtkgui/config.py index 1298a1fa2..e927be12a 100644 --- a/plugins/gtkgui/config.py +++ b/plugins/gtkgui/config.py @@ -969,7 +969,6 @@ class Preferences_window: self.on_msg_treemodel_row_deleted) self.xml.signal_autoconnect(self) - #self.window.show_all() class Account_modification_window: """Class for account informations""" @@ -1337,13 +1336,12 @@ class Account_modification_window: class Accounts_window: """Class for accounts window: lists of accounts""" - def on_accounts_window_destroy(self, widget): - """close window""" - del self.plugin.windows['accounts_window'] + def on_delete_event(self, widget, event): + self.window.hide() + return True # do NOT destory the window def on_close_button_clicked(self, widget): - """When Close button is clicked""" - widget.get_toplevel().destroy() + self.window.hide() def init_accounts(self): """initialize listStore with existing accounts""" diff --git a/plugins/gtkgui/dialogs.py b/plugins/gtkgui/dialogs.py index 660e71e5c..efc9d0824 100644 --- a/plugins/gtkgui/dialogs.py +++ b/plugins/gtkgui/dialogs.py @@ -694,7 +694,11 @@ class New_message_dialog: 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 + if len(self.plugin.accounts) > 1: + title = 'New Message as %s' % self.plugin.accounts[account]['jid'] + else: + title = 'New Message' + self.window.set_title(title) class Change_password_dialog: def run(self): diff --git a/plugins/gtkgui/gtkgui.glade b/plugins/gtkgui/gtkgui.glade index 507cf6270..54d051980 100644 --- a/plugins/gtkgui/gtkgui.glade +++ b/plugins/gtkgui/gtkgui.glade @@ -310,7 +310,6 @@ 4 450 200 - True Accounts GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE @@ -322,7 +321,7 @@ False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST - + @@ -8735,7 +8734,7 @@ Custom 460 160 True - New Message + GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py index 39eacfcff..f2933508f 100644 --- a/plugins/gtkgui/gtkgui.py +++ b/plugins/gtkgui/gtkgui.py @@ -413,8 +413,8 @@ class plugin: jid = array[0].split('/')[0] if jid.find("@") <= 0: jid = jid.replace('@', '') - self.roster.on_message(jid, _("error while sending") + " \"%s\" ( %s )"%\ - (array[3], array[2]), array[4], account) + self.roster.on_message(jid, _("error while sending") + \ + ' \"%s\" ( %s )' % (array[3], array[2]), array[4], account) def handle_event_msgsent(self, account, array): #('MSG', account, (jid, msg, keyID)) @@ -919,6 +919,8 @@ class plugin: # get instances for windows/dialogs that will show_all()/hide() self.windows['preferences'] = Preferences_window(self) + self.windows['roster'] = self.roster + self.windows['accounts'] = Accounts_window(self) gtk.gdk.threads_enter() gobject.timeout_add(100, self.autoconnect) diff --git a/plugins/gtkgui/roster_window.py b/plugins/gtkgui/roster_window.py index 101154fb8..1e794b272 100644 --- a/plugins/gtkgui/roster_window.py +++ b/plugins/gtkgui/roster_window.py @@ -251,15 +251,15 @@ class Roster_window: sub_menu = gtk.Menu() add_contact_menuitem.set_submenu(sub_menu) for account in self.plugin.accounts.keys(): - item = gtk.MenuItem(_('using ') + account + _(' account')) + item = gtk.MenuItem(_('to ') + account + _(' account')) sub_menu.append(item) item.connect("activate", self.on_add_contact, account) sub_menu.show_all() - #agents + #disco sub_menu = gtk.Menu() service_disco_menuitem.set_submenu(sub_menu) for account in self.plugin.accounts.keys(): - item = gtk.MenuItem(_('using ') + account + _(' account')) + item = gtk.MenuItem(_('as ') + self.plugin.accounts[account]['jid']) sub_menu.append(item) item.connect('activate', self.on_service_disco_menuitem_activate, account) sub_menu.show_all() @@ -267,7 +267,7 @@ class Roster_window: sub_menu = gtk.Menu() join_gc_menuitem.set_submenu(sub_menu) for account in self.plugin.accounts.keys(): - item = gtk.MenuItem(_('using ') + account + _(' account')) + item = gtk.MenuItem(_('as ') + self.plugin.accounts[account]['jid']) sub_menu.append(item) item.connect("activate", self.on_join_gc_activate, account) sub_menu.show_all() @@ -275,16 +275,16 @@ class Roster_window: sub_menu = gtk.Menu() new_message_menuitem.set_submenu(sub_menu) for account in self.plugin.accounts.keys(): - item = gtk.MenuItem(_('using ') + account + _(' account')) + item = gtk.MenuItem(_('as ') + self.plugin.accounts[account]['jid']) sub_menu.append(item) - item.connect("activate", self.on_new_message_menuitem_activate, account) + item.connect('activate', self.on_new_message_menuitem_activate, account) sub_menu.show_all() elif len(self.plugin.accounts.keys()) == 1: # one account #add if not self.add_contact_handler_id: self.add_contact_handler_id = add_contact_menuitem.connect(\ 'activate', self.on_add_contact, self.plugin.accounts.keys()[0]) - #agents + #disco if not self.service_disco_handler_id: self.service_disco_handler_id = service_disco_menuitem.connect(\ 'activate', self.on_service_disco_menuitem_activate, self.plugin.accounts.keys()[0]) @@ -893,38 +893,28 @@ class Roster_window: jid, tim = tim) def on_preferences_menuitem_activate(self, widget): - """When preferences is selected : - call the preferences_window class""" if self.plugin.windows['preferences'].window.get_property('visible'): - self.plugin.windows['preferences'].window.present() + self.plugin.windows['preferences'].window.present() # give focus else: self.plugin.windows['preferences'].window.show_all() def on_add_contact(self, widget, account): - """When add user is selected : - call the add_contact_window class""" Add_contact_window(self.plugin, account) def on_join_gc_activate(self, widget, account): - """When Join Groupchat is selected : - call the join_gc class""" Join_groupchat_window(self.plugin, account) def on_new_message_menuitem_activate(self, widget, account): - """When new message menuitem is activated: - call the New_message_dialog class""" New_message_dialog(self.plugin, account) def on_about_menuitem_activate(self, widget): - """When about is selected : - call the about class""" About_dialog(self.plugin) def on_accounts_menuitem_activate(self, widget): - """When accounts is seleted : - call the accounts class to modify accounts""" - if not self.plugin.windows.has_key('accounts_window'): - self.plugin.windows['accounts_window'] = Accounts_window(self.plugin) + if self.plugin.windows['accounts'].window.get_property('visible'): + self.plugin.windows['accounts'].window.present() # give focus + else: + self.plugin.windows['accounts'].window.show_all() def close_all(self, dic): """close all the windows in the given dictionary""" @@ -953,7 +943,7 @@ class Roster_window: if self.plugin.connected[acct]: self.send_status(acct, 'offline', message) self.quit_gtkgui_plugin() - return 1 + return True # do NOT destory the window def quit_gtkgui_plugin(self): """When we quit the gtk plugin : diff --git a/plugins/gtkgui/systray.py b/plugins/gtkgui/systray.py index 3940f6dc9..37f1fd580 100644 --- a/plugins/gtkgui/systray.py +++ b/plugins/gtkgui/systray.py @@ -142,18 +142,18 @@ class systray: for account in self.plugin.accounts.keys(): #for chat_with - item = gtk.MenuItem(_('using ') + account + _(' account')) + item = gtk.MenuItem(_('as ') + plugin.accounts[account]['jid']) account_menu_for_chat_with.append(item) group_menu = self.make_groups_submenus_for_chat_with(account) item.set_submenu(group_menu) #for new_message - item = gtk.MenuItem(_('using ') + account + _(' account')) + item = gtk.MenuItem(_('as ') + plugin.accounts[account]['jid']) item.connect('activate',\ self.on_new_message_menuitem_activate, account) account_menu_for_new_message.append(item) elif len(self.plugin.accounts.keys()) == 1: # one account - #one account, no need to show 'using foo account' + #one account, no need to show 'as jid #for chat_with account = self.plugin.accounts.keys()[0]