[sol] save GPG status
This commit is contained in:
parent
faaf972261
commit
c4a3262488
4 changed files with 22 additions and 0 deletions
|
@ -890,11 +890,25 @@ class ChatControl(ChatControlBase):
|
||||||
# setup the label that holds name and jid
|
# setup the label that holds name and jid
|
||||||
banner_name_label.set_markup(label_text)
|
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):
|
def _update_gpg(self):
|
||||||
tb = self.xml.get_widget('gpg_togglebutton')
|
tb = self.xml.get_widget('gpg_togglebutton')
|
||||||
if self.contact.keyID: # we can do gpg
|
if self.contact.keyID: # we can do gpg
|
||||||
tb.set_sensitive(True)
|
tb.set_sensitive(True)
|
||||||
tt = _('OpenPGP Encryption')
|
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:
|
else:
|
||||||
tb.set_sensitive(False)
|
tb.set_sensitive(False)
|
||||||
#we talk about a contact here
|
#we talk about a contact here
|
||||||
|
|
|
@ -284,6 +284,9 @@ class Config:
|
||||||
'state_muc_msg_color': [ opt_color, 'mediumblue' ],
|
'state_muc_msg_color': [ opt_color, 'mediumblue' ],
|
||||||
'state_muc_directed_msg_color': [ opt_color, 'red2' ],
|
'state_muc_directed_msg_color': [ opt_color, 'red2' ],
|
||||||
}, {}),
|
}, {}),
|
||||||
|
'contacts': ({
|
||||||
|
'gpg_enabled': [ opt_bool, False ],
|
||||||
|
}, {}),
|
||||||
}
|
}
|
||||||
|
|
||||||
statusmsg_default = {
|
statusmsg_default = {
|
||||||
|
|
|
@ -727,6 +727,10 @@ class Connection(ConnectionHandlers):
|
||||||
return
|
return
|
||||||
if remove_auth:
|
if remove_auth:
|
||||||
self.connection.getRoster().delItem(jid)
|
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:
|
else:
|
||||||
self.connection.getRoster().Unsubscribe(jid)
|
self.connection.getRoster().Unsubscribe(jid)
|
||||||
self.update_contact(jid, '', [])
|
self.update_contact(jid, '', [])
|
||||||
|
|
|
@ -18268,6 +18268,7 @@ Status message</property>
|
||||||
<property name="focus_on_click">False</property>
|
<property name="focus_on_click">False</property>
|
||||||
<property name="active">False</property>
|
<property name="active">False</property>
|
||||||
<property name="inconsistent">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>
|
<child>
|
||||||
<widget class="GtkImage" id="image1333">
|
<widget class="GtkImage" id="image1333">
|
||||||
|
|
Loading…
Add table
Reference in a new issue