+
+void
+modest_ui_actions_on_change_zoom (GtkRadioAction *action,
+ GtkRadioAction *selected,
+ ModestWindow *window)
+{
+ gint value;
+
+ value = gtk_radio_action_get_current_value (selected);
+ if (MODEST_IS_WINDOW (window)) {
+ modest_window_set_zoom (MODEST_WINDOW (window), ((gdouble)value)/100);
+ }
+}
+
+void
+modest_ui_actions_on_zoom_plus (GtkAction *action,
+ ModestWindow *window)
+{
+ g_return_if_fail (MODEST_IS_WINDOW (window));
+
+ modest_window_zoom_plus (MODEST_WINDOW (window));
+}
+
+void
+modest_ui_actions_on_zoom_minus (GtkAction *action,
+ ModestWindow *window)
+{
+ g_return_if_fail (MODEST_IS_WINDOW (window));
+
+ modest_window_zoom_minus (MODEST_WINDOW (window));
+}
+
+void
+modest_ui_actions_on_toggle_fullscreen (GtkToggleAction *toggle,
+ ModestWindow *window)
+{
+ ModestWindowMgr *mgr;
+ gboolean fullscreen, active;
+ g_return_if_fail (MODEST_IS_WINDOW (window));
+
+ mgr = modest_runtime_get_window_mgr ();
+
+ active = (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (toggle)))?1:0;
+ fullscreen = modest_window_mgr_get_fullscreen_mode (mgr);
+
+ if (active != fullscreen) {
+ modest_window_mgr_set_fullscreen_mode (mgr, active);
+ gtk_window_present (GTK_WINDOW (window));
+ }
+}
+
+void
+modest_ui_actions_on_change_fullscreen (GtkAction *action,
+ ModestWindow *window)
+{
+ ModestWindowMgr *mgr;
+ gboolean fullscreen;
+
+ g_return_if_fail (MODEST_IS_WINDOW (window));
+
+ mgr = modest_runtime_get_window_mgr ();
+ fullscreen = modest_window_mgr_get_fullscreen_mode (mgr);
+ modest_window_mgr_set_fullscreen_mode (mgr, !fullscreen);
+
+ gtk_window_present (GTK_WINDOW (window));
+}
+
+static void
+modest_ui_actions_message_details_cb (gpointer msg_data,
+ gpointer helper_data)
+{
+ GtkWidget *dialog;
+ TnyMsg *msg = (TnyMsg *) msg_data;
+ TnyHeader *header;
+ GetMsgAsyncHelper *helper = (GetMsgAsyncHelper *) helper_data;
+
+ header = tny_msg_get_header (msg);
+
+ dialog = modest_msg_view_details_dialog_new (GTK_WINDOW (helper->window), header);
+ g_object_unref (header);
+ gtk_widget_show_all (dialog);
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+
+ gtk_widget_destroy (dialog);
+}
+
+void
+modest_ui_actions_on_message_details (GtkAction *action,
+ ModestWindow *win)
+{
+ TnyList * headers_list;
+ GetMsgAsyncHelper *helper;
+
+ headers_list = get_selected_headers (win);
+ if (!headers_list)
+ return;
+
+ helper = g_slice_new0 (GetMsgAsyncHelper);
+ helper->window = win;
+ helper->func = modest_ui_actions_message_details_cb;
+ helper->iter = tny_list_create_iterator (headers_list);
+ helper->user_data = NULL;
+
+ if (MODEST_IS_MSG_VIEW_WINDOW (win)) {
+ TnyMsg *msg;
+
+ msg = modest_msg_view_window_get_message (MODEST_MSG_VIEW_WINDOW (win));
+ if (!msg)
+ return;
+ else {
+ modest_ui_actions_message_details_cb (msg, helper);
+ }
+ } else {
+ /* here we should add an implementation to run the message details dialog
+ from the main window */
+ g_return_if_reached ();
+ }
+}
+
+void
+modest_ui_actions_on_toggle_show_cc (GtkToggleAction *toggle,
+ ModestMsgEditWindow *window)
+{
+ g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window));
+
+ modest_msg_edit_window_show_cc (window, gtk_toggle_action_get_active (toggle));
+}
+
+void
+modest_ui_actions_on_toggle_show_bcc (GtkToggleAction *toggle,
+ ModestMsgEditWindow *window)
+{
+ g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window));
+
+ modest_msg_edit_window_show_bcc (window, gtk_toggle_action_get_active (toggle));
+}
+
+void
+modest_ui_actions_toggle_folders_view (GtkAction *action,
+ ModestMainWindow *main_window)
+{
+ ModestConf *conf;
+
+ g_return_if_fail (MODEST_IS_MAIN_WINDOW(main_window));
+
+ conf = modest_runtime_get_conf ();
+
+ if (modest_main_window_get_style (main_window) == MODEST_MAIN_WINDOW_STYLE_SPLIT)
+ modest_main_window_set_style (main_window, MODEST_MAIN_WINDOW_STYLE_SIMPLE);
+ else
+ modest_main_window_set_style (main_window, MODEST_MAIN_WINDOW_STYLE_SPLIT);
+}
+
+void
+modest_ui_actions_on_toggle_toolbar (GtkToggleAction *toggle,
+ ModestWindow *window)
+{
+ gboolean active, fullscreen = FALSE;
+ ModestWindowMgr *mgr;
+
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (toggle));
+
+ /* Check if we want to toggle the toolbar vuew in fullscreen
+ or normal mode */
+ if (!strcmp (gtk_action_get_name (GTK_ACTION (toggle)),
+ "ViewShowToolbarFullScreen")) {
+ fullscreen = TRUE;
+ }
+
+ /* Toggle toolbar */
+ mgr = modest_runtime_get_window_mgr ();
+ modest_window_mgr_show_toolbars (mgr, active, fullscreen);
+}