Commit 2295a319 authored by nkour's avatar nkour

show_all/hide for roster and accounts window, better strings when multiple...

show_all/hide for roster and accounts window, better strings when multiple accounts [has a bug], changelog is better now
parent ee6fb422
......@@ -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.
......@@ -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"""
......
......@@ -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):
......
......@@ -310,7 +310,6 @@
<property name="border_width">4</property>
<property name="width_request">450</property>
<property name="height_request">200</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Accounts</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
......@@ -322,7 +321,7 @@
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<signal name="destroy" handler="on_accounts_window_destroy" last_modification_time="Mon, 07 Mar 2005 15:10:45 GMT"/>
<signal name="delete_event" handler="on_delete_event" last_modification_time="Sun, 27 Mar 2005 18:58:04 GMT"/>
<child>
<widget class="GtkVBox" id="vbox5">
......@@ -8735,7 +8734,7 @@ Custom</property>
<property name="width_request">460</property>
<property name="height_request">160</property>
<property name="visible">True</property>
<property name="title" translatable="yes">New Message</property>
<property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
......
......@@ -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)
......
......@@ -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 :
......
......@@ -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]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment