2008-08-15 19:31:51 +02:00
# -*- coding:utf-8 -*-
2008-08-15 05:20:23 +02:00
## src/common/config.py
##
2014-01-02 09:33:54 +01:00
## Copyright (C) 2003-2014 Yann Leboulanger <asterix AT lagaule.org>
2008-08-15 05:20:23 +02:00
## Copyright (C) 2004-2005 Vincent Hanquez <tab AT snarc.org>
2008-08-15 19:31:51 +02:00
## Copyright (C) 2005 Stéphan Kochen <stephan AT kochen.nl>
2008-08-15 05:20:23 +02:00
## Copyright (C) 2005-2006 Dimitur Kirov <dkirov AT gmail.com>
## Alex Mauer <hawke AT hawkesnest.net>
## Nikos Kouremenos <kourem AT gmail.com>
## Copyright (C) 2005-2007 Travis Shirk <travis AT pobox.com>
## Copyright (C) 2006 Stefan Bethge <stefan AT lanpartei.de>
## Copyright (C) 2006-2008 Jean-Marie Traissard <jim AT lapin.org>
## Copyright (C) 2007 James Newton <redshodan AT gmail.com>
## Julien Pivotto <roidelapluie AT gmail.com>
## Copyright (C) 2007-2008 Brendan Taylor <whateley AT gmail.com>
## Stephan Erb <steve-e AT h3c.de>
## Copyright (C) 2008 Jonathan Schleifer <js-gajim AT webkeks.org>
2005-04-14 09:28:59 +02:00
##
2007-12-12 09:44:46 +01:00
## This file is part of Gajim.
##
## Gajim is free software; you can redistribute it and/or modify
2005-04-14 09:28:59 +02:00
## it under the terms of the GNU General Public License as published
2007-12-12 09:44:46 +01:00
## by the Free Software Foundation; version 3 only.
2005-04-14 09:28:59 +02:00
##
2007-12-12 09:44:46 +01:00
## Gajim is distributed in the hope that it will be useful,
2005-04-14 09:28:59 +02:00
## but WITHOUT ANY WARRANTY; without even the implied warranty of
2008-08-15 05:20:23 +02:00
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2005-04-14 09:28:59 +02:00
## GNU General Public License for more details.
##
2007-12-12 09:44:46 +01:00
## You should have received a copy of the GNU General Public License
2008-08-15 05:20:23 +02:00
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
2007-12-12 09:44:46 +01:00
##
2005-04-14 09:28:59 +02:00
2006-11-19 00:21:59 +01:00
import re
2013-07-28 20:50:30 +02:00
from gi . repository import GLib
2017-03-04 21:22:46 +01:00
from enum import IntEnum , unique
2005-04-14 09:28:59 +02:00
2017-07-20 00:43:06 +02:00
import gajim
2017-03-04 21:22:46 +01:00
@unique
2017-02-07 21:18:41 +01:00
class Option ( IntEnum ) :
TYPE = 0
VAL = 1
DESC = 2
# If Option.RESTART is True - we need restart to use our changed option
# Option.DESC also should be there
RESTART = 3
2005-04-14 09:28:59 +02:00
opt_int = [ ' integer ' , 0 ]
opt_str = [ ' string ' , 0 ]
opt_bool = [ ' boolean ' , 0 ]
2017-10-07 17:03:31 +02:00
opt_color = [ ' color ' , ' ^(#[0-9a-fA-F] {6} )|()|rgb \ ( \ d+, \ d+, \ d+ \ )|rgba \ ( \ d+, \ d+, \ d+,[01] \ .? \ d* \ )$ ' ]
Merge one_window branch
Merged revisions 9143,9145-9155,9157-9162,9164-9169,9171-9177 via svnmerge from
svn://88.191.11.156/gajim/branches/one_window
........
r9145 | nicfit | 2007-12-13 21:49:09 -0700 (Thu, 13 Dec 2007) | 2 lines
Implemented the original Nikos patch with an HPaned instead of a HBox and only do this mode when one_message_window == 'always'
........
r9152 | nicfit | 2007-12-15 13:33:56 -0700 (Sat, 15 Dec 2007) | 2 lines
Added config and GUI for one_message_window_with_roster
........
r9153 | nicfit | 2007-12-15 13:41:46 -0700 (Sat, 15 Dec 2007) | 2 lines
Use one_message_window_with_roster and some whitespace cleanup
........
r9154 | nicfit | 2007-12-15 14:04:49 -0700 (Sat, 15 Dec 2007) | 2 lines
Scratch the chckbox for with roster mode, use one_message_window opt and combo
........
r9155 | nicfit | 2007-12-15 17:01:13 -0700 (Sat, 15 Dec 2007) | 2 lines
MessageWindowMgr knows about ONE_MESSAGE_WINDOW_ALWAYS_WITH_ROSTER and MessageWindow can reparent itself rather then the roster having to do so.
........
r9157 | nicfit | 2007-12-15 17:47:20 -0700 (Sat, 15 Dec 2007) | 2 lines
Resizing fixes and make the roster window shrink when last tab is removed
........
r9158 | nicfit | 2007-12-15 19:15:11 -0700 (Sat, 15 Dec 2007) | 2 lines
Added "Show roster" (CTRL+R) to view menu when using always_with_roster to quickly hide/show the roster.
........
r9159 | nicfit | 2007-12-15 19:49:30 -0700 (Sat, 15 Dec 2007) | 2 lines
Handle window title setting in always_with_roster mode.
........
r9160 | nicfit | 2007-12-15 20:13:57 -0700 (Sat, 15 Dec 2007) | 2 lines
Removed FIXME
........
r9167 | nicfit | 2007-12-17 18:40:59 -0700 (Mon, 17 Dec 2007) | 2 lines
When roster is hidden, show it when the number of MessageWindow controls == 0
........
r9168 | nicfit | 2007-12-17 19:07:49 -0700 (Mon, 17 Dec 2007) | 2 lines
Disable hiding roster when there are no message controls open
........
r9169 | nicfit | 2007-12-17 20:41:11 -0700 (Mon, 17 Dec 2007) | 2 lines
Bunch of saved size bugs fixed
........
2007-12-19 00:42:22 +01:00
opt_one_window_types = [ ' never ' , ' always ' , ' always_with_roster ' , ' peracct ' , ' pertype ' ]
2011-02-04 21:52:03 +01:00
opt_show_roster_on_startup = [ ' always ' , ' never ' , ' last_state ' ]
2007-01-05 21:38:36 +01:00
opt_treat_incoming_messages = [ ' ' , ' chat ' , ' normal ' ]
2005-04-14 09:28:59 +02:00
class Config :
2010-02-08 15:08:40 +01:00
DEFAULT_ICONSET = ' dcraven '
DEFAULT_MOOD_ICONSET = ' default '
DEFAULT_ACTIVITY_ICONSET = ' default '
2010-09-08 15:25:36 +02:00
DEFAULT_OPENWITH = ' xdg-open '
2010-02-08 15:08:40 +01:00
DEFAULT_BROWSER = ' firefox '
DEFAULT_MAILAPP = ' mozilla-thunderbird -compose '
DEFAULT_FILE_MANAGER = ' xffm '
2012-04-09 19:45:56 +02:00
__options = ( {
2010-02-08 15:08:40 +01:00
# name: [ type, default_value, help_string ]
' verbose ' : [ opt_bool , False , ' ' , True ] ,
' autopopup ' : [ opt_bool , False ] ,
' notify_on_signin ' : [ opt_bool , True ] ,
' notify_on_signout ' : [ opt_bool , False ] ,
' notify_on_new_message ' : [ opt_bool , True ] ,
' autopopupaway ' : [ opt_bool , False ] ,
2015-10-25 15:06:37 +01:00
' autopopup_chat_opened ' : [ opt_bool , False , _ ( ' Show desktop notification even when a chat window is opened for this contact and does not have focus ' ) ] ,
2010-02-08 15:08:40 +01:00
' sounddnd ' : [ opt_bool , False , _ ( ' Play sound when user is busy ' ) ] ,
' showoffline ' : [ opt_bool , False ] ,
' show_only_chat_and_online ' : [ opt_bool , False , _ ( ' Show only online and free for chat contacts in roster. ' ) ] ,
' show_transports_group ' : [ opt_bool , True ] ,
' autoaway ' : [ opt_bool , True ] ,
' autoawaytime ' : [ opt_int , 5 , _ ( ' Time in minutes, after which your status changes to away. ' ) ] ,
2013-08-15 10:33:27 +02:00
' autoaway_message ' : [ opt_str , _ ( ' $S (Away as a result of being idle more than $T min) ' ) , _ ( ' $S will be replaced by current status message, $T by autoawaytime. ' ) ] ,
2010-02-08 15:08:40 +01:00
' autoxa ' : [ opt_bool , True ] ,
' autoxatime ' : [ opt_int , 15 , _ ( ' Time in minutes, after which your status changes to not available. ' ) ] ,
2013-08-15 10:33:27 +02:00
' autoxa_message ' : [ opt_str , _ ( ' $S (Not available as a result of being idle more than $T min) ' ) , _ ( ' $S will be replaced by current status message, $T by autoxatime. ' ) ] ,
2010-02-08 15:08:40 +01:00
' ask_online_status ' : [ opt_bool , False ] ,
' ask_offline_status ' : [ opt_bool , False ] ,
2011-07-24 10:54:43 +02:00
' trayicon ' : [ opt_str , ' always ' , _ ( " When to show notification area icon. Can be ' never ' , ' on_event ' , ' always ' . " ) , False ] ,
' allow_hide_roster ' : [ opt_bool , False , _ ( " Allow to hide the roster window even if the tray icon is not shown. " ) , False ] ,
2010-02-08 15:08:40 +01:00
' iconset ' : [ opt_str , DEFAULT_ICONSET , ' ' , True ] ,
' mood_iconset ' : [ opt_str , DEFAULT_MOOD_ICONSET , ' ' , True ] ,
' activity_iconset ' : [ opt_str , DEFAULT_ACTIVITY_ICONSET , ' ' , True ] ,
' use_transports_iconsets ' : [ opt_bool , True , ' ' , True ] ,
' inmsgcolor ' : [ opt_color , ' #a40000 ' , _ ( ' Incoming nickname color. ' ) , True ] ,
' outmsgcolor ' : [ opt_color , ' #3465a4 ' , _ ( ' Outgoing nickname color. ' ) , True ] ,
' inmsgtxtcolor ' : [ opt_color , ' ' , _ ( ' Incoming text color. ' ) , True ] ,
' outmsgtxtcolor ' : [ opt_color , ' #555753 ' , _ ( ' Outgoing text color. ' ) , True ] ,
' statusmsgcolor ' : [ opt_color , ' #4e9a06 ' , _ ( ' Status message text color. ' ) , True ] ,
' markedmsgcolor ' : [ opt_color , ' #ff8080 ' , ' ' , True ] ,
' urlmsgcolor ' : [ opt_color , ' #204a87 ' , ' ' , True ] ,
2012-03-27 14:50:26 +02:00
' notif_signin_color ' : [ opt_color , ' #32CD32 ' , _ ( ' Contact signed in notification color. ' ) ] , # limegreen
' notif_signout_color ' : [ opt_color , ' #FF0000 ' , _ ( ' Contact signout notification color ' ) ] , # red
2017-10-03 12:36:31 +02:00
' notif_message_color ' : [ opt_color , ' #1E90FF ' , _ ( ' New message notification color. ' ) ] , # dodgerblue
2012-03-27 14:50:26 +02:00
' notif_ftrequest_color ' : [ opt_color , ' #F0E68C ' , _ ( ' File transfer request notification color. ' ) ] , # khaki
' notif_fterror_color ' : [ opt_color , ' #B22222 ' , _ ( ' File transfer error notification color. ' ) ] , # firebrick
' notif_ftcomplete_color ' : [ opt_color , ' #9ACD32 ' , _ ( ' File transfer complete or stopped notification color. ' ) ] , # yellowgreen
' notif_invite_color ' : [ opt_color , ' #D2B48C ' , _ ( ' Groupchat invitation notification color ' ) ] , # tan1
2016-01-16 16:05:43 +01:00
' notif_status_color ' : [ opt_color , ' #D8BFD8 ' , _ ( ' Background color of status changed notification ' ) ] , # thistle2
2012-03-27 14:50:26 +02:00
' notif_other_color ' : [ opt_color , ' #FFFFFF ' , _ ( ' Other dialogs color. ' ) ] , # white
2010-02-08 15:08:40 +01:00
' inmsgfont ' : [ opt_str , ' ' , _ ( ' Incoming nickname font. ' ) , True ] ,
' outmsgfont ' : [ opt_str , ' ' , _ ( ' Outgoing nickname font. ' ) , True ] ,
' inmsgtxtfont ' : [ opt_str , ' ' , _ ( ' Incoming text font. ' ) , True ] ,
' outmsgtxtfont ' : [ opt_str , ' ' , _ ( ' Outgoing text font. ' ) , True ] ,
' statusmsgfont ' : [ opt_str , ' ' , _ ( ' Status message text font. ' ) , True ] ,
' collapsed_rows ' : [ opt_str , ' ' , _ ( ' List (space separated) of rows (accounts and groups) that are collapsed. ' ) , True ] ,
' roster_theme ' : [ opt_str , _ ( ' default ' ) , ' ' , True ] ,
' mergeaccounts ' : [ opt_bool , False , ' ' , True ] ,
' sort_by_show_in_roster ' : [ opt_bool , True , ' ' , True ] ,
' sort_by_show_in_muc ' : [ opt_bool , False , ' ' , True ] ,
' use_speller ' : [ opt_bool , False , ] ,
' ignore_incoming_xhtml ' : [ opt_bool , False , ] ,
' speller_language ' : [ opt_str , ' ' , _ ( ' Language used by speller ' ) ] ,
' print_time ' : [ opt_str , ' always ' , _ ( ' \' always \' - print time for every message. \n \' sometimes \' - print time every print_ichat_every_foo_minutes minute. \n \' never \' - never print time. ' ) ] ,
' print_time_fuzzy ' : [ opt_int , 0 , _ ( ' Print time in chats using Fuzzy Clock. Value of fuzziness from 1 to 4, or 0 to disable fuzzyclock. 1 is the most precise clock, 4 the least precise one. This is used only if print_time is \' sometimes \' . ' ) ] ,
2017-07-02 19:42:42 +02:00
' emoticons_theme ' : [ opt_str , ' noto-emoticons ' , ' ' , True ] ,
2017-09-15 23:22:21 +02:00
' ascii_emoticons ' : [ opt_bool , True , _ ( ' Enable ASCII emoticons ' ) , True ] ,
2010-02-08 15:08:40 +01:00
' ascii_formatting ' : [ opt_bool , True ,
_ ( ' Treat * / _ pairs as possible formatting characters. ' ) , True ] ,
2010-02-10 19:24:11 +01:00
' show_ascii_formatting_chars ' : [ opt_bool , True , _ ( ' If True, do not '
2010-02-08 15:08:40 +01:00
' remove */_ . So *abc* will be bold but with * * not removed. ' ) ] ,
' rst_formatting_outgoing_messages ' : [ opt_bool , False ,
_ ( ' Uses ReStructured text markup to send HTML, plus ascii formatting if selected. For syntax, see http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html (If you want to use this, install docutils) ' ) ] ,
' sounds_on ' : [ opt_bool , True ] ,
# 'aplay', 'play', 'esdplay', 'artsplay' detected first time only
' soundplayer ' : [ opt_str , ' ' ] ,
' openwith ' : [ opt_str , DEFAULT_OPENWITH ] ,
' custombrowser ' : [ opt_str , DEFAULT_BROWSER ] ,
' custommailapp ' : [ opt_str , DEFAULT_MAILAPP ] ,
' custom_file_manager ' : [ opt_str , DEFAULT_FILE_MANAGER ] ,
' gc-hpaned-position ' : [ opt_int , 430 ] ,
' gc_refer_to_nick_char ' : [ opt_str , ' , ' , _ ( ' Character to add after nickname when using nick completion (tab) in group chat. ' ) ] ,
' gc_proposed_nick_char ' : [ opt_str , ' _ ' , _ ( ' Character to propose to add after desired nickname when desired nickname is used by someone else in group chat. ' ) ] ,
' msgwin-max-state ' : [ opt_bool , False ] ,
' msgwin-x-position ' : [ opt_int , - 1 ] , # Default is to let the window manager decide
' msgwin-y-position ' : [ opt_int , - 1 ] , # Default is to let the window manager decide
' msgwin-width ' : [ opt_int , 500 ] ,
' msgwin-height ' : [ opt_int , 440 ] ,
' chat-msgwin-x-position ' : [ opt_int , - 1 ] , # Default is to let the window manager decide
' chat-msgwin-y-position ' : [ opt_int , - 1 ] , # Default is to let the window manager decide
' chat-msgwin-width ' : [ opt_int , 480 ] ,
' chat-msgwin-height ' : [ opt_int , 440 ] ,
' gc-msgwin-x-position ' : [ opt_int , - 1 ] , # Default is to let the window manager decide
' gc-msgwin-y-position ' : [ opt_int , - 1 ] , # Default is to let the window manager decide
' gc-msgwin-width ' : [ opt_int , 600 ] ,
' gc-msgwin-height ' : [ opt_int , 440 ] ,
2017-08-17 15:03:40 +02:00
' pm-msgwin-x-position ' : [ opt_int , - 1 ] , # Default is to let the window manager decide
' pm-msgwin-y-position ' : [ opt_int , - 1 ] , # Default is to let the window manager decide
' pm-msgwin-width ' : [ opt_int , 480 ] ,
' pm-msgwin-height ' : [ opt_int , 440 ] ,
2010-02-08 15:08:40 +01:00
' single-msg-x-position ' : [ opt_int , 0 ] ,
' single-msg-y-position ' : [ opt_int , 0 ] ,
' single-msg-width ' : [ opt_int , 400 ] ,
' single-msg-height ' : [ opt_int , 280 ] ,
2013-08-15 10:33:27 +02:00
' save-roster-position ' : [ opt_bool , True , _ ( ' If True, Gajim will save roster position when hiding roster, and restore it when showing roster. ' ) ] ,
2010-02-08 15:08:40 +01:00
' roster_x-position ' : [ opt_int , 0 ] ,
' roster_y-position ' : [ opt_int , 0 ] ,
' roster_width ' : [ opt_int , 200 ] ,
' roster_height ' : [ opt_int , 400 ] ,
2013-03-10 19:18:53 +01:00
' roster_hpaned_position ' : [ opt_int , 200 ] ,
2016-02-21 11:07:04 +01:00
' roster_on_the_right ' : [ opt_bool , False , _ ( ' Place the roster on the right in single window mode ' ) , True ] ,
2010-02-08 15:08:40 +01:00
' history_window_width ' : [ opt_int , 650 ] ,
' history_window_height ' : [ opt_int , 450 ] ,
' history_window_x-position ' : [ opt_int , 0 ] ,
' history_window_y-position ' : [ opt_int , 0 ] ,
' latest_disco_addresses ' : [ opt_str , ' ' ] ,
' recently_groupchat ' : [ opt_str , ' ' ] ,
' time_stamp ' : [ opt_str , ' [ %X ] ' , _ ( ' This option let you customize timestamp that is printed in conversation. For exemple " [ % H: % M] " will show " [hour:minute] " . See python doc on strftime for full documentation: http://docs.python.org/lib/module-time.html ' ) ] ,
' before_nickname ' : [ opt_str , ' ' , _ ( ' Characters that are printed before the nickname in conversations ' ) ] ,
' after_nickname ' : [ opt_str , ' : ' , _ ( ' Characters that are printed after the nickname in conversations ' ) ] ,
' use_gpg_agent ' : [ opt_bool , False ] ,
' change_roster_title ' : [ opt_bool , True , _ ( ' Add * and [n] in roster title? ' ) ] ,
2017-07-10 20:47:49 +02:00
' restore_lines ' : [ opt_int , 10 , _ ( ' How many history messages should be restored when a chat tab/window is reopened? ' ) ] ,
' restore_timeout ' : [ opt_int , - 1 , _ ( ' How far back in time (minutes) history is restored. -1 means no limit. ' ) ] ,
' muc_restore_lines ' : [ opt_int , 100 , _ ( ' How many lines to request from server when entering a groupchat. -1 means no limit ' ) ] ,
' muc_restore_timeout ' : [ opt_int , - 1 , _ ( ' Minutes of backlog to request when entering a groupchat. -1 means no limit ' ) ] ,
2010-02-08 15:08:40 +01:00
' muc_autorejoin_timeout ' : [ opt_int , 1 , _ ( ' How many seconds to wait before trying to autorejoin to a conference you are being disconnected from. Set to 0 to disable autorejoining. ' ) ] ,
2010-12-13 06:38:27 +01:00
' muc_autorejoin_on_kick ' : [ opt_bool , False , _ ( ' Should autorejoin be activated when we are being kicked from a conference? ' ) ] ,
2010-02-08 15:08:40 +01:00
' send_on_ctrl_enter ' : [ opt_bool , False , _ ( ' Send message on Ctrl+Enter and with Enter make new line (Mirabilis ICQ Client default behaviour). ' ) ] ,
2011-02-04 21:52:03 +01:00
' last_roster_visible ' : [ opt_bool , True ] ,
2010-02-08 15:08:40 +01:00
' key_up_lines ' : [ opt_int , 25 , _ ( ' How many lines to store for Ctrl+KeyUP. ' ) ] ,
2017-07-20 00:43:06 +02:00
' version ' : [ opt_str , gajim . __version__ ] , # which version created the config
2013-01-14 20:13:45 +01:00
' search_engine ' : [ opt_str , ' https://www.google.com/search?&q= %s &sourceid=gajim ' ] ,
2017-09-19 12:45:02 +02:00
' dictionary_url ' : [ opt_str , ' WIKTIONARY ' , _ ( " Either custom url with %% s in it where %% s is the word/phrase or ' WIKTIONARY ' which means use wiktionary. " ) ] ,
2010-02-08 15:08:40 +01:00
' always_english_wikipedia ' : [ opt_bool , False ] ,
' always_english_wiktionary ' : [ opt_bool , True ] ,
2013-10-15 21:56:20 +02:00
' remote_control ' : [ opt_bool , False , _ ( ' If checked, Gajim can be controlled remotely using gajim-remote. ' ) , True ] ,
2010-02-08 15:08:40 +01:00
' outgoing_chat_state_notifications ' : [ opt_str , ' all ' , _ ( ' Sent chat state notifications. Can be one of all, composing_only, disabled. ' ) ] ,
' displayed_chat_state_notifications ' : [ opt_str , ' all ' , _ ( ' Displayed chat state notifications in chat windows. Can be one of all, composing_only, disabled. ' ) ] ,
2011-09-02 07:23:31 +02:00
' autodetect_browser_mailer ' : [ opt_bool , True , ' ' , True ] ,
2010-02-08 15:08:40 +01:00
' print_ichat_every_foo_minutes ' : [ opt_int , 5 , _ ( ' When not printing time for every message (print_time==sometimes), print it every x minutes. ' ) ] ,
' confirm_close_muc ' : [ opt_bool , True , _ ( ' Ask before closing a group chat tab/window. ' ) ] ,
2017-02-04 23:29:45 +01:00
' confirm_close_muc_rooms ' : [ opt_str , ' ' , _ ( ' Always ask for confirmation before closing groupchats with any of the JIDs on this space separated list. ' ) ] ,
' noconfirm_close_muc_rooms ' : [ opt_str , ' ' , _ ( ' Never ask for confirmation before closing groupchats with any of the JIDs on this space separated list. ' ) ] ,
2013-08-15 10:33:27 +02:00
' confirm_close_multiple_tabs ' : [ opt_bool , True , _ ( ' Ask before closing tabbed chat window if there are controls that can lose data (chat, private chat, groupchat that will not be minimized) ' ) ] ,
2010-02-08 15:08:40 +01:00
' notify_on_file_complete ' : [ opt_bool , True ] ,
' file_transfers_port ' : [ opt_int , 28011 ] ,
' ft_add_hosts_to_send ' : [ opt_str , ' ' , _ ( ' Comma separated list of hosts that we send, in addition of local interfaces, for File Transfer in case of address translation/port forwarding. ' ) ] ,
' conversation_font ' : [ opt_str , ' ' ] ,
' use_kib_mib ' : [ opt_bool , False , _ ( ' IEC standard says KiB = 1024 bytes, KB = 1000 bytes. ' ) ] ,
' notify_on_all_muc_messages ' : [ opt_bool , False ] ,
2010-08-23 10:40:04 +02:00
' trayicon_notification_on_events ' : [ opt_bool , True , _ ( ' Notify of events in the notification area. ' ) ] ,
2012-08-14 20:36:16 +02:00
' trayicon_blink ' : [ opt_bool , True , _ ( ' If False, Gajim will display a static event icon instead of the blinking status icon in the notification area when notifying on event. ' ) ] ,
2010-02-08 15:08:40 +01:00
' last_save_dir ' : [ opt_str , ' ' ] ,
' last_send_dir ' : [ opt_str , ' ' ] ,
' last_emoticons_dir ' : [ opt_str , ' ' ] ,
' last_sounds_dir ' : [ opt_str , ' ' ] ,
' tabs_position ' : [ opt_str , ' top ' ] ,
' tabs_always_visible ' : [ opt_bool , False , _ ( ' Show tab when only one conversation? ' ) ] ,
' tabs_border ' : [ opt_bool , False , _ ( ' Show tabbed notebook border in chat windows? ' ) ] ,
' tabs_close_button ' : [ opt_bool , True , _ ( ' Show close button in tab? ' ) ] ,
2013-12-29 16:00:01 +01:00
' esession_modp ' : [ opt_str , ' 15,16,14 ' , _ ( ' A list of modp groups to use in a Diffie-Hellman, highest preference first, separated by commas. Valid groups are 1, 2, 5, 14, 15, 16, 17 and 18. Higher numbers are more secure, but take longer to calculate when you start a session. ' ) ] ,
2012-06-16 22:58:46 +02:00
' tooltip_status_online_color ' : [ opt_color , ' #73D216 ' ] ,
' tooltip_status_free_for_chat_color ' : [ opt_color , ' #3465A4 ' ] ,
' tooltip_status_away_color ' : [ opt_color , ' #EDD400 ' ] ,
' tooltip_status_busy_color ' : [ opt_color , ' #F57900 ' ] ,
' tooltip_status_na_color ' : [ opt_color , ' #CC0000 ' ] ,
' tooltip_status_offline_color ' : [ opt_color , ' #555753 ' ] ,
' tooltip_affiliation_none_color ' : [ opt_color , ' #555753 ' ] ,
' tooltip_affiliation_member_color ' : [ opt_color , ' #73D216 ' ] ,
' tooltip_affiliation_administrator_color ' : [ opt_color , ' #F57900 ' ] ,
' tooltip_affiliation_owner_color ' : [ opt_color , ' #CC0000 ' ] ,
' tooltip_account_name_color ' : [ opt_color , ' #888A85 ' ] ,
' tooltip_idle_color ' : [ opt_color , ' #888A85 ' ] ,
2010-02-08 15:08:40 +01:00
' notification_preview_message ' : [ opt_bool , True , _ ( ' Preview new messages in notification popup? ' ) ] ,
' notification_position_x ' : [ opt_int , - 1 ] ,
' notification_position_y ' : [ opt_int , - 1 ] ,
' muc_highlight_words ' : [ opt_str , ' ' , _ ( ' A semicolon-separated list of words that will be highlighted in group chats. ' ) ] ,
2010-08-23 10:40:04 +02:00
' 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 notification icon is used. ' ) ] ,
2017-10-31 17:28:30 +01:00
' hide_on_roster_x_button ' : [ opt_bool , False , _ ( ' If True, Gajim hides the Roster window on pressing the X button instead of minimizing into the Dock. ' ) ] ,
2010-02-08 15:08:40 +01:00
' 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. ' ) , True ] ,
' show_avatars_in_roster ' : [ opt_bool , True , ' ' , True ] ,
' show_mood_in_roster ' : [ opt_bool , True , ' ' , True ] ,
' show_activity_in_roster ' : [ opt_bool , True , ' ' , True ] ,
' show_tunes_in_roster ' : [ opt_bool , True , ' ' , True ] ,
' show_location_in_roster ' : [ opt_bool , True , ' ' , True ] ,
' avatar_position_in_roster ' : [ opt_str , ' right ' , _ ( ' Define the position of the avatar in roster. Can be left or right ' ) , True ] ,
2016-08-08 15:12:28 +02:00
' print_status_in_chats ' : [ opt_bool , False , _ ( ' If False, Gajim will no longer print status line in chats when a contact changes his or her status and/or his or her status message. ' ) ] ,
' print_status_in_muc ' : [ opt_str , ' none ' , _ ( ' Can be " none " , " all " or " in_and_out " . If " none " , Gajim will no longer print status line in groupchats when a member changes his or her status and/or his or her status message. If " all " Gajim will print all status messages. If " in_and_out " , Gajim will only print FOO enters/leaves group chat. ' ) ] ,
2010-02-08 15:08:40 +01:00
' log_contact_status_changes ' : [ opt_bool , False ] ,
2011-05-30 19:47:05 +02:00
' log_xhtml_messages ' : [ opt_bool , False , _ ( ' Log XHTML messages instead of plain text messages. ' ) ] ,
2010-02-08 15:08:40 +01:00
' just_connected_bg_color ' : [ opt_str , ' #adc3c6 ' , _ ( ' Background color of contacts when they just signed in. ' ) ] ,
' just_disconnected_bg_color ' : [ opt_str , ' #ab6161 ' , _ ( ' Background color of contacts when they just signed out. ' ) ] ,
' restored_messages_color ' : [ opt_color , ' #555753 ' ] ,
' restored_messages_small ' : [ opt_bool , True , _ ( ' If True, restored messages will use a smaller font than the default one. ' ) ] ,
' hide_avatar_of_transport ' : [ opt_bool , False , _ ( ' Don \' t show avatar for the transport itself. ' ) ] ,
' roster_window_skip_taskbar ' : [ opt_bool , False , _ ( ' Don \' t show roster in the system taskbar. ' ) ] ,
' use_urgency_hint ' : [ opt_bool , True , _ ( ' If True and installed GTK+ and PyGTK versions are at least 2.8, make the window flash (the default behaviour in most Window Managers) when holding pending events. ' ) ] ,
' notification_timeout ' : [ opt_int , 5 ] ,
' send_sha_in_gc_presence ' : [ opt_bool , True , _ ( ' Jabberd1.4 does not like sha info when one join a password protected group chat. Turn this option to False to stop sending sha info in group chat presences. ' ) ] ,
' one_message_window ' : [ opt_str , ' always ' ,
2006-09-14 18:48:03 +02:00
#always, never, peracct, pertype should not be translated
2013-08-15 10:33:27 +02:00
_ ( ' Controls the window where new messages are placed. \n \' always \' - All messages are sent to a single window. \n \' always_with_roster \' - Like \' always \' but the messages are in a single window along with the roster. \n \' never \' - All messages get their own window. \n \' peracct \' - Messages for each account are sent to a specific window. \n \' pertype \' - Each message type (e.g. chats vs. groupchats) is sent to a specific window. ' ) ] ,
2011-02-04 21:52:03 +01:00
' show_roster_on_startup ' : [ opt_str , ' always ' , _ ( ' Show roster on startup. \n \' always \' - Always show roster. \n \' never \' - Never show roster. \n \' last_state \' - Restore the last state roster. ' ) ] ,
2010-02-08 15:08:40 +01:00
' show_avatar_in_chat ' : [ opt_bool , True , _ ( ' If False, you will no longer see the avatar in the chat window. ' ) ] ,
' escape_key_closes ' : [ opt_bool , True , _ ( ' If True, pressing the escape key closes a tab/window. ' ) ] ,
' hide_groupchat_banner ' : [ opt_bool , False , _ ( ' Hides the banner in a group chat window ' ) ] ,
' hide_chat_banner ' : [ opt_bool , False , _ ( ' Hides the banner in two persons chat window ' ) ] ,
' hide_groupchat_occupants_list ' : [ opt_bool , False , _ ( ' Hides the group chat occupants list in group chat window. ' ) ] ,
' chat_merge_consecutive_nickname ' : [ opt_bool , False , _ ( ' In a chat, show the nickname at the beginning of a line only when it \' s not the same person talking than in previous message. ' ) ] ,
' chat_merge_consecutive_nickname_indent ' : [ opt_str , ' ' , _ ( ' Indentation when using merge consecutive nickname. ' ) ] ,
' gc_nicknames_colors ' : [ opt_str , ' #4e9a06:#f57900:#ce5c00:#3465a4:#204a87:#75507b:#5c3566:#c17d11:#8f5902:#ef2929:#cc0000:#a40000 ' , _ ( ' List of colors, separated by " : " , that will be used to color nicknames in group chats. ' ) , True ] ,
' ctrl_tab_go_to_next_composing ' : [ opt_bool , True , _ ( ' Ctrl-Tab go to next composing tab when none is unread. ' ) ] ,
' confirm_metacontacts ' : [ opt_str , ' ' , _ ( ' Should we show the confirm metacontacts creation dialog or not? Empty string means we never show the dialog. ' ) ] ,
' confirm_block ' : [ opt_str , ' ' , _ ( ' Should we show the confirm block contact dialog or not? Empty string means we never show the dialog. ' ) ] ,
' confirm_custom_status ' : [ opt_str , ' ' , _ ( ' Should we show the confirm custom status dialog or not? Empty string means we never show the dialog. ' ) ] ,
' enable_negative_priority ' : [ opt_bool , False , _ ( ' If True, you will be able to set a negative priority to your account in account modification window. BE CAREFUL, when you are logged in with a negative priority, you will NOT receive any message from your server. ' ) ] ,
' show_contacts_number ' : [ opt_bool , True , _ ( ' If True, Gajim will show number of online and total contacts in account and group rows. ' ) ] ,
' treat_incoming_messages ' : [ opt_str , ' ' , _ ( ' Can be empty, \' chat \' or \' normal \' . If not empty, treat all incoming messages as if they were of this type ' ) ] ,
' scroll_roster_to_last_message ' : [ opt_bool , True , _ ( ' If True, Gajim will scroll and select the contact who sent you the last message, if chat window is not already opened. ' ) ] ,
' change_status_window_timeout ' : [ opt_int , 15 , _ ( ' Time of inactivity needed before the change status window closes down. ' ) ] ,
' max_conversation_lines ' : [ opt_int , 500 , _ ( ' Maximum number of lines that are printed in conversations. Oldest lines are cleared. ' ) ] ,
2010-08-23 10:40:04 +02:00
' attach_notifications_to_systray ' : [ opt_bool , False , _ ( ' If True, notification windows from notification-daemon will be attached to notification icon. ' ) ] ,
2010-02-08 15:08:40 +01:00
' check_idle_every_foo_seconds ' : [ opt_int , 2 , _ ( ' Choose interval between 2 checks of idleness. ' ) ] ,
2017-04-15 12:02:44 +02:00
' uri_schemes ' : [ opt_str , ' aaa:// aaas:// acap:// cap:// cid: crid:// data: dav: dict:// dns: fax: file:/ ftp:// geo: go: gopher:// h323: http:// https:// iax: icap:// im: imap:// info: ipp:// iris: iris.beep: iris.xpc: iris.xpcs: iris.lwz: ldap:// mid: modem: msrp:// msrps:// mtqp:// mupdate:// news: nfs:// nntp:// opaquelocktoken: pop:// pres: prospero:// rtsp:// service: shttp:// sip: sips: sms: snmp:// soap.beep:// soap.beeps:// tag: tel: telnet:// tftp:// thismessage:/ tip:// tv: urn:// vemmi:// xmlrpc.beep:// xmlrpc.beeps:// z39.50r:// z39.50s:// about: apt: cvs:// daap:// ed2k:// feed: fish:// git:// iax2: irc:// ircs:// ldaps:// magnet: mms:// rsync:// ssh:// svn:// sftp:// smb:// webcal:// aesgcm:// ' , _ ( ' Valid uri schemes. Only schemes in this list will be accepted as " real " uri. (mailto and xmpp are handled separately) ' ) , True ] ,
2010-02-08 15:08:40 +01:00
' shell_like_completion ' : [ opt_bool , False , _ ( ' If True, completion in groupchats will be like a shell auto-completion ' ) ] ,
' show_self_contact ' : [ opt_str , ' when_other_resource ' , _ ( ' When is self contact row displayed. Can be " always " , " when_other_resource " or " never " ' ) , True ] ,
' audio_input_device ' : [ opt_str , ' autoaudiosrc ! volume name=gajim_vol ' ] ,
' audio_output_device ' : [ opt_str , ' autoaudiosink ' ] ,
2016-03-30 21:19:13 +02:00
' video_input_device ' : [ opt_str , ' autovideosrc ' ] ,
2010-02-08 15:08:40 +01:00
' video_output_device ' : [ opt_str , ' autovideosink ' ] ,
2010-06-19 15:44:10 +02:00
' video_framerate ' : [ opt_str , ' ' , _ ( ' Optionally fix jingle output video framerate. Example: 10/1 or 25/2 ' ) ] ,
' video_size ' : [ opt_str , ' ' , _ ( ' Optionally resize jingle output video. Example: 320x240 ' ) ] ,
2012-12-30 18:59:48 +01:00
' video_see_self ' : [ opt_bool , True , _ ( ' If True, You will also see your webcam ' ) ] ,
2010-02-08 15:08:40 +01:00
' audio_input_volume ' : [ opt_int , 50 ] ,
' audio_output_volume ' : [ opt_int , 50 ] ,
2017-02-04 23:29:45 +01:00
' use_stun_server ' : [ opt_bool , False , _ ( ' If True, Gajim will try to use a STUN server when using Jingle. The one in " stun_server " option, or the one given by the XMPP server. ' ) ] ,
' stun_server ' : [ opt_str , ' ' , _ ( ' STUN server to use when using Jingle ' ) ] ,
2010-02-08 15:08:40 +01:00
' show_affiliation_in_groupchat ' : [ opt_bool , True , _ ( ' If True, Gajim will show affiliation of groupchat occupants by adding a colored square to the status icon ' ) ] ,
2011-11-10 20:37:48 +01:00
' global_proxy ' : [ opt_str , ' ' , _ ( ' Proxy used for all outgoing connections if the account does not have a specific proxy configured ' ) ] ,
2012-04-09 13:38:28 +02:00
' ignore_incoming_attention ' : [ opt_bool , False , _ ( ' If True, Gajim will ignore incoming attention requestd ( " wizz " ). ' ) ] ,
2012-08-05 13:34:35 +02:00
' remember_opened_chat_controls ' : [ opt_bool , True , _ ( ' If enabled, Gajim will reopen chat windows that were opened last time Gajim was closed. ' ) ] ,
2013-05-12 21:32:29 +02:00
' positive_184_ack ' : [ opt_bool , False , _ ( ' If enabled, Gajim will show an icon to show that sent message has been received by your contact ' ) ] ,
2016-04-12 22:53:41 +02:00
' show_avatar_in_tabs ' : [ opt_bool , False , _ ( ' Show a mini avatar in chat window tabs and in window icon ' ) ] ,
2017-01-23 19:02:21 +01:00
' use_keyring ' : [ opt_bool , True , _ ( ' If True, Gajim will use the Systems Keyring to store account passwords. ' ) ] ,
2017-03-28 18:15:29 +02:00
' pgp_encoding ' : [ opt_str , ' ' , _ ( ' Sets the encoding used by python-gnupg ' ) , True ] ,
2017-05-26 23:10:05 +02:00
' remote_commands ' : [ opt_bool , False , _ ( ' If True, Gajim will execute XEP-0146 Commands. ' ) ] ,
2012-04-09 19:45:56 +02:00
} , { } )
2010-02-08 15:08:40 +01:00
__options_per_key = {
' accounts ' : ( {
' name ' : [ opt_str , ' ' , ' ' , True ] ,
2017-08-15 19:12:30 +02:00
' account_label ' : [ opt_str , ' ' , ' ' , False ] ,
2010-02-08 15:08:40 +01:00
' hostname ' : [ opt_str , ' ' , ' ' , True ] ,
' anonymous_auth ' : [ opt_bool , False ] ,
2017-09-16 11:49:31 +02:00
' avatar_sha ' : [ opt_str , ' ' , ' ' , False ] ,
2010-04-18 20:43:40 +02:00
' client_cert ' : [ opt_str , ' ' , ' ' , True ] ,
2011-07-26 22:44:11 +02:00
' client_cert_encrypted ' : [ opt_bool , False , ' ' , False ] ,
2010-02-08 15:08:40 +01:00
' savepass ' : [ opt_bool , False ] ,
' password ' : [ opt_str , ' ' ] ,
2017-01-04 13:13:55 +01:00
' resource ' : [ opt_str , ' gajim.$rand ' , ' ' , True ] ,
2010-02-08 15:08:40 +01:00
' priority ' : [ opt_int , 5 , ' ' , True ] ,
' adjust_priority_with_status ' : [ opt_bool , True , _ ( ' Priority will change automatically according to your status. Priorities are defined in autopriority_* options. ' ) ] ,
' autopriority_online ' : [ opt_int , 50 ] ,
' autopriority_chat ' : [ opt_int , 50 ] ,
' autopriority_away ' : [ opt_int , 40 ] ,
' autopriority_xa ' : [ opt_int , 30 ] ,
' autopriority_dnd ' : [ opt_int , 20 ] ,
' autopriority_invisible ' : [ opt_int , 10 ] ,
' autoconnect ' : [ opt_bool , False , ' ' , True ] ,
' autoconnect_as ' : [ opt_str , ' online ' , _ ( ' Status used to autoconnect as. Can be online, chat, away, xa, dnd, invisible. NOTE: this option is used only if restore_last_status is disabled ' ) , True ] ,
' restore_last_status ' : [ opt_bool , False , _ ( ' If enabled, restore the last status that was used. ' ) ] ,
' autoreconnect ' : [ opt_bool , True ] ,
' autoauth ' : [ opt_bool , False , _ ( ' If True, Contacts requesting authorization will be automatically accepted. ' ) ] ,
' active ' : [ opt_bool , True , _ ( ' If False, this account will be disabled and will not appear in roster window. ' ) , True ] ,
' proxy ' : [ opt_str , ' ' , ' ' , True ] ,
' keyid ' : [ opt_str , ' ' , ' ' , True ] ,
' gpg_sign_presence ' : [ opt_bool , True , _ ( ' If disabled, don \' t sign presences with GPG key, even if GPG is configured. ' ) ] ,
' keyname ' : [ opt_str , ' ' , ' ' , True ] ,
2016-02-21 19:03:44 +01:00
' enable_esessions ' : [ opt_bool , True , _ ( ' Enable ESessions encryption for this account. ' ) , True ] ,
2016-08-08 15:12:28 +02:00
' autonegotiate_esessions ' : [ opt_bool , False , _ ( ' Should Gajim automatically start an encrypted session when possible? ' ) ] ,
2017-02-04 23:29:45 +01:00
#keep tls, ssl and plain lowercase
2016-09-18 15:18:30 +02:00
' connection_types ' : [ opt_str , ' tls ' , _ ( ' Ordered list (space separated) of connection type to try. Can contain tls, ssl or plain ' ) ] ,
2017-07-23 20:12:00 +02:00
' tls_version ' : [ opt_str , ' 1.2 ' , ' ' ] ,
2013-12-23 23:26:54 +01:00
' cipher_list ' : [ opt_str , ' HIGH:!aNULL:RC4-SHA ' , ' ' ] ,
2014-03-01 21:16:24 +01:00
' authentication_mechanisms ' : [ opt_str , ' ' , _ ( ' List (space separated) of authentication mechanisms to try. Can contain ANONYMOUS, EXTERNAL, GSSAPI, SCRAM-SHA-1-PLUS, SCRAM-SHA-1, DIGEST-MD5, PLAIN, X-MESSENGER-OAUTH2 or XEP-0078 ' ) ] ,
2011-10-31 09:47:01 +01:00
' action_when_plaintext_connection ' : [ opt_str , ' warn ' , _ ( ' Show a warning dialog before sending password on an plaintext connection. Can be \' warn \' , \' connect \' , \' disconnect \' ' ) ] ,
2010-02-08 15:08:40 +01:00
' warn_when_insecure_ssl_connection ' : [ opt_bool , True , _ ( ' Show a warning dialog before using standard SSL library. ' ) ] ,
2011-05-29 20:45:18 +02:00
' warn_when_insecure_password ' : [ opt_bool , True , _ ( ' Show a warning dialog before sending PLAIN password over a plain connection. ' ) ] ,
2010-02-08 15:08:40 +01:00
' ssl_fingerprint_sha1 ' : [ opt_str , ' ' , ' ' , True ] ,
2014-01-21 15:27:41 +01:00
' ssl_fingerprint_sha256 ' : [ opt_str , ' ' , ' ' , True ] ,
2010-02-08 15:08:40 +01:00
' ignore_ssl_errors ' : [ opt_str , ' ' , _ ( ' Space separated list of ssl errors to ignore. ' ) ] ,
' use_srv ' : [ opt_bool , True , ' ' , True ] ,
' use_custom_host ' : [ opt_bool , False , ' ' , True ] ,
' custom_port ' : [ opt_int , 5222 , ' ' , True ] ,
' custom_host ' : [ opt_str , ' ' , ' ' , True ] ,
' sync_with_global_status ' : [ opt_bool , False , ] ,
2011-09-28 17:43:59 +02:00
' no_log_for ' : [ opt_str , ' ' , _ ( ' Space separated list of JIDs for which you do not want to store logs. You can also add account name to log nothing for this account. ' ) ] ,
2017-07-28 00:34:18 +02:00
' sync_logs_with_server ' : [ opt_bool , True , _ ( ' On startup, Gajim will download logs stored on server, provided the server supports XEP-0313 ' ) ] ,
2011-09-28 17:43:59 +02:00
' allow_no_log_for ' : [ opt_str , ' ' , _ ( ' Space separated list of JIDs for which you accept to not log conversations if he does not want to. ' ) ] ,
2016-09-05 19:02:43 +02:00
' non_minimized_gc ' : [ opt_str , ' ' ] ,
2010-02-08 15:08:40 +01:00
' attached_gpg_keys ' : [ opt_str , ' ' ] ,
' keep_alives_enabled ' : [ opt_bool , True , _ ( ' Whitespace sent after inactivity ' ) ] ,
' ping_alives_enabled ' : [ opt_bool , True , _ ( ' XMPP ping sent after inactivity ' ) ] ,
# send keepalive every N seconds of inactivity
' keep_alive_every_foo_secs ' : [ opt_int , 55 ] ,
' ping_alive_every_foo_secs ' : [ opt_int , 120 ] ,
2013-08-15 10:33:27 +02:00
' time_for_ping_alive_answer ' : [ opt_int , 60 , _ ( ' How many seconds to wait for the answer of ping alive packet before we try to reconnect? ' ) ] ,
2010-02-08 15:08:40 +01:00
# try for 1 minutes before giving up (aka. timeout after those seconds)
' try_connecting_for_foo_secs ' : [ opt_int , 60 ] ,
' http_auth ' : [ opt_str , ' ask ' ] , # yes, no, ask
' dont_ack_subscription ' : [ opt_bool , False , _ ( ' Jabberd2 workaround ' ) ] ,
# proxy65 for FT
2017-04-29 16:51:12 +02:00
' file_transfer_proxies ' : [ opt_str , ' ' ] ,
2016-08-08 15:12:28 +02:00
' use_ft_proxies ' : [ opt_bool , False , _ ( ' If checked, Gajim will use your IP and proxies defined in file_transfer_proxies option for file transfer. ' ) , True ] ,
' test_ft_proxies_on_startup ' : [ opt_bool , False , _ ( ' If True, Gajim will test file transfer proxies on startup to be sure it works. Openfire \' s proxies are known to fail this test even if they work. ' ) ] ,
2010-02-08 15:08:40 +01:00
' msgwin-x-position ' : [ opt_int , - 1 ] , # Default is to let the wm decide
' msgwin-y-position ' : [ opt_int , - 1 ] , # Default is to let the wm decide
' msgwin-width ' : [ opt_int , 480 ] ,
' msgwin-height ' : [ opt_int , 440 ] ,
' is_zeroconf ' : [ opt_bool , False ] ,
' last_status ' : [ opt_str , ' online ' ] ,
' last_status_msg ' : [ opt_str , ' ' ] ,
' zeroconf_first_name ' : [ opt_str , ' ' , ' ' , True ] ,
' zeroconf_last_name ' : [ opt_str , ' ' , ' ' , True ] ,
' zeroconf_jabber_id ' : [ opt_str , ' ' , ' ' , True ] ,
' zeroconf_email ' : [ opt_str , ' ' , ' ' , True ] ,
2010-02-10 19:24:11 +01:00
' use_env_http_proxy ' : [ opt_bool , False ] ,
' answer_receipts ' : [ opt_bool , True , _ ( ' Answer to receipt requests ' ) ] ,
' request_receipt ' : [ opt_bool , True , _ ( ' Sent receipt requests ' ) ] ,
2010-02-08 15:08:40 +01:00
' publish_tune ' : [ opt_bool , False ] ,
' publish_location ' : [ opt_bool , False ] ,
' subscribe_mood ' : [ opt_bool , True ] ,
' subscribe_activity ' : [ opt_bool , True ] ,
' subscribe_tune ' : [ opt_bool , True ] ,
' subscribe_nick ' : [ opt_bool , True ] ,
' subscribe_location ' : [ opt_bool , True ] ,
' ignore_unknown_contacts ' : [ opt_bool , False ] ,
2011-01-19 09:08:31 +01:00
' send_os_info ' : [ opt_bool , True , _ ( " Allow Gajim to send information about the operating system you are running. " ) ] ,
' send_time_info ' : [ opt_bool , True , _ ( " Allow Gajim to send your local time. " ) ] ,
2010-02-08 15:08:40 +01:00
' log_encrypted_sessions ' : [ opt_bool , True , _ ( ' When negotiating an encrypted session, should Gajim assume you want your messages to be logged? ' ) ] ,
' send_idle_time ' : [ opt_bool , True ] ,
' roster_version ' : [ opt_str , ' ' ] ,
' subscription_request_msg ' : [ opt_str , ' ' , _ ( ' Message that is sent to contacts you want to add ' ) ] ,
2014-11-11 16:11:26 +01:00
' enable_message_carbons ' : [ opt_bool , True , _ ( ' If enabled and if server supports this feature, Gajim will receive messages sent and received by other resources. ' ) ] ,
2011-11-06 20:53:07 +01:00
' ft_send_local_ips ' : [ opt_bool , True , _ ( ' If enabled, Gajim will send your local IPs so your contact can connect to your machine to transfer files. ' ) ] ,
2017-02-04 23:29:45 +01:00
' oauth2_refresh_token ' : [ opt_str , ' ' , _ ( ' Latest token for OAuth 2.0 authentication. ' ) ] ,
' oauth2_client_id ' : [ opt_str , ' 0000000044077801 ' , _ ( ' client_id for OAuth 2.0 authentication. ' ) ] ,
' oauth2_redirect_url ' : [ opt_str , ' https % 3A %2F %2F gajim.org %2F msnauth %2F index.cgi ' , _ ( ' redirect_url for OAuth 2.0 authentication. ' ) ] ,
2013-08-16 08:09:41 +02:00
' opened_chat_controls ' : [ opt_str , ' ' , _ ( ' Space separated list of JIDs for which we want to re-open a chat window on next startup. ' ) ] ,
2010-02-08 15:08:40 +01:00
} , { } ) ,
' statusmsg ' : ( {
' message ' : [ opt_str , ' ' ] ,
' activity ' : [ opt_str , ' ' ] ,
' subactivity ' : [ opt_str , ' ' ] ,
' activity_text ' : [ opt_str , ' ' ] ,
' mood ' : [ opt_str , ' ' ] ,
' mood_text ' : [ opt_str , ' ' ] ,
} , { } ) ,
' defaultstatusmsg ' : ( {
' enabled ' : [ opt_bool , False ] ,
' message ' : [ opt_str , ' ' ] ,
} , { } ) ,
' soundevents ' : ( {
' enabled ' : [ opt_bool , True ] ,
' path ' : [ opt_str , ' ' ] ,
} , { } ) ,
' proxies ' : ( {
' type ' : [ opt_str , ' http ' ] ,
' host ' : [ opt_str , ' ' ] ,
' port ' : [ opt_int , 3128 ] ,
' useauth ' : [ opt_bool , False ] ,
' user ' : [ opt_str , ' ' ] ,
' pass ' : [ opt_str , ' ' ] ,
' bosh_uri ' : [ opt_str , ' ' ] ,
' bosh_useproxy ' : [ opt_bool , False ] ,
' bosh_wait ' : [ opt_int , 30 ] ,
' bosh_hold ' : [ opt_int , 2 ] ,
' bosh_content ' : [ opt_str , ' text/xml; charset=utf-8 ' ] ,
' bosh_http_pipelining ' : [ opt_bool , False ] ,
' bosh_wait_for_restart_response ' : [ opt_bool , False ] ,
} , { } ) ,
' themes ' : ( {
' accounttextcolor ' : [ opt_color , ' black ' , ' ' , True ] ,
' accountbgcolor ' : [ opt_color , ' white ' , ' ' , True ] ,
' accountfont ' : [ opt_str , ' ' , ' ' , True ] ,
' accountfontattrs ' : [ opt_str , ' B ' , ' ' , True ] ,
' grouptextcolor ' : [ opt_color , ' black ' , ' ' , True ] ,
' groupbgcolor ' : [ opt_color , ' white ' , ' ' , True ] ,
' groupfont ' : [ opt_str , ' ' , ' ' , True ] ,
' groupfontattrs ' : [ opt_str , ' I ' , ' ' , True ] ,
' contacttextcolor ' : [ opt_color , ' black ' , ' ' , True ] ,
' contactbgcolor ' : [ opt_color , ' white ' , ' ' , True ] ,
' contactfont ' : [ opt_str , ' ' , ' ' , True ] ,
' contactfontattrs ' : [ opt_str , ' ' , ' ' , True ] ,
' bannertextcolor ' : [ opt_color , ' black ' , ' ' , True ] ,
' bannerbgcolor ' : [ opt_color , ' ' , ' ' , True ] ,
' bannerfont ' : [ opt_str , ' ' , ' ' , True ] ,
' bannerfontattrs ' : [ opt_str , ' B ' , ' ' , True ] ,
2017-03-01 17:11:18 +01:00
' msgcorrectingcolor ' : [ opt_color , ' #eee8aa ' ] ,
2010-02-08 15:08:40 +01:00
# http://www.pitt.edu/~nisg/cis/web/cgi/rgb.html
' state_inactive_color ' : [ opt_color , ' grey62 ' ] ,
' state_composing_color ' : [ opt_color , ' green4 ' ] ,
' state_paused_color ' : [ opt_color , ' mediumblue ' ] ,
' state_gone_color ' : [ opt_color , ' grey ' ] ,
# MUC chat states
' state_muc_msg_color ' : [ opt_color , ' mediumblue ' ] ,
' state_muc_directed_msg_color ' : [ opt_color , ' red2 ' ] ,
} , { } ) ,
' contacts ' : ( {
' speller_language ' : [ opt_str , ' ' , _ ( ' Language for which we want to check misspelled words ' ) ] ,
} , { } ) ,
2017-05-17 16:58:11 +02:00
' encryption ' : ( { ' encryption ' : [ opt_str , ' ' , _ ( ' The currently active encryption for that contact ' ) ] ,
} , { } ) ,
2010-02-08 15:08:40 +01:00
' rooms ' : ( {
' speller_language ' : [ opt_str , ' ' , _ ( ' Language for which we want to check misspelled words ' ) ] ,
2012-12-13 10:07:51 +01:00
' muc_restore_lines ' : [ opt_int , - 2 , _ ( ' How many lines to request from server when entering a groupchat. -1 means no limit, -2 means global value ' ) ] ,
2017-02-04 23:29:45 +01:00
' muc_restore_timeout ' : [ opt_int , - 2 , _ ( ' Minutes of backlog to request when entering a groupchat. -1 means no limit, -2 means global value ' ) ] ,
2017-08-20 23:07:58 +02:00
' notify_on_all_messages ' : [ opt_bool , False , _ ( ' State whether we want a notification for every message in this room ' ) ] ,
2010-02-08 15:08:40 +01:00
} , { } ) ,
2010-04-08 01:20:17 +02:00
' plugins ' : ( {
2012-03-18 12:17:55 +01:00
' active ' : [ opt_bool , False , _ ( ' State whether plugins should be activated on startup (this is saved on Gajim exit). This option SHOULD NOT be used to (de)activate plug-ins. Use GUI instead. ' ) ] ,
2010-07-19 19:53:29 +02:00
} , { } ) ,
2010-02-08 15:08:40 +01:00
}
statusmsg_default = {
_ ( ' Sleeping ' ) : [ ' ZZZZzzzzzZZZZZ ' , ' inactive ' , ' sleeping ' , ' ' , ' sleepy ' , ' ' ] ,
_ ( ' Back soon ' ) : [ _ ( ' Back in some minutes. ' ) , ' ' , ' ' , ' ' , ' ' , ' ' ] ,
_ ( ' Eating ' ) : [ _ ( " I ' m eating, so leave me a message. " ) , ' eating ' , ' other ' , ' ' , ' ' , ' ' ] ,
_ ( ' Movie ' ) : [ _ ( " I ' m watching a movie. " ) , ' relaxing ' , ' watching_a_movie ' , ' ' , ' ' , ' ' ] ,
_ ( ' Working ' ) : [ _ ( " I ' m working. " ) , ' working ' , ' other ' , ' ' , ' ' , ' ' ] ,
_ ( ' Phone ' ) : [ _ ( " I ' m on the phone. " ) , ' talking ' , ' on_the_phone ' , ' ' , ' ' , ' ' ] ,
_ ( ' Out ' ) : [ _ ( " I ' m out enjoying life. " ) , ' relaxing ' , ' going_out ' , ' ' , ' ' , ' ' ] ,
' _last_online ' : [ ' ' , ' ' , ' ' , ' ' , ' ' , ' ' ] ,
' _last_chat ' : [ ' ' , ' ' , ' ' , ' ' , ' ' , ' ' ] ,
' _last_away ' : [ ' ' , ' ' , ' ' , ' ' , ' ' , ' ' ] ,
' _last_xa ' : [ ' ' , ' ' , ' ' , ' ' , ' ' , ' ' ] ,
' _last_dnd ' : [ ' ' , ' ' , ' ' , ' ' , ' ' , ' ' ] ,
' _last_invisible ' : [ ' ' , ' ' , ' ' , ' ' , ' ' , ' ' ] ,
' _last_offline ' : [ ' ' , ' ' , ' ' , ' ' , ' ' , ' ' ] ,
}
defaultstatusmsg_default = {
' online ' : [ False , _ ( " I ' m available. " ) ] ,
' chat ' : [ False , _ ( " I ' m free for chat. " ) ] ,
' away ' : [ False , _ ( ' Be right back. ' ) ] ,
' xa ' : [ False , _ ( " I ' m not available. " ) ] ,
' dnd ' : [ False , _ ( ' Do not disturb. ' ) ] ,
' invisible ' : [ False , _ ( ' Bye! ' ) ] ,
' offline ' : [ False , _ ( ' Bye! ' ) ] ,
}
soundevents_default = {
2012-04-09 13:38:28 +02:00
' attention_received ' : [ True , ' attention.wav ' ] ,
2010-02-08 15:08:40 +01:00
' first_message_received ' : [ True , ' message1.wav ' ] ,
' next_message_received_focused ' : [ True , ' message2.wav ' ] ,
' next_message_received_unfocused ' : [ True , ' message2.wav ' ] ,
2016-08-08 15:12:28 +02:00
' contact_connected ' : [ False , ' connected.wav ' ] ,
' contact_disconnected ' : [ False , ' disconnected.wav ' ] ,
' message_sent ' : [ False , ' sent.wav ' ] ,
2010-02-08 15:08:40 +01:00
' muc_message_highlight ' : [ True , ' gc_message1.wav ' , _ ( ' Sound to play when a group chat message contains one of the words in muc_highlight_words, or when a group chat message contains your nickname. ' ) ] ,
' muc_message_received ' : [ False , ' gc_message2.wav ' , _ ( ' Sound to play when any MUC message arrives. ' ) ] ,
}
themes_default = {
# sorted alphanum
2010-02-10 19:24:11 +01:00
_ ( ' default ' ) : [ ' ' , ' ' , ' ' , ' B ' , ' ' , ' ' , ' ' , ' I ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' ,
2010-02-08 15:08:40 +01:00
' ' , ' B ' ] ,
_ ( ' green ' ) : [ ' ' , ' #94aa8c ' , ' ' , ' B ' , ' #0000ff ' , ' #eff3e7 ' ,
' ' , ' I ' , ' #000000 ' , ' ' , ' ' , ' ' , ' ' ,
' #94aa8c ' , ' ' , ' B ' ] ,
_ ( ' grocery ' ) : [ ' ' , ' #6bbe18 ' , ' ' , ' B ' , ' #12125a ' , ' #ceefad ' ,
' ' , ' I ' , ' #000000 ' , ' #efb26b ' , ' ' , ' ' , ' ' ,
' #108abd ' , ' ' , ' B ' ] ,
_ ( ' human ' ) : [ ' ' , ' #996442 ' , ' ' , ' B ' , ' #ab5920 ' , ' #e3ca94 ' ,
' ' , ' I ' , ' #000000 ' , ' ' , ' ' , ' ' , ' ' ,
' #996442 ' , ' ' , ' B ' ] ,
_ ( ' marine ' ) : [ ' ' , ' #918caa ' , ' ' , ' B ' , ' ' , ' #e9e7f3 ' ,
' ' , ' I ' , ' #000000 ' , ' ' , ' ' , ' ' , ' ' ,
' #918caa ' , ' ' , ' B ' ] ,
}
2011-11-14 18:44:17 +01:00
proxies_default = {
_ ( ' Tor ' ) : [ ' socks5 ' , ' localhost ' , 9050 ] ,
}
2012-04-09 19:45:56 +02:00
def foreach ( self , cb , data = None ) :
for opt in self . __options [ 1 ] :
cb ( data , opt , None , self . __options [ 1 ] [ opt ] )
2010-02-08 15:08:40 +01:00
for opt in self . __options_per_key :
cb ( data , opt , None , None )
dict_ = self . __options_per_key [ opt ] [ 1 ]
for opt2 in dict_ . keys ( ) :
cb ( data , opt2 , [ opt ] , None )
for opt3 in dict_ [ opt2 ] :
cb ( data , opt3 , [ opt , opt2 ] , dict_ [ opt2 ] [ opt3 ] )
def get_children ( self , node = None ) :
"""
Tree - like interface
"""
if node is None :
2013-01-02 13:54:02 +01:00
for child , option in self . __options [ 1 ] . items ( ) :
2010-02-08 15:08:40 +01:00
yield ( child , ) , option
for grandparent in self . __options_per_key :
yield ( grandparent , ) , None
elif len ( node ) == 1 :
grandparent , = node
for parent in self . __options_per_key [ grandparent ] [ 1 ] :
yield ( grandparent , parent ) , None
elif len ( node ) == 2 :
grandparent , parent = node
children = self . __options_per_key [ grandparent ] [ 1 ] [ parent ]
2013-01-02 13:54:02 +01:00
for child , option in children . items ( ) :
2010-02-08 15:08:40 +01:00
yield ( grandparent , parent , child ) , option
else :
raise ValueError ( ' Invalid node ' )
def is_valid_int ( self , val ) :
try :
ival = int ( val )
except Exception :
return None
return ival
def is_valid_bool ( self , val ) :
if val == ' True ' :
return True
2016-11-05 15:53:48 +01:00
if val == ' False ' :
2010-02-08 15:08:40 +01:00
return False
2016-11-05 15:53:48 +01:00
ival = self . is_valid_int ( val )
if ival :
return True
if ival is None :
return None
return False
2010-02-08 15:08:40 +01:00
def is_valid_string ( self , val ) :
return val
def is_valid ( self , type_ , val ) :
if not type_ :
return None
if type_ [ 0 ] == ' boolean ' :
return self . is_valid_bool ( val )
elif type_ [ 0 ] == ' integer ' :
return self . is_valid_int ( val )
elif type_ [ 0 ] == ' string ' :
return self . is_valid_string ( val )
else :
if re . match ( type_ [ 1 ] , val ) :
return val
else :
return None
def set ( self , optname , value ) :
2012-04-09 19:45:56 +02:00
if optname not in self . __options [ 1 ] :
2010-02-08 15:08:40 +01:00
return
2017-02-07 21:18:41 +01:00
value = self . is_valid ( self . __options [ 0 ] [ optname ] [ Option . TYPE ] , value )
2010-02-08 15:08:40 +01:00
if value is None :
return
2012-04-09 19:45:56 +02:00
self . __options [ 1 ] [ optname ] = value
2012-04-18 10:15:53 +02:00
self . _timeout_save ( )
2010-02-08 15:08:40 +01:00
2012-04-09 19:45:56 +02:00
def get ( self , optname = None ) :
2010-02-08 15:08:40 +01:00
if not optname :
2013-01-02 18:23:38 +01:00
return list ( self . __options [ 1 ] . keys ( ) )
2012-04-09 19:45:56 +02:00
if optname not in self . __options [ 1 ] :
return None
return self . __options [ 1 ] [ optname ]
def get_default ( self , optname ) :
if optname not in self . __options [ 0 ] :
return None
2017-02-07 21:18:41 +01:00
return self . __options [ 0 ] [ optname ] [ Option . VAL ]
2012-04-09 19:45:56 +02:00
def get_type ( self , optname ) :
if optname not in self . __options [ 0 ] :
2010-02-08 15:08:40 +01:00
return None
2017-02-07 21:18:41 +01:00
return self . __options [ 0 ] [ optname ] [ Option . TYPE ] [ 0 ]
2010-02-08 15:08:40 +01:00
def get_desc ( self , optname ) :
2012-04-09 19:45:56 +02:00
if optname not in self . __options [ 0 ] :
2010-02-08 15:08:40 +01:00
return None
2017-02-07 21:18:41 +01:00
if len ( self . __options [ 0 ] [ optname ] ) > Option . DESC :
return self . __options [ 0 ] [ optname ] [ Option . DESC ]
2010-02-08 15:08:40 +01:00
def get_restart ( self , optname ) :
2012-04-09 19:45:56 +02:00
if optname not in self . __options [ 0 ] :
2010-02-08 15:08:40 +01:00
return None
2017-02-07 21:18:41 +01:00
if len ( self . __options [ 0 ] [ optname ] ) > Option . RESTART :
return self . __options [ 0 ] [ optname ] [ Option . RESTART ]
2010-02-08 15:08:40 +01:00
def add_per ( self , typename , name ) : # per_group_of_option
if typename not in self . __options_per_key :
return
opt = self . __options_per_key [ typename ]
if name in opt [ 1 ] :
# we already have added group name before
return ' you already have added %s before ' % name
2012-04-09 19:45:56 +02:00
opt [ 1 ] [ name ] = { }
for o in opt [ 0 ] :
2017-02-07 21:18:41 +01:00
opt [ 1 ] [ name ] [ o ] = opt [ 0 ] [ o ] [ Option . VAL ]
2012-04-18 10:15:53 +02:00
self . _timeout_save ( )
2010-02-08 15:08:40 +01:00
def del_per ( self , typename , name , subname = None ) : # per_group_of_option
if typename not in self . __options_per_key :
return
opt = self . __options_per_key [ typename ]
if subname is None :
del opt [ 1 ] [ name ]
# if subname is specified, delete the item in the group.
elif subname in opt [ 1 ] [ name ] :
del opt [ 1 ] [ name ] [ subname ]
2012-04-18 10:15:53 +02:00
self . _timeout_save ( )
2010-02-08 15:08:40 +01:00
def set_per ( self , optname , key , subname , value ) : # per_group_of_option
if optname not in self . __options_per_key :
return
if not key :
return
dict_ = self . __options_per_key [ optname ] [ 1 ]
if key not in dict_ :
self . add_per ( optname , key )
obj = dict_ [ key ]
if subname not in obj :
return
2017-02-07 21:18:41 +01:00
typ = self . __options_per_key [ optname ] [ 0 ] [ subname ] [ Option . TYPE ]
2012-04-09 19:45:56 +02:00
value = self . is_valid ( typ , value )
2010-02-08 15:08:40 +01:00
if value is None :
return
2012-04-09 19:45:56 +02:00
obj [ subname ] = value
2012-04-18 10:15:53 +02:00
self . _timeout_save ( )
2010-02-08 15:08:40 +01:00
2012-04-09 19:45:56 +02:00
def get_per ( self , optname , key = None , subname = None ) : # per_group_of_option
2010-02-08 15:08:40 +01:00
if optname not in self . __options_per_key :
return None
dict_ = self . __options_per_key [ optname ] [ 1 ]
if not key :
2013-01-02 18:23:38 +01:00
return list ( dict_ . keys ( ) )
2010-02-08 15:08:40 +01:00
if key not in dict_ :
2012-04-09 19:45:56 +02:00
if subname in self . __options_per_key [ optname ] [ 0 ] :
return self . __options_per_key [ optname ] [ 0 ] [ subname ] [ 1 ]
2010-02-08 15:08:40 +01:00
return None
obj = dict_ [ key ]
if not subname :
return obj
if subname not in obj :
return None
2012-04-09 19:45:56 +02:00
return obj [ subname ]
2010-02-08 15:08:40 +01:00
2012-04-09 19:45:56 +02:00
def get_default_per ( self , optname , subname ) :
2010-02-08 15:08:40 +01:00
if optname not in self . __options_per_key :
return None
2012-04-09 19:45:56 +02:00
dict_ = self . __options_per_key [ optname ] [ 0 ]
if subname not in dict_ :
return None
2017-02-07 21:18:41 +01:00
return dict_ [ subname ] [ Option . VAL ]
2012-04-09 19:45:56 +02:00
def get_type_per ( self , optname , subname ) :
if optname not in self . __options_per_key :
return None
dict_ = self . __options_per_key [ optname ] [ 0 ]
if subname not in dict_ :
return None
2017-02-07 21:18:41 +01:00
return dict_ [ subname ] [ Option . TYPE ] [ 0 ]
2012-04-09 19:45:56 +02:00
2017-07-10 21:31:31 +02:00
def get_desc_per ( self , optname , subname = None ) :
2012-04-09 19:45:56 +02:00
if optname not in self . __options_per_key :
return None
dict_ = self . __options_per_key [ optname ] [ 0 ]
2017-07-10 21:31:31 +02:00
if subname not in dict_ :
2010-02-08 15:08:40 +01:00
return None
2017-07-10 21:31:31 +02:00
obj = dict_ [ subname ]
if len ( obj ) > Option . DESC :
return obj [ Option . DESC ]
2010-02-08 15:08:40 +01:00
return None
2012-04-09 19:45:56 +02:00
def get_restart_per ( self , optname , key = None , subname = None ) :
2010-02-08 15:08:40 +01:00
if optname not in self . __options_per_key :
return False
2012-04-09 19:45:56 +02:00
dict_ = self . __options_per_key [ optname ] [ 0 ]
2010-02-08 15:08:40 +01:00
if not key :
return False
if key not in dict_ :
return False
obj = dict_ [ key ]
if not subname :
return False
if subname not in obj :
return False
2017-02-07 21:18:41 +01:00
if len ( obj [ subname ] ) > Option . RESTART :
return obj [ subname ] [ Option . RESTART ]
2010-02-08 15:08:40 +01:00
return False
def should_log ( self , account , jid ) :
"""
Should conversations between a local account and a remote jid be logged ?
"""
no_log_for = self . get_per ( ' accounts ' , account , ' no_log_for ' )
if not no_log_for :
no_log_for = ' '
no_log_for = no_log_for . split ( )
return ( account not in no_log_for ) and ( jid not in no_log_for )
2012-04-09 19:45:56 +02:00
def _init_options ( self ) :
for opt in self . __options [ 0 ] :
2017-02-07 21:18:41 +01:00
self . __options [ 1 ] [ opt ] = self . __options [ 0 ] [ opt ] [ Option . VAL ]
2012-04-09 19:45:56 +02:00
2012-04-18 10:15:53 +02:00
def _really_save ( self ) :
2017-08-13 13:18:56 +02:00
from gajim . common import app
if app . interface :
app . interface . save_config ( )
2012-04-18 10:33:42 +02:00
self . save_timeout_id = None
2012-04-18 10:15:53 +02:00
return False
def _timeout_save ( self ) :
if self . save_timeout_id :
return
2013-07-28 20:50:30 +02:00
self . save_timeout_id = GLib . timeout_add ( 1000 , self . _really_save )
2012-04-18 10:15:53 +02:00
2010-02-08 15:08:40 +01:00
def __init__ ( self ) :
#init default values
2012-04-09 19:45:56 +02:00
self . _init_options ( )
2012-04-18 10:15:53 +02:00
self . save_timeout_id = None
2010-02-08 15:08:40 +01:00
for event in self . soundevents_default :
default = self . soundevents_default [ event ]
self . add_per ( ' soundevents ' , event )
self . set_per ( ' soundevents ' , event , ' enabled ' , default [ 0 ] )
self . set_per ( ' soundevents ' , event , ' path ' , default [ 1 ] )
for status in self . defaultstatusmsg_default :
default = self . defaultstatusmsg_default [ status ]
self . add_per ( ' defaultstatusmsg ' , status )
self . set_per ( ' defaultstatusmsg ' , status , ' enabled ' , default [ 0 ] )
self . set_per ( ' defaultstatusmsg ' , status , ' message ' , default [ 1 ] )