diff options
author | Timo Sirainen <cras@irssi.org> | 2000-07-21 18:53:04 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-07-21 18:53:04 +0000 |
commit | 4ba9a1356b7e1df3abcbbad4a9e38e789e177005 (patch) | |
tree | 097946367b259cb9cf746bfb00b052485aee64f2 | |
parent | 9f4ab078740c8a9099d5fd79b57bcfb617f9ae29 (diff) | |
download | irssi-4ba9a1356b7e1df3abcbbad4a9e38e789e177005.zip |
You can now change the texts /FORMAT prints itself.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@500 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r-- | src/fe-common/core/module-formats.c | 3 | ||||
-rw-r--r-- | src/fe-common/core/module-formats.h | 3 | ||||
-rw-r--r-- | src/fe-common/core/themes.c | 10 |
3 files changed, 10 insertions, 6 deletions
diff --git a/src/fe-common/core/module-formats.c b/src/fe-common/core/module-formats.c index b6d66f70..d98cb33e 100644 --- a/src/fe-common/core/module-formats.c +++ b/src/fe-common/core/module-formats.c @@ -114,6 +114,9 @@ FORMAT_REC fecommon_core_formats[] = { /* ---- */ { NULL, "Misc", 0 }, + { "format_title", "%:%K[%W$0%K] - [%W$1%K]%:%:", 2, { 0, 0 } }, + { "format_subtitle", "%K[%W$0%K]", 1, { 0 } }, + { "format_item", "$0 %K=%n $1", 2, { 0, 0 } }, { "not_toggle", "Value must be either ON, OFF or TOGGLE", 0 }, { "perl_error", "Perl error: $0", 1, { 0 } }, { "bind_key", "$[10]0 $1 $2", 3, { 0, 0, 0 } }, diff --git a/src/fe-common/core/module-formats.h b/src/fe-common/core/module-formats.h index afb78bb4..969d9d2f 100644 --- a/src/fe-common/core/module-formats.h +++ b/src/fe-common/core/module-formats.h @@ -85,6 +85,9 @@ enum { IRCTXT_FILL_8, + IRCTXT_FORMAT_TITLE, + IRCTXT_FORMAT_SUBTITLE, + IRCTXT_FORMAT_ITEM, IRCTXT_NOT_TOGGLE, IRCTXT_PERL_ERROR, IRCTXT_BIND_KEY, diff --git a/src/fe-common/core/themes.c b/src/fe-common/core/themes.c index 16ef2b45..3179a990 100644 --- a/src/fe-common/core/themes.c +++ b/src/fe-common/core/themes.c @@ -19,6 +19,7 @@ */ #include "module.h" +#include "module-formats.h" #include "signals.h" #include "commands.h" #include "levels.h" @@ -26,7 +27,6 @@ #include "lib-config/iconfig.h" #include "settings.h" -#include "printtext.h" #include "themes.h" GSList *themes; @@ -328,13 +328,11 @@ static void theme_show(THEME_SEARCH_REC *rec, const char *key, const char *value else if ((value != NULL && key != NULL && g_strcasecmp(formats[n].tag, key) == 0) || (value == NULL && (key == NULL || stristr(formats[n].tag, key) != NULL))) { if (first) { - printtext(NULL, NULL, MSGLEVEL_CLIENTCRAP, ""); - printtext(NULL, NULL, MSGLEVEL_CLIENTCRAP, "%K[%W%s%K] - [%W%s%K]", rec->short_name, formats[0].def); - printtext(NULL, NULL, MSGLEVEL_CLIENTCRAP, ""); + printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_FORMAT_TITLE, rec->short_name, formats[0].def); first = FALSE; } if (last_title != NULL) - printtext(NULL, NULL, MSGLEVEL_CLIENTCRAP, "%K[%W%s%K]", last_title); + printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_FORMAT_SUBTITLE, last_title); if (reset || value != NULL) { theme = theme_module_create(current_theme, rec->name); g_free_not_null(theme->formats[n]); @@ -342,7 +340,7 @@ static void theme_show(THEME_SEARCH_REC *rec, const char *key, const char *value theme->formats[n] = reset ? NULL : g_strdup(value); text = reset ? formats[n].def : value; } - printtext(NULL, NULL, MSGLEVEL_CLIENTCRAP, "%s %K=%n %s", formats[n].tag, text); + printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_FORMAT_ITEM, formats[n].tag, text); last_title = NULL; } } |