GTK_WIDGET (user_data));
}
+#ifndef MODEST_TOOLKIT_HILDON2
/*
* This function is used to track changes in the selection of the
* folder view that is inside the "move to" dialog to enable/disable
/* Set sensitivity of the NEW button */
gtk_widget_set_sensitive (new_button, new_sensitive);
}
+#endif
+
+#ifdef MODEST_TOOLKIT_HILDON2
+static void
+on_move_to_dialog_folder_activated (GtkTreeView *tree_view,
+ GtkTreePath *path,
+ GtkTreeViewColumn *column,
+ gpointer user_data)
+{
+ gtk_dialog_response (GTK_DIALOG (user_data), GTK_RESPONSE_ACCEPT);
+}
+#endif
#define MODEST_MOVE_TO_DIALOG_FOLDER_VIEW "move-to-dialog-folder-view"
GtkWidget *pannable;
#else
GtkWidget *scroll;
+ GtkWidget *ok_button;
#endif
- GtkWidget *new_button, *ok_button;
+ GtkWidget *new_button;
dialog = gtk_dialog_new_with_buttons (_("mcen_ti_moveto_folders_title"),
GTK_WINDOW (win),
NULL);
#ifndef MODEST_TOOLKIT_GTK
+#ifndef MODEST_TOOLKIT_HILDON2
ok_button = gtk_dialog_add_button (GTK_DIALOG (dialog), _("mcen_bd_dialog_ok"), GTK_RESPONSE_ACCEPT);
+#endif
/* We do this manually so GTK+ does not associate a response ID for
* the button. */
new_button = gtk_button_new_from_stock (_("mcen_bd_new"));
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->action_area), new_button, FALSE, FALSE, 0);
- gtk_widget_show (new_button);
#ifndef MODEST_TOOLKIT_HILDON2
+ hildon_gtk_widget_set_theme_size (new_button, HILDON_SIZE_FINGER_HEIGHT);
gtk_dialog_add_button (GTK_DIALOG (dialog), _("mcen_bd_dialog_cancel"), GTK_RESPONSE_REJECT);
#endif
+ gtk_widget_show (new_button);
#else
/* We do this manually so GTK+ does not associate a response ID for
* the button. */
gtk_container_set_border_width (GTK_CONTAINER (dialog), 12);
gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 24);
#endif
+
+#ifndef MODEST_TOOLKIT_HILDON2
g_object_set_data (G_OBJECT (dialog), MOVE_FOLDER_OK_BUTTON, ok_button);
+#endif
g_object_set_data (G_OBJECT (dialog), MOVE_FOLDER_NEW_BUTTON, new_button);
/* Create scrolled window */
/* Create folder view */
*tree_view = modest_platform_create_folder_view (NULL);
+#ifdef MODEST_TOOLKIT_HILDON2
+ /* We return OK on activation */
+ g_signal_connect (*tree_view,
+ "row-activated",
+ G_CALLBACK (on_move_to_dialog_folder_activated),
+ dialog);
+#else
/* Track changes in the selection to
* disable the OK button whenever "Move to" is not possible
* disbale NEW button whenever New is not possible */
"folder_selection_changed",
G_CALLBACK (on_move_to_dialog_folder_selection_changed),
win);
+#endif
/* Listen to clicks on New button */
g_signal_connect (G_OBJECT (new_button),