From: Jose Dapena Paz Date: Fri, 20 Apr 2007 13:54:54 +0000 (+0000) Subject: * src/modest-ui-actions.[ch]: X-Git-Tag: git_migration_finished~3844 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=23b77fcc7767731bd6d8b59c303afc393694908c * src/modest-ui-actions.[ch]: * (..._on_undo): Add UI action for undo, with implementation for editor. * (..._msg_edit_on_change_file_format): Added UI action to handle changes in editor file format * (..._on_select_font): Added UI action to rise font dialog and update editor font with it. * src/maemo/modest-msg-edit-window.c: * Replaced static strings of icons with icons in modest-icon-names.h. * Use logical id's * Set translation domain of menu to make translation work. * Add radio action group for choosing file format. * Send mail in plain text or rich format depending on the file format selection. * (..._set_file_format): new method to change the file format between plain and formatted text. If the change is from formatted text to plain text, it shows a warning about losing format. * (..._select_font): new method to change the font attributes through the Maemo generic dialog. It shows the dialog and then updates the currently applied attributes. * (..._undo): new method to undo last change in body. * src/maemo/ui/modest-msg-edit-window-ui.xml: * Added Undo menu option. * Added show toolbar toggles. * Corrected order of menus. * Removed format menu options not present in UI specs (background color). * Now there's a new send toolbar action, to make menu action not show the icon. * src/modest-defs.h: * Added definitions for file format options. * src/gnome/modest-msg-edit-window.c: * Added more stub implementations for actions present in Maemo client. * src/widgets/modest-msg-edit-window.h: * New actions for Maemo client (undo, set_file_format, select_font). * src/widgets/modest-msg-edit-window-ui.h: * Use logical-id's * Added ToolbarSend, separate from ActionSend. * New actions for selecting font, file format and undo. * src/modes-tny-msg.c: * Changed the order of alternate to put html part after pplain text part for mails with rich text. This makes evolution choose the correct format. pmo-trunk-r1613 --- diff --git a/src/gnome/modest-msg-edit-window.c b/src/gnome/modest-msg-edit-window.c index 8f3e0a3..cbbe436 100644 --- a/src/gnome/modest-msg-edit-window.c +++ b/src/gnome/modest-msg-edit-window.c @@ -475,6 +475,23 @@ modest_msg_edit_window_select_color (ModestMsgEditWindow *window) } void +modest_msg_edit_window_select_file_format (ModestMsgEditWindow *window, + gint file_format) +{ + g_return_if_fail (MODEST_MSG_EDIT_WINDOW (window)); + + g_message ("Select file format operation is not supported"); +} + +void +modest_msg_edit_window_select_font (ModestMsgEditWindow *window) +{ + g_return_if_fail (MODEST_MSG_EDIT_WINDOW (window)); + + g_message ("Select font operation is not supported"); +} + +void modest_msg_edit_window_select_background_color (ModestMsgEditWindow *window) { g_return_if_fail (MODEST_MSG_EDIT_WINDOW (window)); @@ -506,6 +523,28 @@ modest_msg_edit_window_show_bcc (ModestMsgEditWindow *window, g_message ("not implemented yet %s", __FUNCTION__); } +void +modest_msg_edit_window_undo (ModestMsgEditWindow *window) +{ + g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window)); + + g_message ("not implemented yet %s", __FUNCTION__); +} +void +modest_msg_edit_window_toggle_fullscreen (ModestMsgEditWindow *window) +{ + g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window)); + + g_message ("not implemented yet %s", __FUNCTION__); +} +void +modest_msg_edit_window_set_priority_flags (ModestMsgEditWindow *window, + TnyHeaderFlags priority_flags) +{ + g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window)); + + g_message ("not implemented yet %s", __FUNCTION__); +} #if 0 /* Not used. */ static void diff --git a/src/maemo/modest-msg-edit-window.c b/src/maemo/modest-msg-edit-window.c index 053e2bf..3be1df3 100644 --- a/src/maemo/modest-msg-edit-window.c +++ b/src/maemo/modest-msg-edit-window.c @@ -62,7 +62,9 @@ #include #include #include +#include #include +#include #include "widgets/modest-msg-edit-window-ui.h" #ifdef MODEST_HILDON_VERSION_0 @@ -348,19 +350,19 @@ init_window (ModestMsgEditWindow *obj) gtk_button_set_relief (GTK_BUTTON (priv->add_attachment_button), GTK_RELIEF_NONE); gtk_button_set_focus_on_click (GTK_BUTTON (priv->add_attachment_button), FALSE); gtk_button_set_alignment (GTK_BUTTON (priv->add_attachment_button), 1.0, 1.0); - attachment_icon = gtk_image_new_from_icon_name ("qgn_list_gene_attacpap", GTK_ICON_SIZE_BUTTON); + attachment_icon = gtk_image_new_from_icon_name (MODEST_HEADER_ICON_ATTACH, GTK_ICON_SIZE_BUTTON); gtk_container_add (GTK_CONTAINER (priv->add_attachment_button), attachment_icon); gtk_box_pack_start (GTK_BOX (subject_box), priv->add_attachment_button, FALSE, FALSE, 0); priv->attachments_view = modest_attachments_view_new (NULL); priv->header_box = gtk_vbox_new (FALSE, 0); - from_caption = hildon_caption_new (size_group, _("From:"), priv->from_field, NULL, 0); - to_caption = hildon_caption_new (size_group, _("To:"), priv->to_field, NULL, 0); - priv->cc_caption = hildon_caption_new (size_group, _("Cc:"), priv->cc_field, NULL, 0); - priv->bcc_caption = hildon_caption_new (size_group, _("Bcc:"), priv->bcc_field, NULL, 0); - subject_caption = hildon_caption_new (size_group, _("Subject:"), subject_box, NULL, 0); - priv->attachments_caption = hildon_caption_new (size_group, _("Attachments:"), priv->attachments_view, NULL, 0); + from_caption = hildon_caption_new (size_group, _("mail_va_from"), priv->from_field, NULL, 0); + to_caption = hildon_caption_new (size_group, _("mail_va_to"), priv->to_field, NULL, 0); + priv->cc_caption = hildon_caption_new (size_group, _("mail_va_cc"), priv->cc_field, NULL, 0); + priv->bcc_caption = hildon_caption_new (size_group, _("mail_va_hotfix1"), priv->bcc_field, NULL, 0); + subject_caption = hildon_caption_new (size_group, _("mail_va_subject"), subject_box, NULL, 0); + priv->attachments_caption = hildon_caption_new (size_group, _("mail_va_attachment"), priv->attachments_view, NULL, 0); g_object_unref (size_group); size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); @@ -724,6 +726,7 @@ modest_msg_edit_window_new (TnyMsg *msg, const gchar *account_name) parent_priv->ui_manager = gtk_ui_manager_new(); action_group = gtk_action_group_new ("ModestMsgEditWindowActions"); + gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE); /* Add common actions */ gtk_action_group_add_actions (action_group, @@ -752,6 +755,12 @@ modest_msg_edit_window_new (TnyMsg *msg, const gchar *account_name) 0, G_CALLBACK (modest_ui_actions_msg_edit_on_change_priority), obj); + gtk_action_group_add_radio_actions (action_group, + modest_msg_edit_file_format_action_entries, + G_N_ELEMENTS (modest_msg_edit_file_format_action_entries), + MODEST_FILE_FORMAT_FORMATTED_TEXT, + G_CALLBACK (modest_ui_actions_msg_edit_on_change_file_format), + obj); gtk_ui_manager_insert_action_group (parent_priv->ui_manager, action_group, 0); g_object_unref (action_group); @@ -849,7 +858,10 @@ modest_msg_edit_window_get_msg_data (ModestMsgEditWindow *edit_window) data->bcc = (gchar*) modest_recpt_editor_get_recipients (MODEST_RECPT_EDITOR(priv->bcc_field)); data->subject = (gchar*) gtk_entry_get_text (GTK_ENTRY(priv->subject_field)); data->plain_body = (gchar *) gtk_text_buffer_get_text (priv->text_buffer, &b, &e, FALSE); - data->html_body = get_formatted_data (edit_window); + if (wp_text_buffer_is_rich_text (WP_TEXT_BUFFER (priv->text_buffer))) + data->html_body = get_formatted_data (edit_window); + else + data->html_body = NULL; data->attachments = priv->attachments; data->priority_flags = priv->priority_flags; @@ -1537,3 +1549,183 @@ modest_msg_edit_window_set_priority_flags (ModestMsgEditWindow *window, } } } + +void +modest_msg_edit_window_set_file_format (ModestMsgEditWindow *window, + gint file_format) +{ + ModestMsgEditWindowPrivate *priv; + gint current_format; + + g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window)); + + priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (window); + + current_format = wp_text_buffer_is_rich_text (WP_TEXT_BUFFER (priv->text_buffer)) + ? MODEST_FILE_FORMAT_FORMATTED_TEXT : MODEST_FILE_FORMAT_PLAIN_TEXT; + + if (current_format != file_format) { + switch (file_format) { + case MODEST_FILE_FORMAT_FORMATTED_TEXT: + wp_text_buffer_enable_rich_text (WP_TEXT_BUFFER (priv->text_buffer), TRUE); + break; + case MODEST_FILE_FORMAT_PLAIN_TEXT: + { + GtkWidget *dialog; + gint response; + dialog = hildon_note_new_confirmation (NULL, _("emev_nc_formatting_lost")); + response = gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + if (response == GTK_RESPONSE_OK) + wp_text_buffer_enable_rich_text (WP_TEXT_BUFFER (priv->text_buffer), FALSE); + } + break; + } + } +} + +void +modest_msg_edit_window_select_font (ModestMsgEditWindow *window) +{ + GtkWidget *dialog; + ModestMsgEditWindowPrivate *priv; + WPTextBufferFormat oldfmt, fmt; + gint old_position = 0; + gint response = 0; + gint position = 0; + gint font_size; + GdkColor *color = NULL; + gboolean bold, bold_set, italic, italic_set; + gboolean underline, underline_set; + gboolean strikethrough, strikethrough_set; + gboolean position_set; + gboolean font_size_set, font_set, color_set; + gchar *font_name; + + g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window)); + priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (window); + + dialog = hildon_font_selection_dialog_new (NULL, NULL); + + /* First we get the currently selected font information */ + wp_text_buffer_get_attributes (WP_TEXT_BUFFER (priv->text_buffer), &oldfmt, TRUE); + g_object_set (G_OBJECT (dialog), "font-scaling", priv->zoom_level, NULL); + + switch (oldfmt.text_position) { + case TEXT_POSITION_NORMAL: + old_position = 0; + break; + case TEXT_POSITION_SUPERSCRIPT: + old_position = 1; + break; + default: + old_position = -1; + break; + } + + g_object_set (G_OBJECT (dialog), + "bold", oldfmt.bold != FALSE, + "bold-set", !oldfmt.cs.bold, + "underline", oldfmt.underline != FALSE, + "underline-set", !oldfmt.cs.underline, + "italic", oldfmt.italic != FALSE, + "italic-set", !oldfmt.cs.italic, + "strikethrough", oldfmt.strikethrough != FALSE, + "strikethrough-set", !oldfmt.cs.strikethrough, + "color", &oldfmt.color, + "color-set", !oldfmt.cs.color, + "size", wp_font_size[oldfmt.font_size], + "size-set", !oldfmt.cs.font_size, + "position", old_position, + "position-set", !oldfmt.cs.text_position, + "family", wp_get_font_name (oldfmt.font), + "family-set", !oldfmt.cs.font, + NULL); + + gtk_widget_show_all (dialog); + response = gtk_dialog_run (GTK_DIALOG (dialog)); + if (response == GTK_RESPONSE_OK) { + + g_object_get( dialog, + "bold", &bold, + "bold-set", &bold_set, + "underline", &underline, + "underline-set", &underline_set, + "italic", &italic, + "italic-set", &italic_set, + "strikethrough", &strikethrough, + "strikethrough-set", &strikethrough_set, + "color", &color, + "color-set", &color_set, + "size", &font_size, + "size-set", &font_size_set, + "family", &font_name, + "family-set", &font_set, + "position", &position, + "position-set", &position_set, + NULL ); + + } + + gtk_widget_destroy (dialog); + + if (response == GTK_RESPONSE_OK) { + memset(&fmt, 0, sizeof(fmt)); + if (bold_set) { + fmt.bold = bold; + fmt.cs.bold = TRUE; + } + if (italic_set) { + fmt.italic = italic; + fmt.cs.italic = TRUE; + } + if (underline_set) { + fmt.underline = underline; + fmt.cs.underline = TRUE; + } + if (strikethrough_set) { + fmt.strikethrough = strikethrough; + fmt.cs.strikethrough = TRUE; + } + if (position_set) { + fmt.text_position = + ( position == 0 ) + ? TEXT_POSITION_NORMAL + : ( ( position == 1 ) + ? TEXT_POSITION_SUPERSCRIPT + : TEXT_POSITION_SUBSCRIPT ); + fmt.cs.text_position = TRUE; + } + if (color_set) { + fmt.color = *color; + fmt.cs.color = TRUE; + } + gdk_color_free(color); + if (font_set) { + fmt.font = wp_get_font_index(font_name, + DEFAULT_FONT); + fmt.cs.font = TRUE; + } + g_free(font_name); + if (font_size_set) { + fmt.font_size = wp_get_font_size_index( + font_size, DEFAULT_FONT_SIZE); + fmt.cs.font_size = TRUE; + } + gtk_widget_grab_focus(GTK_WIDGET(priv->msg_body)); + wp_text_buffer_set_format(WP_TEXT_BUFFER(priv->text_buffer), &fmt); + } + +} + +void +modest_msg_edit_window_undo (ModestMsgEditWindow *window) +{ + ModestMsgEditWindowPrivate *priv; + + g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window)); + priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (window); + + wp_text_buffer_undo (WP_TEXT_BUFFER (priv->text_buffer)); + +} diff --git a/src/maemo/ui/modest-msg-edit-window-ui.xml b/src/maemo/ui/modest-msg-edit-window-ui.xml index 8987bc1..bcfcd4d 100644 --- a/src/maemo/ui/modest-msg-edit-window-ui.xml +++ b/src/maemo/ui/modest-msg-edit-window-ui.xml @@ -33,6 +33,8 @@ + + @@ -50,22 +52,32 @@ + + + + + - - - - - + + - + + + + + + + + + @@ -79,7 +91,7 @@ - + diff --git a/src/modest-defs.h b/src/modest-defs.h index 67df45e..46c734d 100644 --- a/src/modest-defs.h +++ b/src/modest-defs.h @@ -145,5 +145,8 @@ #define MODEST_ACCOUNT_OPTION_USE_LSUB "use_lsub" #define MODEST_ACCOUNT_OPTION_CHECK_ALL "check_all" +/* Macros for different text formats in mail editor */ +#define MODEST_FILE_FORMAT_PLAIN_TEXT 0 +#define MODEST_FILE_FORMAT_FORMATTED_TEXT 1 #endif /*__MODEST_DEFS_H__*/ diff --git a/src/modest-tny-msg.c b/src/modest-tny-msg.c index d168d40..26b2647 100644 --- a/src/modest-tny-msg.c +++ b/src/modest-tny-msg.c @@ -111,8 +111,8 @@ modest_tny_msg_new_html_plain (const gchar* mailto, const gchar* from, const gch content_type = get_content_type(plain_body); /* Add the body of the new mail */ - add_html_body_part (new_msg, html_body); add_body_part (new_msg, plain_body, content_type, TRUE); + add_html_body_part (new_msg, html_body); g_free (content_type); /* Add attachments */ diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index f90427c..b6f2faf 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -1454,6 +1454,17 @@ modest_ui_actions_on_copy (GtkAction *action, } void +modest_ui_actions_on_undo (GtkAction *action, + ModestWindow *window) +{ + if (MODEST_IS_MSG_EDIT_WINDOW (window)) { + modest_msg_edit_window_undo (MODEST_MSG_EDIT_WINDOW (window)); + } else { + g_return_if_reached (); + } +} + +void modest_ui_actions_on_paste (GtkAction *action, ModestWindow *window) { @@ -1518,6 +1529,18 @@ void modest_ui_actions_msg_edit_on_change_priority (GtkRadioAction *action, modest_msg_edit_window_set_priority_flags (MODEST_MSG_EDIT_WINDOW (window), flags); } +void modest_ui_actions_msg_edit_on_change_file_format (GtkRadioAction *action, + GtkRadioAction *selected, + ModestWindow *window) +{ + gint file_format; + + g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window)); + + file_format = gtk_radio_action_get_current_value (selected); + modest_msg_edit_window_set_file_format (MODEST_MSG_EDIT_WINDOW (window), file_format); +} + void modest_ui_actions_on_zoom_plus (GtkAction *action, @@ -1680,6 +1703,13 @@ modest_ui_actions_on_toggle_toolbar (GtkToggleAction *toggle, modest_window_mgr_show_toolbars (mgr, active, fullscreen); } +void +modest_ui_actions_msg_edit_on_select_font (GtkAction *action, + ModestMsgEditWindow *window) +{ + modest_msg_edit_window_select_font (window); +} + void modest_ui_actions_on_folder_display_name_changed (ModestFolderView *folder_view, const gchar *display_name, diff --git a/src/modest-ui-actions.h b/src/modest-ui-actions.h index c4f5e33..a872764 100644 --- a/src/modest-ui-actions.h +++ b/src/modest-ui-actions.h @@ -174,6 +174,9 @@ void modest_ui_actions_on_password_requested (TnyAccountStore *account_store gchar **password, gboolean *cancel, gboolean *remember, ModestMainWindow *main_window); +void modest_ui_actions_on_undo (GtkAction *action, + ModestWindow *window); + void modest_ui_actions_on_cut (GtkAction *action, ModestWindow *window); @@ -212,6 +215,13 @@ void modest_ui_actions_msg_edit_on_change_priority (GtkRadioAction *action, GtkRadioAction *selected, ModestWindow *window); +void modest_ui_actions_msg_edit_on_change_file_format (GtkRadioAction *action, + GtkRadioAction *selected, + ModestWindow *window); + +void modest_ui_actions_msg_edit_on_select_font (GtkAction *action, + ModestMsgEditWindow *window); + /** * modest_ui_actions_on_toggle_toolbar: * @toggle: diff --git a/src/widgets/modest-msg-edit-window-ui.h b/src/widgets/modest-msg-edit-window-ui.h index 98a7d4d..91176d5 100644 --- a/src/widgets/modest-msg-edit-window-ui.h +++ b/src/widgets/modest-msg-edit-window-ui.h @@ -40,52 +40,64 @@ G_BEGIN_DECLS static const GtkActionEntry modest_msg_edit_action_entries [] = { /* Toplevel menus */ - { "View", NULL, N_("_View") }, - { "Edit", NULL, N_("_Edit") }, - { "Insert", NULL, N_("_Insert") }, - { "Format", NULL, N_("For_mat") }, - { "Alignment", NULL, N_("_Alignment") }, - { "Attachments", NULL, N_("Attachments") }, - { "Zoom", NULL, N_("Zoom") }, - { "MessagePriority", NULL, N_("Message priority") }, - { "Tools", NULL, N_("Tools") }, + { "View", NULL, N_("mcen_me_inbox_view") }, + { "Edit", NULL, N_("mcen_me_inbox_edit") }, + { "Format", NULL, N_("mcen_me_editor_format") }, + { "Alignment", NULL, N_("mcen_me_editor_align") }, + { "Attachments", NULL, N_("mcen_me_viewer_attachments") }, + { "Zoom", NULL, N_("mcen_me_viewer_zoom") }, + { "MessagePriority", NULL, N_("mcen_me_editor_message_priority") }, + { "FileFormat", NULL, N_("mcen_me_editor_file_format") }, + { "Tools", NULL, N_("mcen_me_inbox_tools") }, + { "ShowToolbar", NULL, N_("mcen_me_inbox_toolbar") }, /* ACTIONS */ - { "ActionsSend", MODEST_STOCK_MAIL_SEND, N_("Send"), NULL, N_("Send a message"), G_CALLBACK (modest_ui_actions_on_send) }, - { "ActionsFontColor", GTK_STOCK_SELECT_COLOR, N_("Color"), NULL, N_("Change text color"), G_CALLBACK (modest_ui_actions_on_select_editor_color)}, - { "BackgroundColor", GTK_STOCK_SELECT_COLOR, N_("Background color"), NULL, N_("Change background color"), G_CALLBACK (modest_ui_actions_on_select_editor_background_color)}, - { "InsertImage", NULL, N_("Insert image..."), NULL, N_("Insert image"), G_CALLBACK (modest_ui_actions_on_insert_image)}, - { "Cut", GTK_STOCK_CUT, N_("Cut"), NULL, N_("Cut selection"), G_CALLBACK (modest_ui_actions_on_cut)}, - { "Copy", GTK_STOCK_COPY, N_("Copy"), NULL, N_("Copy selection"), G_CALLBACK (modest_ui_actions_on_copy)}, - { "Paste", GTK_STOCK_PASTE, N_("Paste"), NULL, N_("Paste selection"), G_CALLBACK (modest_ui_actions_on_paste)}, - { "SelectAll", NULL, N_("Select all"), NULL, N_("Select all"), G_CALLBACK (modest_ui_actions_on_select_all)}, + { "ActionsSend", NULL, N_("mcen_me_editor_send"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_send) }, +/* { "ActionsFontColor", GTK_STOCK_SELECT_COLOR, N_("Color"), NULL, N_("Change text color"), G_CALLBACK (modest_ui_actions_on_select_editor_color)}, */ +/* { "BackgroundColor", GTK_STOCK_SELECT_COLOR, N_("Background color"), NULL, N_("Change background color"), G_CALLBACK (modest_ui_actions_on_select_editor_background_color)}, */ + { "InsertImage", NULL, N_("mcen_me_editor_attach_inlineimage"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_insert_image)}, + { "Undo", NULL, N_("mcen_me_inbox_undo"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_undo)}, + { "Cut", NULL, N_("mcen_me_inbox_cut"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_cut)}, + { "Copy", NULL, N_("mcen_me_inbox_copy"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_copy)}, + { "Paste", NULL, N_("mcen_me_inbox_paste"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_paste)}, + { "SelectAll", NULL, N_("mcen_me_viewer_selectall"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_select_all)}, + { "SelectFont", NULL, N_("mcen_me_editor_font"), NULL, NULL, G_CALLBACK (modest_ui_actions_msg_edit_on_select_font)}, /* KEY ACCELERATOR ACTIONS */ { "ZoomPlus", NULL, N_("Zoom +"), "F7", NULL, G_CALLBACK (modest_ui_actions_on_zoom_plus) }, { "ZoomMinus", NULL, N_("Zoom -"), "F8", NULL, G_CALLBACK (modest_ui_actions_on_zoom_minus) }, { "ToggleFullscreen", NULL, N_("Toggle fullscreen"), "F6", NULL, G_CALLBACK (modest_ui_actions_on_change_fullscreen) }, + /* TOOLBAR ACTIONS */ + { "ToolbarSend", MODEST_STOCK_MAIL_SEND, N_("qgn_toolb_messagin_send"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_send) }, + }; static const GtkToggleActionEntry modest_msg_edit_toggle_action_entries [] = { /* VIEW */ - { "ViewCcField", NULL, N_("Cc: field"), NULL, N_("Shows the Cc: field"), G_CALLBACK (modest_ui_actions_on_toggle_show_cc), TRUE }, - { "ViewBccField", NULL, N_("Bcc: filed"), NULL, N_("Shows the Bcc: field"), G_CALLBACK (modest_ui_actions_on_toggle_show_bcc), TRUE }, + { "ViewCcField", NULL, N_("mcen_me_editor_showcc"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_show_cc), TRUE }, + { "ViewBccField", NULL, N_("mcen_me_editor_showbcc"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_show_bcc), TRUE }, /* Fullscreen toggle */ - { "ViewToggleFullscreen", NULL, N_("Show fullscreen"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_fullscreen), FALSE}, + { "ViewToggleFullscreen", NULL, N_("mcen_me_inbox_fullscreen"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_fullscreen), FALSE}, + /* Toolbar visibility */ + { "ViewShowToolbarNormalScreen", NULL, N_("mcen_me_inbox_normalview"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_toolbar), TRUE }, + { "ViewShowToolbarFullScreen", NULL, N_("mcen_me_inbox_optimizedview"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_toolbar), TRUE }, /* Rich text editor functions */ - { "ActionsBold", GTK_STOCK_BOLD, N_("Bold"), NULL, N_("Use bold"), G_CALLBACK (modest_ui_actions_on_toggle_bold), FALSE }, - { "ActionsItalics", GTK_STOCK_ITALIC, N_("Italics"), NULL, N_("Use italics"), G_CALLBACK (modest_ui_actions_on_toggle_italics), FALSE }, - { "ActionsBulletedList", MODEST_TOOLBAR_ICON_FORMAT_BULLETS, N_("Bullet list"), NULL, N_("Add a bullet list"), G_CALLBACK (modest_ui_actions_on_toggle_bullets), FALSE }, + { "ActionsBulletedList", NULL, N_("mcen_me_editor_bullets"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_bullets), FALSE }, + + /* Toolbar buttons */ + { "ActionsBold", GTK_STOCK_BOLD, NULL, NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_bold), FALSE }, + { "ActionsItalics", GTK_STOCK_ITALIC, NULL, NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_italics), FALSE }, + }; static const GtkRadioActionEntry modest_msg_edit_alignment_radio_action_entries [] = { - { "AlignmentLeft", NULL, N_("Left"), NULL, N_("Align to the left"), GTK_JUSTIFY_LEFT }, - { "AlignmentCenter", NULL, N_("Center"), NULL, N_("Align to the center"), GTK_JUSTIFY_CENTER }, - { "AlignmentRight", NULL, N_("Right"), NULL, N_("Align to the right"), GTK_JUSTIFY_RIGHT }, + { "AlignmentLeft", NULL, N_("mcen_me_editor_align_left"), NULL, NULL, GTK_JUSTIFY_LEFT }, + { "AlignmentCenter", NULL, N_("mcen_me_editor_align_centred"), NULL, NULL, GTK_JUSTIFY_CENTER }, + { "AlignmentRight", NULL, N_("mcen_me_editor_align_right"), NULL, NULL, GTK_JUSTIFY_RIGHT }, }; static const GtkRadioActionEntry modest_msg_edit_zoom_action_entries [] = { @@ -96,9 +108,14 @@ static const GtkRadioActionEntry modest_msg_edit_zoom_action_entries [] = { }; static const GtkRadioActionEntry modest_msg_edit_priority_action_entries [] = { - { "MessagePriorityHigh", NULL, N_("High"), NULL, NULL, TNY_HEADER_FLAG_HIGH_PRIORITY }, - { "MessagePriorityNormal", NULL, N_("Normal"), NULL, NULL, TNY_HEADER_FLAG_NORMAL_PRIORITY }, - { "MessagePriorityLow", NULL, N_("Low"), NULL, NULL, TNY_HEADER_FLAG_LOW_PRIORITY }, + { "MessagePriorityHigh", NULL, N_("mcen_me_editor_priority_high"), NULL, NULL, TNY_HEADER_FLAG_HIGH_PRIORITY }, + { "MessagePriorityNormal", NULL, N_("mcen_me_editor_priority_normal"), NULL, NULL, TNY_HEADER_FLAG_NORMAL_PRIORITY }, + { "MessagePriorityLow", NULL, N_("mcen_me_editor_priority_low"), NULL, NULL, TNY_HEADER_FLAG_LOW_PRIORITY }, +}; + +static const GtkRadioActionEntry modest_msg_edit_file_format_action_entries [] = { + { "FileFormatPlainText", NULL, N_("mcen_me_editor_plain_text"), NULL, NULL, MODEST_FILE_FORMAT_PLAIN_TEXT }, + { "FileFormatFormattedText", NULL, N_("mcen_me_editor_formatted_text"), NULL, NULL, MODEST_FILE_FORMAT_FORMATTED_TEXT }, }; G_END_DECLS diff --git a/src/widgets/modest-msg-edit-window.h b/src/widgets/modest-msg-edit-window.h index e8a9a64..d97efa0 100644 --- a/src/widgets/modest-msg-edit-window.h +++ b/src/widgets/modest-msg-edit-window.h @@ -233,6 +233,33 @@ void modest_msg_edit_window_toggle_fullscreen (ModestMsgEditWindow *w void modest_msg_edit_window_set_priority_flags (ModestMsgEditWindow *window, TnyHeaderFlags priority_flags); +/** + * modest_msg_edit_window_set_file_format: + * @window: a #ModestMsgEditWindow + * @file_format: %MODEST_FILE_FORMAT_PLAIN_TEXT or %MODEST_FILE_FORMAT_FORMATTED_TEXT + * + * Changes the current file format. + */ +void modest_msg_edit_window_set_file_format (ModestMsgEditWindow *window, + gint file_format); + +/** + * modest_msg_edit_window_select_font: + * @window: a #ModestMsgEditWindow + * + * Show the dialog to select the editor font and update the + * used font in the editor. + */ +void modest_msg_edit_window_select_font (ModestMsgEditWindow *window); + +/** + * modest_msg_edit_window_undo: + * @window: a #ModestMsgEditWindow + * + * Undoes the last operation. + */ +void modest_msg_edit_window_undo (ModestMsgEditWindow *window); + G_END_DECLS #endif /* __MODEST_MSG_EDIT_WINDOW_H__ */