inital gtk2 patch
[claws.git] / src / editjpilot.c
index 172ea1d..43194e4 100644 (file)
@@ -83,11 +83,12 @@ static gint edit_jpilot_delete_event( GtkWidget *widget, GdkEventAny *event, gbo
        return TRUE;
 }
 
-static void edit_jpilot_key_pressed( GtkWidget *widget, GdkEventKey *event, gboolean *cancelled ) {
+static gboolean edit_jpilot_key_pressed( GtkWidget *widget, GdkEventKey *event, gboolean *cancelled ) {
        if (event && event->keyval == GDK_Escape) {
                *cancelled = TRUE;
                gtk_main_quit();
        }
+       return FALSE;
 }
 
 static void edit_jpilot_ok( GtkWidget *widget, gboolean *cancelled ) {
@@ -195,7 +196,7 @@ static void edit_jpilot_file_check( void ) {
 }
 
 static void edit_jpilot_file_ok( GtkWidget *widget, gpointer data ) {
-       gchar *sFile;
+       const gchar *sFile;
        AddressFileSelection *afs;
        GtkWidget *fileSel;
 
@@ -224,10 +225,10 @@ static void edit_jpilot_file_select_create( AddressFileSelection *afs ) {
 
        fileSelector = gtk_file_selection_new( _("Select JPilot File") );
        gtk_file_selection_hide_fileop_buttons( GTK_FILE_SELECTION(fileSelector) );
-       gtk_signal_connect( GTK_OBJECT (GTK_FILE_SELECTION(fileSelector)->ok_button),
-                             "clicked", GTK_SIGNAL_FUNC (edit_jpilot_file_ok), ( gpointer ) afs );
-       gtk_signal_connect( GTK_OBJECT (GTK_FILE_SELECTION(fileSelector)->cancel_button),
-                             "clicked", GTK_SIGNAL_FUNC (edit_jpilot_file_cancel), ( gpointer ) afs );
+       g_signal_connect( G_OBJECT (GTK_FILE_SELECTION(fileSelector)->ok_button),
+                         "clicked", G_CALLBACK (edit_jpilot_file_ok), ( gpointer ) afs );
+       g_signal_connect( G_OBJECT (GTK_FILE_SELECTION(fileSelector)->cancel_button),
+                         "clicked", G_CALLBACK (edit_jpilot_file_cancel), ( gpointer ) afs );
        afs->fileSelector = fileSelector;
        afs->cancelled = TRUE;
 }
@@ -267,18 +268,18 @@ static void addressbook_edit_jpilot_create( gboolean *cancelled ) {
        GtkWidget *statusbar;
        gint top, i;
 
-       window = gtk_window_new(GTK_WINDOW_DIALOG);
-       gtk_widget_set_usize(window, 450, -1);
+       window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+       gtk_widget_set_size_request(window, 450, -1);
        gtk_container_set_border_width(GTK_CONTAINER(window), 0);
        gtk_window_set_title(GTK_WINDOW(window), _("Edit JPilot Entry"));
        gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
        gtk_window_set_modal(GTK_WINDOW(window), TRUE); 
-       gtk_signal_connect(GTK_OBJECT(window), "delete_event",
-                          GTK_SIGNAL_FUNC(edit_jpilot_delete_event),
-                          cancelled);
-       gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
-                          GTK_SIGNAL_FUNC(edit_jpilot_key_pressed),
-                          cancelled);
+       g_signal_connect(G_OBJECT(window), "delete_event",
+                        G_CALLBACK(edit_jpilot_delete_event),
+                        cancelled);
+       g_signal_connect(G_OBJECT(window), "key_press_event",
+                        G_CALLBACK(edit_jpilot_key_pressed),
+                        cancelled);
 
        vbox = gtk_vbox_new(FALSE, 8);
        gtk_container_add(GTK_CONTAINER(window), vbox);
@@ -350,14 +351,14 @@ static void addressbook_edit_jpilot_create( gboolean *cancelled ) {
        hsep = gtk_hseparator_new();
        gtk_box_pack_end(GTK_BOX(vbox), hsep, FALSE, FALSE, 0);
 
-       gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
-                          GTK_SIGNAL_FUNC(edit_jpilot_ok), cancelled);
-       gtk_signal_connect(GTK_OBJECT(cancel_btn), "clicked",
-                          GTK_SIGNAL_FUNC(edit_jpilot_cancel), cancelled);
-       gtk_signal_connect(GTK_OBJECT(file_btn), "clicked",
-                          GTK_SIGNAL_FUNC(edit_jpilot_file_select), NULL);
-       gtk_signal_connect(GTK_OBJECT(check_btn), "clicked",
-                          GTK_SIGNAL_FUNC(edit_jpilot_file_check), NULL);
+       g_signal_connect(G_OBJECT(ok_btn), "clicked",
+                        G_CALLBACK(edit_jpilot_ok), cancelled);
+       g_signal_connect(G_OBJECT(cancel_btn), "clicked",
+                        G_CALLBACK(edit_jpilot_cancel), cancelled);
+       g_signal_connect(G_OBJECT(file_btn), "clicked",
+                        G_CALLBACK(edit_jpilot_file_select), NULL);
+       g_signal_connect(G_OBJECT(check_btn), "clicked",
+                        G_CALLBACK(edit_jpilot_file_check), NULL);
 
        gtk_widget_show_all(vbox);