confirmation is asked when we remove an account
This commit is contained in:
		
							parent
							
								
									b3473a5f1f
								
							
						
					
					
						commit
						cfd0e58803
					
				
					 1 changed files with 14 additions and 10 deletions
				
			
		| 
						 | 
					@ -737,15 +737,20 @@ class accounts_Window:
 | 
				
			||||||
		sel = self.treeview.get_selection()
 | 
							sel = self.treeview.get_selection()
 | 
				
			||||||
		(model, iter) = sel.get_selected()
 | 
							(model, iter) = sel.get_selected()
 | 
				
			||||||
		account = model.get_value(iter, 0)
 | 
							account = model.get_value(iter, 0)
 | 
				
			||||||
		del self.plugin.accounts[account]
 | 
							window = confirm_Window('Are you sure you want to remove this account (' \
 | 
				
			||||||
		self.plugin.send('CONFIG', None, ('accounts', self.plugin.accounts))
 | 
								+ account + ') ?')
 | 
				
			||||||
		del self.plugin.windows[account]
 | 
							if window.wait() == gtk.RESPONSE_OK:
 | 
				
			||||||
		del self.plugin.queues[account]
 | 
								if self.plugin.connected[account]:
 | 
				
			||||||
		del self.plugin.connected[account]
 | 
									self.plugin.send('STATUS', account, ('offline', 'offline'))
 | 
				
			||||||
		del self.plugin.roster.groups[account]
 | 
								del self.plugin.accounts[account]
 | 
				
			||||||
		del self.plugin.roster.contacts[account]
 | 
								self.plugin.send('CONFIG', None, ('accounts', self.plugin.accounts))
 | 
				
			||||||
		self.plugin.roster.draw_roster()
 | 
								del self.plugin.windows[account]
 | 
				
			||||||
		self.init_accounts()
 | 
								del self.plugin.queues[account]
 | 
				
			||||||
 | 
								del self.plugin.connected[account]
 | 
				
			||||||
 | 
								del self.plugin.roster.groups[account]
 | 
				
			||||||
 | 
								del self.plugin.roster.contacts[account]
 | 
				
			||||||
 | 
								self.plugin.roster.draw_roster()
 | 
				
			||||||
 | 
								self.init_accounts()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def on_modify_clicked(self, widget):
 | 
						def on_modify_clicked(self, widget):
 | 
				
			||||||
		"""When modify button is clicked :
 | 
							"""When modify button is clicked :
 | 
				
			||||||
| 
						 | 
					@ -1594,7 +1599,6 @@ class roster_Window:
 | 
				
			||||||
		else:
 | 
							else:
 | 
				
			||||||
			txt = status
 | 
								txt = status
 | 
				
			||||||
		self.plugin.send('STATUS', account, (status, txt))
 | 
							self.plugin.send('STATUS', account, (status, txt))
 | 
				
			||||||
		
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def on_optionmenu_changed(self, widget):
 | 
						def on_optionmenu_changed(self, widget):
 | 
				
			||||||
		"""When we change our status"""
 | 
							"""When we change our status"""
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue