Skip to content
Permalink
Browse files

avoid deprecated GtkStock

  • Loading branch information...
sc0w authored and raveit65 committed Feb 14, 2018
1 parent dab6502 commit 70a60111e00fe834e1303d87265c1aa65cb1f086
@@ -1728,9 +1728,9 @@ baobab_chart_save_snapshot (GtkWidget *chart)
fs_dlg = gtk_file_chooser_dialog_new (_("Save Snapshot"),
NULL,
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL,
"gtk-cancel",
GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE,
"gtk-save",
GTK_RESPONSE_ACCEPT, NULL);

item = (BaobabChartItem *) priv->first_item->data;
@@ -723,7 +723,7 @@ baobab_remote_connect_dialog_init (BaobabRemoteConnectDialog *dialog)
setup_for_type (dialog);

gtk_dialog_add_button (GTK_DIALOG (dialog),
GTK_STOCK_CANCEL,
"gtk-cancel",
GTK_RESPONSE_CANCEL);
gtk_dialog_add_button (GTK_DIALOG (dialog),
_("_Scan"),
@@ -106,9 +106,9 @@ dir_select (gboolean SEARCH, GtkWidget *parent)
file_chooser = gtk_file_chooser_dialog_new (_("Select Folder"),
GTK_WINDOW (parent),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
GTK_STOCK_CANCEL,
"gtk-cancel",
GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN,
"gtk-open",
GTK_RESPONSE_OK, NULL);

gtk_file_chooser_set_show_hidden (GTK_FILE_CHOOSER (file_chooser), FALSE);
@@ -369,7 +369,12 @@ display_dialog_file_open_limit (GtkWidget * window,
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14);

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

gtk_widget_set_can_default (button, TRUE);
gtk_widget_show (button);

@@ -566,7 +571,12 @@ display_dialog_folder_open_limit (GtkWidget * window,
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14);

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

gtk_widget_set_can_default (button, TRUE);
gtk_widget_show (button);

@@ -746,7 +756,12 @@ display_dialog_delete_permanently (GtkWidget * window,
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14);

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

gtk_widget_set_can_default (button, TRUE);
gtk_widget_show (button);

@@ -1094,7 +1109,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch,
gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (new1), file_icon != NULL);

if (file_icon == NULL) {
file_icon = g_themed_icon_new (GTK_STOCK_OPEN);
file_icon = g_themed_icon_new ("gtk-open");
}

image1 = gtk_image_new_from_gicon (file_icon, GTK_ICON_SIZE_MENU);
@@ -1132,7 +1147,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch,
gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (new1), file_icon != NULL);

if (file_icon == NULL) {
file_icon = g_themed_icon_new (GTK_STOCK_OPEN);
file_icon = g_themed_icon_new ("gtk-open");
}

image1 = gtk_image_new_from_gicon (file_icon, GTK_ICON_SIZE_MENU);
@@ -1167,7 +1182,7 @@ build_popup_menu_for_file (GSearchWindow * gsearch,
gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (new1), file_icon != NULL);

if (file_icon == NULL) {
file_icon = g_themed_icon_new (GTK_STOCK_OPEN);
file_icon = g_themed_icon_new ("gtk-open");
}

image1 = gtk_image_new_from_gicon (file_icon, GTK_ICON_SIZE_MENU);
@@ -1514,7 +1529,7 @@ drag_begin_file_cb (GtkWidget * widget,
number_of_selected_rows = gtk_tree_selection_count_selected_rows (GTK_TREE_SELECTION (gsearch->search_results_selection));

if (number_of_selected_rows > 1) {
gtk_drag_set_icon_stock (context, GTK_STOCK_DND_MULTIPLE, 0, 0);
gtk_drag_set_icon_stock (context, "gtk-dnd-multiple", 0, 0);
}
else if (number_of_selected_rows == 1) {
GdkPixbuf * pixbuf;
@@ -1538,7 +1553,7 @@ drag_begin_file_cb (GtkWidget * widget,
gtk_drag_set_icon_pixbuf (context, pixbuf, 0, 0);
}
else {
gtk_drag_set_icon_stock (context, GTK_STOCK_DND, 0, 0);
gtk_drag_set_icon_stock (context, "gtk-dnd", 0, 0);
}
}
}
@@ -1618,8 +1633,8 @@ show_file_selector_cb (GtkAction * action,
file_chooser = gtk_file_chooser_dialog_new (_("Save Search Results As..."),
GTK_WINDOW (gsearch->window),
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
"gtk-cancel", GTK_RESPONSE_CANCEL,
"gtk-save", GTK_RESPONSE_OK,
NULL);

gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (file_chooser), TRUE);
@@ -1727,7 +1742,7 @@ display_dialog_could_not_save_exists (GtkWidget * window,
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 14);

button = gsearchtool_button_new_with_stock_icon (_("_Replace"), GTK_STOCK_OK);
button = gsearchtool_button_new_with_icon (_("_Replace"), "gtk-ok");
gtk_widget_set_can_default (button, TRUE);
gtk_widget_show (button);

@@ -1117,8 +1117,8 @@ gsearchtool_get_unique_filename (const gchar * path,
}

GtkWidget *
gsearchtool_button_new_with_stock_icon (const gchar * string,
const gchar * stock_id)
gsearchtool_button_new_with_icon (const gchar * string,
const gchar * icon_name)
{
GtkWidget * button;
GtkWidget * hbox;
@@ -1128,7 +1128,7 @@ gsearchtool_button_new_with_stock_icon (const gchar * string,
button = gtk_button_new ();
label = gtk_label_new_with_mnemonic (string);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), GTK_WIDGET (button));
image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0);
@@ -93,8 +93,8 @@ gchar *
gsearchtool_get_unique_filename (const gchar * path,
const gchar * suffix);
GtkWidget *
gsearchtool_button_new_with_stock_icon (const gchar * string,
const gchar * stock_id);
gsearchtool_button_new_with_icon (const gchar * string,
const gchar * icon_name);
GSList *
gsearchtool_get_columns_order (GtkTreeView * treeview);

@@ -1798,7 +1798,7 @@ handle_search_command_stderr_io (GIOChannel * ioc,
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox, FALSE, FALSE, 0);
gtk_widget_show_all (hbox);

button = gsearchtool_button_new_with_stock_icon (_("Disable _Quick Search"), GTK_STOCK_OK);
button = gsearchtool_button_new_with_icon (_("Disable _Quick Search"), "gtk-ok");
gtk_widget_set_can_default (button, TRUE);
gtk_widget_show (button);

@@ -2051,7 +2051,12 @@ create_constraint_box (GSearchWindow * gsearch,
break;
}

button = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
"label", "gtk-remove",
"use-stock", TRUE,
"use-underline", TRUE,
NULL));

gtk_widget_set_can_default (button, FALSE);

{
@@ -2197,7 +2202,12 @@ create_additional_constraint_section (GSearchWindow * gsearch)
_("Select a search option from the drop-down list."));
}

gsearch->available_options_add_button = gtk_button_new_from_stock (GTK_STOCK_ADD);
gsearch->available_options_add_button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
"label", "gtk-add",
"use-stock", TRUE,
"use-underline", TRUE,
NULL));

gtk_widget_set_can_default (gsearch->available_options_add_button, FALSE);
gsearch->available_options_button_size_group = gtk_size_group_new (GTK_SIZE_GROUP_BOTH);
gtk_size_group_add_widget (gsearch->available_options_button_size_group, gsearch->available_options_add_button);
@@ -2877,7 +2887,14 @@ gsearch_app_create (GSearchWindow * gsearch)
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);

gtk_box_set_spacing (GTK_BOX (hbox), 6);
button = gtk_button_new_from_stock (GTK_STOCK_HELP);

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


gtk_widget_set_can_default (button, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (hbox), button, TRUE);
@@ -2887,7 +2904,12 @@ gsearch_app_create (GSearchWindow * gsearch)
add_atk_namedesc (GTK_WIDGET (button), NULL, _("Click to display the help manual."));
}

button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
"label", "gtk-close",
"use-stock", TRUE,
"use-underline", TRUE,
NULL));

gtk_widget_set_can_default (button, TRUE);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (click_close_cb), (gpointer) gsearch);
@@ -2898,8 +2920,17 @@ gsearch_app_create (GSearchWindow * gsearch)
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);

/* Find and Stop buttons... */
gsearch->find_button = gtk_button_new_from_stock (GTK_STOCK_FIND);
gsearch->stop_button = gtk_button_new_from_stock (GTK_STOCK_STOP);
gsearch->find_button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
"label", "gtk-find",
"use-stock", TRUE,
"use-underline", TRUE,
NULL));

gsearch->stop_button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
"label", "gtk-stop",
"use-stock", TRUE,
"use-underline", TRUE,
NULL));

gtk_widget_set_can_default (gsearch->find_button, TRUE);
gtk_widget_set_can_default (gsearch->stop_button, TRUE);
@@ -468,7 +468,7 @@ logview_filter_manager_init (LogviewFilterManager *manager)
priv->prefs = logview_prefs_get ();

gtk_dialog_add_button (GTK_DIALOG(manager),
GTK_STOCK_CLOSE,
"gtk-close",
GTK_RESPONSE_CLOSE);
gtk_window_set_modal (GTK_WINDOW (manager),
TRUE);
@@ -502,9 +502,23 @@ logview_filter_manager_init (LogviewFilterManager *manager)
gtk_tree_view_append_column (GTK_TREE_VIEW (priv->tree),
column);

priv->add_button = gtk_button_new_from_stock (GTK_STOCK_ADD);
priv->edit_button = gtk_button_new_from_stock (GTK_STOCK_PROPERTIES);
priv->remove_button = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
priv->add_button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
"label", "gtk-add",
"use-stock", TRUE,
"use-underline", TRUE,
NULL));

priv->edit_button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
"label", "gtk-properties",
"use-stock", TRUE,
"use-underline", TRUE,
NULL));

priv->remove_button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
"label", "gtk-remove",
"use-stock", TRUE,
"use-underline", TRUE,
NULL));

gtk_window_set_title (GTK_WINDOW (manager),
_("Filters"));
@@ -200,7 +200,7 @@ logview_findbar_init (LogviewFindbar *findbar)
gtk_widget_show_all (GTK_WIDGET (priv->forward_button));

/* clear button */
priv->clear_button = gtk_tool_button_new_from_stock (GTK_STOCK_CLEAR);
priv->clear_button = gtk_tool_button_new_from_stock ("gtk-clear");
gtk_tool_item_set_tooltip_text (priv->clear_button,
_("Clear the search string"));
gtk_toolbar_insert (gtoolbar, priv->clear_button, -1);
@@ -325,8 +325,8 @@ logview_open_log (GtkAction *action, LogviewWindow *logview)
chooser = gtk_file_chooser_dialog_new (_("Open Log"),
GTK_WINDOW (logview),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
"gtk-cancel", GTK_RESPONSE_CANCEL,
"gtk-open", GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (chooser), GTK_RESPONSE_OK);
gtk_window_set_modal (GTK_WINDOW (chooser), TRUE);
@@ -819,33 +819,33 @@ static GtkActionEntry entries[] = {
{ "FilterMenu", NULL, N_("_Filters"), NULL, NULL, NULL },
{ "HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL },

{ "OpenLog", GTK_STOCK_OPEN, N_("_Open..."), "<control>O", N_("Open a log from file"),
{ "OpenLog", "document-open", N_("_Open..."), "<control>O", N_("Open a log from file"),
G_CALLBACK (logview_open_log) },
{ "CloseLog", GTK_STOCK_CLOSE, N_("_Close"), "<control>W", N_("Close this log"),
{ "CloseLog", "window-close", N_("_Close"), "<control>W", N_("Close this log"),
G_CALLBACK (logview_close_log) },
{ "Quit", GTK_STOCK_QUIT, N_("_Quit"), "<control>Q", N_("Quit the log viewer"),
{ "Quit", "application-exit", N_("_Quit"), "<control>Q", N_("Quit the log viewer"),
G_CALLBACK (gtk_main_quit) },

{ "Copy", GTK_STOCK_COPY, N_("_Copy"), "<control>C", N_("Copy the selection"),
{ "Copy", "edit-copy", N_("_Copy"), "<control>C", N_("Copy the selection"),
G_CALLBACK (logview_copy) },
{ "SelectAll", NULL, N_("Select _All"), "<Control>A", N_("Select the entire log"),
G_CALLBACK (logview_select_all) },
{ "Search", GTK_STOCK_FIND, N_("_Find..."), "<control>F", N_("Find a word or phrase in the log"),
{ "Search", "edit-find", N_("_Find..."), "<control>F", N_("Find a word or phrase in the log"),
G_CALLBACK (logview_search) },

{ "ViewZoomIn", GTK_STOCK_ZOOM_IN, NULL, "<control>plus", N_("Bigger text size"),
{ "ViewZoomIn", "zoom-in", N_("Zoom _In"), "<control>plus", N_("Bigger text size"),
G_CALLBACK (logview_bigger_text)},
{ "ViewZoomOut", GTK_STOCK_ZOOM_OUT, NULL, "<control>minus", N_("Smaller text size"),
{ "ViewZoomOut", "zoom-out", N_("Zoom _Out"), "<control>minus", N_("Smaller text size"),
G_CALLBACK (logview_smaller_text)},
{ "ViewZoom100", GTK_STOCK_ZOOM_100, NULL, "<control>0", N_("Normal text size"),
{ "ViewZoom100", "zoom-original", N_("_Normal Size"), "<control>0", N_("Normal text size"),
G_CALLBACK (logview_normal_text)},

{ "FilterManage", NULL, N_("Manage Filters"), NULL, N_("Manage filters"),
G_CALLBACK (logview_manage_filters)},

{ "HelpContents", GTK_STOCK_HELP, N_("_Contents"), "F1", N_("Open the help contents for the log viewer"),
{ "HelpContents", "help-browser", N_("_Contents"), "F1", N_("Open the help contents for the log viewer"),
G_CALLBACK (logview_help) },
{ "AboutAction", GTK_STOCK_ABOUT, N_("_About"), NULL, N_("Show the about dialog for the log viewer"),
{ "AboutAction", "help-about", N_("_About"), NULL, N_("Show the about dialog for the log viewer"),
G_CALLBACK (logview_about) },
};

@@ -1364,7 +1364,7 @@ logview_window_init (LogviewWindow *logview)
priv->message_area = gtk_info_bar_new ();
message_area_create_error_box (logview, priv->message_area);
gtk_info_bar_add_button (GTK_INFO_BAR (priv->message_area),
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
"gtk-close", GTK_RESPONSE_CLOSE);
gtk_box_pack_start (GTK_BOX (main_view), priv->message_area, FALSE, FALSE, 0);

/* second pane: text view */
@@ -1130,7 +1130,11 @@ gdict_database_chooser_add_button (GdictDatabaseChooser *chooser,

priv = chooser->priv;

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

gtk_widget_set_can_default (button, TRUE);

@@ -884,7 +884,11 @@ gdict_source_chooser_add_button (GdictSourceChooser *chooser,

priv = chooser->priv;

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

gtk_widget_set_can_default (button, TRUE);

Oops, something went wrong.

0 comments on commit 70a6011

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