From: Jose Dapena Paz Date: Thu, 9 Oct 2008 10:34:04 +0000 (+0000) Subject: * Remove cancel button in move to folder dialog. X-Git-Tag: git_migration_finished~1164 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=a94369d25da41b17c58482707f46914350271572 * Remove cancel button in move to folder dialog. * Fix wizard buttons translation. * Now "New folder" button works again in move to folder dialog. * Reworked the way we retrieve the buttons in move to folders dialog, to be a bit more clean. pmo-trunk-r5977 --- diff --git a/src/hildon2/modest-maemo-global-settings-dialog.c b/src/hildon2/modest-maemo-global-settings-dialog.c index f445457..69c061f 100644 --- a/src/hildon2/modest-maemo-global-settings-dialog.c +++ b/src/hildon2/modest-maemo-global-settings-dialog.c @@ -145,7 +145,7 @@ modest_maemo_global_settings_dialog_init (ModestMaemoGlobalSettingsDialog *self) ppriv->updating_page = create_updating_page (self); /* Add the buttons: */ - gtk_dialog_add_button (GTK_DIALOG (self), _HL("wdgt_bd_save "), GTK_RESPONSE_OK); + gtk_dialog_add_button (GTK_DIALOG (self), _HL("wdgt_bd_save"), GTK_RESPONSE_OK); /* Set the default focusable widgets */ g_object_set_data (G_OBJECT(ppriv->updating_page), DEFAULT_FOCUS_WIDGET, diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 945a469..7d3ec7e 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -88,6 +88,8 @@ #include #define MIN_FREE_SPACE 5 * 1024 * 1024 +#define MOVE_FOLDER_OK_BUTTON "ok-button" +#define MOVE_FOLDER_NEW_BUTTON "new-button" typedef struct _GetMsgAsyncHelper { ModestWindow *window; @@ -4451,7 +4453,6 @@ on_move_to_dialog_folder_selection_changed (ModestFolderView* self, { GtkWidget *dialog = NULL; GtkWidget *ok_button = NULL, *new_button = NULL; - GList *children = NULL; gboolean ok_sensitive = TRUE, new_sensitive = TRUE; gboolean moving_folder = FALSE; gboolean is_local_account = TRUE; @@ -4468,15 +4469,8 @@ on_move_to_dialog_folder_selection_changed (ModestFolderView* self, if (!dialog) return; - children = gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area)); -#ifndef MODEST_TOOLKIT_GTK - ok_button = GTK_WIDGET (children->next->next->data); - new_button = GTK_WIDGET (children->next->data); -#else - ok_button = GTK_WIDGET (children->data); - new_button = GTK_WIDGET (children->next->next->data); -#endif - g_list_free (children); + ok_button = g_object_get_data (G_OBJECT (dialog), MOVE_FOLDER_OK_BUTTON); + new_button = g_object_get_data (G_OBJECT (dialog), MOVE_FOLDER_NEW_BUTTON); /* check if folder_store is an remote account */ if (TNY_IS_ACCOUNT (folder_store)) { @@ -4607,7 +4601,7 @@ create_move_to_dialog (GtkWindow *win, GtkWidget **tree_view) { GtkWidget *dialog, *scroll; - GtkWidget *new_button; + GtkWidget *new_button, *ok_button; dialog = gtk_dialog_new_with_buttons (_("mcen_ti_moveto_folders_title"), GTK_WINDOW (win), @@ -4615,12 +4609,15 @@ create_move_to_dialog (GtkWindow *win, NULL); #ifndef MODEST_TOOLKIT_GTK - gtk_dialog_add_button (GTK_DIALOG (dialog), _("mcen_bd_dialog_ok"), GTK_RESPONSE_ACCEPT); + ok_button = gtk_dialog_add_button (GTK_DIALOG (dialog), _("mcen_bd_dialog_ok"), GTK_RESPONSE_ACCEPT); /* 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 gtk_dialog_add_button (GTK_DIALOG (dialog), _("mcen_bd_dialog_cancel"), GTK_RESPONSE_REJECT); +#endif #else /* We do this manually so GTK+ does not associate a response ID for * the button. */ @@ -4628,10 +4625,12 @@ create_move_to_dialog (GtkWindow *win, gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), new_button, FALSE, FALSE, 0); gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (GTK_DIALOG (dialog)->action_area), new_button, TRUE); gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT); - gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_OK, GTK_RESPONSE_ACCEPT); + ok_button = gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_OK, GTK_RESPONSE_ACCEPT); gtk_container_set_border_width (GTK_CONTAINER (dialog), 12); gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 24); #endif + g_object_set_data (G_OBJECT (dialog), MOVE_FOLDER_OK_BUTTON, ok_button); + g_object_set_data (G_OBJECT (dialog), MOVE_FOLDER_NEW_BUTTON, new_button); /* Create scrolled window */ scroll = gtk_scrolled_window_new (NULL, NULL); diff --git a/src/widgets/modest-wizard-dialog.c b/src/widgets/modest-wizard-dialog.c index 975cf7e..b6e8dd4 100644 --- a/src/widgets/modest-wizard-dialog.c +++ b/src/widgets/modest-wizard-dialog.c @@ -286,9 +286,9 @@ init (ModestWizardDialog *wizard_dialog) gtk_dialog_add_button (dialog, _HL("ecdg_bd_wizard_cancel"), MODEST_WIZARD_DIALOG_CANCEL); #endif #ifdef MODEST_TOOLKIT_HILDON2 - gtk_dialog_add_button (dialog, _HL("wdgt_bd_finish "), MODEST_WIZARD_DIALOG_FINISH); - gtk_dialog_add_button (dialog, _HL("wdgt_bd_previous "), MODEST_WIZARD_DIALOG_PREVIOUS); - gtk_dialog_add_button (dialog, _HL("wdgt_bd_next "), MODEST_WIZARD_DIALOG_NEXT); + gtk_dialog_add_button (dialog, _HL("wdgt_bd_finish"), MODEST_WIZARD_DIALOG_FINISH); + gtk_dialog_add_button (dialog, _HL("wdgt_bd_previous"), MODEST_WIZARD_DIALOG_PREVIOUS); + gtk_dialog_add_button (dialog, _HL("wdgt_bd_next"), MODEST_WIZARD_DIALOG_NEXT); #endif #ifdef MODEST_TOOLKIT_GTK gtk_dialog_add_button (dialog, GTK_STOCK_SAVE, MODEST_WIZARD_DIALOG_FINISH);