we can now save password in password_window
This commit is contained in:
		
							parent
							
								
									d8305fb20b
								
							
						
					
					
						commit
						3c2ba42a7e
					
				
					 3 changed files with 33 additions and 6 deletions
				
			
		|  | @ -221,8 +221,9 @@ class passphrase_Window: | ||||||
| 			msg = self.entry.get_text() | 			msg = self.entry.get_text() | ||||||
| 		else: | 		else: | ||||||
| 			msg = -1 | 			msg = -1 | ||||||
|  | 		chk = self.xml.get_widget("save_checkbutton") | ||||||
| 		self.win.destroy() | 		self.win.destroy() | ||||||
| 		return msg | 		return msg, chk.get_active() | ||||||
| 
 | 
 | ||||||
| 	def on_key_pressed(self, widget, event): | 	def on_key_pressed(self, widget, event): | ||||||
| 		if event.keyval == gtk.keysyms.Return: | 		if event.keyval == gtk.keysyms.Return: | ||||||
|  | @ -242,8 +243,9 @@ class passphrase_Window: | ||||||
| 	 | 	 | ||||||
| 	def get_pass(self): | 	def get_pass(self): | ||||||
| 		self.autoconnect = 0 | 		self.autoconnect = 0 | ||||||
|  | 		chk = self.xml.get_widget("save_checkbutton") | ||||||
| 		self.win.destroy() | 		self.win.destroy() | ||||||
| 		return self.msg | 		return self.msg, chk.get_active() | ||||||
| 		 | 		 | ||||||
| 	def delete_event(self, widget=None): | 	def delete_event(self, widget=None): | ||||||
| 		"""close window""" | 		"""close window""" | ||||||
|  |  | ||||||
|  | @ -8563,6 +8563,25 @@ on the server.</property> | ||||||
| 	      <property name="fill">False</property> | 	      <property name="fill">False</property> | ||||||
| 	    </packing> | 	    </packing> | ||||||
| 	  </child> | 	  </child> | ||||||
|  | 
 | ||||||
|  | 	  <child> | ||||||
|  | 	    <widget class="GtkCheckButton" id="save_checkbutton"> | ||||||
|  | 	      <property name="visible">True</property> | ||||||
|  | 	      <property name="can_focus">True</property> | ||||||
|  | 	      <property name="label" translatable="yes">Save password ?</property> | ||||||
|  | 	      <property name="use_underline">True</property> | ||||||
|  | 	      <property name="relief">GTK_RELIEF_NORMAL</property> | ||||||
|  | 	      <property name="focus_on_click">True</property> | ||||||
|  | 	      <property name="active">False</property> | ||||||
|  | 	      <property name="inconsistent">False</property> | ||||||
|  | 	      <property name="draw_indicator">True</property> | ||||||
|  | 	    </widget> | ||||||
|  | 	    <packing> | ||||||
|  | 	      <property name="padding">0</property> | ||||||
|  | 	      <property name="expand">False</property> | ||||||
|  | 	      <property name="fill">False</property> | ||||||
|  | 	    </packing> | ||||||
|  | 	  </child> | ||||||
| 	</widget> | 	</widget> | ||||||
| 	<packing> | 	<packing> | ||||||
| 	  <property name="padding">0</property> | 	  <property name="padding">0</property> | ||||||
|  |  | ||||||
|  | @ -1392,12 +1392,15 @@ class roster_Window: | ||||||
| 				w = passphrase_Window('Enter your password for your account %s' % account, autoconnect) | 				w = passphrase_Window('Enter your password for your account %s' % account, autoconnect) | ||||||
| 				if autoconnect: | 				if autoconnect: | ||||||
| 					gtk.main() | 					gtk.main() | ||||||
| 					passphrase = w.get_pass() | 					passphrase, save = w.get_pass() | ||||||
| 				else: | 				else: | ||||||
| 					passphrase = w.run() | 					passphrase, save = w.run() | ||||||
| 				if passphrase == -1: | 				if passphrase == -1: | ||||||
| 					return | 					return | ||||||
| 				self.plugin.send('PASSPHRASE', account, passphrase) | 				self.plugin.send('PASSPHRASE', account, passphrase) | ||||||
|  | 				if save: | ||||||
|  | 					self.plugin.accounts[account]['savepass'] = 1 | ||||||
|  | 					self.plugin.accounts[account]['password'] = passphrase | ||||||
| 
 | 
 | ||||||
| 			keyid = None | 			keyid = None | ||||||
| 			save_gpg_pass = 0 | 			save_gpg_pass = 0 | ||||||
|  | @ -1414,11 +1417,14 @@ class roster_Window: | ||||||
| 					w = passphrase_Window('Enter your passphrase for your the GPG key of your account %s' % account, autoconnect) | 					w = passphrase_Window('Enter your passphrase for your the GPG key of your account %s' % account, autoconnect) | ||||||
| 					if autoconnect: | 					if autoconnect: | ||||||
| 						gtk.main() | 						gtk.main() | ||||||
| 						passphrase = w.get_pass() | 						passphrase, save = w.get_pass() | ||||||
| 					else: | 					else: | ||||||
| 						passphrase = w.run() | 						passphrase, save = w.run() | ||||||
| 					if passphrase == -1: | 					if passphrase == -1: | ||||||
| 						passphrase = '' | 						passphrase = '' | ||||||
|  | 					if save: | ||||||
|  | 						self.plugin.accounts[account]['savegpgpass'] = 1 | ||||||
|  | 						self.plugin.accounts[account]['gpgpassword'] = passphrase | ||||||
| 				self.plugin.send('GPGPASSPHRASE', account, passphrase) | 				self.plugin.send('GPGPASSPHRASE', account, passphrase) | ||||||
| 		self.plugin.send('STATUS', account, (status, txt)) | 		self.plugin.send('STATUS', account, (status, txt)) | ||||||
| 		if status == 'online' and self.plugin.sleeper.getState() != \ | 		if status == 'online' and self.plugin.sleeper.getState() != \ | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue