Merge branch 'master' into 'master'
fixed lookup of description for keyed options See merge request !105
This commit is contained in:
commit
84f48a400c
2 changed files with 7 additions and 15 deletions
|
@ -166,8 +166,7 @@ class AdvancedConfigurationWindow(object):
|
||||||
# Get text from first column in this row
|
# Get text from first column in this row
|
||||||
desc = None
|
desc = None
|
||||||
if len(opt_path) == 3:
|
if len(opt_path) == 3:
|
||||||
desc = gajim.config.get_desc_per(opt_path[2], opt_path[1],
|
desc = gajim.config.get_desc_per(opt_path[2], opt_path[0])
|
||||||
opt_path[0])
|
|
||||||
elif len(opt_path) == 1:
|
elif len(opt_path) == 1:
|
||||||
desc = gajim.config.get_desc(opt_path[0])
|
desc = gajim.config.get_desc(opt_path[0])
|
||||||
if desc:
|
if desc:
|
||||||
|
@ -322,8 +321,7 @@ class AdvancedConfigurationWindow(object):
|
||||||
if model[it][Column.TYPE] != '':
|
if model[it][Column.TYPE] != '':
|
||||||
opt_path = self.get_option_path(model, it)
|
opt_path = self.get_option_path(model, it)
|
||||||
if len(opt_path) == 3:
|
if len(opt_path) == 3:
|
||||||
desc = gajim.config.get_desc_per(opt_path[2], opt_path[1],
|
desc = gajim.config.get_desc_per(opt_path[2], opt_path[0])
|
||||||
opt_path[0])
|
|
||||||
elif len(opt_path) == 1:
|
elif len(opt_path) == 1:
|
||||||
desc = gajim.config.get_desc(opt_path[0])
|
desc = gajim.config.get_desc(opt_path[0])
|
||||||
if search_string in model[it][Column.PREFERENCE_NAME] or (desc and \
|
if search_string in model[it][Column.PREFERENCE_NAME] or (desc and \
|
||||||
|
|
|
@ -746,21 +746,15 @@ class Config:
|
||||||
return None
|
return None
|
||||||
return dict_[subname][Option.TYPE][0]
|
return dict_[subname][Option.TYPE][0]
|
||||||
|
|
||||||
def get_desc_per(self, optname, key=None, subname=None):
|
def get_desc_per(self, optname, subname=None):
|
||||||
if optname not in self.__options_per_key:
|
if optname not in self.__options_per_key:
|
||||||
return None
|
return None
|
||||||
dict_ = self.__options_per_key[optname][0]
|
dict_ = self.__options_per_key[optname][0]
|
||||||
if not key:
|
if subname not in dict_:
|
||||||
return None
|
return None
|
||||||
if key not in dict_:
|
obj = dict_[subname]
|
||||||
return None
|
if len(obj) > Option.DESC:
|
||||||
obj = dict_[key]
|
return obj[Option.DESC]
|
||||||
if not subname:
|
|
||||||
return None
|
|
||||||
if subname not in obj:
|
|
||||||
return None
|
|
||||||
if len(obj[subname]) > Option.DESC:
|
|
||||||
return obj[subname][Option.DESC]
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_restart_per(self, optname, key=None, subname=None):
|
def get_restart_per(self, optname, key=None, subname=None):
|
||||||
|
|
Loading…
Add table
Reference in a new issue