[sol] save GPG status

This commit is contained in:
Yann Leboulanger 2006-04-15 08:10:24 +00:00
parent faaf972261
commit c4a3262488
4 changed files with 22 additions and 0 deletions

View File

@ -889,12 +889,26 @@ class ChatControl(ChatControlBase):
self.status_tooltip.disable()
# setup the label that holds name and jid
banner_name_label.set_markup(label_text)
def on_toggle_gpg_togglebutton(self, widget):
gajim.config.set_per('contacts', self.contact.get_full_jid(),
'gpg_enabled', widget.get_active())
def _update_gpg(self):
tb = self.xml.get_widget('gpg_togglebutton')
if self.contact.keyID: # we can do gpg
tb.set_sensitive(True)
tt = _('OpenPGP Encryption')
# restore gpg pref
gpg_pref = gajim.config.get_per('contacts',
self.contact.get_full_jid(), 'gpg_enabled')
if gpg_pref == None:
gajim.config.add_per('contacts', self.contact.get_full_jid())
gpg_pref = gajim.config.get_per('contacts',
self.contact.get_full_jid(), 'gpg_enabled')
tb.set_active(gpg_pref)
else:
tb.set_sensitive(False)
#we talk about a contact here

View File

@ -284,6 +284,9 @@ class Config:
'state_muc_msg_color': [ opt_color, 'mediumblue' ],
'state_muc_directed_msg_color': [ opt_color, 'red2' ],
}, {}),
'contacts': ({
'gpg_enabled': [ opt_bool, False ],
}, {}),
}
statusmsg_default = {

View File

@ -727,6 +727,10 @@ class Connection(ConnectionHandlers):
return
if remove_auth:
self.connection.getRoster().delItem(jid)
jid_list = gajim.config.del_per('contacts')
for j in jid_list:
if j.startswith(jid):
gajim.config.del_per('contacts', j)
else:
self.connection.getRoster().Unsubscribe(jid)
self.update_contact(jid, '', [])

View File

@ -18268,6 +18268,7 @@ Status message</property>
<property name="focus_on_click">False</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<signal name="clicked" handler="on_toggle_gpg_togglebutton" last_modification_time="Fri, 14 Apr 2006 22:50:46 GMT"/>
<child>
<widget class="GtkImage" id="image1333">