Skip to content
Permalink
Browse files

avoid deprecated GtkStock

  • Loading branch information...
sc0w authored and raveit65 committed Jan 18, 2018
1 parent 29d362e commit 2217a021ca5c5ac918dd6e41c4ef29435b5a6b8e
@@ -222,7 +222,7 @@ PlumaPanelPrivate
PlumaPanel
pluma_panel_new
pluma_panel_add_item
pluma_panel_add_item_with_stock_icon
pluma_panel_add_item_with_icon
pluma_panel_remove_item
pluma_panel_activate_item
pluma_panel_item_is_active
@@ -277,7 +277,7 @@ PlumaProgressMessageAreaPrivate
<TITLE>PlumaProgressMessageArea</TITLE>
PlumaProgressMessageArea
pluma_progress_message_area_new
pluma_progress_message_area_set_stock_image
pluma_progress_message_area_set_image
pluma_progress_message_area_set_markup
pluma_progress_message_area_set_text
pluma_progress_message_area_set_fraction
@@ -699,7 +699,7 @@ pluma_utils_uri_has_writable_scheme
pluma_utils_uri_has_file_scheme
pluma_utils_menu_position_under_widget
pluma_utils_menu_position_under_tree_view
pluma_gtk_button_new_with_stock_icon
pluma_gtk_button_new_with_icon
pluma_dialog_add_button
pluma_utils_escape_underscores
pluma_utils_str_middle_truncate
@@ -574,7 +574,7 @@ on_selection_changed_cb (GtkTreeSelection *selection,

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

gtk_widget_show(image);
@@ -1141,7 +1141,7 @@ on_confirm_no_trash_cb (PlumaFileBrowserWidget * widget,
GTK_MESSAGE_QUESTION,
message,
secondary,
GTK_STOCK_DELETE,
"gtk-delete",
NULL);
g_free (secondary);

@@ -1176,7 +1176,7 @@ on_confirm_delete_cb (PlumaFileBrowserWidget *widget,
GTK_MESSAGE_QUESTION,
message,
secondary,
GTK_STOCK_DELETE,
"gtk-delete",
NULL);

g_free (message);
@@ -149,7 +149,7 @@ pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
GtkMessageType type,
gchar const *message,
gchar const *secondary,
gchar const * button_stock,
gchar const * button_image,
gchar const * button_label)
{
GtkWidget *dlg;
@@ -167,7 +167,12 @@ pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
(GTK_MESSAGE_DIALOG (dlg), "%s", secondary);

/* Add a cancel button */
button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
"label", "gtk-cancel",
"use-stock", TRUE,
"use-underline", TRUE,
NULL));

gtk_widget_show (button);

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

/* Add custom button */
button = gtk_button_new_from_stock (button_stock);

button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
"label", button_image,
"use-stock", TRUE,
"use-underline", TRUE,
NULL));

if (button_label) {
gtk_button_set_use_stock (GTK_BUTTON (button), FALSE);
gtk_button_set_label (GTK_BUTTON (button), button_label);
}

@@ -19,7 +19,7 @@ gboolean pluma_file_browser_utils_confirmation_dialog (PlumaWindow * window,
GtkMessageType type,
gchar const *message,
gchar const *secondary,
gchar const * button_stock,
gchar const * button_image,
gchar const * button_label);

#endif /* __PLUMA_FILE_BROWSER_UTILS_H__ */
@@ -802,30 +802,30 @@ static const GtkActionEntry tree_actions_selection[] =
{"FileMoveToTrash", "mate-stock-trash", N_("_Move to Trash"), NULL,
N_("Move selected file or folder to trash"),
G_CALLBACK (on_action_file_move_to_trash)},
{"FileDelete", GTK_STOCK_DELETE, N_("_Delete"), NULL,
{"FileDelete", "edit-delete", N_("_Delete"), NULL,
N_("Delete selected file or folder"),
G_CALLBACK (on_action_file_delete)}
};

static const GtkActionEntry tree_actions_file_selection[] =
{
{"FileOpen", GTK_STOCK_OPEN, NULL, NULL,
{"FileOpen", "document-open", N_("_Open"), NULL,
N_("Open selected file"),
G_CALLBACK (on_action_file_open)}
};

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

static const GtkActionEntry tree_actions_single_most_selection[] =
{
{"DirectoryNew", GTK_STOCK_ADD, N_("_New Folder"), NULL,
{"DirectoryNew", "list-add", N_("_New Folder"), NULL,
N_("Add new empty folder"),
G_CALLBACK (on_action_directory_new)},
{"FileNew", GTK_STOCK_NEW, N_("New F_ile"), NULL,
{"FileNew", "document-new", N_("New F_ile"), NULL,
N_("Add new empty file"), G_CALLBACK (on_action_file_new)}
};

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

static const GtkActionEntry tree_actions_sensitive[] =
{
{"DirectoryPrevious", GTK_STOCK_GO_BACK, N_("_Previous Location"),
{"DirectoryPrevious", "go-previous", N_("_Previous Location"),
NULL,
N_("Go to the previous visited location"),
G_CALLBACK (on_action_directory_previous)},
{"DirectoryNext", GTK_STOCK_GO_FORWARD, N_("_Next Location"), NULL,
{"DirectoryNext", "go-next", N_("_Next Location"), NULL,
N_("Go to the next visited location"), G_CALLBACK (on_action_directory_next)},
{"DirectoryRefresh", GTK_STOCK_REFRESH, N_("Re_fresh View"), NULL,
{"DirectoryRefresh", "view-refresh", N_("Re_fresh View"), NULL,
N_("Refresh the view"), G_CALLBACK (on_action_directory_refresh)},
{"DirectoryOpen", GTK_STOCK_OPEN, N_("_View Folder"), NULL,
{"DirectoryOpen", "document-open", N_("_View Folder"), NULL,
N_("View folder in file manager"),
G_CALLBACK (on_action_directory_open)}
};

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

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

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

widget = GTK_WIDGET (gtk_menu_tool_button_new_from_stock (GTK_STOCK_GO_BACK));
widget = GTK_WIDGET (gtk_menu_tool_button_new (gtk_image_new_from_icon_name ("go-previous",
GTK_ICON_SIZE_MENU),
_("Previous location")));

gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (widget),
obj->priv->location_previous_menu);

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

widget = GTK_WIDGET (gtk_menu_tool_button_new_from_stock (GTK_STOCK_GO_FORWARD));
widget = GTK_WIDGET (gtk_menu_tool_button_new (gtk_image_new_from_icon_name ("go-next",
GTK_ICON_SIZE_MENU),
_("Next location")));

gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (widget),
obj->priv->location_next_menu);

g_object_set (widget, "label", _("Next location"), NULL);
gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (widget),
_("Go to next location"));
gtk_menu_tool_button_set_arrow_tooltip_text (GTK_MENU_TOOL_BUTTON (widget),
@@ -90,7 +90,7 @@ static void sort_real (SortDialog *dialog);
static const GtkActionEntry action_entries[] =
{
{ "Sort",
GTK_STOCK_SORT_ASCENDING,
"view-sort-ascending",
N_("S_ort..."),
NULL,
N_("Sort the current document or selection"),
@@ -498,8 +498,8 @@ build_suggestion_menu (PlumaAutomaticSpellChecker *spell, const gchar *word)
/* Ignore all */
mi = gtk_image_menu_item_new_with_mnemonic (_("_Ignore All"));
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi),
gtk_image_new_from_stock (GTK_STOCK_GOTO_BOTTOM,
GTK_ICON_SIZE_MENU));
gtk_image_new_from_icon_name ("go-bottom",
GTK_ICON_SIZE_MENU));

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

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

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

@@ -130,11 +130,11 @@ create_dialog (PlumaSpellLanguageDialog *dlg,
};

gtk_dialog_add_buttons (GTK_DIALOG (dlg),
GTK_STOCK_CANCEL,
"gtk-cancel",
GTK_RESPONSE_CANCEL,
GTK_STOCK_OK,
"gtk-ok",
GTK_RESPONSE_OK,
GTK_STOCK_HELP,
"gtk-help",
GTK_RESPONSE_HELP,
NULL);

@@ -96,7 +96,7 @@ static void auto_spell_cb (GtkAction *action, PlumaSpellPlugin *plugin);
static const GtkActionEntry action_entries[] =
{
{ "CheckSpell",
GTK_STOCK_SPELL_CHECK,
"tools-check-spelling",
N_("_Check Spelling..."),
"<shift>F7",
N_("Check the current document for incorrect spelling"),
@@ -120,10 +120,10 @@ pluma_taglist_plugin_activate (PeasActivatable *activatable)
priv->taglist_panel = pluma_taglist_plugin_panel_new (window, data_dir);
g_free (data_dir);

pluma_panel_add_item_with_stock_icon (side_panel,
priv->taglist_panel,
_("Tags"),
"list-add");
pluma_panel_add_item_with_icon (side_panel,
priv->taglist_panel,
_("Tags"),
"list-add");
}

static void
@@ -919,7 +919,7 @@ get_choose_format_dialog (GtkWindow *parent,
err_dialog = gtk_dialog_new_with_buttons (NULL,
parent,
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
"gtk-ok", GTK_RESPONSE_ACCEPT,
NULL);

if (wg != NULL)
@@ -142,7 +142,7 @@ set_logout_mode (PlumaCloseConfirmationDialog *dlg,

pluma_dialog_add_button (GTK_DIALOG (dlg),
_("_Cancel Logout"),
GTK_STOCK_CANCEL,
"process-stop",
GTK_RESPONSE_CANCEL);
}
else
@@ -152,7 +152,7 @@ set_logout_mode (PlumaCloseConfirmationDialog *dlg,
GTK_RESPONSE_NO);

gtk_dialog_add_button (GTK_DIALOG (dlg),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
"gtk-cancel", GTK_RESPONSE_CANCEL);
}

if (dlg->priv->disable_save_to_disk)
@@ -162,7 +162,7 @@ set_logout_mode (PlumaCloseConfirmationDialog *dlg,
}
else
{
const gchar *stock_id = GTK_STOCK_SAVE;
const gchar *icon_id = "gtk-save";

if (GET_MODE (dlg->priv) == SINGLE_DOC_MODE)
{
@@ -172,11 +172,11 @@ set_logout_mode (PlumaCloseConfirmationDialog *dlg,

if (pluma_document_get_readonly (doc) ||
pluma_document_is_untitled (doc))
stock_id = GTK_STOCK_SAVE_AS;
icon_id = "gtk-save-as";
}

gtk_dialog_add_button (GTK_DIALOG (dlg),
stock_id,
icon_id,
GTK_RESPONSE_YES);

gtk_dialog_set_default_response (GTK_DIALOG (dlg),
@@ -310,11 +310,11 @@ pluma_encodings_dialog_init (PlumaEncodingsDialog *dlg)
dlg->priv = PLUMA_ENCODINGS_DIALOG_GET_PRIVATE (dlg);

gtk_dialog_add_buttons (GTK_DIALOG (dlg),
GTK_STOCK_CANCEL,
"gtk-cancel",
GTK_RESPONSE_CANCEL,
GTK_STOCK_OK,
"gtk-ok",
GTK_RESPONSE_OK,
GTK_STOCK_HELP,
"gtk-help",
GTK_RESPONSE_HELP,
NULL);

@@ -810,12 +810,12 @@ install_scheme_clicked (GtkButton *button,
chooser = gtk_file_chooser_dialog_new (_("Add Scheme"),
GTK_WINDOW (dlg),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
"gtk-cancel", GTK_RESPONSE_CANCEL,
NULL);

pluma_dialog_add_button (GTK_DIALOG (chooser),
_("A_dd Scheme"),
GTK_STOCK_ADD,
"list-add",
GTK_RESPONSE_ACCEPT);

gtk_window_set_destroy_with_parent (GTK_WINDOW (chooser), TRUE);
@@ -1079,9 +1079,9 @@ pluma_preferences_dialog_init (PlumaPreferencesDialog *dlg)
dlg->priv = PLUMA_PREFERENCES_DIALOG_GET_PRIVATE (dlg);

gtk_dialog_add_buttons (GTK_DIALOG (dlg),
GTK_STOCK_CLOSE,
"gtk-close",
GTK_RESPONSE_CLOSE,
GTK_STOCK_HELP,
"gtk-help",
GTK_RESPONSE_HELP,
NULL);

Oops, something went wrong.

0 comments on commit 2217a02

Please sign in to comment.
You can’t perform that action at this time.