2005-02-25 [paul] 1.0.1cvs15.12
[claws.git] / src / gtk / logwindow.c
index c6cb6a8941877e995d675e62fda6f995371e5d43..d20f08192d11d3daa05ea611bede6187e31c27d9 100644 (file)
@@ -105,8 +105,6 @@ void log_window_init(LogWindow *logwin)
        gboolean success[3];
        gint i;
 
        gboolean success[3];
        gint i;
 
-       gtkut_widget_disable_theme_engine(logwin->text);
-
        logwin->msg_color   = color[0];
        logwin->warn_color  = color[1];
        logwin->error_color = color[2];
        logwin->msg_color   = color[0];
        logwin->warn_color  = color[1];
        logwin->error_color = color[2];
@@ -208,13 +206,13 @@ static gboolean log_window_append(gpointer source, gpointer data)
                                                 tag, NULL);
 
        gtk_text_buffer_get_start_iter(buffer, &iter);
                                                 tag, NULL);
 
        gtk_text_buffer_get_start_iter(buffer, &iter);
-       gtk_text_buffer_place_cursor(buffer, &iter);
 
        if (logwindow->clip)
               log_window_clip (GTK_WIDGET (text), logwindow->clip_length);
 
        gtk_text_buffer_get_iter_at_offset(buffer, &iter, -1);
        gtk_text_view_scroll_to_iter(text, &iter, 0, TRUE, 0, 0);
 
        if (logwindow->clip)
               log_window_clip (GTK_WIDGET (text), logwindow->clip_length);
 
        gtk_text_buffer_get_iter_at_offset(buffer, &iter, -1);
        gtk_text_view_scroll_to_iter(text, &iter, 0, TRUE, 0, 0);
+       gtk_text_buffer_place_cursor(buffer, &iter);
 
        return FALSE;
 }
 
        return FALSE;
 }
@@ -239,14 +237,14 @@ static void log_window_clip(GtkWidget *textw, guint clip_length)
        GtkTextBuffer *textbuf = gtk_text_view_get_buffer(textview);
        GtkTextIter start_iter, end_iter;
        
        GtkTextBuffer *textbuf = gtk_text_view_get_buffer(textview);
        GtkTextIter start_iter, end_iter;
        
-       length = gtk_text_buffer_get_char_count (textbuf);
-       debug_print("Log window length: %u\n", length);
+       length = gtk_text_buffer_get_line_count(textbuf);
+       /* debug_print("Log window length: %u\n", length); */
        
        if (length > clip_length) {
                /* find the end of the first line after the cut off
                 * point */
                        point = length - clip_length;
        
        if (length > clip_length) {
                /* find the end of the first line after the cut off
                 * point */
                        point = length - clip_length;
-               gtk_text_buffer_get_iter_at_offset(textbuf, &end_iter, point);
+               gtk_text_buffer_get_iter_at_line(textbuf, &end_iter, point);
                if (!gtk_text_iter_forward_to_line_end(&end_iter))
                        return;
                gtk_text_buffer_get_start_iter(textbuf, &start_iter);
                if (!gtk_text_iter_forward_to_line_end(&end_iter))
                        return;
                gtk_text_buffer_get_start_iter(textbuf, &start_iter);