Skip to content

Commit 2217a02

Browse files
sc0wraveit65
authored andcommitted
avoid deprecated GtkStock
1 parent 29d362e commit 2217a02

27 files changed

+193
-174
lines changed

‎docs/reference/pluma-sections.txt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ PlumaPanelPrivate
222222
PlumaPanel
223223
pluma_panel_new
224224
pluma_panel_add_item
225-
pluma_panel_add_item_with_stock_icon
225+
pluma_panel_add_item_with_icon
226226
pluma_panel_remove_item
227227
pluma_panel_activate_item
228228
pluma_panel_item_is_active
@@ -277,7 +277,7 @@ PlumaProgressMessageAreaPrivate
277277
<TITLE>PlumaProgressMessageArea</TITLE>
278278
PlumaProgressMessageArea
279279
pluma_progress_message_area_new
280-
pluma_progress_message_area_set_stock_image
280+
pluma_progress_message_area_set_image
281281
pluma_progress_message_area_set_markup
282282
pluma_progress_message_area_set_text
283283
pluma_progress_message_area_set_fraction
@@ -699,7 +699,7 @@ pluma_utils_uri_has_writable_scheme
699699
pluma_utils_uri_has_file_scheme
700700
pluma_utils_menu_position_under_widget
701701
pluma_utils_menu_position_under_tree_view
702-
pluma_gtk_button_new_with_stock_icon
702+
pluma_gtk_button_new_with_icon
703703
pluma_dialog_add_button
704704
pluma_utils_escape_underscores
705705
pluma_utils_str_middle_truncate

‎plugins/filebrowser/pluma-file-browser-plugin.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ on_selection_changed_cb (GtkTreeSelection *selection,
574574

575575
static GtkActionEntry extra_actions[] =
576576
{
577-
{"SetActiveRoot", GTK_STOCK_JUMP_TO, N_("_Set root to active document"),
577+
{"SetActiveRoot", "go-jump", N_("_Set root to active document"),
578578
NULL,
579579
N_("Set the root to the active document location"),
580580
G_CALLBACK (on_action_set_active_root)}
@@ -717,7 +717,7 @@ pluma_file_browser_plugin_activate (PeasActivatable *activatable)
717717
image = gtk_image_new_from_pixbuf(pixbuf);
718718
g_object_unref(pixbuf);
719719
} else {
720-
image = gtk_image_new_from_stock(GTK_STOCK_INDEX, GTK_ICON_SIZE_MENU);
720+
image = gtk_image_new_from_icon_name("gtk-index", GTK_ICON_SIZE_MENU);
721721
}
722722

723723
gtk_widget_show(image);
@@ -1141,7 +1141,7 @@ on_confirm_no_trash_cb (PlumaFileBrowserWidget * widget,
11411141
GTK_MESSAGE_QUESTION,
11421142
message,
11431143
secondary,
1144-
GTK_STOCK_DELETE,
1144+
"gtk-delete",
11451145
NULL);
11461146
g_free (secondary);
11471147

@@ -1176,7 +1176,7 @@ on_confirm_delete_cb (PlumaFileBrowserWidget *widget,
11761176
GTK_MESSAGE_QUESTION,
11771177
message,
11781178
secondary,
1179-
GTK_STOCK_DELETE,
1179+
"gtk-delete",
11801180
NULL);
11811181

11821182
g_free (message);

‎plugins/filebrowser/pluma-file-browser-utils.c‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
149149
GtkMessageType type,
150150
gchar const *message,
151151
gchar const *secondary,
152-
gchar const * button_stock,
152+
gchar const * button_image,
153153
gchar const * button_label)
154154
{
155155
GtkWidget *dlg;
@@ -167,7 +167,12 @@ pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
167167
(GTK_MESSAGE_DIALOG (dlg), "%s", secondary);
168168

169169
/* Add a cancel button */
170-
button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
170+
button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
171+
"label", "gtk-cancel",
172+
"use-stock", TRUE,
173+
"use-underline", TRUE,
174+
NULL));
175+
171176
gtk_widget_show (button);
172177

173178
gtk_widget_set_can_default (button, TRUE);
@@ -176,10 +181,13 @@ pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
176181
GTK_RESPONSE_CANCEL);
177182

178183
/* Add custom button */
179-
button = gtk_button_new_from_stock (button_stock);
180-
184+
button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
185+
"label", button_image,
186+
"use-stock", TRUE,
187+
"use-underline", TRUE,
188+
NULL));
189+
181190
if (button_label) {
182-
gtk_button_set_use_stock (GTK_BUTTON (button), FALSE);
183191
gtk_button_set_label (GTK_BUTTON (button), button_label);
184192
}
185193

‎plugins/filebrowser/pluma-file-browser-utils.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ gboolean pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
1919
GtkMessageType type,
2020
gchar const *message,
2121
gchar const *secondary,
22-
gchar const * button_stock,
22+
gchar const * button_image,
2323
gchar const * button_label);
2424

2525
#endif /* __PLUMA_FILE_BROWSER_UTILS_H__ */

‎plugins/filebrowser/pluma-file-browser-widget.c‎

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -802,30 +802,30 @@ static const GtkActionEntry tree_actions_selection[] =
802802
{"FileMoveToTrash", "mate-stock-trash", N_("_Move to Trash"), NULL,
803803
N_("Move selected file or folder to trash"),
804804
G_CALLBACK (on_action_file_move_to_trash)},
805-
{"FileDelete", GTK_STOCK_DELETE, N_("_Delete"), NULL,
805+
{"FileDelete", "edit-delete", N_("_Delete"), NULL,
806806
N_("Delete selected file or folder"),
807807
G_CALLBACK (on_action_file_delete)}
808808
};
809809

810810
static const GtkActionEntry tree_actions_file_selection[] =
811811
{
812-
{"FileOpen", GTK_STOCK_OPEN, NULL, NULL,
812+
{"FileOpen", "document-open", N_("_Open"), NULL,
813813
N_("Open selected file"),
814814
G_CALLBACK (on_action_file_open)}
815815
};
816816

817817
static const GtkActionEntry tree_actions[] =
818818
{
819-
{"DirectoryUp", GTK_STOCK_GO_UP, N_("Up"), NULL,
819+
{"DirectoryUp", "go-up", N_("Up"), NULL,
820820
N_("Open the parent folder"), G_CALLBACK (on_action_directory_up)}
821821
};
822822

823823
static const GtkActionEntry tree_actions_single_most_selection[] =
824824
{
825-
{"DirectoryNew", GTK_STOCK_ADD, N_("_New Folder"), NULL,
825+
{"DirectoryNew", "list-add", N_("_New Folder"), NULL,
826826
N_("Add new empty folder"),
827827
G_CALLBACK (on_action_directory_new)},
828-
{"FileNew", GTK_STOCK_NEW, N_("New F_ile"), NULL,
828+
{"FileNew", "document-new", N_("New F_ile"), NULL,
829829
N_("Add new empty file"), G_CALLBACK (on_action_file_new)}
830830
};
831831

@@ -838,22 +838,22 @@ static const GtkActionEntry tree_actions_single_selection[] =
838838

839839
static const GtkActionEntry tree_actions_sensitive[] =
840840
{
841-
{"DirectoryPrevious", GTK_STOCK_GO_BACK, N_("_Previous Location"),
841+
{"DirectoryPrevious", "go-previous", N_("_Previous Location"),
842842
NULL,
843843
N_("Go to the previous visited location"),
844844
G_CALLBACK (on_action_directory_previous)},
845-
{"DirectoryNext", GTK_STOCK_GO_FORWARD, N_("_Next Location"), NULL,
845+
{"DirectoryNext", "go-next", N_("_Next Location"), NULL,
846846
N_("Go to the next visited location"), G_CALLBACK (on_action_directory_next)},
847-
{"DirectoryRefresh", GTK_STOCK_REFRESH, N_("Re_fresh View"), NULL,
847+
{"DirectoryRefresh", "view-refresh", N_("Re_fresh View"), NULL,
848848
N_("Refresh the view"), G_CALLBACK (on_action_directory_refresh)},
849-
{"DirectoryOpen", GTK_STOCK_OPEN, N_("_View Folder"), NULL,
849+
{"DirectoryOpen", "document-open", N_("_View Folder"), NULL,
850850
N_("View folder in file manager"),
851851
G_CALLBACK (on_action_directory_open)}
852852
};
853853

854854
static const GtkToggleActionEntry tree_actions_toggle[] =
855855
{
856-
{"FilterHidden", GTK_STOCK_DIALOG_AUTHENTICATION,
856+
{"FilterHidden", "dialog-password",
857857
N_("Show _Hidden"), NULL,
858858
N_("Show hidden files and folders"),
859859
G_CALLBACK (on_action_filter_hidden), FALSE},
@@ -864,7 +864,7 @@ static const GtkToggleActionEntry tree_actions_toggle[] =
864864

865865
static const GtkActionEntry bookmark_actions[] =
866866
{
867-
{"BookmarkOpen", GTK_STOCK_OPEN, N_("_View Folder"), NULL,
867+
{"BookmarkOpen", "document-open", N_("_View Folder"), NULL,
868868
N_("View folder in file manager"), G_CALLBACK (on_action_bookmark_open)}
869869
};
870870

@@ -986,11 +986,13 @@ create_toolbar (PlumaFileBrowserWidget * obj,
986986
obj->priv->location_previous_menu = gtk_menu_new ();
987987
gtk_widget_show (obj->priv->location_previous_menu);
988988

989-
widget = GTK_WIDGET (gtk_menu_tool_button_new_from_stock (GTK_STOCK_GO_BACK));
989+
widget = GTK_WIDGET (gtk_menu_tool_button_new (gtk_image_new_from_icon_name ("go-previous",
990+
GTK_ICON_SIZE_MENU),
991+
_("Previous location")));
992+
990993
gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (widget),
991994
obj->priv->location_previous_menu);
992995

993-
g_object_set (widget, "label", _("Previous location"), NULL);
994996
gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (widget),
995997
_("Go to previous location"));
996998
gtk_menu_tool_button_set_arrow_tooltip_text (GTK_MENU_TOOL_BUTTON (widget),
@@ -1007,11 +1009,13 @@ create_toolbar (PlumaFileBrowserWidget * obj,
10071009
obj->priv->location_next_menu = gtk_menu_new ();
10081010
gtk_widget_show (obj->priv->location_next_menu);
10091011

1010-
widget = GTK_WIDGET (gtk_menu_tool_button_new_from_stock (GTK_STOCK_GO_FORWARD));
1012+
widget = GTK_WIDGET (gtk_menu_tool_button_new (gtk_image_new_from_icon_name ("go-next",
1013+
GTK_ICON_SIZE_MENU),
1014+
_("Next location")));
1015+
10111016
gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (widget),
10121017
obj->priv->location_next_menu);
10131018

1014-
g_object_set (widget, "label", _("Next location"), NULL);
10151019
gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (widget),
10161020
_("Go to next location"));
10171021
gtk_menu_tool_button_set_arrow_tooltip_text (GTK_MENU_TOOL_BUTTON (widget),

‎plugins/sort/pluma-sort-plugin.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static void sort_real (SortDialog *dialog);
9090
static const GtkActionEntry action_entries[] =
9191
{
9292
{ "Sort",
93-
GTK_STOCK_SORT_ASCENDING,
93+
"view-sort-ascending",
9494
N_("S_ort..."),
9595
NULL,
9696
N_("Sort the current document or selection"),

‎plugins/spell/pluma-automatic-spell-checker.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ build_suggestion_menu (PlumaAutomaticSpellChecker *spell, const gchar *word)
498498
/* Ignore all */
499499
mi = gtk_image_menu_item_new_with_mnemonic (_("_Ignore All"));
500500
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi),
501-
gtk_image_new_from_stock (GTK_STOCK_GOTO_BOTTOM,
502-
GTK_ICON_SIZE_MENU));
501+
gtk_image_new_from_icon_name ("go-bottom",
502+
GTK_ICON_SIZE_MENU));
503503

504504
g_signal_connect (mi,
505505
"activate",
@@ -513,8 +513,8 @@ build_suggestion_menu (PlumaAutomaticSpellChecker *spell, const gchar *word)
513513
/* + Add to Dictionary */
514514
mi = gtk_image_menu_item_new_with_mnemonic (_("_Add"));
515515
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi),
516-
gtk_image_new_from_stock (GTK_STOCK_ADD,
517-
GTK_ICON_SIZE_MENU));
516+
gtk_image_new_from_icon_name ("list-add",
517+
GTK_ICON_SIZE_MENU));
518518

519519
g_signal_connect (mi,
520520
"activate",
@@ -549,7 +549,7 @@ populate_popup (GtkTextView *textview, GtkMenu *menu, PlumaAutomaticSpellChecker
549549
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), mi);
550550

551551
/* then, on top of it, the suggestions menu. */
552-
img = gtk_image_new_from_stock (GTK_STOCK_SPELL_CHECK, GTK_ICON_SIZE_MENU);
552+
img = gtk_image_new_from_icon_name ("tools-check-spelling", GTK_ICON_SIZE_MENU);
553553
mi = gtk_image_menu_item_new_with_mnemonic (_("_Spelling Suggestions..."));
554554
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), img);
555555

‎plugins/spell/pluma-spell-language-dialog.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ create_dialog (PlumaSpellLanguageDialog *dlg,
130130
};
131131

132132
gtk_dialog_add_buttons (GTK_DIALOG (dlg),
133-
GTK_STOCK_CANCEL,
133+
"gtk-cancel",
134134
GTK_RESPONSE_CANCEL,
135-
GTK_STOCK_OK,
135+
"gtk-ok",
136136
GTK_RESPONSE_OK,
137-
GTK_STOCK_HELP,
137+
"gtk-help",
138138
GTK_RESPONSE_HELP,
139139
NULL);
140140

‎plugins/spell/pluma-spell-plugin.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static void auto_spell_cb (GtkAction *action, PlumaSpellPlugin *plugin);
9696
static const GtkActionEntry action_entries[] =
9797
{
9898
{ "CheckSpell",
99-
GTK_STOCK_SPELL_CHECK,
99+
"tools-check-spelling",
100100
N_("_Check Spelling..."),
101101
"<shift>F7",
102102
N_("Check the current document for incorrect spelling"),

‎plugins/taglist/pluma-taglist-plugin.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ pluma_taglist_plugin_activate (PeasActivatable *activatable)
120120
priv->taglist_panel = pluma_taglist_plugin_panel_new (window, data_dir);
121121
g_free (data_dir);
122122

123-
pluma_panel_add_item_with_stock_icon (side_panel,
124-
priv->taglist_panel,
125-
_("Tags"),
126-
"list-add");
123+
pluma_panel_add_item_with_icon (side_panel,
124+
priv->taglist_panel,
125+
_("Tags"),
126+
"list-add");
127127
}
128128

129129
static void

0 commit comments

Comments
 (0)