Skip to content
Permalink
Browse files

fix GtkStock deprecations

  • Loading branch information...
info-cppsp authored and raveit65 committed Jan 17, 2018
1 parent f304020 commit 7e4869045b4327cbd8453e7a9b670680f8cfb87d
Showing with 22 additions and 15 deletions.
  1. +9 −5 sensors-applet/prefs-dialog.c
  2. +10 −7 sensors-applet/sensor-config-dialog.c
  3. +3 −3 sensors-applet/sensors-applet.c
@@ -417,12 +417,13 @@ void prefs_dialog_open(SensorsApplet *sensors_applet) {
prefs_dialog->dialog = GTK_DIALOG(gtk_dialog_new_with_buttons(_("Sensors Applet Preferences"),
NULL,
0,
GTK_STOCK_HELP,
"gtk-help",
GTK_RESPONSE_HELP,
GTK_STOCK_CLOSE,
"gtk-close",
GTK_RESPONSE_CLOSE,
NULL));


gtk_window_set_icon_name(GTK_WINDOW(prefs_dialog->dialog), "mate-sensors-applet");

g_object_set(prefs_dialog->dialog,
@@ -822,14 +823,16 @@ void prefs_dialog_open(SensorsApplet *sensors_applet) {
/* when selection is changed, make sure sensor_config button is activated */

/* Create buttons for user to interact with sensors tree */
prefs_dialog->sensor_up_button = GTK_BUTTON(gtk_button_new_from_stock(GTK_STOCK_GO_UP));
prefs_dialog->sensor_up_button = GTK_BUTTON(gtk_button_new_with_mnemonic(_("_Up")));
gtk_button_set_image(prefs_dialog->sensor_up_button, gtk_image_new_from_icon_name("go-up", GTK_ICON_SIZE_BUTTON));
gtk_widget_set_sensitive(GTK_WIDGET(prefs_dialog->sensor_up_button), FALSE);

g_signal_connect(prefs_dialog->sensor_up_button, "clicked",
G_CALLBACK(prefs_dialog_sensor_up_button_clicked),
prefs_dialog);

prefs_dialog->sensor_down_button = GTK_BUTTON(gtk_button_new_from_stock(GTK_STOCK_GO_DOWN));
prefs_dialog->sensor_down_button = GTK_BUTTON(gtk_button_new_with_mnemonic(_("_Down")));
gtk_button_set_image(prefs_dialog->sensor_down_button, gtk_image_new_from_icon_name("go-down", GTK_ICON_SIZE_BUTTON));
gtk_widget_set_sensitive(GTK_WIDGET(prefs_dialog->sensor_down_button), FALSE);

g_signal_connect(prefs_dialog->sensor_down_button, "clicked",
@@ -862,7 +865,8 @@ void prefs_dialog_open(SensorsApplet *sensors_applet) {
/* Sensor Config button */
/* initially make button insensitive until user selects a row
from the sensors tree */
prefs_dialog->sensor_config_button = GTK_BUTTON(gtk_button_new_from_stock(GTK_STOCK_PROPERTIES));
prefs_dialog->sensor_config_button = GTK_BUTTON(gtk_button_new_with_mnemonic(_("_Properties")));
gtk_button_set_image(prefs_dialog->sensor_config_button, gtk_image_new_from_icon_name("document-properties", GTK_ICON_SIZE_BUTTON));
g_object_set(prefs_dialog->sensor_config_button,
"sensitive", FALSE,
NULL);
@@ -30,7 +30,7 @@
typedef struct {
SensorsApplet *sensors_applet;

GtkWidget *dialog;
GtkDialog *dialog;
/* icon widgets */
GtkLabel *icon_header, *icon_type_label;
GtkComboBox *icon_type_combo_box;
@@ -387,14 +387,17 @@ void sensor_config_dialog_create(SensorsApplet *sensors_applet) {
-1);
header_text = g_strdup_printf("%s - %s", _("Sensor Properties"), sensor_label);

config_dialog->dialog = gtk_dialog_new_with_buttons(header_text,

config_dialog->dialog = GTK_DIALOG(gtk_dialog_new_with_buttons(header_text,
GTK_WINDOW(sensors_applet->prefs_dialog->dialog),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_HELP,
"gtk-help",
GTK_RESPONSE_HELP,
GTK_STOCK_CLOSE,
"gtk-close",
GTK_RESPONSE_CLOSE,
NULL);
NULL));


gtk_window_set_icon_name(GTK_WINDOW(config_dialog->dialog), "sensors-applet");

g_free(header_text);
@@ -823,8 +826,8 @@ void sensor_config_dialog_create(SensorsApplet *sensors_applet) {
GTK_WIDGET(config_dialog->graph_color_button),
2, 14, 1, 1);

content_area = gtk_dialog_get_content_area (GTK_DIALOG(config_dialog->dialog));
content_area = gtk_dialog_get_content_area (config_dialog->dialog);
gtk_box_pack_start(GTK_BOX(content_area), GTK_WIDGET(config_dialog->grid), FALSE, FALSE, 0);
gtk_widget_show_all(config_dialog->dialog);
gtk_widget_show_all(GTK_WIDGET(config_dialog->dialog));

}
@@ -231,13 +231,13 @@ static gboolean mouse_leave_cb(GtkWidget *widget, GdkEventCrossing *event, gpoin
}

static const GtkActionEntry sensors_applet_menu_actions[] = {
{ "Preferences", GTK_STOCK_PROPERTIES, N_("_Preferences"),
{ "Preferences", "document-properties", N_("_Preferences"),
NULL, NULL,
G_CALLBACK(prefs_cb) },
{ "Help", GTK_STOCK_HELP, N_("_Help"),
{ "Help", "help-browser", N_("_Help"),
NULL, NULL,
G_CALLBACK(help_cb) },
{ "About", GTK_STOCK_ABOUT, N_("_About"),
{ "About", "help-about", N_("_About"),
NULL, NULL,
G_CALLBACK(about_cb) }
};

0 comments on commit 7e48690

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