2008-11-30 [paul] 3.6.1cvs54
[claws.git] / src / gtk / prefswindow.c
index 2331cabd34f3bd97b2069ed2e52728f7426674c5..292daedf2f6b2d9b7074f8ffe3e2a06b08350a4e 100644 (file)
@@ -25,7 +25,6 @@
 #include <glib/gi18n.h>
 #include <string.h>
 #include <gtk/gtk.h>
-#include <gtk/gtktext.h>
 #include <gdk/gdkkeysyms.h>
 
 #include "utils.h"
@@ -71,7 +70,7 @@ struct _PrefsWindow
 
        gpointer         data;
        GSList          *prefs_pages;
-       GtkDestroyNotify func;
+       GDestroyNotify func;
 };
 
 struct _PrefsTreeNode
@@ -132,7 +131,7 @@ static void close_all_pages(GSList *prefs_pages)
        }       
 }
 
-#ifdef MAEMO
+#ifdef GENERIC_UMPC
 static void prefs_show_sections(PrefsWindow *prefswindow)
 {
        gint max;
@@ -167,7 +166,7 @@ static void apply_button_clicked(GtkButton *button, gpointer user_data)
        PrefsWindow *prefswindow = (PrefsWindow *) user_data;
 
        save_all_pages(prefswindow->prefs_pages);
-#ifdef MAEMO
+#ifdef GENERIC_UMPC
        prefs_show_sections(prefswindow);
 #endif
 }
@@ -209,7 +208,7 @@ static gboolean window_closed(GtkWidget *widget, GdkEvent *event, gpointer user_
 {
        PrefsWindow *prefswindow = (PrefsWindow *) user_data;
 
-#ifdef MAEMO
+#ifdef GENERIC_UMPC
        save_all_pages(prefswindow->prefs_pages);
 #endif
        close_prefs_window(prefswindow);
@@ -317,7 +316,7 @@ static void prefswindow_build_tree(GtkWidget *tree_view, GSList *prefs_pages,
                        (GTK_TREE_VIEW(tree_view)));
        GSList *cur;
        gint index; /* index in pages list */
-#ifndef MAEMO
+#ifndef GENERIC_UMPC
        GtkTreeSelection *selection;
        GtkTreeIter iter;
 #endif
@@ -399,7 +398,7 @@ static void prefswindow_build_tree(GtkWidget *tree_view, GSList *prefs_pages,
                prefswindow_build_all_pages(prefswindow, prefs_pages);
 
        /* select first one or its first child if necessary */
-#ifndef MAEMO
+#ifndef GENERIC_UMPC
        selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view));
        if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) {
                if (activate_child && gtk_tree_model_iter_has_child(GTK_TREE_MODEL(store), &iter)) {
@@ -413,7 +412,7 @@ static void prefswindow_build_tree(GtkWidget *tree_view, GSList *prefs_pages,
 }
 
 void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
-                                                        gpointer data, GtkDestroyNotify func,
+                                                        gpointer data, GDestroyNotify func,
                                                         gint *save_width, gint *save_height,
                                                         gboolean preload_pages, gboolean activate_child,
                                                         PrefsOpenCallbackFunc open_cb,
@@ -518,7 +517,7 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
 
        gtk_widget_grab_focus(prefswindow->tree_view);
 
-#ifndef MAEMO
+#ifndef GENERIC_UMPC
        gtkut_stock_button_set_create(&prefswindow->confirm_area,
                                      &prefswindow->apply_btn,  GTK_STOCK_APPLY,
                                      &prefswindow->cancel_btn, GTK_STOCK_CANCEL,
@@ -536,7 +535,7 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
 
        gtk_box_pack_start(GTK_BOX(prefswindow->vbox), prefswindow->confirm_area, FALSE, FALSE, 0);
 
-#ifndef MAEMO
+#ifndef GENERIC_UMPC
        g_signal_connect(G_OBJECT(prefswindow->ok_btn), "clicked", 
                         G_CALLBACK(ok_button_clicked), prefswindow);
        g_signal_connect(G_OBJECT(prefswindow->cancel_btn), "clicked", 
@@ -583,7 +582,7 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
                                            *(prefswindow->save_height));
        }
 
-#ifdef MAEMO
+#ifdef GENERIC_UMPC
        prefs_show_sections(prefswindow);
 #endif
        gtk_widget_show(prefswindow->window);
@@ -691,7 +690,9 @@ static gboolean prefswindow_row_selected(GtkTreeSelection *selector,
        GtkTreeIter iter;
        GtkAdjustment *adj;
 
-#ifndef MAEMO
+       if (gtk_tree_path_get_depth(path) < 2)
+               return FALSE;
+#ifndef GENERIC_UMPC
        if (currently_selected) 
                return TRUE;
 #endif
@@ -739,7 +740,7 @@ static gboolean prefswindow_row_selected(GtkTreeSelection *selector,
        gtk_adjustment_set_value(adj, adj->lower);
        gtk_adjustment_changed(adj);
 
-#ifdef MAEMO
+#ifdef GENERIC_UMPC
        prefs_show_page(prefswindow);
 #endif
        return TRUE;