show_all/hide for roster and accounts window, better strings when multiple accounts [has a bug], changelog is better now
This commit is contained in:
		
							parent
							
								
									ee6fb42258
								
							
						
					
					
						commit
						2295a319ce
					
				
					 7 changed files with 61 additions and 39 deletions
				
			
		
							
								
								
									
										31
									
								
								Changelog
									
										
									
									
									
								
							
							
						
						
									
										31
									
								
								Changelog
									
										
									
									
									
								
							| 
						 | 
					@ -7,7 +7,7 @@ What's new since 0.5.1:
 | 
				
			||||||
    * URL, mailto and ascii formatin (* / _) detection
 | 
					    * URL, mailto and ascii formatin (* / _) detection
 | 
				
			||||||
    * Better transports detection, group management, and many minor additions/bugfixes
 | 
					    * 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.
 | 
					Version 0.5.1 of Gajim is now Available.
 | 
				
			||||||
What's new since 0.5:
 | 
					What's new since 0.5:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -37,3 +37,32 @@ What's new since 0.3:
 | 
				
			||||||
    * GUI improvements
 | 
					    * GUI improvements
 | 
				
			||||||
    * Bugfixes
 | 
					    * 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.on_msg_treemodel_row_deleted)
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		self.xml.signal_autoconnect(self)
 | 
							self.xml.signal_autoconnect(self)
 | 
				
			||||||
		#self.window.show_all()
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Account_modification_window:
 | 
					class Account_modification_window:
 | 
				
			||||||
	"""Class for account informations"""
 | 
						"""Class for account informations"""
 | 
				
			||||||
| 
						 | 
					@ -1337,13 +1336,12 @@ class Account_modification_window:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Accounts_window:
 | 
					class Accounts_window:
 | 
				
			||||||
	"""Class for accounts window: lists of accounts"""
 | 
						"""Class for accounts window: lists of accounts"""
 | 
				
			||||||
	def on_accounts_window_destroy(self, widget):
 | 
						def on_delete_event(self, widget, event):
 | 
				
			||||||
		"""close window"""
 | 
					  		self.window.hide()  
 | 
				
			||||||
		del self.plugin.windows['accounts_window']
 | 
							return True # do NOT destory the window 
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
	def on_close_button_clicked(self, widget):
 | 
						def on_close_button_clicked(self, widget):
 | 
				
			||||||
		"""When Close button is clicked"""
 | 
							self.window.hide()
 | 
				
			||||||
		widget.get_toplevel().destroy()
 | 
					 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
	def init_accounts(self):
 | 
						def init_accounts(self):
 | 
				
			||||||
		"""initialize listStore with existing accounts"""
 | 
							"""initialize listStore with existing accounts"""
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -694,7 +694,11 @@ class New_message_dialog:
 | 
				
			||||||
		self.window = self.xml.get_widget('new_message_dialog')
 | 
							self.window = self.xml.get_widget('new_message_dialog')
 | 
				
			||||||
		self.jid_entry = self.xml.get_widget('jid_entry')
 | 
							self.jid_entry = self.xml.get_widget('jid_entry')
 | 
				
			||||||
		self.xml.signal_autoconnect(self)
 | 
							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:
 | 
					class Change_password_dialog:
 | 
				
			||||||
	def run(self):
 | 
						def run(self):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -310,7 +310,6 @@
 | 
				
			||||||
  <property name="border_width">4</property>
 | 
					  <property name="border_width">4</property>
 | 
				
			||||||
  <property name="width_request">450</property>
 | 
					  <property name="width_request">450</property>
 | 
				
			||||||
  <property name="height_request">200</property>
 | 
					  <property name="height_request">200</property>
 | 
				
			||||||
  <property name="visible">True</property>
 | 
					 | 
				
			||||||
  <property name="title" translatable="yes">Accounts</property>
 | 
					  <property name="title" translatable="yes">Accounts</property>
 | 
				
			||||||
  <property name="type">GTK_WINDOW_TOPLEVEL</property>
 | 
					  <property name="type">GTK_WINDOW_TOPLEVEL</property>
 | 
				
			||||||
  <property name="window_position">GTK_WIN_POS_NONE</property>
 | 
					  <property name="window_position">GTK_WIN_POS_NONE</property>
 | 
				
			||||||
| 
						 | 
					@ -322,7 +321,7 @@
 | 
				
			||||||
  <property name="skip_pager_hint">False</property>
 | 
					  <property name="skip_pager_hint">False</property>
 | 
				
			||||||
  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
 | 
					  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
 | 
				
			||||||
  <property name="gravity">GDK_GRAVITY_NORTH_WEST</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>
 | 
					  <child>
 | 
				
			||||||
    <widget class="GtkVBox" id="vbox5">
 | 
					    <widget class="GtkVBox" id="vbox5">
 | 
				
			||||||
| 
						 | 
					@ -8735,7 +8734,7 @@ Custom</property>
 | 
				
			||||||
  <property name="width_request">460</property>
 | 
					  <property name="width_request">460</property>
 | 
				
			||||||
  <property name="height_request">160</property>
 | 
					  <property name="height_request">160</property>
 | 
				
			||||||
  <property name="visible">True</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="type">GTK_WINDOW_TOPLEVEL</property>
 | 
				
			||||||
  <property name="window_position">GTK_WIN_POS_NONE</property>
 | 
					  <property name="window_position">GTK_WIN_POS_NONE</property>
 | 
				
			||||||
  <property name="modal">False</property>
 | 
					  <property name="modal">False</property>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -413,8 +413,8 @@ class plugin:
 | 
				
			||||||
		jid = array[0].split('/')[0]
 | 
							jid = array[0].split('/')[0]
 | 
				
			||||||
		if jid.find("@") <= 0:
 | 
							if jid.find("@") <= 0:
 | 
				
			||||||
			jid = jid.replace('@', '')
 | 
								jid = jid.replace('@', '')
 | 
				
			||||||
		self.roster.on_message(jid, _("error while sending") + " \"%s\" ( %s )"%\
 | 
							self.roster.on_message(jid, _("error while sending") + \
 | 
				
			||||||
			(array[3], array[2]), array[4], account)
 | 
								' \"%s\" ( %s )' % (array[3], array[2]), array[4], account)
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
	def handle_event_msgsent(self, account, array):
 | 
						def handle_event_msgsent(self, account, array):
 | 
				
			||||||
		#('MSG', account, (jid, msg, keyID))
 | 
							#('MSG', account, (jid, msg, keyID))
 | 
				
			||||||
| 
						 | 
					@ -919,6 +919,8 @@ class plugin:
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		# get instances for windows/dialogs that will show_all()/hide()
 | 
							# get instances for windows/dialogs that will show_all()/hide()
 | 
				
			||||||
		self.windows['preferences'] = Preferences_window(self)
 | 
							self.windows['preferences'] = Preferences_window(self)
 | 
				
			||||||
 | 
							self.windows['roster'] = self.roster
 | 
				
			||||||
 | 
							self.windows['accounts'] = Accounts_window(self)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		gtk.gdk.threads_enter()
 | 
							gtk.gdk.threads_enter()
 | 
				
			||||||
		gobject.timeout_add(100, self.autoconnect)
 | 
							gobject.timeout_add(100, self.autoconnect)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -251,15 +251,15 @@ class Roster_window:
 | 
				
			||||||
			sub_menu = gtk.Menu()
 | 
								sub_menu = gtk.Menu()
 | 
				
			||||||
			add_contact_menuitem.set_submenu(sub_menu)
 | 
								add_contact_menuitem.set_submenu(sub_menu)
 | 
				
			||||||
			for account in self.plugin.accounts.keys():
 | 
								for account in self.plugin.accounts.keys():
 | 
				
			||||||
				item = gtk.MenuItem(_('using ') + account + _(' account'))
 | 
									item = gtk.MenuItem(_('to ') + account + _(' account'))
 | 
				
			||||||
				sub_menu.append(item)
 | 
									sub_menu.append(item)
 | 
				
			||||||
				item.connect("activate", self.on_add_contact, account)
 | 
									item.connect("activate", self.on_add_contact, account)
 | 
				
			||||||
			sub_menu.show_all()
 | 
								sub_menu.show_all()
 | 
				
			||||||
			#agents
 | 
								#disco
 | 
				
			||||||
			sub_menu = gtk.Menu()
 | 
								sub_menu = gtk.Menu()
 | 
				
			||||||
			service_disco_menuitem.set_submenu(sub_menu)
 | 
								service_disco_menuitem.set_submenu(sub_menu)
 | 
				
			||||||
			for account in self.plugin.accounts.keys():
 | 
								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)
 | 
									sub_menu.append(item)
 | 
				
			||||||
				item.connect('activate', self.on_service_disco_menuitem_activate, account)
 | 
									item.connect('activate', self.on_service_disco_menuitem_activate, account)
 | 
				
			||||||
			sub_menu.show_all()
 | 
								sub_menu.show_all()
 | 
				
			||||||
| 
						 | 
					@ -267,7 +267,7 @@ class Roster_window:
 | 
				
			||||||
			sub_menu = gtk.Menu()
 | 
								sub_menu = gtk.Menu()
 | 
				
			||||||
			join_gc_menuitem.set_submenu(sub_menu)
 | 
								join_gc_menuitem.set_submenu(sub_menu)
 | 
				
			||||||
			for account in self.plugin.accounts.keys():
 | 
								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)
 | 
									sub_menu.append(item)
 | 
				
			||||||
				item.connect("activate", self.on_join_gc_activate, account)
 | 
									item.connect("activate", self.on_join_gc_activate, account)
 | 
				
			||||||
			sub_menu.show_all()
 | 
								sub_menu.show_all()
 | 
				
			||||||
| 
						 | 
					@ -275,16 +275,16 @@ class Roster_window:
 | 
				
			||||||
			sub_menu = gtk.Menu()
 | 
								sub_menu = gtk.Menu()
 | 
				
			||||||
			new_message_menuitem.set_submenu(sub_menu)
 | 
								new_message_menuitem.set_submenu(sub_menu)
 | 
				
			||||||
			for account in self.plugin.accounts.keys():
 | 
								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)
 | 
									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()
 | 
								sub_menu.show_all()
 | 
				
			||||||
		elif len(self.plugin.accounts.keys()) == 1: # one account
 | 
							elif len(self.plugin.accounts.keys()) == 1: # one account
 | 
				
			||||||
			#add
 | 
								#add
 | 
				
			||||||
			if not self.add_contact_handler_id:
 | 
								if not self.add_contact_handler_id:
 | 
				
			||||||
				self.add_contact_handler_id = add_contact_menuitem.connect(\
 | 
									self.add_contact_handler_id = add_contact_menuitem.connect(\
 | 
				
			||||||
				'activate', self.on_add_contact, self.plugin.accounts.keys()[0])
 | 
									'activate', self.on_add_contact, self.plugin.accounts.keys()[0])
 | 
				
			||||||
			#agents
 | 
								#disco
 | 
				
			||||||
			if not self.service_disco_handler_id:
 | 
								if not self.service_disco_handler_id:
 | 
				
			||||||
				self.service_disco_handler_id = service_disco_menuitem.connect(\
 | 
									self.service_disco_handler_id = service_disco_menuitem.connect(\
 | 
				
			||||||
'activate', self.on_service_disco_menuitem_activate, self.plugin.accounts.keys()[0])
 | 
					'activate', self.on_service_disco_menuitem_activate, self.plugin.accounts.keys()[0])
 | 
				
			||||||
| 
						 | 
					@ -893,38 +893,28 @@ class Roster_window:
 | 
				
			||||||
				jid, tim = tim)
 | 
									jid, tim = tim)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def on_preferences_menuitem_activate(self, widget):
 | 
						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'):
 | 
							if self.plugin.windows['preferences'].window.get_property('visible'):
 | 
				
			||||||
			self.plugin.windows['preferences'].window.present()
 | 
								self.plugin.windows['preferences'].window.present() # give focus
 | 
				
			||||||
		else:
 | 
							else:
 | 
				
			||||||
			self.plugin.windows['preferences'].window.show_all()
 | 
								self.plugin.windows['preferences'].window.show_all()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def on_add_contact(self, widget, account):
 | 
						def on_add_contact(self, widget, account):
 | 
				
			||||||
		"""When add user is selected :
 | 
					 | 
				
			||||||
		call the add_contact_window class"""
 | 
					 | 
				
			||||||
		Add_contact_window(self.plugin, account)
 | 
							Add_contact_window(self.plugin, account)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def on_join_gc_activate(self, widget, 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)
 | 
							Join_groupchat_window(self.plugin, account)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def on_new_message_menuitem_activate(self, widget, 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)
 | 
							New_message_dialog(self.plugin, account)
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
	def on_about_menuitem_activate(self, widget):
 | 
						def on_about_menuitem_activate(self, widget):
 | 
				
			||||||
		"""When about is selected :
 | 
					 | 
				
			||||||
		call the about class"""
 | 
					 | 
				
			||||||
		About_dialog(self.plugin)
 | 
							About_dialog(self.plugin)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def on_accounts_menuitem_activate(self, widget):
 | 
						def on_accounts_menuitem_activate(self, widget):
 | 
				
			||||||
		"""When accounts is seleted :
 | 
							if	self.plugin.windows['accounts'].window.get_property('visible'):
 | 
				
			||||||
		call the accounts class to modify accounts"""
 | 
								self.plugin.windows['accounts'].window.present() # give focus
 | 
				
			||||||
		if not self.plugin.windows.has_key('accounts_window'):
 | 
							else:
 | 
				
			||||||
			self.plugin.windows['accounts_window'] = Accounts_window(self.plugin)
 | 
								self.plugin.windows['accounts'].window.show_all()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def close_all(self, dic):
 | 
						def close_all(self, dic):
 | 
				
			||||||
		"""close all the windows in the given dictionary"""
 | 
							"""close all the windows in the given dictionary"""
 | 
				
			||||||
| 
						 | 
					@ -953,7 +943,7 @@ class Roster_window:
 | 
				
			||||||
					if self.plugin.connected[acct]:
 | 
										if self.plugin.connected[acct]:
 | 
				
			||||||
						self.send_status(acct, 'offline', message)
 | 
											self.send_status(acct, 'offline', message)
 | 
				
			||||||
			self.quit_gtkgui_plugin()
 | 
								self.quit_gtkgui_plugin()
 | 
				
			||||||
		return 1
 | 
							return True # do NOT destory the window
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def quit_gtkgui_plugin(self):
 | 
						def quit_gtkgui_plugin(self):
 | 
				
			||||||
		"""When we quit the gtk plugin :
 | 
							"""When we quit the gtk plugin :
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -142,18 +142,18 @@ class systray:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			for account in self.plugin.accounts.keys():
 | 
								for account in self.plugin.accounts.keys():
 | 
				
			||||||
				#for chat_with
 | 
									#for chat_with
 | 
				
			||||||
				item = gtk.MenuItem(_('using ') + account + _(' account'))
 | 
									item = gtk.MenuItem(_('as ') + plugin.accounts[account]['jid'])
 | 
				
			||||||
				account_menu_for_chat_with.append(item)
 | 
									account_menu_for_chat_with.append(item)
 | 
				
			||||||
				group_menu = self.make_groups_submenus_for_chat_with(account)
 | 
									group_menu = self.make_groups_submenus_for_chat_with(account)
 | 
				
			||||||
				item.set_submenu(group_menu)
 | 
									item.set_submenu(group_menu)
 | 
				
			||||||
				#for new_message
 | 
									#for new_message
 | 
				
			||||||
				item = gtk.MenuItem(_('using ') + account + _(' account'))
 | 
									item = gtk.MenuItem(_('as ') + plugin.accounts[account]['jid'])
 | 
				
			||||||
				item.connect('activate',\
 | 
									item.connect('activate',\
 | 
				
			||||||
					self.on_new_message_menuitem_activate, account)
 | 
										self.on_new_message_menuitem_activate, account)
 | 
				
			||||||
				account_menu_for_new_message.append(item)
 | 
									account_menu_for_new_message.append(item)
 | 
				
			||||||
				
 | 
									
 | 
				
			||||||
		elif len(self.plugin.accounts.keys()) == 1: # one account
 | 
							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
 | 
								#for chat_with
 | 
				
			||||||
			account = self.plugin.accounts.keys()[0]
 | 
								account = self.plugin.accounts.keys()[0]
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue