From 93c1357da29c068d1418f8bd07b58b55d05f5c0b Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Wed, 25 Jun 2014 11:33:44 +0200 Subject: EHTMLEditor - Stop using deprecated gtk-stock items --- e-util/e-color-chooser-widget.c | 4 +-- e-util/e-html-editor-actions.c | 44 +++++++++++++++---------------- e-util/e-html-editor-dialog.c | 5 +++- e-util/e-html-editor-find-dialog.c | 5 ++-- e-util/e-html-editor-link-dialog.c | 2 +- e-util/e-html-editor-paragraph-dialog.c | 6 ++--- e-util/e-html-editor-replace-dialog.c | 2 +- e-util/e-html-editor-spell-check-dialog.c | 36 +++++-------------------- e-util/e-html-editor-text-dialog.c | 8 +++--- e-util/e-image-chooser-dialog.c | 10 +++++-- e-util/test-html-editor.c | 20 +++++++------- modules/mail/em-composer-prefs.c | 2 +- 12 files changed, 66 insertions(+), 78 deletions(-) diff --git a/e-util/e-color-chooser-widget.c b/e-util/e-color-chooser-widget.c index 5761ebf2ff..c1357ea572 100644 --- a/e-util/e-color-chooser-widget.c +++ b/e-util/e-color-chooser-widget.c @@ -114,8 +114,8 @@ run_color_chooser_dialog (gpointer user_data) N_("Choose custom color"), GTK_WINDOW (parent_window), GTK_DIALOG_MODAL, - GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, - GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); + _("_Cancel"), GTK_RESPONSE_REJECT, + _("_OK"), GTK_RESPONSE_ACCEPT, NULL); chooser = gtk_color_chooser_widget_new (); g_object_set (G_OBJECT (chooser), "show-editor", TRUE, NULL); diff --git a/e-util/e-html-editor-actions.c b/e-util/e-html-editor-actions.c index 6db3ad48da..94f2493d72 100644 --- a/e-util/e-html-editor-actions.c +++ b/e-util/e-html-editor-actions.c @@ -469,8 +469,8 @@ action_insert_html_file_cb (GtkToggleAction *action, dialog = gtk_file_chooser_dialog_new ( _("Insert HTML File"), NULL, GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_Open"), GTK_RESPONSE_ACCEPT, NULL); filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, _("HTML file")); @@ -562,8 +562,8 @@ action_insert_text_file_cb (GtkAction *action, dialog = gtk_file_chooser_dialog_new ( _("Insert text file"), NULL, GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_Open"), GTK_RESPONSE_ACCEPT, NULL); filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, _("Text file")); @@ -924,21 +924,21 @@ action_show_webkit_inspector_cb (GtkAction *action, static GtkActionEntry core_entries[] = { { "copy", - GTK_STOCK_COPY, + "edit-copy", N_("_Copy"), "c", N_("Copy selected text to the clipboard"), G_CALLBACK (action_copy_cb) }, { "cut", - GTK_STOCK_CUT, + "edit-cut", N_("Cu_t"), "x", N_("Cut selected text to the clipboard"), G_CALLBACK (action_cut_cb) }, { "indent", - GTK_STOCK_INDENT, + "format-indent-more", N_("_Increase Indent"), "bracketright", N_("Increase Indent"), @@ -959,7 +959,7 @@ static GtkActionEntry core_entries[] = { G_CALLBACK (action_insert_text_file_cb) }, { "paste", - GTK_STOCK_PASTE, + "edit-paste", N_("_Paste"), "v", N_("Paste text from the clipboard"), @@ -973,21 +973,21 @@ static GtkActionEntry core_entries[] = { G_CALLBACK (action_paste_quote_cb) }, { "redo", - GTK_STOCK_REDO, + "edit-redo", N_("_Redo"), "z", N_("Redo the last undone action"), G_CALLBACK (action_redo_cb) }, { "select-all", - GTK_STOCK_SELECT_ALL, + "edit-select-all", N_("Select _All"), "a", NULL, G_CALLBACK (action_select_all_cb) }, { "show-find", - GTK_STOCK_FIND, + "edit-find", N_("_Find..."), "f", N_("Search for text"), @@ -1001,28 +1001,28 @@ static GtkActionEntry core_entries[] = { G_CALLBACK (action_find_again_cb) }, { "show-replace", - GTK_STOCK_FIND_AND_REPLACE, + "edit-find-replace", N_("Re_place..."), "h", N_("Search for and replace text"), G_CALLBACK (action_show_replace_cb) }, { "spell-check", - GTK_STOCK_SPELL_CHECK, + "tools-check-spelling", N_("Check _Spelling..."), "F7", NULL, G_CALLBACK (action_spell_check_cb) }, { "undo", - GTK_STOCK_UNDO, + "edit-undo", N_("_Undo"), "z", N_("Undo the last action"), G_CALLBACK (action_undo_cb) }, { "unindent", - GTK_STOCK_UNINDENT, + "format-indent-less", N_("_Decrease Indent"), "bracketleft", N_("Decrease Indent"), @@ -1104,21 +1104,21 @@ static GtkActionEntry core_entries[] = { static GtkRadioActionEntry core_justify_entries[] = { { "justify-center", - GTK_STOCK_JUSTIFY_CENTER, + "format-justify-center", N_("_Center"), "e", N_("Center Alignment"), E_HTML_EDITOR_SELECTION_ALIGNMENT_CENTER }, { "justify-left", - GTK_STOCK_JUSTIFY_LEFT, + "format-justify-left", N_("_Left"), "l", N_("Left Alignment"), E_HTML_EDITOR_SELECTION_ALIGNMENT_LEFT }, { "justify-right", - GTK_STOCK_JUSTIFY_RIGHT, + "format-justify-right", N_("_Right"), "r", N_("Right Alignment"), @@ -1344,7 +1344,7 @@ static GtkActionEntry html_entries[] = { static GtkToggleActionEntry html_toggle_entries[] = { { "bold", - GTK_STOCK_BOLD, + "format-text-bold", N_("_Bold"), "b", N_("Bold"), @@ -1352,7 +1352,7 @@ static GtkToggleActionEntry html_toggle_entries[] = { FALSE }, { "italic", - GTK_STOCK_ITALIC, + "format-text-italic", N_("_Italic"), "i", N_("Italic"), @@ -1368,7 +1368,7 @@ static GtkToggleActionEntry html_toggle_entries[] = { FALSE }, { "strikethrough", - GTK_STOCK_STRIKETHROUGH, + "format-text-strikethrough", N_("_Strikethrough"), NULL, N_("Strikethrough"), @@ -1376,7 +1376,7 @@ static GtkToggleActionEntry html_toggle_entries[] = { FALSE }, { "underline", - GTK_STOCK_UNDERLINE, + "format-text-underline", N_("_Underline"), "u", N_("Underline"), diff --git a/e-util/e-html-editor-dialog.c b/e-util/e-html-editor-dialog.c index 5b43ebd316..b62e4ac284 100644 --- a/e-util/e-html-editor-dialog.c +++ b/e-util/e-html-editor-dialog.c @@ -22,7 +22,10 @@ #include #endif +#include + #include "e-html-editor-dialog.h" +#include "e-dialog-widgets.h" #define E_HTML_EDITOR_DIALOG_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -190,7 +193,7 @@ e_html_editor_dialog_init (EHTMLEditorDialog *dialog) dialog->priv->container = grid; /* == Button box == */ - widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE); + widget = e_dialog_button_new_with_icon ("window-close", _("_Close")); g_signal_connect_swapped ( widget, "clicked", G_CALLBACK (gtk_widget_hide), dialog); diff --git a/e-util/e-html-editor-find-dialog.c b/e-util/e-html-editor-find-dialog.c index 9f44cf8dc5..2a19d01fe5 100644 --- a/e-util/e-html-editor-find-dialog.c +++ b/e-util/e-html-editor-find-dialog.c @@ -23,6 +23,7 @@ #endif #include "e-html-editor-find-dialog.h" +#include "e-dialog-widgets.h" #include #include @@ -191,7 +192,7 @@ e_html_editor_find_dialog_init (EHTMLEditorFindDialog *dialog) box = GTK_BOX (widget); box = e_html_editor_dialog_get_button_box (E_HTML_EDITOR_DIALOG (dialog)); - widget = gtk_button_new_from_stock (GTK_STOCK_FIND); + widget = e_dialog_button_new_with_icon ("edit-find", _("_Find")); gtk_box_pack_start (box, widget, FALSE, FALSE, 5); g_signal_connect_swapped ( widget, "clicked", @@ -208,7 +209,7 @@ e_html_editor_find_dialog_new (EHTMLEditor *editor) g_object_new ( E_TYPE_HTML_EDITOR_FIND_DIALOG, "editor", editor, - "icon-name", GTK_STOCK_FIND, + "icon-name", "edit-find", "title", N_("Find"), NULL)); } diff --git a/e-util/e-html-editor-link-dialog.c b/e-util/e-html-editor-link-dialog.c index 0572d07c09..89113e3c78 100644 --- a/e-util/e-html-editor-link-dialog.c +++ b/e-util/e-html-editor-link-dialog.c @@ -367,7 +367,7 @@ e_html_editor_link_dialog_init (EHTMLEditorLinkDialog *dialog) gtk_box_pack_start (button_box, widget, FALSE, FALSE, 5); dialog->priv->remove_link_button = widget; - widget = gtk_button_new_from_stock (GTK_STOCK_OK); + widget = gtk_button_new_with_mnemonic (_("_OK")); g_signal_connect_swapped ( widget, "clicked", G_CALLBACK (html_editor_link_dialog_ok), dialog); diff --git a/e-util/e-html-editor-paragraph-dialog.c b/e-util/e-html-editor-paragraph-dialog.c index f0fce973a6..66fbfcc208 100644 --- a/e-util/e-html-editor-paragraph-dialog.c +++ b/e-util/e-html-editor-paragraph-dialog.c @@ -95,7 +95,7 @@ html_editor_paragraph_dialog_constructed (GObject *object) gtk_widget_set_margin_left (GTK_WIDGET (grid), 10); /* Left */ - widget = gtk_toggle_button_new_with_label (GTK_STOCK_JUSTIFY_LEFT); + widget = gtk_toggle_button_new_with_label (_("_Left")); gtk_button_set_use_stock (GTK_BUTTON (widget), TRUE); gtk_activatable_set_related_action ( GTK_ACTIVATABLE (widget), @@ -104,7 +104,7 @@ html_editor_paragraph_dialog_constructed (GObject *object) dialog->priv->left_button = widget; /* Center */ - widget = gtk_toggle_button_new_with_label (GTK_STOCK_JUSTIFY_CENTER); + widget = gtk_toggle_button_new_with_label (_("_Center")); gtk_button_set_use_stock (GTK_BUTTON (widget), TRUE); gtk_grid_attach (grid, widget, 1, 0, 1, 1); gtk_activatable_set_related_action ( @@ -113,7 +113,7 @@ html_editor_paragraph_dialog_constructed (GObject *object) dialog->priv->center_button = widget; /* Right */ - widget = gtk_toggle_button_new_with_label (GTK_STOCK_JUSTIFY_RIGHT); + widget = gtk_toggle_button_new_with_label (_("_Right")); gtk_button_set_use_stock (GTK_BUTTON (widget), TRUE); gtk_grid_attach (grid, widget, 2, 0, 1, 1); gtk_activatable_set_related_action ( diff --git a/e-util/e-html-editor-replace-dialog.c b/e-util/e-html-editor-replace-dialog.c index 7addcdfdad..2b4369045f 100644 --- a/e-util/e-html-editor-replace-dialog.c +++ b/e-util/e-html-editor-replace-dialog.c @@ -278,7 +278,7 @@ e_html_editor_replace_dialog_new (EHTMLEditor *editor) g_object_new ( E_TYPE_HTML_EDITOR_REPLACE_DIALOG, "editor", editor, - "icon-name", GTK_STOCK_FIND_AND_REPLACE, + "icon-name", "edit-find-replace", "resizable", FALSE, "title", N_("Replace"), "transient-for", gtk_widget_get_toplevel (GTK_WIDGET (editor)), diff --git a/e-util/e-html-editor-spell-check-dialog.c b/e-util/e-html-editor-spell-check-dialog.c index b399dfabd8..a3b0c693b2 100644 --- a/e-util/e-html-editor-spell-check-dialog.c +++ b/e-util/e-html-editor-spell-check-dialog.c @@ -31,6 +31,8 @@ #include "e-spell-checker.h" #include "e-spell-dictionary.h" +#include "e-dialog-widgets.h" + #define E_HTML_EDITOR_SPELL_CHECK_DIALOG_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_HTML_EDITOR_SPELL_CHECK_DIALOG, EHTMLEditorSpellCheckDialogPrivate)) @@ -531,11 +533,7 @@ e_html_editor_spell_check_dialog_init (EHTMLEditorSpellCheckDialog *dialog) gtk_grid_attach (main_layout, widget, 0, 1, 1, 5); /* Replace */ - widget = gtk_button_new_with_mnemonic (_("Replace")); - gtk_button_set_image ( - GTK_BUTTON (widget), - gtk_image_new_from_stock ( - GTK_STOCK_CONVERT, GTK_ICON_SIZE_BUTTON)); + widget = e_dialog_button_new_with_icon ("edit-find-replace", _("Replace")); gtk_grid_attach (main_layout, widget, 1, 1, 1, 1); dialog->priv->replace_button = widget; @@ -545,10 +543,6 @@ e_html_editor_spell_check_dialog_init (EHTMLEditorSpellCheckDialog *dialog) /* Replace All */ widget = gtk_button_new_with_mnemonic (_("Replace All")); - gtk_button_set_image ( - GTK_BUTTON (widget), - gtk_image_new_from_stock ( - GTK_STOCK_APPLY, GTK_ICON_SIZE_BUTTON)); gtk_grid_attach (main_layout, widget, 1, 2, 1, 1); dialog->priv->replace_all_button = widget; @@ -557,11 +551,7 @@ e_html_editor_spell_check_dialog_init (EHTMLEditorSpellCheckDialog *dialog) G_CALLBACK (html_editor_spell_check_dialog_replace_all), dialog); /* Ignore */ - widget = gtk_button_new_with_mnemonic (_("Ignore")); - gtk_button_set_image ( - GTK_BUTTON (widget), - gtk_image_new_from_stock ( - GTK_STOCK_CLEAR, GTK_ICON_SIZE_BUTTON)); + widget = e_dialog_button_new_with_icon ("edit-clear", _("Ignore")); gtk_grid_attach (main_layout, widget, 1, 3, 1, 1); dialog->priv->ignore_button = widget; @@ -570,11 +560,7 @@ e_html_editor_spell_check_dialog_init (EHTMLEditorSpellCheckDialog *dialog) G_CALLBACK (html_editor_spell_check_dialog_ignore), dialog); /* Skip */ - widget = gtk_button_new_with_mnemonic (_("Skip")); - gtk_button_set_image ( - GTK_BUTTON (widget), - gtk_image_new_from_stock ( - GTK_STOCK_GO_FORWARD, GTK_ICON_SIZE_BUTTON)); + widget = e_dialog_button_new_with_icon ("go-next", _("Skip")); gtk_grid_attach (main_layout, widget, 1, 4, 1, 1); dialog->priv->skip_button = widget; @@ -583,11 +569,7 @@ e_html_editor_spell_check_dialog_init (EHTMLEditorSpellCheckDialog *dialog) G_CALLBACK (html_editor_spell_check_dialog_next), dialog); /* Back */ - widget = gtk_button_new_with_mnemonic (_("Back")); - gtk_button_set_image ( - GTK_BUTTON (widget), - gtk_image_new_from_stock ( - GTK_STOCK_GO_BACK, GTK_ICON_SIZE_BUTTON)); + widget = e_dialog_button_new_with_icon ("go-previous", _("Back")); gtk_grid_attach (main_layout, widget, 1, 5, 1, 1); g_signal_connect_swapped ( @@ -616,11 +598,7 @@ e_html_editor_spell_check_dialog_init (EHTMLEditorSpellCheckDialog *dialog) G_CALLBACK (html_editor_spell_check_dialog_set_dictionary), dialog); /* Add Word button */ - widget = gtk_button_new_with_mnemonic (_("Add Word")); - gtk_button_set_image ( - GTK_BUTTON (widget), - gtk_image_new_from_stock ( - GTK_STOCK_ADD, GTK_ICON_SIZE_BUTTON)); + widget = e_dialog_button_new_with_icon ("list-add", _("Add word")); gtk_grid_attach (main_layout, widget, 1, 7, 1, 1); dialog->priv->add_word_button = widget; diff --git a/e-util/e-html-editor-text-dialog.c b/e-util/e-html-editor-text-dialog.c index 2db792c70a..e0eb5fcf9e 100644 --- a/e-util/e-html-editor-text-dialog.c +++ b/e-util/e-html-editor-text-dialog.c @@ -208,7 +208,7 @@ e_html_editor_text_dialog_init (EHTMLEditorTextDialog *dialog) main_layout = e_html_editor_dialog_get_container (E_HTML_EDITOR_DIALOG (dialog)); /* Bold */ - widget = gtk_image_new_from_stock (GTK_STOCK_BOLD, GTK_ICON_SIZE_BUTTON); + widget = gtk_image_new_from_stock ("format-text-bold", GTK_ICON_SIZE_BUTTON); gtk_grid_attach (main_layout, widget, 0, 0, 1, 1); widget = gtk_check_button_new_with_mnemonic (_("_Bold")); @@ -219,7 +219,7 @@ e_html_editor_text_dialog_init (EHTMLEditorTextDialog *dialog) dialog->priv->bold_check = widget; /* Italic */ - widget = gtk_image_new_from_stock (GTK_STOCK_ITALIC, GTK_ICON_SIZE_BUTTON); + widget = gtk_image_new_from_stock ("format-text-italic", GTK_ICON_SIZE_BUTTON); gtk_grid_attach (main_layout, widget, 0, 1, 1, 1); widget = gtk_check_button_new_with_mnemonic (_("_Italic")); @@ -230,7 +230,7 @@ e_html_editor_text_dialog_init (EHTMLEditorTextDialog *dialog) dialog->priv->italic_check = widget; /* Underline */ - widget = gtk_image_new_from_stock (GTK_STOCK_UNDERLINE, GTK_ICON_SIZE_BUTTON); + widget = gtk_image_new_from_stock ("format-text-underline", GTK_ICON_SIZE_BUTTON); gtk_grid_attach (main_layout, widget, 0, 2, 1, 1); widget = gtk_check_button_new_with_mnemonic (_("_Underline")); @@ -240,7 +240,7 @@ e_html_editor_text_dialog_init (EHTMLEditorTextDialog *dialog) G_CALLBACK (html_editor_text_dialog_set_underline), dialog); dialog->priv->underline_check = widget; - widget = gtk_image_new_from_stock (GTK_STOCK_STRIKETHROUGH, GTK_ICON_SIZE_BUTTON); + widget = gtk_image_new_from_stock ("format-text-strikethrough", GTK_ICON_SIZE_BUTTON); gtk_grid_attach (main_layout, widget, 0, 3, 1, 1); widget = gtk_check_button_new_with_mnemonic (_("_Strikethrough")); diff --git a/e-util/e-image-chooser-dialog.c b/e-util/e-image-chooser-dialog.c index 73a6c202cb..936d39793e 100644 --- a/e-util/e-image-chooser-dialog.c +++ b/e-util/e-image-chooser-dialog.c @@ -18,6 +18,12 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + #include "e-image-chooser-dialog.h" #define E_IMAGE_CHOOSER_DIALOG_GET_PRIVATE(obj) \ @@ -159,10 +165,10 @@ image_chooser_dialog_constructed (GObject *object) gtk_dialog_add_button ( GTK_DIALOG (file_chooser), - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); + _("_Cancel"), GTK_RESPONSE_CANCEL); gtk_dialog_add_button ( GTK_DIALOG (file_chooser), - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT); + _("_Open"), GTK_RESPONSE_ACCEPT); gtk_dialog_set_default_response ( GTK_DIALOG (file_chooser), GTK_RESPONSE_ACCEPT); diff --git a/e-util/test-html-editor.c b/e-util/test-html-editor.c index 488eb44bf1..f461acbbe0 100644 --- a/e-util/test-html-editor.c +++ b/e-util/test-html-editor.c @@ -93,8 +93,8 @@ save_dialog (EHTMLEditor *editor) _("Save As"), GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (editor))), GTK_FILE_CHOOSER_ACTION_SAVE, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_Save"), GTK_RESPONSE_ACCEPT, NULL); gtk_file_chooser_set_do_overwrite_confirmation ( @@ -141,7 +141,7 @@ view_source_dialog (EHTMLEditor *editor, title, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (editor))), GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, + _("_Close"), GTK_RESPONSE_CLOSE, NULL); content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); @@ -296,35 +296,35 @@ action_view_inspector (GtkAction *action, static GtkActionEntry file_entries[] = { { "print", - GTK_STOCK_PRINT, + "document-print", N_("_Print..."), - NULL, + "p", NULL, G_CALLBACK (action_print_cb) }, { "print-preview", - GTK_STOCK_PRINT_PREVIEW, + "document-print-preview", N_("Print Pre_view"), - NULL, + "p", NULL, G_CALLBACK (action_print_preview_cb) }, { "quit", - GTK_STOCK_QUIT, + "application-exit", N_("_Quit"), NULL, NULL, G_CALLBACK (action_quit_cb) }, { "save", - GTK_STOCK_SAVE, + "document-save", N_("_Save"), NULL, NULL, G_CALLBACK (action_save_cb) }, { "save-as", - GTK_STOCK_SAVE_AS, + "document-save-as", N_("Save _As..."), NULL, NULL, diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c index 25c4771faa..126160ded8 100644 --- a/modules/mail/em-composer-prefs.c +++ b/modules/mail/em-composer-prefs.c @@ -1169,7 +1169,7 @@ em_composer_prefs_construct (EMComposerPrefs *prefs, info_pixmap = e_builder_get_widget (prefs->builder, "pixmapSpellInfo"); gtk_image_set_from_icon_name ( GTK_IMAGE (info_pixmap), - GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_BUTTON); + "dialog-information", GTK_ICON_SIZE_BUTTON); spell_setup (prefs); -- cgit v1.2.3