diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 5 | ||||
-rw-r--r-- | src/statusbar.c | 2 | ||||
-rw-r--r-- | src/utils.c | 14 | ||||
-rw-r--r-- | src/utils.h | 7 |
5 files changed, 29 insertions, 4 deletions
@@ -1,5 +1,10 @@ 2005-08-29 + * src/statusbar.c + src/utils.[ch]: separate statusbar from utils.c. + +2005-08-29 + * src/logwindow.c src/utils.[ch]: separate LogWindow from utils.c. diff --git a/ChangeLog.ja b/ChangeLog.ja index f7b77994..2d495b51 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,10 @@ 2005-08-29 + * src/statusbar.c + src/utils.[ch]: statusbar を utils.c から分離。 + +2005-08-29 + * src/logwindow.c src/utils.[ch]: LogWindow を utils.c から分離。 diff --git a/src/statusbar.c b/src/statusbar.c index c112b9cd..15897235 100644 --- a/src/statusbar.c +++ b/src/statusbar.c @@ -42,6 +42,8 @@ GtkWidget *statusbar_create(void) gtk_widget_set_size_request(statusbar, 1, -1); statusbar_list = g_list_append(statusbar_list, statusbar); + set_log_show_status_func(statusbar_puts_all); + return statusbar; } diff --git a/src/utils.c b/src/utils.c index 7bc8e8a5..dc72b814 100644 --- a/src/utils.c +++ b/src/utils.c @@ -52,7 +52,6 @@ #include "utils.h" #include "socket.h" -#include "statusbar.h" #define BUFFSIZE 8192 @@ -3302,7 +3301,7 @@ void set_debug_mode(gboolean enable) debug_mode = enable; } -void log_dummy_func(const gchar *str) +static void log_dummy_func(const gchar *str) { } @@ -3311,6 +3310,8 @@ static LogFunc log_message_ui_func = log_dummy_func; static LogFunc log_warning_ui_func = log_dummy_func; static LogFunc log_error_ui_func = log_dummy_func; +static LogFunc log_show_status_func = log_dummy_func; + void set_log_ui_func(LogFunc print_func, LogFunc message_func, LogFunc warning_func, LogFunc error_func) { @@ -3320,6 +3321,11 @@ void set_log_ui_func(LogFunc print_func, LogFunc message_func, log_error_ui_func = error_func; } +void set_log_show_status_func(LogFunc status_func) +{ + log_show_status_func = status_func; +} + void debug_print(const gchar *format, ...) { va_list args; @@ -3356,7 +3362,7 @@ void log_print(const gchar *format, ...) fflush(log_fp); } if (log_verbosity_count) - statusbar_puts_all(buf + TIME_LEN); + log_show_status_func(buf + TIME_LEN); } void log_message(const gchar *format, ...) @@ -3380,7 +3386,7 @@ void log_message(const gchar *format, ...) fputs(buf + TIME_LEN, log_fp); fflush(log_fp); } - statusbar_puts_all(buf + TIME_LEN); + log_show_status_func(buf + TIME_LEN); } void log_warning(const gchar *format, ...) diff --git a/src/utils.h b/src/utils.h index 0ccf2fbf..fbda26a3 100644 --- a/src/utils.h +++ b/src/utils.h @@ -477,6 +477,13 @@ void set_log_verbosity (gboolean verbose); gboolean get_debug_mode (void); void set_debug_mode (gboolean enable); +void set_log_ui_func (LogFunc print_func, + LogFunc message_func, + LogFunc warning_func, + LogFunc error_func); + +void set_log_show_status_func (LogFunc status_func); + void debug_print (const gchar *format, ...) G_GNUC_PRINTF(1, 2); void log_print (const gchar *format, ...) G_GNUC_PRINTF(1, 2); void log_message (const gchar *format, ...) G_GNUC_PRINTF(1, 2); |