2009-01-09 [colin] 3.7.0cvs25
[claws.git] / src / foldersel.c
index bc24af354e1da64df6b79209901228b69f66e241..4e17c959726c67c7b3f4374deb35f5b2244d018e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2009 Hiroyuki Yamamoto and the Claws Mail team
  *
  * 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
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <gdk/gdkkeysyms.h>
-#include <gtk/gtkmain.h>
-#include <gtk/gtkwidget.h>
-#include <gtk/gtktreestore.h>
-#include <gtk/gtktreeview.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtkvbox.h>
-#include <gtk/gtkscrolledwindow.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkhbbox.h>
-#include <gtk/gtksignal.h>
+#include <gtk/gtk.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <string.h>
@@ -71,9 +62,9 @@ struct _FolderItemSearch
        GtkTreeIter iter;
 };
 
-static GdkPixbuf *folder_pixbuf;
-static GdkPixbuf *folderopen_pixbuf;
-static GdkPixbuf *foldernoselect_pixbuf;
+static GdkPixbuf *folder_pixbuf = NULL;
+static GdkPixbuf *folderopen_pixbuf = NULL;
+static GdkPixbuf *foldernoselect_pixbuf = NULL;
 
 static GtkWidget *window;
 static GtkWidget *treeview;
@@ -269,8 +260,10 @@ static void foldersel_create(void)
        gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), FALSE);
        gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview),
                                     prefs_common.use_stripes_everywhere);
+#if GTK_CHECK_VERSION(2,10,0)
        gtk_tree_view_set_enable_tree_lines(GTK_TREE_VIEW(treeview),
                                                        prefs_common.enable_dotted_lines);
+#endif
        gtk_tree_view_set_search_column(GTK_TREE_VIEW(treeview),
                                        FOLDERSEL_FOLDERNAME);
 
@@ -309,7 +302,7 @@ static void foldersel_create(void)
        gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
 
        entry = gtk_entry_new();
-       gtk_entry_set_editable(GTK_ENTRY(entry), FALSE);
+       gtk_editable_set_editable(GTK_EDITABLE(entry), FALSE);
        gtk_box_pack_start(GTK_BOX(vbox), entry, FALSE, FALSE, 0);
        g_signal_connect(G_OBJECT(entry), "activate",
                         G_CALLBACK(foldersel_entry_activated), NULL);
@@ -352,6 +345,16 @@ static void foldersel_init(void)
                         &foldernoselect_pixbuf);
 }
 
+void foldersel_reflect_prefs_pixmap_theme(void){
+       if (folder_pixbuf)
+               g_object_unref(folder_pixbuf);
+       if (folderopen_pixbuf)
+               g_object_unref(folderopen_pixbuf);
+       if (foldernoselect_pixbuf)
+               g_object_unref(foldernoselect_pixbuf);
+       foldersel_init();
+}
+
 static void foldersel_append_item(GtkTreeStore *store, FolderItem *item,
                                  GtkTreeIter *iter, GtkTreeIter *parent)
 {