[zloygod] Show "need gajim restart" label in ACE only when needed. Fixes #1645
This commit is contained in:
parent
5e23ba3adb
commit
9a340cabaf
|
@ -54,6 +54,12 @@ class AdvancedConfigurationWindow:
|
||||||
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')
|
self.desc_label = self.xml.get_widget('advanced_desc_label')
|
||||||
|
self.restart_label = self.xml.get_widget('restart_label')
|
||||||
|
|
||||||
|
# Format:
|
||||||
|
# key = option name (root/subopt/opt separated by \n then)
|
||||||
|
# value = array(oldval, newval)
|
||||||
|
self.changed_opts = {}
|
||||||
|
|
||||||
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)
|
||||||
|
@ -91,6 +97,7 @@ class AdvancedConfigurationWindow:
|
||||||
|
|
||||||
self.xml.signal_autoconnect(self)
|
self.xml.signal_autoconnect(self)
|
||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
|
self.restart_label.hide()
|
||||||
gajim.interface.instances['advanced_config'] = self
|
gajim.interface.instances['advanced_config'] = self
|
||||||
|
|
||||||
def cb_value_column_data(self, col, cell, model, iter):
|
def cb_value_column_data(self, col, cell, model, iter):
|
||||||
|
@ -103,20 +110,43 @@ class AdvancedConfigurationWindow:
|
||||||
else:
|
else:
|
||||||
cell.set_property('editable', True)
|
cell.set_property('editable', True)
|
||||||
|
|
||||||
|
def get_option_path(self, model, iter):
|
||||||
|
# It looks like path made from reversed array
|
||||||
|
# path[0] is the true one optname
|
||||||
|
# path[1] is the key name
|
||||||
|
# path[2] is the root of tree
|
||||||
|
# last two is optional
|
||||||
|
path = [model[iter][0].decode('utf-8')]
|
||||||
|
parent = model.iter_parent(iter)
|
||||||
|
while parent:
|
||||||
|
path.append(model[parent][0].decode('utf-8'))
|
||||||
|
parent = model.iter_parent(parent)
|
||||||
|
return path
|
||||||
|
|
||||||
def on_advanced_treeview_selection_changed(self, treeselection):
|
def on_advanced_treeview_selection_changed(self, treeselection):
|
||||||
iter = treeselection.get_selected()
|
model, iter = treeselection.get_selected()
|
||||||
# Check for GtkTreeIter
|
# Check for GtkTreeIter
|
||||||
if iter[1]:
|
if iter:
|
||||||
|
opt_path = self.get_option_path(model, iter)
|
||||||
# Get text from first column in this row
|
# Get text from first column in this row
|
||||||
opt = iter[0][iter[1]][0]
|
desc = None
|
||||||
desc = gajim.config.get_desc(opt)
|
if len(opt_path) == 3:
|
||||||
|
desc = gajim.config.get_desc_per(opt_path[2], opt_path[1],
|
||||||
|
opt_path[0])
|
||||||
|
elif len(opt_path) == 1:
|
||||||
|
desc = gajim.config.get_desc(opt_path[0])
|
||||||
if desc:
|
if desc:
|
||||||
# FIXME: DESC IS ALREADY _() why again _()?
|
self.desc_label.set_text(desc)
|
||||||
self.desc_label.set_text(_(desc))
|
|
||||||
else:
|
else:
|
||||||
#we talk about option description in advanced configuration editor
|
#we talk about option description in advanced configuration editor
|
||||||
self.desc_label.set_text(_('(None)'))
|
self.desc_label.set_text(_('(None)'))
|
||||||
|
|
||||||
|
def remember_option(self, option, oldval, newval):
|
||||||
|
if self.changed_opts.has_key(option):
|
||||||
|
self.changed_opts[option] = (self.changed_opts[option][0], newval)
|
||||||
|
else:
|
||||||
|
self.changed_opts[option] = (oldval, newval)
|
||||||
|
|
||||||
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]
|
||||||
|
@ -128,11 +158,30 @@ class AdvancedConfigurationWindow:
|
||||||
optname = optnamerow[0].decode('utf-8')
|
optname = optnamerow[0].decode('utf-8')
|
||||||
keyrow = self.model[modelpath[:2]]
|
keyrow = self.model[modelpath[:2]]
|
||||||
key = keyrow[0].decode('utf-8')
|
key = keyrow[0].decode('utf-8')
|
||||||
|
gajim.config.get_desc_per(optname, key, option)
|
||||||
|
self.remember_option(option + '\n' + key + '\n' + optname,
|
||||||
|
modelrow[1], newval)
|
||||||
gajim.config.set_per(optname, key, option, newval)
|
gajim.config.set_per(optname, key, option, newval)
|
||||||
else:
|
else:
|
||||||
|
self.remember_option(option, modelrow[1], newval)
|
||||||
gajim.config.set(option, newval)
|
gajim.config.set(option, newval)
|
||||||
gajim.interface.save_config()
|
gajim.interface.save_config()
|
||||||
modelrow[1] = newval
|
modelrow[1] = newval
|
||||||
|
self.check_for_restart()
|
||||||
|
|
||||||
|
def check_for_restart(self):
|
||||||
|
self.restart_label.hide()
|
||||||
|
for opt in self.changed_opts:
|
||||||
|
opt_path = opt.split('\n')
|
||||||
|
if len(opt_path)==3:
|
||||||
|
restart = gajim.config.get_restart_per(opt_path[2], opt_path[1],
|
||||||
|
opt_path[0])
|
||||||
|
else:
|
||||||
|
restart = gajim.config.get_restart(opt_path[0])
|
||||||
|
if restart:
|
||||||
|
if self.changed_opts[opt][0] != self.changed_opts[opt][1]:
|
||||||
|
self.restart_label.show()
|
||||||
|
break
|
||||||
|
|
||||||
def on_config_edited(self, cell, path, text):
|
def on_config_edited(self, cell, path, text):
|
||||||
# convert modelfilter path to model path
|
# convert modelfilter path to model path
|
||||||
|
@ -145,11 +194,15 @@ class AdvancedConfigurationWindow:
|
||||||
optname = optnamerow[0].decode('utf-8')
|
optname = optnamerow[0].decode('utf-8')
|
||||||
keyrow = self.model[modelpath[:2]]
|
keyrow = self.model[modelpath[:2]]
|
||||||
key = keyrow[0].decode('utf-8')
|
key = keyrow[0].decode('utf-8')
|
||||||
|
self.remember_option(option + '\n' + key + '\n' + optname, modelrow[1],
|
||||||
|
text)
|
||||||
gajim.config.set_per(optname, key, option, text)
|
gajim.config.set_per(optname, key, option, text)
|
||||||
else:
|
else:
|
||||||
|
self.remember_option(option, modelrow[1], text)
|
||||||
gajim.config.set(option, text)
|
gajim.config.set(option, text)
|
||||||
gajim.interface.save_config()
|
gajim.interface.save_config()
|
||||||
modelrow[1] = text
|
modelrow[1] = text
|
||||||
|
self.check_for_restart()
|
||||||
|
|
||||||
def on_advanced_configuration_window_destroy(self, widget):
|
def on_advanced_configuration_window_destroy(self, widget):
|
||||||
# update ui of preferences window to get possible changes we did
|
# update ui of preferences window to get possible changes we did
|
||||||
|
|
|
@ -26,6 +26,9 @@ _ = i18n._
|
||||||
OPT_TYPE = 0
|
OPT_TYPE = 0
|
||||||
OPT_VAL = 1
|
OPT_VAL = 1
|
||||||
OPT_DESC = 2
|
OPT_DESC = 2
|
||||||
|
# If OPT_RESTART is True - we need restart to use our changed option
|
||||||
|
# OPT_DESC also should be there
|
||||||
|
OPT_RESTART = 3
|
||||||
|
|
||||||
opt_int = [ 'integer', 0 ]
|
opt_int = [ 'integer', 0 ]
|
||||||
opt_str = [ 'string', 0 ]
|
opt_str = [ 'string', 0 ]
|
||||||
|
@ -37,7 +40,7 @@ class Config:
|
||||||
|
|
||||||
__options = {
|
__options = {
|
||||||
# name: [ type, default_value, help_string ]
|
# name: [ type, default_value, help_string ]
|
||||||
'verbose': [ opt_bool, False ],
|
'verbose': [ opt_bool, False, '', True ],
|
||||||
'alwaysauth': [ opt_bool, False ],
|
'alwaysauth': [ opt_bool, False ],
|
||||||
'autopopup': [ opt_bool, False ],
|
'autopopup': [ opt_bool, False ],
|
||||||
'notify_on_signin': [ opt_bool, True ],
|
'notify_on_signin': [ opt_bool, True ],
|
||||||
|
@ -46,7 +49,7 @@ class Config:
|
||||||
'autopopupaway': [ opt_bool, False ],
|
'autopopupaway': [ opt_bool, False ],
|
||||||
'use_notif_daemon': [ opt_bool, True , _('Use DBus and Notification-Daemon to show notifications') ],
|
'use_notif_daemon': [ opt_bool, True , _('Use DBus and Notification-Daemon to show notifications') ],
|
||||||
'ignore_unknown_contacts': [ opt_bool, False ],
|
'ignore_unknown_contacts': [ opt_bool, False ],
|
||||||
'showoffline': [ opt_bool, False ],
|
'showoffline': [ opt_bool, False, '', True ],
|
||||||
'autoaway': [ opt_bool, True ],
|
'autoaway': [ opt_bool, True ],
|
||||||
'autoawaytime': [ opt_int, 5, _('Time in minutes, after which your status changes to away.') ],
|
'autoawaytime': [ opt_int, 5, _('Time in minutes, after which your status changes to away.') ],
|
||||||
'autoaway_message': [ opt_str, _('Away as a result of being idle') ],
|
'autoaway_message': [ opt_str, _('Away as a result of being idle') ],
|
||||||
|
@ -62,24 +65,24 @@ class Config:
|
||||||
'last_status_msg_dnd': [ opt_str, '' ],
|
'last_status_msg_dnd': [ opt_str, '' ],
|
||||||
'last_status_msg_invisible': [ opt_str, '' ],
|
'last_status_msg_invisible': [ opt_str, '' ],
|
||||||
'last_status_msg_offline': [ opt_str, '' ],
|
'last_status_msg_offline': [ opt_str, '' ],
|
||||||
'trayicon': [ opt_bool, True ],
|
'trayicon': [ opt_bool, True, '', True ],
|
||||||
'iconset': [ opt_str, 'dcraven' ],
|
'iconset': [ opt_str, 'dcraven', '', True ],
|
||||||
'use_transports_iconsets': [ opt_bool, True ],
|
'use_transports_iconsets': [ opt_bool, True, '', True ],
|
||||||
'inmsgcolor': [ opt_color, '#a34526' ],
|
'inmsgcolor': [ opt_color, '#a34526', '', True ],
|
||||||
'outmsgcolor': [ opt_color, '#164e6f' ],
|
'outmsgcolor': [ opt_color, '#164e6f', '', True ],
|
||||||
'statusmsgcolor': [ opt_color, '#1eaa1e' ],
|
'statusmsgcolor': [ opt_color, '#1eaa1e', '', True ],
|
||||||
'markedmsgcolor': [ opt_color, '#ff8080' ],
|
'markedmsgcolor': [ opt_color, '#ff8080', '', True ],
|
||||||
'urlmsgcolor': [ opt_color, '#0000ff' ],
|
'urlmsgcolor': [ opt_color, '#0000ff', '', True ],
|
||||||
'collapsed_rows': [ opt_str, '' ],
|
'collapsed_rows': [ opt_str, '', '', True ],
|
||||||
'roster_theme': [ opt_str, 'green' ],
|
'roster_theme': [ opt_str, 'green', '', True ],
|
||||||
'saveposition': [ opt_bool, True ],
|
'saveposition': [ opt_bool, True ],
|
||||||
'mergeaccounts': [ opt_bool, False ],
|
'mergeaccounts': [ opt_bool, False, '', True ],
|
||||||
'sort_by_show': [ opt_bool, True ],
|
'sort_by_show': [ opt_bool, True, '', True ],
|
||||||
'use_speller': [ opt_bool, False ],
|
'use_speller': [ opt_bool, False, ],
|
||||||
'print_time': [ opt_str, 'always' ],
|
'print_time': [ opt_str, 'always' ],
|
||||||
'useemoticons': [ opt_bool, True ],
|
'useemoticons': [ opt_bool, True ],
|
||||||
'ascii_formatting': [ opt_bool, True,
|
'ascii_formatting': [ opt_bool, True,
|
||||||
_('Treat * / _ pairs as possible formatting characters.')],
|
_('Treat * / _ pairs as possible formatting characters.'), True],
|
||||||
'show_ascii_formatting_chars': [ opt_bool, False , _('If True, do not '
|
'show_ascii_formatting_chars': [ opt_bool, False , _('If True, do not '
|
||||||
'remove */_ . So *abc* will be bold but with * * not removed.')],
|
'remove */_ . So *abc* will be bold but with * * not removed.')],
|
||||||
'sounds_on': [ opt_bool, True ],
|
'sounds_on': [ opt_bool, True ],
|
||||||
|
@ -120,7 +123,7 @@ class Config:
|
||||||
'after_nickname': [ opt_str, ':' ],
|
'after_nickname': [ opt_str, ':' ],
|
||||||
'send_os_info': [ opt_bool, True ],
|
'send_os_info': [ opt_bool, True ],
|
||||||
'notify_on_new_gmail_email': [ opt_bool, True ],
|
'notify_on_new_gmail_email': [ opt_bool, True ],
|
||||||
'usegpg': [ opt_bool, False ],
|
'usegpg': [ opt_bool, False, '', True ],
|
||||||
'use_gpg_agent': [ opt_bool, False ],
|
'use_gpg_agent': [ opt_bool, False ],
|
||||||
'change_roster_title': [ opt_bool, True, _('Add * and [n] in roster title?')],
|
'change_roster_title': [ opt_bool, True, _('Add * and [n] in roster title?')],
|
||||||
'restore_lines': [opt_int, 4, _('How many lines to remember from previous conversation when a chat tab/window is reopened.')],
|
'restore_lines': [opt_int, 4, _('How many lines to remember from previous conversation when a chat tab/window is reopened.')],
|
||||||
|
@ -135,13 +138,13 @@ class Config:
|
||||||
'dictionary_url': [opt_str, 'WIKTIONARY', _("Either custom url with %s in it where %s is the word/phrase or 'WIKTIONARY' which means use wiktionary.")],
|
'dictionary_url': [opt_str, 'WIKTIONARY', _("Either custom url with %s in it where %s is the word/phrase or 'WIKTIONARY' which means use wiktionary.")],
|
||||||
'always_english_wikipedia': [opt_bool, False],
|
'always_english_wikipedia': [opt_bool, False],
|
||||||
'always_english_wiktionary': [opt_bool, True],
|
'always_english_wiktionary': [opt_bool, True],
|
||||||
'remote_control': [opt_bool, True, _('If checked, Gajim can be controlled remotely using gajim-remote.')],
|
'remote_control': [opt_bool, True, _('If checked, Gajim can be controlled remotely using gajim-remote.'), True],
|
||||||
'chat_state_notifications': [opt_str, 'all'], # 'all', 'composing_only', 'disabled'
|
'chat_state_notifications': [opt_str, 'all'], # 'all', 'composing_only', 'disabled'
|
||||||
'autodetect_browser_mailer': [opt_bool, False],
|
'autodetect_browser_mailer': [opt_bool, False, '', True],
|
||||||
'print_ichat_every_foo_minutes': [opt_int, 5],
|
'print_ichat_every_foo_minutes': [opt_int, 5],
|
||||||
'confirm_close_muc': [opt_bool, True, _('Ask before closing a group chat tab/window.')],
|
'confirm_close_muc': [opt_bool, True, _('Ask before closing a group chat tab/window.')],
|
||||||
'notify_on_file_complete': [opt_bool, True], # notif. on file complete
|
'notify_on_file_complete': [opt_bool, True],
|
||||||
'file_transfers_port': [opt_int, 28011], # port, used for file transfers
|
'file_transfers_port': [opt_int, 28011],
|
||||||
'ft_override_host_to_send': [opt_str, '', _('Overrides the host we send for File Transfer in case of address translation/port forwarding.')],
|
'ft_override_host_to_send': [opt_str, '', _('Overrides the host we send for File Transfer in case of address translation/port forwarding.')],
|
||||||
'conversation_font': [opt_str, ''],
|
'conversation_font': [opt_str, ''],
|
||||||
'use_kib_mib': [opt_bool, False, _('IEC standard says KiB = 1024 bytes, KB = 1000 bytes.')],
|
'use_kib_mib': [opt_bool, False, _('IEC standard says KiB = 1024 bytes, KB = 1000 bytes.')],
|
||||||
|
@ -152,7 +155,7 @@ class Config:
|
||||||
'last_emoticons_dir': [opt_str, ''],
|
'last_emoticons_dir': [opt_str, ''],
|
||||||
'last_sounds_dir': [opt_str, ''],
|
'last_sounds_dir': [opt_str, ''],
|
||||||
'tabs_position': [opt_str, 'top'],
|
'tabs_position': [opt_str, 'top'],
|
||||||
'tabs_always_visible': [opt_bool, False, _('Show tab when only one conversation?')],
|
'tabs_always_visible': [opt_bool, False, _('Show tab when only one conversation?'), '', True],
|
||||||
'tabs_border': [opt_bool, False, _('Show tab border if one conversation?')],
|
'tabs_border': [opt_bool, False, _('Show tab border if one conversation?')],
|
||||||
'tabs_close_button': [opt_bool, True, _('Show close button in tab?')],
|
'tabs_close_button': [opt_bool, True, _('Show close button in tab?')],
|
||||||
'chat_avatar_width': [opt_int, 52],
|
'chat_avatar_width': [opt_int, 52],
|
||||||
|
@ -169,8 +172,8 @@ class Config:
|
||||||
'quit_on_roster_x_button': [opt_bool, False, _('If True, quits Gajim when X button of Window Manager is clicked. This setting is taken into account only if trayicon is used.')],
|
'quit_on_roster_x_button': [opt_bool, False, _('If True, quits Gajim when X button of Window Manager is clicked. This setting is taken into account only if trayicon is used.')],
|
||||||
'set_xmpp://_handler_everytime': [opt_bool, False, _('If True, Gajim registers for xmpp:// on each startup.')],
|
'set_xmpp://_handler_everytime': [opt_bool, False, _('If True, Gajim registers for xmpp:// on each startup.')],
|
||||||
'show_unread_tab_icon': [opt_bool, False, _('If True, Gajim will display an icon on each tab containing unread messages. Depending on the theme, this icon may be animated.')],
|
'show_unread_tab_icon': [opt_bool, False, _('If True, Gajim will display an icon on each tab containing unread messages. Depending on the theme, this icon may be animated.')],
|
||||||
'show_status_msgs_in_roster': [opt_bool, True, _('If True, Gajim will display the status message, if not empty, for every contact under the contact name in roster window')],
|
'show_status_msgs_in_roster': [opt_bool, True, _('If True, Gajim will display the status message, if not empty, for every contact under the contact name in roster window'), True],
|
||||||
'show_avatars_in_roster': [opt_bool, True],
|
'show_avatars_in_roster': [opt_bool, True, '', True],
|
||||||
'ask_avatars_on_startup': [opt_bool, True, _('If True, Gajim will ask for avatar each contact that did not have an avatar last time or has one cached that is too old.')],
|
'ask_avatars_on_startup': [opt_bool, True, _('If True, Gajim will ask for avatar each contact that did not have an avatar last time or has one cached that is too old.')],
|
||||||
#FIXME: remove you and make it Gajim will not; and/or his or *her* status messages
|
#FIXME: remove you and make it Gajim will not; and/or his or *her* status messages
|
||||||
'print_status_in_chats': [opt_bool, True, _('If False, you will no longer see status line in chats when a contact changes his or her status and/or his status message.')],
|
'print_status_in_chats': [opt_bool, True, _('If False, you will no longer see status line in chats when a contact changes his or her status and/or his status message.')],
|
||||||
|
@ -189,26 +192,26 @@ class Config:
|
||||||
|
|
||||||
__options_per_key = {
|
__options_per_key = {
|
||||||
'accounts': ({
|
'accounts': ({
|
||||||
'name': [ opt_str, '' ],
|
'name': [ opt_str, '', '', True ],
|
||||||
'hostname': [ opt_str, '' ],
|
'hostname': [ opt_str, '', '', True ],
|
||||||
'savepass': [ opt_bool, False ],
|
'savepass': [ opt_bool, False ],
|
||||||
'password': [ opt_str, '' ],
|
'password': [ opt_str, '' ],
|
||||||
'resource': [ opt_str, 'gajim' ],
|
'resource': [ opt_str, 'gajim', '', True ],
|
||||||
'priority': [ opt_int, 5 ],
|
'priority': [ opt_int, 5, '', True ],
|
||||||
'autoconnect': [ opt_bool, False ],
|
'autoconnect': [ opt_bool, False, '', True ],
|
||||||
'autoreconnect': [ opt_bool, True ],
|
'autoreconnect': [ opt_bool, True ],
|
||||||
'active': [ opt_bool, True],
|
'active': [ opt_bool, True],
|
||||||
'proxy': [ opt_str, '' ],
|
'proxy': [ opt_str, '', '', True ],
|
||||||
'keyid': [ opt_str, '' ],
|
'keyid': [ opt_str, '', '', True ],
|
||||||
'keyname': [ opt_str, '' ],
|
'keyname': [ opt_str, '', '', True ],
|
||||||
'usessl': [ opt_bool, False ],
|
'usessl': [ opt_bool, False, '', True ],
|
||||||
'use_srv': [ opt_bool, True ],
|
'use_srv': [ opt_bool, True, '', True ],
|
||||||
'use_custom_host': [ opt_bool, False ],
|
'use_custom_host': [ opt_bool, False, '', True ],
|
||||||
'custom_port': [ opt_int, 5222 ],
|
'custom_port': [ opt_int, 5222, '', True ],
|
||||||
'custom_host': [ opt_str, '' ],
|
'custom_host': [ opt_str, '', '', True ],
|
||||||
'savegpgpass': [ opt_bool, False ],
|
'savegpgpass': [ opt_bool, False, '', True ],
|
||||||
'gpgpassword': [ opt_str, '' ],
|
'gpgpassword': [ opt_str, '' ],
|
||||||
'sync_with_global_status': [ opt_bool, False ],
|
'sync_with_global_status': [ opt_bool, False, ],
|
||||||
'no_log_for': [ opt_str, '' ],
|
'no_log_for': [ opt_str, '' ],
|
||||||
'attached_gpg_keys': [ opt_str, '' ],
|
'attached_gpg_keys': [ opt_str, '' ],
|
||||||
'keep_alives_enabled': [ opt_bool, True],
|
'keep_alives_enabled': [ opt_bool, True],
|
||||||
|
@ -216,7 +219,6 @@ class Config:
|
||||||
'keep_alive_every_foo_secs': [ opt_int, 55 ],
|
'keep_alive_every_foo_secs': [ opt_int, 55 ],
|
||||||
# try for 2 minutes before giving up (aka. timeout after those seconds)
|
# try for 2 minutes before giving up (aka. timeout after those seconds)
|
||||||
'try_connecting_for_foo_secs': [ opt_int, 60 ],
|
'try_connecting_for_foo_secs': [ opt_int, 60 ],
|
||||||
'max_stanza_per_sec': [ opt_int, 5],
|
|
||||||
'http_auth': [opt_str, 'ask'], # yes, no, ask
|
'http_auth': [opt_str, 'ask'], # yes, no, ask
|
||||||
# proxy65 for FT
|
# proxy65 for FT
|
||||||
'file_transfer_proxies': [opt_str,
|
'file_transfer_proxies': [opt_str,
|
||||||
|
@ -249,22 +251,22 @@ class Config:
|
||||||
'jid': [ opt_str, ''],
|
'jid': [ opt_str, ''],
|
||||||
}, {}),
|
}, {}),
|
||||||
'themes': ({
|
'themes': ({
|
||||||
'accounttextcolor': [ opt_color, 'black' ],
|
'accounttextcolor': [ opt_color, 'black', '', True ],
|
||||||
'accountbgcolor': [ opt_color, 'white' ],
|
'accountbgcolor': [ opt_color, 'white', '', True ],
|
||||||
'accountfont': [ opt_str, '' ],
|
'accountfont': [ opt_str, '', '', True ],
|
||||||
'accountfontattrs': [ opt_str, 'B' ],
|
'accountfontattrs': [ opt_str, 'B', '', True ],
|
||||||
'grouptextcolor': [ opt_color, 'black' ],
|
'grouptextcolor': [ opt_color, 'black', '', True ],
|
||||||
'groupbgcolor': [ opt_color, 'white' ],
|
'groupbgcolor': [ opt_color, 'white', '', True ],
|
||||||
'groupfont': [ opt_str, '' ],
|
'groupfont': [ opt_str, '', '', True ],
|
||||||
'groupfontattrs': [ opt_str, 'I' ],
|
'groupfontattrs': [ opt_str, 'I', '', True ],
|
||||||
'contacttextcolor': [ opt_color, 'black' ],
|
'contacttextcolor': [ opt_color, 'black', '', True ],
|
||||||
'contactbgcolor': [ opt_color, 'white' ],
|
'contactbgcolor': [ opt_color, 'white', '', True ],
|
||||||
'contactfont': [ opt_str, '' ],
|
'contactfont': [ opt_str, '', '', True ],
|
||||||
'contactfontattrs': [ opt_str, '' ],
|
'contactfontattrs': [ opt_str, '', '', True ],
|
||||||
'bannertextcolor': [ opt_color, 'black' ],
|
'bannertextcolor': [ opt_color, 'black', '', True ],
|
||||||
'bannerbgcolor': [ opt_color, '' ],
|
'bannerbgcolor': [ opt_color, '', '', True ],
|
||||||
'bannerfont': [ opt_str, '' ],
|
'bannerfont': [ opt_str, '', '', True ],
|
||||||
'bannerfontattrs': [ opt_str, 'B' ],
|
'bannerfontattrs': [ opt_str, 'B', '', True ],
|
||||||
|
|
||||||
# http://www.pitt.edu/~nisg/cis/web/cgi/rgb.html
|
# http://www.pitt.edu/~nisg/cis/web/cgi/rgb.html
|
||||||
# FIXME: not black but the default color from gtk+ theme
|
# FIXME: not black but the default color from gtk+ theme
|
||||||
|
@ -471,6 +473,12 @@ class Config:
|
||||||
if len(self.__options[optname]) > OPT_DESC:
|
if len(self.__options[optname]) > OPT_DESC:
|
||||||
return self.__options[optname][OPT_DESC]
|
return self.__options[optname][OPT_DESC]
|
||||||
|
|
||||||
|
def get_restart(self, optname):
|
||||||
|
if not self.__options.has_key(optname):
|
||||||
|
return None
|
||||||
|
if len(self.__options[optname]) > OPT_RESTART:
|
||||||
|
return self.__options[optname][OPT_RESTART]
|
||||||
|
|
||||||
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
|
||||||
|
@ -528,6 +536,40 @@ class Config:
|
||||||
return None
|
return None
|
||||||
return obj[subname][OPT_VAL]
|
return obj[subname][OPT_VAL]
|
||||||
|
|
||||||
|
def get_desc_per(self, optname, key = None, subname = None):
|
||||||
|
if not self.__options_per_key.has_key(optname):
|
||||||
|
return None
|
||||||
|
dict = self.__options_per_key[optname][1]
|
||||||
|
if not key:
|
||||||
|
return None
|
||||||
|
if not dict.has_key(key):
|
||||||
|
return None
|
||||||
|
obj = dict[key]
|
||||||
|
if not subname:
|
||||||
|
return None
|
||||||
|
if not obj.has_key(subname):
|
||||||
|
return None
|
||||||
|
if len(obj[subname]) > OPT_DESC:
|
||||||
|
return obj[subname][OPT_DESC]
|
||||||
|
return None
|
||||||
|
|
||||||
|
def get_restart_per(self, optname, key = None, subname = None):
|
||||||
|
if not self.__options_per_key.has_key(optname):
|
||||||
|
return False
|
||||||
|
dict = self.__options_per_key[optname][1]
|
||||||
|
if not key:
|
||||||
|
return False
|
||||||
|
if not dict.has_key(key):
|
||||||
|
return False
|
||||||
|
obj = dict[key]
|
||||||
|
if not subname:
|
||||||
|
return False
|
||||||
|
if not obj.has_key(subname):
|
||||||
|
return False
|
||||||
|
if len(obj[subname]) > OPT_RESTART:
|
||||||
|
return obj[subname][OPT_RESTART]
|
||||||
|
return False
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
#init default values
|
#init default values
|
||||||
for event in self.soundevents_default:
|
for event in self.soundevents_default:
|
||||||
|
|
|
@ -11920,10 +11920,10 @@ Static</property>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label384">
|
<widget class="GtkLabel" id="restart_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">False</property>
|
||||||
<property name="label" translatable="yes"><b>NOTE:</b> You may have to restart Gajim for some settings to apply.</property>
|
<property name="label" translatable="yes"><b>NOTE:</b> You should restart gajim for some setting to take effect</property>
|
||||||
<property name="use_underline">False</property>
|
<property name="use_underline">True</property>
|
||||||
<property name="use_markup">True</property>
|
<property name="use_markup">True</property>
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||||
<property name="wrap">False</property>
|
<property name="wrap">False</property>
|
||||||
|
|
Loading…
Reference in New Issue