Fix #314: Remote commands for thumbnail maintenance
[geeqie.git] / src / logwindow.c
index b94725b..e70e9e4 100644 (file)
@@ -1,13 +1,21 @@
 /*
- * Geeqie
- * Copyright (C) 2008 - 2012 The Geeqie Team
+ * Copyright (C) 2008 - 2016 The Geeqie Team
  *
- * Author: Vladimir Nadvornik, Laurent Monin
- * based on logwindow.[ch] from Sylpheed 2.4.7 (C) Hiroyuki Yamamoto
+ * Authors: Vladimir Nadvornik, Laurent Monin
  *
- * This software is released under the GNU General Public License (GNU GPL).
- * Please read the included file COPYING for more information.
- * This software comes with no warranty of any kind, use at your own risk!
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include "main.h"
@@ -26,7 +34,7 @@ struct _LogWindow
        GtkWidget *window;
        GtkWidget *scrolledwin;
        GtkWidget *text;
-       
+
        GdkColor colors[LOG_COUNT];
 
        guint lines;
@@ -57,7 +65,7 @@ static void hide_cb(GtkWidget *widget, LogWindow *logwin)
 static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event,
                            LogWindow *logwin)
 {
-       if (event && event->keyval == GDK_Escape)
+       if (event && event->keyval == GDK_KEY_Escape)
                gtk_widget_hide(logwin->window);
        return FALSE;
 }
@@ -113,8 +121,8 @@ static void log_window_init(LogWindow *logwin)
        GtkTextBuffer *buffer;
 #if !GTK_CHECK_VERSION(3,0,0)
        GdkColormap *colormap;
-#endif
        gboolean success[LOG_COUNT];
+#endif
        gint i;
 
        g_assert(logwin != NULL);
@@ -160,7 +168,7 @@ static void log_window_show(LogWindow *logwin)
        GtkTextView *text = GTK_TEXT_VIEW(logwin->text);
        GtkTextBuffer *buffer;
        GtkTextMark *mark;
-       
+
        g_assert(logwin != NULL);
 
        buffer = gtk_text_view_get_buffer(text);
@@ -229,7 +237,7 @@ void log_window_append(const gchar *str, LogType type)
                                {
                                GList *work = g_list_last(memory);
                                LogMsg *oldest_msg = work->data;
-                       
+
                                g_free(oldest_msg->text);
                                memory = g_list_delete_link(memory, work);
                                }
@@ -259,9 +267,9 @@ void log_window_append(const gchar *str, LogType type)
                {
                GList *prev;
                LogMsg *oldest_msg = work->data;
-               
+
                log_window_insert_text(buffer, &iter, oldest_msg->text, logdefs[oldest_msg->type].tag);
-               
+
                prev = work->prev;
                memory = g_list_delete_link(memory, work);
                work = prev;
@@ -270,14 +278,10 @@ void log_window_append(const gchar *str, LogType type)
 
        log_window_insert_text(buffer, &iter, str, logdefs[type].tag);
 
-#if GTK_CHECK_VERSION(2,20,0)
-       if (gtk_widget_get_visible(text))
-#else
-       if (GTK_WIDGET_VISIBLE(text))
-#endif
+       if (gtk_widget_get_visible(GTK_WIDGET(text)))
                {
                GtkTextMark *mark;
-               
+
                mark = gtk_text_buffer_get_mark(buffer, "end");
                gtk_text_view_scroll_mark_onscreen(text, mark);
                }