g_return_if_fail (MODEST_IS_ACCOUNTS_WINDOW(self));
/* Settings menu buttons */
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_new_account"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_new_account"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_new_account),
NULL);
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_edit_accounts"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_edit_accounts"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_accounts),
NULL);
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_options"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_options"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_settings),
NULL);
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_globalsmtpservers"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_globalsmtpservers"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_smtp_servers),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_tools_smtp_servers));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_viewer_newemail"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_viewer_newemail"), "<Control>n",
APP_MENU_CALLBACK (modest_ui_actions_on_new_msg),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_new_msg));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_sendandreceive"),
+ 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_all));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_outbox_cancelsend"),
+ 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));
}
g_return_if_fail (MODEST_IS_FOLDER_WINDOW(self));
/* folders actions */
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_new_folder"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_new_folder"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_new_folder),
NULL);
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_user_renamefolder"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_user_renamefolder"), NULL,
APP_MENU_CALLBACK (set_rename_edit_mode),
NULL);
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_move_folder"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_move_folder"), NULL,
APP_MENU_CALLBACK (set_moveto_edit_mode),
NULL);
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_delete_folder"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_delete_folder"), NULL,
APP_MENU_CALLBACK (set_delete_edit_mode),
NULL);
/* new message */
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_viewer_newemail"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_viewer_newemail"), "<Ctrl>n",
APP_MENU_CALLBACK (modest_ui_actions_on_new_msg),
NULL);
/* send receive actions should be only one visible always */
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_sendandreceive"),
+ 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_all));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_outbox_cancelsend"),
+ 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));
/* Settings menu buttons */
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_new_accounts"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_new_accounts"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_new_account),
NULL);
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_edit_accounts"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_edit_accounts"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_accounts),
NULL);
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_options"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_options"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_settings),
NULL);
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_globalsmtpservers"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_globalsmtpservers"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_smtp_servers),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_tools_smtp_servers));
{
g_return_if_fail (MODEST_IS_HEADER_WINDOW(self));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_moveto"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_moveto"), NULL,
APP_MENU_CALLBACK (set_moveto_edit_mode),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_delete));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_delete"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_delete"), NULL,
APP_MENU_CALLBACK (set_delete_edit_mode),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_move_to));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_messagedetails"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_messagedetails"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_details),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_details));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_sort"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_sort"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_sort),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_sort));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_viewer_newemail"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_viewer_newemail"), "<Control>n",
APP_MENU_CALLBACK (modest_ui_actions_on_new_msg),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_new_msg));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_sendandreceive"),
+ 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"),
+ 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));
}
GtkWidget *app_menu;
ModestDimmingRulesGroup *app_menu_dimming_group;
+ GtkAccelGroup *accel_group;
/* Edit mode support */
gboolean edit_mode;
parent_priv = MODEST_WINDOW_GET_PRIVATE (self);
priv = MODEST_HILDON2_WINDOW_GET_PRIVATE (self);
+ priv->accel_group = gtk_accel_group_new ();
+
priv->edit_mode = FALSE;
priv->edit_toolbar = NULL;
priv->current_edit_tree_view = NULL;
parent_priv->ui_dimming_manager = modest_ui_dimming_manager_new();
priv->app_menu_dimming_group = modest_dimming_rules_group_new (MODEST_DIMMING_RULES_MENU, FALSE);
+ gtk_window_add_accel_group (GTK_WINDOW (self), priv->accel_group);
setup_menu (self);
void
modest_hildon2_window_add_to_menu (ModestHildon2Window *self,
gchar *label,
+ const gchar *accelerator,
ModestHildon2AppMenuCallback callback,
ModestDimmingCallback dimming_callback)
{
g_signal_connect_after (G_OBJECT (button), "clicked",
G_CALLBACK (callback), (gpointer) self);
+ if (accelerator != NULL) {
+ guint accel_key;
+ GdkModifierType accel_mods;
+
+ gtk_accelerator_parse (accelerator, &accel_key, &accel_mods);
+ gtk_widget_add_accelerator (button, "clicked", priv->accel_group,
+ accel_key, accel_mods, 0);
+ }
+
modest_hildon2_window_add_button_to_menu (self, GTK_BUTTON (button), dimming_callback);
}
void
modest_hildon2_window_add_to_menu (ModestHildon2Window *self,
gchar *label,
+ const gchar *accelerator,
ModestHildon2AppMenuCallback callback,
ModestDimmingCallback dimming_callback);
priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (self);
/* Settings menu buttons */
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_editor_checknames"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_editor_checknames"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_check_names),
NULL);
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_undo"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_undo"), "<Ctrl>z",
APP_MENU_CALLBACK (modest_ui_actions_on_undo),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_undo));
g_signal_connect (G_OBJECT (priv->bcc_button), "toggled",
G_CALLBACK (on_bcc_button_toggled), (gpointer) self);
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_editor_attach_inlineimage"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_editor_attach_inlineimage"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_insert_image),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_set_style));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_remove_attachments"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_remove_attachments"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_remove_attachments),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_editor_remove_attachment));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_message_settings"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_message_settings"), NULL,
APP_MENU_CALLBACK (on_message_settings),
NULL);
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_viewer_find"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_viewer_find"), "<Ctrl>f",
APP_MENU_CALLBACK (modest_ui_actions_on_toggle_find_in_page),
NULL);
}
g_return_if_fail (MODEST_IS_MSG_VIEW_WINDOW(self));
/* Settings menu buttons */
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_replytoall"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_replytoall"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_reply_all),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_reply_msg));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_forward"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_forward"), "<Control>d",
APP_MENU_CALLBACK (modest_ui_actions_on_forward),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_reply_msg));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_mark_as_read"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_mark_as_read"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_mark_as_read),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_mark_as_read_msg_in_view));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_mark_as_unread"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_mark_as_unread"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_mark_as_unread),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_mark_as_unread_msg_in_view));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_viewer_save_attachments"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_viewer_save_attachments"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_save_attachments),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_save_attachments));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_remove_attachments"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_remove_attachments"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_remove_attachments),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_remove_attachments));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_viewer_newemail"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_viewer_newemail"), "<Control>n",
APP_MENU_CALLBACK (modest_ui_actions_on_new_msg),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_new_msg));
- modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_viewer_addtocontacts"),
+ modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_viewer_addtocontacts"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_add_to_contacts),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_add_to_contacts));
}