[FishFace] Now Gajim has comments support for advanced settings

This commit is contained in:
Nikos Kouremenos 2005-09-03 12:28:30 +00:00
parent 3d5901dd63
commit 0a482f179a
3 changed files with 1109 additions and 1 deletions

View File

@ -41,6 +41,7 @@ class AdvancedConfigurationWindow:
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'advanced_configuration_window', None) self.xml = gtk.glade.XML(GTKGUI_GLADE, 'advanced_configuration_window', None)
self.window = self.xml.get_widget('advanced_configuration_window') self.window = self.xml.get_widget('advanced_configuration_window')
self.entry = self.xml.get_widget('advanced_entry') self.entry = self.xml.get_widget('advanced_entry')
self.desc_label = self.xml.get_widget('advanced_desc_label')
treeview = self.xml.get_widget('advanced_treeview') treeview = self.xml.get_widget('advanced_treeview')
self.model = gtk.TreeStore(str, str, str) self.model = gtk.TreeStore(str, str, str)
@ -73,6 +74,9 @@ class AdvancedConfigurationWindow:
treeview.set_model(self.modelfilter) treeview.set_model(self.modelfilter)
# connect signal for selection change
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
@ -84,6 +88,16 @@ class AdvancedConfigurationWindow:
else: else:
cell.set_property('editable', 1) cell.set_property('editable', 1)
def on_advanced_treeview_selection_changed(self, treeselection):
iter = treeselection.get_selected()
# Get text from first column in this row
opt = iter[0][iter[1]][0]
desc = gajim.config.get_desc(opt)
if desc:
self.desc_label.set_text(_(desc))
else:
self.desc_label.set_text(_('(None)'))
def on_advanced_treeview_row_activated(self, treeview, path, column): def on_advanced_treeview_row_activated(self, treeview, path, column):
modelpath = self.modelfilter.convert_path_to_child_path(path) modelpath = self.modelfilter.convert_path_to_child_path(path)
modelrow = self.model[modelpath] modelrow = self.model[modelpath]

View File

@ -25,6 +25,7 @@ _ = i18n._
OPT_TYPE = 0 OPT_TYPE = 0
OPT_VAL = 1 OPT_VAL = 1
OPT_DESC = 2
opt_int = [ 'integer', 0 ] opt_int = [ 'integer', 0 ]
opt_str = [ 'string', 0 ] opt_str = [ 'string', 0 ]
@ -47,7 +48,7 @@ class Config:
'ignore_unknown_contacts': [ opt_bool, False ], 'ignore_unknown_contacts': [ opt_bool, False ],
'showoffline': [ opt_bool, False ], 'showoffline': [ opt_bool, False ],
'autoaway': [ opt_bool, True ], 'autoaway': [ opt_bool, True ],
'autoawaytime': [ opt_int, 5 ], 'autoawaytime': [ opt_int, 5, 'Time after which you are displayed as being away.' ],
'autoaway_message': [ opt_str, _('Away as a result of being idle') ], 'autoaway_message': [ opt_str, _('Away as a result of being idle') ],
'autoxa': [ opt_bool, True ], 'autoxa': [ opt_bool, True ],
'autoxatime': [ opt_int, 15 ], 'autoxatime': [ opt_int, 15 ],
@ -389,6 +390,12 @@ class Config:
return None return None
return self.__options[optname][OPT_VAL] return self.__options[optname][OPT_VAL]
def get_desc(self, optname):
if not self.__options.has_key(optname):
return None
if len(self.__options[optname]) > OPT_DESC:
return self.__options[optname][OPT_DESC]
def add_per(self, typename, name): # per_group_of_option def add_per(self, typename, name): # per_group_of_option
if not self.__options_per_key.has_key(typename): if not self.__options_per_key.has_key(typename):
# raise RuntimeError, 'option %s does not exist' % typename # raise RuntimeError, 'option %s does not exist' % typename

File diff suppressed because it is too large Load Diff