inital gtk2 patch
[claws.git] / src / prefs_summary_column.c
index cfb8ea6..e6d3282 100644 (file)
@@ -33,7 +33,7 @@
 #include <gdk/gdkkeysyms.h>
 
 #include "intl.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "prefs_common.h"
 #include "prefs_summary_column.h"
 #include "manage_window.h"
@@ -65,7 +65,7 @@ static struct _SummaryColumnDialog
 
 static const gchar *const col_name[N_SUMMARY_COLS] = {
        N_("Mark"),             /* S_COL_MARK    */
-       N_("Unread"),           /* S_COL_UNREAD  */
+       N_("Status"),           /* S_COL_STATUS  */
        N_("Attachment"),       /* S_COL_MIME    */
        N_("Subject"),          /* S_COL_SUBJECT */
        N_("From"),             /* S_COL_FROM    */
@@ -78,7 +78,7 @@ static const gchar *const col_name[N_SUMMARY_COLS] = {
 
 static SummaryColumnState default_state[N_SUMMARY_COLS] = {
        { S_COL_MARK   , TRUE  },
-       { S_COL_UNREAD , TRUE  },
+       { S_COL_STATUS , TRUE  },
        { S_COL_MIME   , TRUE  },
        { S_COL_SUBJECT, TRUE  },
        { S_COL_FROM   , TRUE  },
@@ -109,7 +109,7 @@ static void prefs_summary_column_cancel     (void);
 static gint prefs_summary_column_delete_event  (GtkWidget      *widget,
                                                 GdkEventAny    *event,
                                                 gpointer        data);
-static void prefs_summary_column_key_pressed   (GtkWidget      *widget,
+static gboolean prefs_summary_column_key_pressed(GtkWidget     *widget,
                                                 GdkEventKey    *event,
                                                 gpointer        data);
 
@@ -169,19 +169,19 @@ static void prefs_summary_column_create(void)
 
        debug_print("Creating summary column setting window...\n");
 
-       window = gtk_window_new(GTK_WINDOW_DIALOG);
+       window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_container_set_border_width(GTK_CONTAINER(window), 8);
-       gtk_window_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
+       gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
        gtk_window_set_modal(GTK_WINDOW(window), TRUE);
        gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
        gtk_window_set_title(GTK_WINDOW(window),
-                            _("Summary display item setting"));
-       gtk_signal_connect(GTK_OBJECT(window), "delete_event",
-                          GTK_SIGNAL_FUNC(prefs_summary_column_delete_event),
-                          NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
-                          GTK_SIGNAL_FUNC(prefs_summary_column_key_pressed),
-                          NULL);
+                            _("Displayed items configuration"));
+       g_signal_connect(G_OBJECT(window), "delete_event",
+                        G_CALLBACK(prefs_summary_column_delete_event),
+                        NULL);
+       g_signal_connect(G_OBJECT(window), "key_press_event",
+                        G_CALLBACK(prefs_summary_column_key_pressed),
+                        NULL);
 
        vbox = gtk_vbox_new(FALSE, 6);
        gtk_widget_show(vbox);
@@ -192,8 +192,8 @@ static void prefs_summary_column_create(void)
        gtk_box_pack_start(GTK_BOX(vbox), label_hbox, FALSE, FALSE, 4);
 
        label = gtk_label_new
-               (_("Select items to be displayed on the summary view. You can modify\n"
-                  "the order by using the Up / Down button, or dragging the items."));
+               (_("Select items to be displayed in the summary view. You can modify\n"
+                  "the order by using the Up / Down buttons or by dragging the items."));
        gtk_widget_show(label);
        gtk_box_pack_start(GTK_BOX(label_hbox), label, FALSE, FALSE, 4);
        gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
@@ -212,7 +212,7 @@ static void prefs_summary_column_create(void)
        gtk_box_pack_start(GTK_BOX(hbox1), clist_hbox, TRUE, TRUE, 0);
 
        scrolledwin = gtk_scrolled_window_new(NULL, NULL);
-       gtk_widget_set_usize(scrolledwin, 180, 210);
+       gtk_widget_set_size_request(scrolledwin, 180, 210);
        gtk_widget_show(scrolledwin);
        gtk_box_pack_start(GTK_BOX(clist_hbox), scrolledwin, TRUE, TRUE, 0);
        gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
@@ -245,17 +245,17 @@ static void prefs_summary_column_create(void)
        gtk_widget_show(remove_btn);
        gtk_box_pack_start(GTK_BOX(btn_vbox1), remove_btn, FALSE, FALSE, 0);
 
-       gtk_signal_connect(GTK_OBJECT(add_btn), "clicked",
-                          GTK_SIGNAL_FUNC(prefs_summary_column_add), NULL);
-       gtk_signal_connect(GTK_OBJECT(remove_btn), "clicked",
-                          GTK_SIGNAL_FUNC(prefs_summary_column_remove), NULL);
+       g_signal_connect(G_OBJECT(add_btn), "clicked",
+                        G_CALLBACK(prefs_summary_column_add), NULL);
+       g_signal_connect(G_OBJECT(remove_btn), "clicked",
+                        G_CALLBACK(prefs_summary_column_remove), NULL);
 
        clist_hbox = gtk_hbox_new(FALSE, 8);
        gtk_widget_show(clist_hbox);
        gtk_box_pack_start(GTK_BOX(hbox1), clist_hbox, TRUE, TRUE, 0);
 
        scrolledwin = gtk_scrolled_window_new(NULL, NULL);
-       gtk_widget_set_usize(scrolledwin, 180, 210);
+       gtk_widget_set_size_request(scrolledwin, 180, 210);
        gtk_widget_show(scrolledwin);
        gtk_box_pack_start(GTK_BOX(clist_hbox), scrolledwin, TRUE, TRUE, 0);
        gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
@@ -290,10 +290,10 @@ static void prefs_summary_column_create(void)
        gtk_widget_show(down_btn);
        gtk_box_pack_start(GTK_BOX(btn_vbox1), down_btn, FALSE, FALSE, 0);
 
-       gtk_signal_connect(GTK_OBJECT(up_btn), "clicked",
-                          GTK_SIGNAL_FUNC(prefs_summary_column_up), NULL);
-       gtk_signal_connect(GTK_OBJECT(down_btn), "clicked",
-                          GTK_SIGNAL_FUNC(prefs_summary_column_down), NULL);
+       g_signal_connect(G_OBJECT(up_btn), "clicked",
+                        G_CALLBACK(prefs_summary_column_up), NULL);
+       g_signal_connect(G_OBJECT(down_btn), "clicked",
+                        G_CALLBACK(prefs_summary_column_down), NULL);
 
        btn_hbox = gtk_hbox_new(FALSE, 8);
        gtk_widget_show(btn_hbox);
@@ -303,12 +303,12 @@ static void prefs_summary_column_create(void)
        gtk_widget_show(btn_vbox);
        gtk_box_pack_start(GTK_BOX(btn_hbox), btn_vbox, FALSE, FALSE, 0);
 
-       default_btn = gtk_button_new_with_label(_(" Revert to default "));
+       default_btn = gtk_button_new_with_label(_(" Use default "));
        gtk_widget_show(default_btn);
        gtk_box_pack_start(GTK_BOX(btn_vbox), default_btn, TRUE, FALSE, 0);
-       gtk_signal_connect(GTK_OBJECT(default_btn), "clicked",
-                          GTK_SIGNAL_FUNC(prefs_summary_column_set_to_default),
-                          NULL);
+       g_signal_connect(G_OBJECT(default_btn), "clicked",
+                        G_CALLBACK(prefs_summary_column_set_to_default),
+                        NULL);
 
        gtkut_button_set_create(&confirm_area, &ok_btn, _("OK"),
                                &cancel_btn, _("Cancel"), NULL, NULL);
@@ -316,10 +316,10 @@ static void prefs_summary_column_create(void)
        gtk_box_pack_end(GTK_BOX(btn_hbox), confirm_area, FALSE, FALSE, 0);
        gtk_widget_grab_default(ok_btn);
 
-       gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
-                          GTK_SIGNAL_FUNC(prefs_summary_column_ok), NULL);
-       gtk_signal_connect(GTK_OBJECT(cancel_btn), "clicked",
-                          GTK_SIGNAL_FUNC(prefs_summary_column_cancel), NULL);
+       g_signal_connect(G_OBJECT(ok_btn), "clicked",
+                        G_CALLBACK(prefs_summary_column_ok), NULL);
+       g_signal_connect(G_OBJECT(cancel_btn), "clicked",
+                        G_CALLBACK(prefs_summary_column_cancel), NULL);
 
        summary_col.window      = window;
        summary_col.stock_clist = stock_clist;
@@ -534,10 +534,11 @@ static gint prefs_summary_column_delete_event(GtkWidget *widget,
        return TRUE;
 }
 
-static void prefs_summary_column_key_pressed(GtkWidget *widget,
-                                            GdkEventKey *event,
-                                            gpointer data)
+static gboolean prefs_summary_column_key_pressed(GtkWidget *widget,
+                                                GdkEventKey *event,
+                                                gpointer data)
 {
        if (event && event->keyval == GDK_Escape)
                summary_col.finished = TRUE;
+       return FALSE;
 }