add option to enable / disable the remember opened chats option. Fixes #7193
This commit is contained in:
		
							parent
							
								
									aa3a8c7f46
								
							
						
					
					
						commit
						57c8fdad39
					
				
					 3 changed files with 14 additions and 8 deletions
				
			
		|  | @ -311,6 +311,7 @@ class Config: | ||||||
|             'show_affiliation_in_groupchat': [opt_bool, True, _('If True, Gajim will show affiliation of groupchat occupants by adding a colored square to the status icon')], |             'show_affiliation_in_groupchat': [opt_bool, True, _('If True, Gajim will show affiliation of groupchat occupants by adding a colored square to the status icon')], | ||||||
|             'global_proxy': [opt_str, '', _('Proxy used for all outgoing connections if the account does not have a specific proxy configured')], |             'global_proxy': [opt_str, '', _('Proxy used for all outgoing connections if the account does not have a specific proxy configured')], | ||||||
|             'ignore_incoming_attention': [opt_bool, False, _('If True, Gajim will ignore incoming attention requestd ("wizz").')], |             'ignore_incoming_attention': [opt_bool, False, _('If True, Gajim will ignore incoming attention requestd ("wizz").')], | ||||||
|  |             'remember_opened_chat_controls': [ opt_bool, True, _('If enabled, Gajim will reopen chat windows that were opened last time Gajim was closed.')], | ||||||
|     }, {}) |     }, {}) | ||||||
| 
 | 
 | ||||||
|     __options_per_key = { |     __options_per_key = { | ||||||
|  |  | ||||||
|  | @ -1246,6 +1246,8 @@ class MessageWindowMgr(gobject.GObject): | ||||||
|             mw.new_tab(ctrl) |             mw.new_tab(ctrl) | ||||||
| 
 | 
 | ||||||
|     def save_opened_controls(self): |     def save_opened_controls(self): | ||||||
|  |         if not gajim.config.get('remember_opened_chat_controls'): | ||||||
|  |             return | ||||||
|         chat_controls = {} |         chat_controls = {} | ||||||
|         for acct in gajim.connections: |         for acct in gajim.connections: | ||||||
|             chat_controls[acct] = [] |             chat_controls[acct] = [] | ||||||
|  |  | ||||||
|  | @ -2609,14 +2609,17 @@ class RosterWindow: | ||||||
|             self.add_account_contacts(obj.conn.name) |             self.add_account_contacts(obj.conn.name) | ||||||
|             self.fire_up_unread_messages_events(obj.conn.name) |             self.fire_up_unread_messages_events(obj.conn.name) | ||||||
|         else: |         else: | ||||||
|  |             if gajim.config.get('remember_opened_chat_controls'): | ||||||
|                 account = obj.conn.name |                 account = obj.conn.name | ||||||
|                 controls = gajim.config.get_per('accounts', account, |                 controls = gajim.config.get_per('accounts', account, | ||||||
|                     'opened_chat_controls') |                     'opened_chat_controls') | ||||||
|                 if controls: |                 if controls: | ||||||
|                     for jid in controls.split(','): |                     for jid in controls.split(','): | ||||||
|                     contact = gajim.contacts.get_contact_with_highest_priority( |                         contact = \ | ||||||
|  |                             gajim.contacts.get_contact_with_highest_priority( | ||||||
|                             account, jid) |                             account, jid) | ||||||
|                     gajim.interface.on_open_chat_window(None, contact, account) |                         gajim.interface.on_open_chat_window(None, contact, | ||||||
|  |                             account) | ||||||
|             gobject.idle_add(self.refilter_shown_roster_items) |             gobject.idle_add(self.refilter_shown_roster_items) | ||||||
| 
 | 
 | ||||||
|     def _nec_anonymous_auth(self, obj): |     def _nec_anonymous_auth(self, obj): | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue