summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-04-28 08:07:42 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-04-28 08:07:42 +0000
commita5a66264de2f56c5b1ba00e0228eae61f70d5689 (patch)
tree981b0663ff753f754cd0204b742ea12bff0d5e56 /src/fe-common
parent9cbf26d5199bdd1f3bd29fb27f181af4b94de02e (diff)
downloadirssi-a5a66264de2f56c5b1ba00e0228eae61f70d5689.zip
Perl working again, better than ever (unless there's bugs :)
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@191 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/fe-common-core.c3
-rw-r--r--src/fe-common/core/fe-log.c2
-rw-r--r--src/fe-common/core/module-formats.c3
-rw-r--r--src/fe-common/core/module-formats.h3
-rw-r--r--src/fe-common/core/printtext.c23
-rw-r--r--src/fe-common/core/printtext.h1
-rw-r--r--src/fe-common/irc/fe-events.c8
7 files changed, 24 insertions, 19 deletions
diff --git a/src/fe-common/core/fe-common-core.c b/src/fe-common/core/fe-common-core.c
index cc76aea6..d111584d 100644
--- a/src/fe-common/core/fe-common-core.c
+++ b/src/fe-common/core/fe-common-core.c
@@ -38,6 +38,9 @@ void autorun_deinit(void);
void fe_core_log_init(void);
void fe_core_log_deinit(void);
+void fe_log_init(void);
+void fe_log_deinit(void);
+
void fe_server_init(void);
void fe_server_deinit(void);
diff --git a/src/fe-common/core/fe-log.c b/src/fe-common/core/fe-log.c
index 560e0f35..636c461b 100644
--- a/src/fe-common/core/fe-log.c
+++ b/src/fe-common/core/fe-log.c
@@ -1,7 +1,7 @@
/*
fe-log.c : irssi
- Copyright (C) 1999 Timo Sirainen
+ Copyright (C) 1999-2000 Timo Sirainen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/src/fe-common/core/module-formats.c b/src/fe-common/core/module-formats.c
index 39546ea3..1453a9d0 100644
--- a/src/fe-common/core/module-formats.c
+++ b/src/fe-common/core/module-formats.c
@@ -83,5 +83,6 @@ FORMAT_REC fecommon_core_formats[] =
/* ---- */
{ NULL, N_("Misc"), 0 },
- { "not_toggle", N_("Value must be either ON, OFF or TOGGLE"), 0 }
+ { "not_toggle", N_("Value must be either ON, OFF or TOGGLE"), 0 },
+ { "perl_error", N_("Perl error: $0"), 1, { 0 } }
};
diff --git a/src/fe-common/core/module-formats.h b/src/fe-common/core/module-formats.h
index cce8d48b..6730f413 100644
--- a/src/fe-common/core/module-formats.h
+++ b/src/fe-common/core/module-formats.h
@@ -55,7 +55,8 @@ enum {
IRCTXT_FILL_6,
- IRCTXT_NOT_TOGGLE
+ IRCTXT_NOT_TOGGLE,
+ IRCTXT_PERL_ERROR
};
extern FORMAT_REC fecommon_core_formats[];
diff --git a/src/fe-common/core/printtext.c b/src/fe-common/core/printtext.c
index b03658b1..a80177b6 100644
--- a/src/fe-common/core/printtext.c
+++ b/src/fe-common/core/printtext.c
@@ -807,21 +807,28 @@ static int sig_check_daychange(void)
return TRUE;
}
-static void sig_gui_dialog(const char *type, const char *text)
+void printtext_multiline(void *server, const char *channel, int level, const char *format, const char *text)
{
char **lines, **tmp;
+ lines = g_strsplit(text, "\n", -1);
+ for (tmp = lines; *tmp != NULL; tmp++)
+ printtext(NULL, NULL, MSGLEVEL_NEVER, format, *tmp);
+ g_strfreev(lines);
+}
+
+static void sig_gui_dialog(const char *type, const char *text)
+{
+ char *format;
+
if (g_strcasecmp(type, "warning") == 0)
- type = _("%_Warning:%_ %s");
+ format = _("%_Warning:%_ %s");
else if (g_strcasecmp(type, "error") == 0)
- type = _("%_Error:%_ %s");
+ format = _("%_Error:%_ %s");
else
- type = "%s";
+ format = "%s";
- lines = g_strsplit(text, "\n", -1);
- for (tmp = lines; *tmp != NULL; tmp++)
- printtext(NULL, NULL, MSGLEVEL_NEVER, type, *tmp);
- g_strfreev(lines);
+ printtext_multiline(NULL, NULL, MSGLEVEL_NEVER, format, text);
}
static void read_settings(void)
diff --git a/src/fe-common/core/printtext.h b/src/fe-common/core/printtext.h
index fc2b2c57..6c32522e 100644
--- a/src/fe-common/core/printtext.h
+++ b/src/fe-common/core/printtext.h
@@ -53,6 +53,7 @@ void printformat(void *server, const char *channel, int level, int formatnum, ..
void printformat_format(FORMAT_REC *formats, void *server, const char *channel, int level, int formatnum, ...);
void printtext(void *server, const char *channel, int level, const char *str, ...);
+void printtext_multiline(void *server, const char *channel, int level, const char *format, const char *text);
void printbeep(void);
void printtext_init(void);
diff --git a/src/fe-common/irc/fe-events.c b/src/fe-common/irc/fe-events.c
index 49b8e3c4..c846211a 100644
--- a/src/fe-common/irc/fe-events.c
+++ b/src/fe-common/irc/fe-events.c
@@ -556,12 +556,6 @@ static void event_ban_type_changed(gchar *bantype)
}
}
-/*FIXME: move to core
-static void event_perl_error(gchar *text)
-{
- printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, IRCTXT_PERL_ERROR, text);
-}*/
-
static void sig_server_lag_disconnected(IRC_SERVER_REC *server)
{
g_return_if_fail(server != NULL);
@@ -643,7 +637,6 @@ void fe_events_init(void)
signal_add("event connected", (SIGNAL_FUNC) event_connected);
signal_add("nickfind event whois", (SIGNAL_FUNC) event_nickfind_whois);
signal_add("ban type changed", (SIGNAL_FUNC) event_ban_type_changed);
- //signal_add("perl error", (SIGNAL_FUNC) event_perl_error);
signal_add("server lag disconnect", (SIGNAL_FUNC) sig_server_lag_disconnected);
signal_add("server reconnect remove", (SIGNAL_FUNC) sig_server_reconnect_removed);
@@ -676,7 +669,6 @@ void fe_events_deinit(void)
signal_remove("event connected", (SIGNAL_FUNC) event_connected);
signal_remove("nickfind event whois", (SIGNAL_FUNC) event_nickfind_whois);
signal_remove("ban type changed", (SIGNAL_FUNC) event_ban_type_changed);
- //signal_remove("perl error", (SIGNAL_FUNC) event_perl_error);
signal_remove("server lag disconnect", (SIGNAL_FUNC) sig_server_lag_disconnected);
signal_remove("server reconnect remove", (SIGNAL_FUNC) sig_server_reconnect_removed);