if we were to edit password/passphrase then Hidden string was saved as our password. now make it not editable
This commit is contained in:
parent
50ac7f932b
commit
e969ff6558
2 changed files with 10 additions and 8 deletions
|
@ -75,15 +75,18 @@ class AdvancedConfigurationWindow:
|
||||||
treeview.set_model(self.modelfilter)
|
treeview.set_model(self.modelfilter)
|
||||||
|
|
||||||
# connect signal for selection change
|
# connect signal for selection change
|
||||||
treeview.get_selection().connect('changed', self.on_advanced_treeview_selection_changed)
|
treeview.get_selection().connect('changed',
|
||||||
|
self.on_advanced_treeview_selection_changed)
|
||||||
|
|
||||||
self.xml.signal_autoconnect(self)
|
self.xml.signal_autoconnect(self)
|
||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
self.plugin.windows['advanced_config'] = self
|
self.plugin.windows['advanced_config'] = self
|
||||||
|
|
||||||
def cb_value_column_data(self, col, cell, model, iter):
|
def cb_value_column_data(self, col, cell, model, iter):
|
||||||
opttype = model[iter][2].decode('utf-8')
|
optname = model[iter][0]
|
||||||
if opttype == 'boolean':
|
opttype = model[iter][2]
|
||||||
|
if opttype == 'boolean' or optname.find('password') != -1 or\
|
||||||
|
optname.find('passphrase') != -1:
|
||||||
cell.set_property('editable', 0)
|
cell.set_property('editable', 0)
|
||||||
else:
|
else:
|
||||||
cell.set_property('editable', 1)
|
cell.set_property('editable', 1)
|
||||||
|
@ -166,8 +169,7 @@ class AdvancedConfigurationWindow:
|
||||||
if val[OPT_TYPE]:
|
if val[OPT_TYPE]:
|
||||||
type = val[OPT_TYPE][0]
|
type = val[OPT_TYPE][0]
|
||||||
if name.find('password') != -1 or name.find('passphrase') != -1:
|
if name.find('password') != -1 or name.find('passphrase') != -1:
|
||||||
print name
|
val[OPT_VAL] = _('Hidden') # override passwords with this string
|
||||||
val[OPT_VAL] = _('Hidden')
|
|
||||||
model.append(iter, [name, val[OPT_VAL], type])
|
model.append(iter, [name, val[OPT_VAL], type])
|
||||||
|
|
||||||
def visible_func(self, model, iter):
|
def visible_func(self, model, iter):
|
||||||
|
|
|
@ -1674,12 +1674,12 @@ _('If "%s" accepts this request you will know his status.') %jid)
|
||||||
if not account in self.collapsed_rows:
|
if not account in self.collapsed_rows:
|
||||||
self.collapsed_rows.append(account)
|
self.collapsed_rows.append(account)
|
||||||
|
|
||||||
def on_editing_started (self, cell, event, row):
|
def on_editing_started(self, cell, event, row):
|
||||||
''' start editing a cell in the tree '''
|
''' start editing a cell in the tree '''
|
||||||
path = self.tree.get_cursor()[0]
|
path = self.tree.get_cursor()[0]
|
||||||
self.editing_path = path
|
self.editing_path = path
|
||||||
|
|
||||||
def on_editing_canceled (self, cell):
|
def on_editing_canceled(self, cell):
|
||||||
'''editing has been canceled'''
|
'''editing has been canceled'''
|
||||||
path = self.tree.get_cursor()[0]
|
path = self.tree.get_cursor()[0]
|
||||||
# do not set new name if row order has changed
|
# do not set new name if row order has changed
|
||||||
|
@ -1695,7 +1695,7 @@ _('If "%s" accepts this request you will know his status.') %jid)
|
||||||
# restore the number of resources string at the end of contact name
|
# restore the number of resources string at the end of contact name
|
||||||
if type == 'contact' and len(gajim.contacts[account][jid]) > 1:
|
if type == 'contact' and len(gajim.contacts[account][jid]) > 1:
|
||||||
self.draw_contact(jid, account)
|
self.draw_contact(jid, account)
|
||||||
# reset editing to False
|
# reset editable to False
|
||||||
model[iter][5] = False
|
model[iter][5] = False
|
||||||
|
|
||||||
def on_cell_edited(self, cell, row, new_text):
|
def on_cell_edited(self, cell, row, new_text):
|
||||||
|
|
Loading…
Add table
Reference in a new issue