mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
*** empty log message ***
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2553 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
418678bc95
commit
ca234bdf5e
@ -50,6 +50,9 @@
|
|||||||
# default foreground color (%N) - -1 is the "default terminal color"
|
# default foreground color (%N) - -1 is the "default terminal color"
|
||||||
default_color = "-1";
|
default_color = "-1";
|
||||||
|
|
||||||
|
# print timestamp/servertag at the end of line, not at beginning
|
||||||
|
info_eol = "false";
|
||||||
|
|
||||||
# these characters are automatically replaced with specified color
|
# these characters are automatically replaced with specified color
|
||||||
# (dark grey by default)
|
# (dark grey by default)
|
||||||
replaces = { "[]=" = "%K$*%n"; };
|
replaces = { "[]=" = "%K$*%n"; };
|
||||||
|
@ -549,6 +549,31 @@ char *format_add_linestart(const char *text, const char *linestart)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *format_add_lineend(const char *text, const char *linestart)
|
||||||
|
{
|
||||||
|
GString *str;
|
||||||
|
char *ret;
|
||||||
|
|
||||||
|
if (linestart == NULL)
|
||||||
|
return g_strdup(text);
|
||||||
|
|
||||||
|
if (strchr(text, '\n') == NULL)
|
||||||
|
return g_strconcat(text, linestart, NULL);
|
||||||
|
|
||||||
|
str = g_string_new(NULL);
|
||||||
|
while (*text != '\0') {
|
||||||
|
if (*text == '\n')
|
||||||
|
g_string_append(str, linestart);
|
||||||
|
g_string_append_c(str, *text);
|
||||||
|
text++;
|
||||||
|
}
|
||||||
|
g_string_append(str, linestart);
|
||||||
|
|
||||||
|
ret = str->str;
|
||||||
|
g_string_free(str, FALSE);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
#define LINE_START_IRSSI_LEVEL \
|
#define LINE_START_IRSSI_LEVEL \
|
||||||
(MSGLEVEL_CLIENTERROR | MSGLEVEL_CLIENTNOTICE)
|
(MSGLEVEL_CLIENTERROR | MSGLEVEL_CLIENTNOTICE)
|
||||||
|
|
||||||
|
@ -86,9 +86,10 @@ char *format_get_text_theme_charargs(THEME_REC *theme, const char *module,
|
|||||||
TEXT_DEST_REC *dest, int formatnum,
|
TEXT_DEST_REC *dest, int formatnum,
|
||||||
char **args);
|
char **args);
|
||||||
|
|
||||||
/* add `linestart' to start of each line in `text'. `text' may contain
|
/* add `linestart' to start/end of each line in `text'. `text' may contain
|
||||||
multiple lines separated with \n. */
|
multiple lines separated with \n. */
|
||||||
char *format_add_linestart(const char *text, const char *linestart);
|
char *format_add_linestart(const char *text, const char *linestart);
|
||||||
|
char *format_add_lineend(const char *text, const char *linestart);
|
||||||
|
|
||||||
/* return the "-!- " text at the start of the line */
|
/* return the "-!- " text at the start of the line */
|
||||||
char *format_get_level_tag(THEME_REC *theme, TEXT_DEST_REC *dest);
|
char *format_get_level_tag(THEME_REC *theme, TEXT_DEST_REC *dest);
|
||||||
|
@ -683,7 +683,7 @@ static void cmd_bind(const char *data)
|
|||||||
command_id = strchr(settings_get_str("cmdchars"), *id) != NULL;
|
command_id = strchr(settings_get_str("cmdchars"), *id) != NULL;
|
||||||
if (command_id) {
|
if (command_id) {
|
||||||
/* using shortcut to command id */
|
/* using shortcut to command id */
|
||||||
keydata = g_strconcat(id, " ", keydata, NULL);
|
keydata = g_strconcat(id+1, " ", keydata, NULL);
|
||||||
id = "command";
|
id = "command";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,13 +158,16 @@ void printformat_module_gui(const char *module, int formatnum, ...)
|
|||||||
|
|
||||||
static void print_line(TEXT_DEST_REC *dest, const char *text)
|
static void print_line(TEXT_DEST_REC *dest, const char *text)
|
||||||
{
|
{
|
||||||
|
THEME_REC *theme;
|
||||||
char *str, *tmp, *stripped;
|
char *str, *tmp, *stripped;
|
||||||
|
|
||||||
g_return_if_fail(dest != NULL);
|
g_return_if_fail(dest != NULL);
|
||||||
g_return_if_fail(text != NULL);
|
g_return_if_fail(text != NULL);
|
||||||
|
|
||||||
tmp = format_get_level_tag(window_get_theme(dest->window), dest);
|
theme = window_get_theme(dest->window);
|
||||||
str = format_add_linestart(text, tmp);
|
tmp = format_get_level_tag(theme, dest);
|
||||||
|
str = !theme->info_eol ? format_add_linestart(text, tmp) :
|
||||||
|
format_add_lineend(text, tmp);
|
||||||
g_free_not_null(tmp);
|
g_free_not_null(tmp);
|
||||||
|
|
||||||
/* send both the formatted + stripped (for logging etc.) */
|
/* send both the formatted + stripped (for logging etc.) */
|
||||||
@ -408,6 +411,7 @@ static void msg_beep_check(TEXT_DEST_REC *dest)
|
|||||||
|
|
||||||
static void sig_print_text(TEXT_DEST_REC *dest, const char *text)
|
static void sig_print_text(TEXT_DEST_REC *dest, const char *text)
|
||||||
{
|
{
|
||||||
|
THEME_REC *theme;
|
||||||
char *str, *tmp;
|
char *str, *tmp;
|
||||||
|
|
||||||
g_return_if_fail(dest != NULL);
|
g_return_if_fail(dest != NULL);
|
||||||
@ -421,9 +425,11 @@ static void sig_print_text(TEXT_DEST_REC *dest, const char *text)
|
|||||||
|
|
||||||
/* add timestamp/server tag here - if it's done in print_line()
|
/* add timestamp/server tag here - if it's done in print_line()
|
||||||
it would be written to log files too */
|
it would be written to log files too */
|
||||||
tmp = format_get_line_start(window_get_theme(dest->window),
|
theme = window_get_theme(dest->window);
|
||||||
dest, time(NULL));
|
tmp = format_get_line_start(theme, dest, time(NULL));
|
||||||
str = format_add_linestart(text, tmp);
|
str = !theme->info_eol ? format_add_linestart(text, tmp) :
|
||||||
|
format_add_lineend(text, tmp);
|
||||||
|
|
||||||
g_free_not_null(tmp);
|
g_free_not_null(tmp);
|
||||||
|
|
||||||
format_send_to_gui(dest, str);
|
format_send_to_gui(dest, str);
|
||||||
|
@ -844,6 +844,8 @@ static int theme_read(THEME_REC *theme, const char *path, const char *data)
|
|||||||
|
|
||||||
theme->default_color =
|
theme->default_color =
|
||||||
config_get_int(config, NULL, "default_color", -1);
|
config_get_int(config, NULL, "default_color", -1);
|
||||||
|
theme->info_eol = config_get_bool(config, NULL, "info_eol", FALSE);
|
||||||
|
|
||||||
/* FIXME: remove after 0.7.99 */
|
/* FIXME: remove after 0.7.99 */
|
||||||
if (theme->default_color == 0 &&
|
if (theme->default_color == 0 &&
|
||||||
config_get_int(config, NULL, "default_real_color", -1) != -1)
|
config_get_int(config, NULL, "default_real_color", -1) != -1)
|
||||||
|
@ -18,6 +18,9 @@ typedef struct {
|
|||||||
int default_color; /* default color to use with text with default
|
int default_color; /* default color to use with text with default
|
||||||
background. default is -1 which means the
|
background. default is -1 which means the
|
||||||
default color set by terminal */
|
default color set by terminal */
|
||||||
|
unsigned int info_eol:1; /* show the timestamp/servertag at the
|
||||||
|
end of the line, not at beginning */
|
||||||
|
|
||||||
GHashTable *modules;
|
GHashTable *modules;
|
||||||
|
|
||||||
int replace_keys[256]; /* index to replace_values for each char */
|
int replace_keys[256]; /* index to replace_values for each char */
|
||||||
|
Loading…
Reference in New Issue
Block a user