mirror of
https://github.com/irssi/irssi.git
synced 2024-09-29 04:45:57 -04:00
Added formats to /SET texts.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1517 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
7038b7f1ab
commit
7cab17c2c9
@ -50,7 +50,8 @@ static void set_print(SETTINGS_REC *rec)
|
|||||||
default:
|
default:
|
||||||
value = "";
|
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)
|
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) {
|
if (strcmp(last_section, rec->section) != 0) {
|
||||||
/* print section */
|
/* print section */
|
||||||
printtext(NULL, NULL, MSGLEVEL_CLIENTCRAP, "%_[ %s ]", rec->section);
|
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP,
|
||||||
|
TXT_SET_TITLE, rec->section);
|
||||||
last_section = rec->section;
|
last_section = rec->section;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,8 +125,10 @@ static void cmd_set(char *data)
|
|||||||
}
|
}
|
||||||
g_slist_free(sets);
|
g_slist_free(sets);
|
||||||
|
|
||||||
if (!found)
|
if (!found) {
|
||||||
printtext(NULL, NULL, MSGLEVEL_CLIENTERROR, "Unknown setting %s", key);
|
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
|
||||||
|
TXT_SET_UNKNOWN, key);
|
||||||
|
}
|
||||||
|
|
||||||
cmd_params_free(free_arg);
|
cmd_params_free(free_arg);
|
||||||
}
|
}
|
||||||
@ -143,9 +147,9 @@ static void cmd_toggle(const char *data)
|
|||||||
|
|
||||||
type = settings_get_type(key);
|
type = settings_get_type(key);
|
||||||
if (type == -1)
|
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)
|
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 {
|
else {
|
||||||
set_boolean(key, *value != '\0' ? value : "TOGGLE");
|
set_boolean(key, *value != '\0' ? value : "TOGGLE");
|
||||||
set_print(settings_get_record(key));
|
set_print(settings_get_record(key));
|
||||||
|
@ -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 } },
|
{ "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 } },
|
{ "glib_error", "{error GLib $0} $1", 2, { 0, 0 } },
|
||||||
{ "overwrite_config", "Overwrite config (y/N)?", 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 }
|
{ NULL, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
@ -188,7 +188,11 @@ enum {
|
|||||||
TXT_CONFIG_RELOADED,
|
TXT_CONFIG_RELOADED,
|
||||||
TXT_CONFIG_MODIFIED,
|
TXT_CONFIG_MODIFIED,
|
||||||
TXT_GLIB_ERROR,
|
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[];
|
extern FORMAT_REC fecommon_core_formats[];
|
||||||
|
Loading…
Reference in New Issue
Block a user