X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fhildon2%2Fmodest-folder-window.c;h=df05c43de4a24112b8de73e7a9ee98dbec995128;hb=fd1d9e254d08ad38779f8a1bb5c4d6d350040a9b;hp=9de1b803af857f3b0d163df523a34a404e09e91c;hpb=6605b1588654686216ad83af0a184367e38fc296;p=modest diff --git a/src/hildon2/modest-folder-window.c b/src/hildon2/modest-folder-window.c index 9de1b80..df05c43 100644 --- a/src/hildon2/modest-folder-window.c +++ b/src/hildon2/modest-folder-window.c @@ -53,6 +53,7 @@ #include #include "modest-text-utils.h" #include "modest-tny-account.h" +#include "modest-account-protocol.h" typedef enum { EDIT_MODE_COMMAND_MOVE = 1, @@ -299,7 +300,7 @@ modest_folder_window_new (TnyFolderStoreQuery *query) G_CALLBACK (edit_mode_changed), (gpointer) self); action_area_box = hildon_tree_view_get_action_area_box (GTK_TREE_VIEW (priv->folder_view)); - priv->new_message_button = hildon_button_new (0, HILDON_BUTTON_ARRANGEMENT_HORIZONTAL); + priv->new_message_button = hildon_button_new (MODEST_EDITABLE_SIZE, HILDON_BUTTON_ARRANGEMENT_HORIZONTAL); hildon_button_set_title (HILDON_BUTTON (priv->new_message_button), _("mcen_ti_new_message")); new_message_pixbuf = modest_platform_get_icon ("general_add", MODEST_ICON_SIZE_BIG); @@ -319,7 +320,7 @@ modest_folder_window_new (TnyFolderStoreQuery *query) priv->top_vbox = gtk_vbox_new (0, FALSE); top_alignment = gtk_alignment_new (0.0, 0.0, 1.0, 1.0); gtk_alignment_set_padding (GTK_ALIGNMENT (top_alignment), - 0, 0, + HILDON_MARGIN_HALF, 0, HILDON_MARGIN_DOUBLE, HILDON_MARGIN_DOUBLE); gtk_container_add (GTK_CONTAINER (pannable), priv->folder_view); @@ -463,6 +464,38 @@ modest_folder_window_set_mailbox (ModestFolderWindow *self, } static void +edit_account (GtkButton *button, + ModestFolderWindow *self) +{ + const gchar *account_name; + + account_name = modest_window_get_active_account ((ModestWindow *) self); + if (modest_ui_actions_check_for_active_account ((ModestWindow *) self, account_name)) { + /* Show the account settings dialog */ + ModestAccountProtocol *proto; + ModestProtocolType proto_type; + + /* Get proto */ + proto_type = modest_account_mgr_get_store_protocol (modest_runtime_get_account_mgr (), + account_name); + proto = (ModestAccountProtocol *) + modest_protocol_registry_get_protocol_by_type (modest_runtime_get_protocol_registry (), + proto_type); + + /* Create and show the dialog */ + if (proto && MODEST_IS_ACCOUNT_PROTOCOL (proto)) { + ModestAccountSettingsDialog *dialog = + modest_account_protocol_get_account_settings_dialog (proto, account_name); + modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), + (GtkWindow *) dialog, + (GtkWindow *) self); + gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), FALSE); + gtk_widget_show (GTK_WIDGET (dialog)); + } + } +} + +static void setup_menu (ModestFolderWindow *self) { g_return_if_fail (MODEST_IS_FOLDER_WINDOW(self)); @@ -482,15 +515,21 @@ setup_menu (ModestFolderWindow *self) MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_folder_window_delete)); /* send receive actions should be only one visible always */ - modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), - _("mcen_me_inbox_sendandreceive"), - NULL, + modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_sendandreceive"), NULL, APP_MENU_CALLBACK (modest_ui_actions_on_send_receive), MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_send_receive)); modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_outbox_cancelsend"), NULL, APP_MENU_CALLBACK (modest_ui_actions_cancel_send), MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_cancel_sending_all)); + + modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), + dngettext(GETTEXT_PACKAGE, + "mcen_me_edit_account", + "mcen_me_edit_accounts", + 1), + NULL, APP_MENU_CALLBACK (edit_account), + MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_edit_accounts)); } static void