diff options
author | Timo Sirainen <cras@irssi.org> | 2001-05-26 19:20:45 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-05-26 19:20:45 +0000 |
commit | 7cab17c2c98477db4c6b7129cf08772021b2fdc0 (patch) | |
tree | 8a83aaadf4c0fc40fd003a4ba54a32e9c242c399 /src | |
parent | 7038b7f1ab176c4014949512faead0bbfcfec51e (diff) | |
download | irssi-7cab17c2c98477db4c6b7129cf08772021b2fdc0.zip |
Added formats to /SET texts.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1517 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/fe-settings.c | 16 | ||||
-rw-r--r-- | src/fe-common/core/module-formats.c | 4 | ||||
-rw-r--r-- | src/fe-common/core/module-formats.h | 6 |
3 files changed, 19 insertions, 7 deletions
diff --git a/src/fe-common/core/fe-settings.c b/src/fe-common/core/fe-settings.c index 90262ee0..5af02ad0 100644 --- a/src/fe-common/core/fe-settings.c +++ b/src/fe-common/core/fe-settings.c @@ -50,7 +50,8 @@ static void set_print(SETTINGS_REC *rec) default: value = ""; } - printtext(NULL, NULL, MSGLEVEL_CLIENTCRAP, "%s = %s", rec->key, value); + printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_SET_ITEM, + rec->key, value); } static void set_boolean(const char *key, const char *value) @@ -92,7 +93,8 @@ static void cmd_set(char *data) if (strcmp(last_section, rec->section) != 0) { /* print section */ - printtext(NULL, NULL, MSGLEVEL_CLIENTCRAP, "%_[ %s ]", rec->section); + printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, + TXT_SET_TITLE, rec->section); last_section = rec->section; } @@ -123,8 +125,10 @@ static void cmd_set(char *data) } g_slist_free(sets); - if (!found) - printtext(NULL, NULL, MSGLEVEL_CLIENTERROR, "Unknown setting %s", key); + if (!found) { + printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, + TXT_SET_UNKNOWN, key); + } cmd_params_free(free_arg); } @@ -143,9 +147,9 @@ static void cmd_toggle(const char *data) type = settings_get_type(key); if (type == -1) - printtext(NULL, NULL, MSGLEVEL_CLIENTERROR, "Unknown setting %_%s", key); + printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, TXT_SET_UNKNOWN, key); else if (type != SETTING_TYPE_BOOLEAN) - printtext(NULL, NULL, MSGLEVEL_CLIENTERROR, "Setting %_%s%_ isn't boolean, use /SET", key); + printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, TXT_SET_NOT_BOOLEAN, key); else { set_boolean(key, *value != '\0' ? value : "TOGGLE"); set_print(settings_get_record(key)); diff --git a/src/fe-common/core/module-formats.c b/src/fe-common/core/module-formats.c index 9ccdd10a..5f4448c1 100644 --- a/src/fe-common/core/module-formats.c +++ b/src/fe-common/core/module-formats.c @@ -223,6 +223,10 @@ FORMAT_REC fecommon_core_formats[] = { { "config_modified", "Configuration file was modified since irssi was last started - do you want to overwrite the possible changes?", 1, { 0 } }, { "glib_error", "{error GLib $0} $1", 2, { 0, 0 } }, { "overwrite_config", "Overwrite config (y/N)?", 0 }, + { "set_title", "[{hilight $0}]", 1, { 0 } }, + { "set_item", "$0 = $1", 2, { 0, 0 } }, + { "set_unknown", "Unknown setting $0", 1, { 0 } }, + { "set_not_boolean", "Setting {hilight $0} isn't boolean, use /SET", 1, { 0 } }, { NULL, NULL, 0 } }; diff --git a/src/fe-common/core/module-formats.h b/src/fe-common/core/module-formats.h index e0f31f9a..c43d330d 100644 --- a/src/fe-common/core/module-formats.h +++ b/src/fe-common/core/module-formats.h @@ -188,7 +188,11 @@ enum { TXT_CONFIG_RELOADED, TXT_CONFIG_MODIFIED, TXT_GLIB_ERROR, - TXT_OVERWRITE_CONFIG + TXT_OVERWRITE_CONFIG, + TXT_SET_TITLE, + TXT_SET_ITEM, + TXT_SET_UNKNOWN, + TXT_SET_NOT_BOOLEAN }; extern FORMAT_REC fecommon_core_formats[]; |