Implement confirm action in move to dialog
authorJose Dapena Paz <jdapena@igalia.com>
Tue, 17 Mar 2009 18:53:44 +0000 (18:53 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Tue, 17 Mar 2009 18:53:44 +0000 (18:53 +0000)
pmo-trunk-r8105

src/hildon2/modest-platform.c

index 90c66d0..4b2d5c2 100644 (file)
@@ -2685,6 +2685,26 @@ on_move_to_dialog_selection_changed (GtkTreeSelection       *selection,
        }
 }
 
+static void
+on_move_to_dialog_action_clicked (GtkButton       *selection,
+                                 gpointer           user_data)
+{
+       TnyFolderStore *selected;
+       GtkWidget *dialog;
+       GtkWidget *folder_view;
+       gboolean showing_folders;
+
+       dialog = (GtkWidget *) user_data;
+       showing_folders = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (dialog), MOVE_TO_DIALOG_SHOWING_FOLDERS));
+       if (showing_folders) {          
+               folder_view = GTK_WIDGET (g_object_get_data (G_OBJECT (dialog), MOVE_TO_DIALOG_FOLDER_VIEW));
+               selected = modest_folder_view_get_selected (MODEST_FOLDER_VIEW (folder_view));
+
+               if (selected)
+                       gtk_dialog_response  (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
+       }
+}
+
 GtkWidget *
 modest_platform_create_move_to_dialog (GtkWindow *parent_window,
                                       GtkWidget **folder_view)
@@ -2777,6 +2797,10 @@ modest_platform_create_move_to_dialog (GtkWindow *parent_window,
                          G_CALLBACK (on_move_to_dialog_selection_changed),
                          dialog);
 
+       g_signal_connect (action_button, "clicked",
+                         G_CALLBACK (on_move_to_dialog_action_clicked),
+                         dialog);
+
        g_signal_connect (back_button, "clicked",
                          G_CALLBACK (on_move_to_dialog_back_clicked),
                          dialog);