0.9.5claws23
authorChristoph Hohmann <reboot@gmx.ch>
Sun, 21 Sep 2003 18:55:12 +0000 (18:55 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Sun, 21 Sep 2003 18:55:12 +0000 (18:55 +0000)
* src/Makefile.am
* src/logwindow.[ch]                    ** REMOVE **
* src/mainwindow.c
* src/prefs_common.c
* src/gtk/Makefile.am
* src/gtk/logwindow.[ch]                ** ADD **
        make logwindow prefs_common independent and move
        it to gtk directory

ChangeLog.claws
configure.ac
src/Makefile.am
src/gtk/Makefile.am
src/gtk/logwindow.c [moved from src/logwindow.c with 91% similarity]
src/gtk/logwindow.h [moved from src/logwindow.h with 90% similarity]
src/mainwindow.c
src/prefs_common.c

index 2cbcf0d..048d3c5 100644 (file)
@@ -1,3 +1,14 @@
+2003-09-21 [christoph] 0.9.5claws23
+
+       * src/Makefile.am
+       * src/logwindow.[ch]                    ** REMOVE **
+       * src/mainwindow.c
+       * src/prefs_common.c
+       * src/gtk/Makefile.am
+       * src/gtk/logwindow.[ch]                ** ADD **
+               make logwindow prefs_common independent and move
+               it to gtk directory
+
 2003-09-20 [christoph] 0.9.5claws22
 
        * src/compose.c
index d1fe158..8b3357d 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=22
+EXTRA_VERSION=23
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 5e66724..b395295 100644 (file)
@@ -57,7 +57,6 @@ sylpheed_SOURCES = \
        ldapserver.c \
        ldaputil.c \
        ldif.c \
-       logwindow.c \
        main.c \
        mainwindow.c \
        manual.c \
@@ -178,7 +177,6 @@ sylpheedinclude_HEADERS = \
        ldapserver.h \
        ldaputil.h \
        ldif.h \
-       logwindow.h \
        main.h \
        mainwindow.h \
        manual.h \
index a4978cd..d076dc0 100644 (file)
@@ -7,16 +7,17 @@ libsylpheedgtk_la_SOURCES = \
        description_window.c \
        filesel.c \
        gtkaspell.c \
-       gtkutils.c \
-       gtkshruler.c \
        gtksctree.c \
+       gtkshruler.c \
        gtkstext.c \
+       gtkutils.c \
+       gtkvscrollbutton.c \
+       logwindow.c \
        manage_window.c \
        menu.c \
        pluginwindow.c \
        prefswindow.c \
-       sslcertwindow.c \
-       gtkvscrollbutton.c
+       sslcertwindow.c
 
 sylpheedgtkincludedir = $(pkgincludedir)/gtk
 sylpheedgtkinclude_HEADERS = \
@@ -26,16 +27,17 @@ sylpheedgtkinclude_HEADERS = \
        description_window.h \
        filesel.h \
        gtkaspell.h \
-       gtkutils.h \
-       gtkshruler.h \
        gtksctree.h \
+       gtkshruler.h \
        gtkstext.h \
+       gtkutils.h \
+       gtkvscrollbutton.h \
+       logwindow.h \
        manage_window.h \
        menu.h \
        pluginwindow.h \
        prefswindow.h \
-       sslcertwindow.h \
-       gtkvscrollbutton.h
+       sslcertwindow.h
 
 AM_CPPFLAGS = \
        -I../common \
similarity index 91%
rename from src/logwindow.c
rename to src/gtk/logwindow.c
index 1d84560..0fe7cde 100644 (file)
@@ -34,7 +34,6 @@
 #include "logwindow.h"
 #include "utils.h"
 #include "gtkutils.h"
-#include "prefs_common.h"
 #include "log.h"
 #include "hooks.h"
 
@@ -45,7 +44,8 @@ static void key_pressed                       (GtkWidget      *widget,
                                         LogWindow      *logwin);
 static gboolean log_window_append      (gpointer        source,
                                         gpointer        data);
-void log_window_clear                  (GtkWidget      *text);
+static void log_window_clip            (GtkWidget      *text,
+                                        guint           glip_length);
 
 LogWindow *log_window_create(void)
 {
@@ -135,6 +135,14 @@ void log_window_show(LogWindow *logwin)
        gtk_widget_show(logwin->window);
 }
 
+void log_window_set_clipping(LogWindow *logwin, gboolean clip, guint clip_length)
+{
+       g_return_if_fail(logwin != NULL);
+
+       logwin->clip = clip;
+       logwin->clip_length = clip_length;
+}
+
 static gboolean log_window_append(gpointer source, gpointer data)
 {
        LogText *logtext = (LogText *) source;
@@ -147,7 +155,7 @@ static gboolean log_window_append(gpointer source, gpointer data)
        g_return_val_if_fail(logtext->text != NULL, TRUE);
        g_return_val_if_fail(logwindow != NULL, FALSE);
 
-       if (prefs_common.cliplog && !prefs_common.loglength)
+       if (logwindow->clip && !logwindow->clip_length)
                return FALSE;
 
        text = GTK_TEXT(logwindow->text);
@@ -171,8 +179,8 @@ static gboolean log_window_append(gpointer source, gpointer data)
 
        if (head) gtk_text_insert(text, NULL, color, NULL, head, -1);
        gtk_text_insert(text, NULL, color, NULL, logtext->text, -1);
-       if (prefs_common.cliplog)
-              log_window_clear (GTK_WIDGET (text));
+       if (logwindow->clip)
+              log_window_clip (GTK_WIDGET (text), logwindow->clip_length);
 
        return FALSE;
 }
@@ -190,7 +198,7 @@ static void key_pressed(GtkWidget *widget, GdkEventKey *event,
                gtk_widget_hide(logwin->window);
 }
 
-void log_window_clear(GtkWidget *textw)
+static void log_window_clip(GtkWidget *textw, guint clip_length)
 {
         guint length;
        guint point;
@@ -200,10 +208,10 @@ void log_window_clear(GtkWidget *textw)
        length = gtk_text_get_length (text);
        debug_print("Log window length: %u\n", length);
        
-       if (length > prefs_common.loglength) {
+       if (length > clip_length) {
                /* find the end of the first line after the cut off
                 * point */
-                       point = length - prefs_common.loglength;
+                       point = length - clip_length;
                while (point < length && GTK_TEXT_INDEX(text, point) != '\n')
                        point++;
                /* erase the text */
@@ -222,5 +230,3 @@ void log_window_clear(GtkWidget *textw)
                        gtk_text_freeze(text);
        }
 }
-
-
similarity index 90%
rename from src/logwindow.h
rename to src/gtk/logwindow.h
index a96575e..34e8cbb 100644 (file)
@@ -35,11 +35,14 @@ struct _LogWindow
        GdkColor warn_color;
        GdkColor error_color;
 
-       guint hook_id;
+       gboolean clip;
+       guint    clip_length;
+       guint    hook_id;
 };
 
 LogWindow *log_window_create(void);
 void log_window_init(LogWindow *logwin);
 void log_window_show(LogWindow *logwin);
+void log_window_set_clipping(LogWindow *logwin, gboolean clip, guint clip_length);
 
 #endif /* __LOGWINDOW_H__ */
index 54df722..e640362 100644 (file)
@@ -1013,6 +1013,8 @@ MainWindow *main_window_create(SeparateType type)
        summary_init(summaryview);
        messageview_init(messageview);
        log_window_init(mainwin->logwin);
+       log_window_set_clipping(mainwin->logwin, prefs_common.cliplog,
+                               prefs_common.loglength);
 #ifdef USE_OPENSSL
        sslcertwindow_register_hook();
 #endif
@@ -1485,7 +1487,6 @@ void main_window_add_mbox(MainWindow *mainwin)
 {
        gchar *path;
        Folder *folder;
-       FolderItem * item;
 
        path = input_dialog(_("Add mbox mailbox"),
                            _("Input the location of mailbox."),
index 8a88a79..d13ef61 100644 (file)
@@ -3921,6 +3921,7 @@ static void prefs_common_apply(void)
        gchar *entry_pixmap_theme_str;
        gboolean update_pixmap_theme;
        gchar *backup_theme_path;
+       MainWindow *mainwindow;
        
        entry_pixmap_theme_str = gtk_entry_get_text(GTK_ENTRY(interface.entry_pixmap_theme));
        if (entry_pixmap_theme_str && 
@@ -3947,9 +3948,13 @@ static void prefs_common_apply(void)
 
        /*!< FIXME: Now it's safe to delete the backup path */
        g_free(backup_theme_path);
-       
+
        prefs_common_save_config();
 
+       mainwindow = mainwindow_get_mainwindow();
+       log_window_set_clipping(mainwindow->logwin, prefs_common.cliplog,
+                               prefs_common.loglength);
+       
        inc_autocheck_timer_remove();
        inc_autocheck_timer_set();
 }