1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-29 04:45:57 -04:00

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
This commit is contained in:
Timo Sirainen 2000-07-21 18:53:04 +00:00 committed by cras
parent 9f4ab07874
commit 4ba9a1356b
3 changed files with 10 additions and 6 deletions

View File

@ -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 } },

View File

@ -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,

View File

@ -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;
}
}