Skip to content
Permalink
Browse files

avoid deprecated GtkStock

  • Loading branch information...
sc0w authored and raveit65 committed Feb 8, 2018
1 parent 77f8101 commit 36bcd30e3fb22d3c8c57c968fccfafe0c011e70f
Showing with 35 additions and 17 deletions.
  1. +6 −6 src/interface.cpp
  2. +21 −3 src/lsof.cpp
  3. +1 −1 src/memmaps.cpp
  4. +1 −1 src/openfiles.cpp
  5. +5 −5 src/procdialogs.cpp
  6. +1 −1 src/procproperties.cpp
@@ -53,9 +53,9 @@ static const GtkActionEntry menu_entries[] =
{ "View", NULL, N_("_View") },
{ "Help", NULL, N_("_Help") },

{ "Lsof", GTK_STOCK_FIND, N_("Search for _Open Files"), "<control>O",
{ "Lsof", "edit-find", N_("Search for _Open Files"), "<control>O",
N_("Search for open files"), G_CALLBACK(cb_show_lsof) },
{ "Quit", GTK_STOCK_QUIT, NULL, NULL,
{ "Quit", "application-exit", N_("_Quit"), "<control>Q",
N_("Quit the program"), G_CALLBACK (cb_app_exit) },


@@ -70,10 +70,10 @@ static const GtkActionEntry menu_entries[] =
N_("Force process to finish immediately"), G_CALLBACK (cb_kill_process) },
{ "ChangePriority", NULL, N_("_Change Priority"), NULL,
N_("Change the order of priority of process"), NULL },
{ "Preferences", GTK_STOCK_PREFERENCES, NULL, NULL,
{ "Preferences", "preferences-desktop", N_("_Preferences"), NULL,
N_("Configure the application"), G_CALLBACK (cb_edit_preferences) },

{ "Refresh", GTK_STOCK_REFRESH, N_("_Refresh"), "<control>R",
{ "Refresh", "view-refresh", N_("_Refresh"), "<control>R",
N_("Refresh the process list"), G_CALLBACK(cb_user_refresh) },

{ "MemoryMaps", NULL, N_("_Memory Maps"), "<control>M",
@@ -85,9 +85,9 @@ static const GtkActionEntry menu_entries[] =
N_("View additional information about a process"), G_CALLBACK (cb_show_process_properties) },


{ "HelpContents", GTK_STOCK_HELP, N_("_Contents"), "F1",
{ "HelpContents", "help-browser", N_("_Contents"), "F1",
N_("Open the manual"), G_CALLBACK (cb_help_contents) },
{ "About", GTK_STOCK_ABOUT, NULL, NULL,
{ "About", "help-about", N_("_About"), NULL,
N_("About this application"), G_CALLBACK (cb_about) }
};

@@ -338,9 +338,21 @@ void procman_lsof(ProcData *procdata)
GtkWidget *entry = gtk_entry_new();

gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 0);
GtkWidget *search_button = gtk_button_new_from_stock(GTK_STOCK_FIND);

GtkWidget *search_button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
"label", "gtk-find",
"use-stock", TRUE,
"use-underline", TRUE,
NULL));

gtk_box_pack_start(GTK_BOX(hbox), search_button, FALSE, FALSE, 0);
GtkWidget *clear_button = gtk_button_new_from_stock(GTK_STOCK_CLEAR);

GtkWidget *clear_button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
"label", "gtk-clear",
"use-stock", TRUE,
"use-underline", TRUE,
NULL));

/* The default accelerator collides with the default close accelerator. */
gtk_button_set_label(GTK_BUTTON(clear_button), _("C_lear"));
gtk_box_pack_start(GTK_BOX(hbox), clear_button, FALSE, FALSE, 0);
@@ -370,7 +382,13 @@ void procman_lsof(ProcData *procdata)
gtk_box_pack_start(GTK_BOX(mainbox), scrolled, TRUE, TRUE, 0);

GtkWidget *bottom_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
GtkWidget *close_button = gtk_button_new_from_stock(GTK_STOCK_CLOSE);

GtkWidget *close_button = GTK_WIDGET (g_object_new (GTK_TYPE_BUTTON,
"label", "gtk-close",
"use-stock", TRUE,
"use-underline", TRUE,
NULL));

gtk_box_pack_start(GTK_BOX(mainbox), bottom_box, FALSE, FALSE, 0);
gtk_box_pack_end(GTK_BOX(bottom_box), close_button, FALSE, FALSE, 0);

@@ -431,7 +431,7 @@ create_single_memmaps_dialog (GtkTreeModel *model, GtkTreePath *path,

memmapsdialog = gtk_dialog_new_with_buttons (_("Memory Maps"), GTK_WINDOW (procdata->app),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
"gtk-close", GTK_RESPONSE_CLOSE,
NULL);
gtk_window_set_resizable(GTK_WINDOW(memmapsdialog), TRUE);
gtk_window_set_default_size(GTK_WINDOW(memmapsdialog), 620, 400);
@@ -323,7 +323,7 @@ create_single_openfiles_dialog (GtkTreeModel *model, GtkTreePath *path,

openfilesdialog = gtk_dialog_new_with_buttons (_("Open Files"), NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
"gtk-close", GTK_RESPONSE_CLOSE,
NULL);
gtk_window_set_resizable (GTK_WINDOW (openfilesdialog), TRUE);
gtk_window_set_default_size (GTK_WINDOW (openfilesdialog), 575, 400);
@@ -104,7 +104,7 @@ procdialog_create_kill_dialog (ProcData *procdata, int signal)
secondary);

gtk_dialog_add_buttons (GTK_DIALOG (kill_alert_dialog),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
"gtk-cancel", GTK_RESPONSE_CANCEL,
button_text, GTK_RESPONSE_OK,
NULL);

@@ -171,7 +171,7 @@ procdialog_create_renice_dialog (ProcData *procdata)
info->name, info->pid);
dialog = gtk_dialog_new_with_buttons (dialog_title, NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
"gtk-cancel", GTK_RESPONSE_CANCEL,
NULL);
g_free (dialog_title);

@@ -182,7 +182,7 @@ procdialog_create_renice_dialog (ProcData *procdata)
button = gtk_button_new_with_mnemonic (_("Change _Priority"));
gtk_widget_set_can_default (button, TRUE);

icon = gtk_image_new_from_stock (GTK_STOCK_OK, GTK_ICON_SIZE_BUTTON);
icon = gtk_image_new_from_stock ("gtk-ok", GTK_ICON_SIZE_BUTTON);
gtk_button_set_image (GTK_BUTTON (button), icon);

gtk_dialog_add_action_widget (GTK_DIALOG (renice_dialog), button, 100);
@@ -531,8 +531,8 @@ procdialog_create_preferences_dialog (ProcData *procdata)
dialog = gtk_dialog_new_with_buttons (_("System Monitor Preferences"),
GTK_WINDOW (procdata->app),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
"gtk-help", GTK_RESPONSE_HELP,
"gtk-close", GTK_RESPONSE_CLOSE,
NULL);
/* FIXME: we should not declare the window size, but let it's */
/* driven by window childs. The problem is that the fields list */
@@ -241,7 +241,7 @@ create_single_procproperties_dialog (GtkTreeModel *model, GtkTreePath *path,

procpropdialog = gtk_dialog_new_with_buttons (_("Process Properties"), NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
"gtk-close", GTK_RESPONSE_CLOSE,
NULL);
gtk_window_set_resizable (GTK_WINDOW (procpropdialog), TRUE);
gtk_window_set_default_size (GTK_WINDOW (procpropdialog), 575, 400);

0 comments on commit 36bcd30

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