From b48e21d9aa7eb16e559739b71b9d08f90dfa92be Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 12 Feb 2014 20:45:53 +0100 Subject: Stop using deprecated gtk-stock items --- plugins/attachment-reminder/attachment-reminder.c | 8 +- plugins/email-custom-header/email-custom-header.c | 8 +- .../org-gnome-email-custom-header.ui | 15 ++-- plugins/external-editor/external-editor.c | 2 +- plugins/face/face.c | 12 +-- plugins/mail-to-task/mail-to-task.c | 6 +- plugins/publish-calendar/publish-calendar.c | 20 ++--- plugins/publish-calendar/publish-calendar.ui | 86 +++------------------- plugins/publish-calendar/url-editor-dialog.c | 4 +- plugins/save-calendar/save-calendar.c | 22 +++--- plugins/templates/templates.c | 10 ++- 11 files changed, 68 insertions(+), 125 deletions(-) (limited to 'plugins') diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index fc69cffa66..cd41cfb956 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -27,6 +27,8 @@ #include #include +#include + #include #include @@ -552,17 +554,17 @@ e_plugin_lib_get_configure_widget (EPlugin *plugin) gtk_button_box_set_layout (GTK_BUTTON_BOX (vbuttonbox2), GTK_BUTTONBOX_START); gtk_box_set_spacing (GTK_BOX (vbuttonbox2), 6); - clue_add = gtk_button_new_from_stock ("gtk-add"); + clue_add = e_dialog_button_new_with_icon ("list-add", _("_Add")); gtk_widget_show (clue_add); gtk_container_add (GTK_CONTAINER (vbuttonbox2), clue_add); gtk_widget_set_can_default (clue_add, TRUE); - clue_edit = gtk_button_new_from_stock ("gtk-edit"); + clue_edit = gtk_button_new_with_mnemonic (_("_Edit")); gtk_widget_show (clue_edit); gtk_container_add (GTK_CONTAINER (vbuttonbox2), clue_edit); gtk_widget_set_can_default (clue_edit, TRUE); - clue_remove = gtk_button_new_from_stock ("gtk-remove"); + clue_remove = e_dialog_button_new_with_icon ("list-remove", _("_Remove")); gtk_widget_show (clue_remove); gtk_container_add (GTK_CONTAINER (vbuttonbox2), clue_remove); gtk_widget_set_can_default (clue_remove, TRUE); diff --git a/plugins/email-custom-header/email-custom-header.c b/plugins/email-custom-header/email-custom-header.c index e2dc23878c..1642ea5ea7 100644 --- a/plugins/email-custom-header/email-custom-header.c +++ b/plugins/email-custom-header/email-custom-header.c @@ -26,6 +26,8 @@ #include #include +#include + #include "mail/em-utils.h" #include "mail/em-event.h" #include "composer/e-msg-composer.h" @@ -833,17 +835,17 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) gtk_button_box_set_layout (GTK_BUTTON_BOX (vbuttonbox1), GTK_BUTTONBOX_START); gtk_box_set_spacing (GTK_BOX (vbuttonbox1), 6); - header_add = gtk_button_new_from_stock ("gtk-add"); + header_add = e_dialog_button_new_with_icon ("list-add", _("_Add")); gtk_widget_show (header_add); gtk_container_add (GTK_CONTAINER (vbuttonbox1), header_add); gtk_widget_set_can_default (header_add, TRUE); - header_edit = gtk_button_new_from_stock ("gtk-edit"); + header_edit = gtk_button_new_with_mnemonic (_("_Edit")); gtk_widget_show (header_edit); gtk_container_add (GTK_CONTAINER (vbuttonbox1), header_edit); gtk_widget_set_can_default (header_edit, TRUE); - header_remove = gtk_button_new_from_stock ("gtk-remove"); + header_remove = e_dialog_button_new_with_icon ("list-remove", _("_Remove")); gtk_widget_show (header_remove); gtk_container_add (GTK_CONTAINER (vbuttonbox1), header_remove); gtk_widget_set_can_default (header_remove, TRUE); diff --git a/plugins/email-custom-header/org-gnome-email-custom-header.ui b/plugins/email-custom-header/org-gnome-email-custom-header.ui index 26857d9997..782ad2b785 100644 --- a/plugins/email-custom-header/org-gnome-email-custom-header.ui +++ b/plugins/email-custom-header/org-gnome-email-custom-header.ui @@ -32,8 +32,9 @@ True True True - gtk-help - True + _Help + False + True GTK_RELIEF_NORMAL True @@ -43,8 +44,9 @@ True True True - gtk-cancel - True + _Cancel + False + True GTK_RELIEF_NORMAL True @@ -54,8 +56,9 @@ True True True - gtk-ok - True + _OK + False + True GTK_RELIEF_NORMAL True diff --git a/plugins/external-editor/external-editor.c b/plugins/external-editor/external-editor.c index c58ac88bdc..46f3be3211 100644 --- a/plugins/external-editor/external-editor.c +++ b/plugins/external-editor/external-editor.c @@ -413,7 +413,7 @@ static void launch_editor (GtkAction *action, EMsgComposer *composer) static GtkActionEntry entries[] = { { "ExternalEditor", - GTK_STOCK_EDIT, + NULL, N_("Compose in External Editor"), "e", N_("Compose in External Editor"), diff --git a/plugins/face/face.c b/plugins/face/face.c index 1f0249c43b..e40bdfc16a 100644 --- a/plugins/face/face.c +++ b/plugins/face/face.c @@ -285,12 +285,12 @@ choose_new_face (void) GtkFileFilter *filter; filesel = gtk_file_chooser_dialog_new ( - _("Select a Face Picture"), - NULL, - GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_STOCK_CANCEL, - GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, GTK_RESPONSE_OK, NULL); + _("Select a Face Picture"), + NULL, + GTK_FILE_CHOOSER_ACTION_OPEN, + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_Open"), GTK_RESPONSE_OK, + NULL); gtk_dialog_set_default_response (GTK_DIALOG (filesel), GTK_RESPONSE_OK); diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c index 807b523a6d..a93848c850 100644 --- a/plugins/mail-to-task/mail-to-task.c +++ b/plugins/mail-to-task/mail-to-task.c @@ -590,9 +590,9 @@ do_ask (const gchar *text, if (is_create_edit_add) { gtk_dialog_add_buttons ( GTK_DIALOG (dialog), - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_EDIT, GTK_RESPONSE_YES, - GTK_STOCK_NEW, GTK_RESPONSE_NO, + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_Edit"), GTK_RESPONSE_YES, + _("_New"), GTK_RESPONSE_NO, NULL); } diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c index 67bfef945c..455c34a503 100644 --- a/plugins/publish-calendar/publish-calendar.c +++ b/plugins/publish-calendar/publish-calendar.c @@ -98,7 +98,7 @@ update_publish_notification (GtkMessageType msg_type, static gboolean can_notify = TRUE; #endif gboolean new_icon = !status_icon; - const gchar *stock_name; + const gchar *icon_name; g_return_if_fail (msg_text != NULL); @@ -114,13 +114,13 @@ update_publish_notification (GtkMessageType msg_type, switch (msg_type) { case GTK_MESSAGE_WARNING: - stock_name = GTK_STOCK_DIALOG_WARNING; + icon_name = "dialog-warning"; break; case GTK_MESSAGE_ERROR: - stock_name = GTK_STOCK_DIALOG_ERROR; + icon_name = "dialog-error"; break; default: - stock_name = GTK_STOCK_DIALOG_INFO; + icon_name = "dialog-information"; break; } @@ -131,20 +131,20 @@ update_publish_notification (GtkMessageType msg_type, g_string_append (actual_msg, msg_text); } - gtk_status_icon_set_from_stock (status_icon, stock_name); + gtk_status_icon_set_from_icon_name (status_icon, icon_name); gtk_status_icon_set_tooltip_text (status_icon, actual_msg->str); #ifdef HAVE_LIBNOTIFY if (can_notify) { if (notify) { - notify_notification_update (notify, _("Calendar Publishing"), actual_msg->str, stock_name); + notify_notification_update (notify, _("Calendar Publishing"), actual_msg->str, icon_name); } else { if (!notify_init ("evolution-publish-calendar")) { can_notify = FALSE; return; } - notify = notify_notification_new (_("Calendar Publishing"), actual_msg->str, stock_name); + notify = notify_notification_new (_("Calendar Publishing"), actual_msg->str, icon_name); notify_notification_set_urgency (notify, NOTIFY_URGENCY_NORMAL); notify_notification_set_timeout (notify, NOTIFY_EXPIRES_DEFAULT); notify_notification_set_hint ( @@ -803,8 +803,8 @@ url_remove_clicked (GtkButton *button, NULL, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, _("Are you sure you want to remove this location?")); - gtk_dialog_add_button (GTK_DIALOG (confirm), GTK_STOCK_CANCEL, GTK_RESPONSE_NO); - gtk_dialog_add_button (GTK_DIALOG (confirm), GTK_STOCK_REMOVE, GTK_RESPONSE_YES); + gtk_dialog_add_button (GTK_DIALOG (confirm), _("_Cancel"), GTK_RESPONSE_NO); + gtk_dialog_add_button (GTK_DIALOG (confirm), _("_Remove"), GTK_RESPONSE_YES); gtk_dialog_set_default_response (GTK_DIALOG (confirm), GTK_RESPONSE_CANCEL); response = gtk_dialog_run (GTK_DIALOG (confirm)); @@ -933,7 +933,7 @@ publish_calendar_locations (EPlugin *epl, gtk_widget_set_sensitive (GTK_WIDGET (ui->url_remove), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (ui->url_enable), FALSE); - gtk_button_set_image (GTK_BUTTON (ui->url_enable), gtk_image_new_from_stock (GTK_STOCK_APPLY, GTK_ICON_SIZE_BUTTON)); + gtk_button_set_image (GTK_BUTTON (ui->url_enable), gtk_image_new_from_icon_name ("dialog-apply", GTK_ICON_SIZE_BUTTON)); gtk_button_set_use_underline (GTK_BUTTON (ui->url_enable), TRUE); l = publish_uris; diff --git a/plugins/publish-calendar/publish-calendar.ui b/plugins/publish-calendar/publish-calendar.ui index 88bce4265e..f59ba9fc03 100644 --- a/plugins/publish-calendar/publish-calendar.ui +++ b/plugins/publish-calendar/publish-calendar.ui @@ -716,12 +716,13 @@ start - gtk-add + _Add True True True True - True + False + True False @@ -735,42 +736,8 @@ True True True - - - True - 0 - 0 - - - True - 2 - - - True - gtk-properties - - - False - False - 0 - - - - - True - _Edit - True - - - False - False - 1 - - - - - - + _Edit + True False @@ -780,12 +747,13 @@ - gtk-remove + _Remove True True True True - True + False + True False @@ -799,42 +767,8 @@ True True True - - - True - 0 - 0 - - - True - 2 - - - True - gtk-apply - - - False - False - 0 - - - - - True - E_nable - True - - - False - False - 1 - - - - - - + E_nable + True False diff --git a/plugins/publish-calendar/url-editor-dialog.c b/plugins/publish-calendar/url-editor-dialog.c index 9173cdeb38..dfbbe69413 100644 --- a/plugins/publish-calendar/url-editor-dialog.c +++ b/plugins/publish-calendar/url-editor-dialog.c @@ -418,8 +418,8 @@ url_editor_dialog_construct (UrlEditorDialog *dialog) gtk_container_set_border_width (GTK_CONTAINER (dialog), 6); - dialog->cancel = gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); - dialog->ok = gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_OK, GTK_RESPONSE_OK); + dialog->cancel = gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), GTK_RESPONSE_CANCEL); + dialog->ok = gtk_dialog_add_button (GTK_DIALOG (dialog), _("_OK"), GTK_RESPONSE_OK); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE); diff --git a/plugins/save-calendar/save-calendar.c b/plugins/save-calendar/save-calendar.c index 79f3117c8e..9d02ab85a3 100644 --- a/plugins/save-calendar/save-calendar.c +++ b/plugins/save-calendar/save-calendar.c @@ -186,8 +186,8 @@ ask_destination_and_save (ESourceSelector *selector, _("Select destination file"), NULL, GTK_FILE_CHOOSER_ACTION_SAVE, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_SAVE_AS, GTK_RESPONSE_OK, + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_Save As"), GTK_RESPONSE_OK, NULL); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); @@ -338,15 +338,15 @@ calendar_save_as_init (GtkUIManager *ui_manager, GtkActionGroup *action_group; GtkAction *action; const gchar *tooltip; - const gchar *stock_id; + const gchar *icon_name; const gchar *name; shell_window = e_shell_view_get_shell_window (shell_view); name = "calendar-save-as"; tooltip = _("Save the selected calendar to disk"); - stock_id = GTK_STOCK_SAVE_AS; - action = gtk_action_new (name, NULL, tooltip, stock_id); + icon_name = "document-save-as"; + action = gtk_action_new (name, _("Save _As"), tooltip, icon_name); name = "lockdown-save-to-disk"; action_group = e_shell_window_get_action_group (shell_window, name); @@ -369,15 +369,15 @@ memo_list_save_as_init (GtkUIManager *ui_manager, GtkActionGroup *action_group; GtkAction *action; const gchar *tooltip; - const gchar *stock_id; + const gchar *icon_name; const gchar *name; shell_window = e_shell_view_get_shell_window (shell_view); name = "memo-list-save-as"; tooltip = _("Save the selected memo list to disk"); - stock_id = GTK_STOCK_SAVE_AS; - action = gtk_action_new (name, NULL, tooltip, stock_id); + icon_name = "document-save-as"; + action = gtk_action_new (name, _("Save _As"), tooltip, icon_name); name = "lockdown-save-to-disk"; action_group = e_shell_window_get_action_group (shell_window, name); @@ -400,15 +400,15 @@ task_list_save_as_init (GtkUIManager *ui_manager, GtkActionGroup *action_group; GtkAction *action; const gchar *tooltip; - const gchar *stock_id; + const gchar *icon_name; const gchar *name; shell_window = e_shell_view_get_shell_window (shell_view); name = "task-list-save-as"; tooltip = _("Save the selected task list to disk"); - stock_id = GTK_STOCK_SAVE_AS; - action = gtk_action_new (name, NULL, tooltip, stock_id); + icon_name = "document-save-as"; + action = gtk_action_new (name, _("Save _As"), tooltip, icon_name); name = "lockdown-save-to-disk"; action_group = e_shell_window_get_action_group (shell_window, name); diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c index 070c7b27d5..fbe20d0adc 100644 --- a/plugins/templates/templates.c +++ b/plugins/templates/templates.c @@ -29,6 +29,8 @@ #include #include +#include + #include #include @@ -448,17 +450,17 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) gtk_button_box_set_layout (GTK_BUTTON_BOX (vbuttonbox2), GTK_BUTTONBOX_START); gtk_box_set_spacing (GTK_BOX (vbuttonbox2), 6); - clue_add = gtk_button_new_from_stock ("gtk-add"); + clue_add = e_dialog_button_new_with_icon ("list-add", _("_Add")); gtk_widget_show (clue_add); gtk_container_add (GTK_CONTAINER (vbuttonbox2), clue_add); gtk_widget_set_can_default (clue_add, TRUE); - clue_edit = gtk_button_new_from_stock ("gtk-edit"); + clue_edit = gtk_button_new_with_mnemonic (_("_Edit")); gtk_widget_show (clue_edit); gtk_container_add (GTK_CONTAINER (vbuttonbox2), clue_edit); gtk_widget_set_can_default (clue_edit, TRUE); - clue_remove = gtk_button_new_from_stock ("gtk-remove"); + clue_remove = e_dialog_button_new_with_icon ("list-remove", _("_Remove")); gtk_widget_show (clue_remove); gtk_container_add (GTK_CONTAINER (vbuttonbox2), clue_remove); gtk_widget_set_can_default (clue_remove, TRUE); @@ -1249,7 +1251,7 @@ action_template_cb (GtkAction *action, static GtkActionEntry composer_entries[] = { { "template", - GTK_STOCK_SAVE, + "document-save", N_("Save as _Template"), "t", N_("Save as Template"), -- cgit v1.2.3