From 30bc91bdbaa44589fe64021e0b2b51589a0cb156 Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Wed, 2 Jul 2014 17:57:58 +0200 Subject: [PATCH] Remove old GTK2 code and support --- data/Makefile.am | 2 - data/gpm-prefs-deprecated.ui | 1133 ----------------------------- data/gpm-statistics-deprecated.ui | 504 ------------- po/POTFILES.in | 2 - src/gpm-prefs-core.c | 136 +--- src/gpm-statistics.c | 82 +-- src/gpm-tray-icon.c | 5 +- 7 files changed, 36 insertions(+), 1828 deletions(-) delete mode 100644 data/gpm-prefs-deprecated.ui delete mode 100644 data/gpm-statistics-deprecated.ui diff --git a/data/Makefile.am b/data/Makefile.am index f1e5bbf8..014264f5 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -29,10 +29,8 @@ convert_DATA = mate-power-manager.convert pkgdata_DATA = \ gpm-statistics.ui \ - gpm-statistics-deprecated.ui \ gpm-feedback-widget.ui \ gpm-prefs.ui \ - gpm-prefs-deprecated.ui \ acme.ui EXTRA_DIST = \ diff --git a/data/gpm-prefs-deprecated.ui b/data/gpm-prefs-deprecated.ui deleted file mode 100644 index 6af3e40c..00000000 --- a/data/gpm-prefs-deprecated.ui +++ /dev/null @@ -1,1133 +0,0 @@ - - - - - - 1 - 1 - 61 - 1 - 5 - - - 23 - 1 - 61 - 1 - 5 - - - 41 - 100 - 1 - 5 - - - 1 - 1 - 61 - 1 - 5 - - - 23 - 1 - 61 - 1 - 5 - - - 1 - 1 - 61 - 1 - 5 - - - 23 - 1 - 61 - 1 - 5 - - - 5 - Power Management Preferences - False - center-on-parent - dialog - - - True - vertical - 2 - - - True - True - 6 - - - True - 12 - vertical - 12 - - - True - vertical - 6 - - - True - 0 - <b>Actions</b> - True - - - False - False - 0 - - - - - True - 12 - - - True - vertical - 6 - - - True - 12 - True - - - True - 0 - Put computer to _sleep when inactive for: - True - - - False - 0 - - - - - True - - - 1 - - - - - False - False - 0 - - - - - True - 12 - True - - - True - 0 - When laptop lid is cl_osed: - True - - - False - 0 - - - - - True - - - 1 - - - - - 1 - - - - - Sp_in down hard disks when possible - True - True - False - True - True - - - False - False - 2 - - - - - - - False - 1 - - - - - False - 0 - - - - - True - vertical - 6 - - - True - 0 - <b>Display</b> - True - - - False - False - 0 - - - - - True - 12 - - - True - vertical - 5 - - - True - 12 - True - - - True - 0 - Put _display to sleep when inactive for: - True - - - False - 0 - - - - - True - - - 1 - - - - - 0 - - - - - True - 12 - True - - - True - 0 - Set display _brightness to: - True - hscale_ac_brightness - - - False - 0 - - - - - True - True - adjustment3 - 0 - bottom - - - 1 - - - - - 1 - - - - - Di_m display when idle - True - True - False - True - True - - - False - False - 2 - - - - - - - 1 - - - - - False - 1 - - - - - - - True - On AC Power - - - False - - - - - True - 12 - vertical - 12 - - - True - vertical - 6 - - - True - 0 - <b>Actions</b> - True - - - False - False - 0 - - - - - True - 12 - - - True - vertical - 6 - - - True - 12 - True - - - True - 0 - Put computer to _sleep when inactive for: - True - - - False - 0 - - - - - True - - - 1 - - - - - False - False - 0 - - - - - True - 12 - True - - - True - 0 - When laptop lid is cl_osed: - True - - - False - 0 - - - - - True - - - 1 - - - - - 1 - - - - - True - 12 - True - - - True - 0 - When battery po_wer is critically low: - True - - - False - 0 - - - - - True - - - 1 - - - - - 2 - - - - - Sp_in down hard disks when possible - True - True - False - True - True - - - False - False - 3 - - - - - - - False - 1 - - - - - False - 0 - - - - - True - vertical - 6 - - - True - 0 - <b>Display</b> - True - - - False - False - 0 - - - - - True - 12 - - - True - vertical - 5 - - - True - 12 - True - - - True - 0 - Put _display to sleep when inactive for: - True - - - False - 0 - - - - - True - - - 1 - - - - - 0 - - - - - _Reduce backlight brightness - True - True - False - True - True - - - False - False - 1 - - - - - Di_m display when idle - True - True - False - True - True - - - False - False - 2 - - - - - - - 1 - - - - - False - 1 - - - - - 1 - - - - - True - On Battery Power - - - 1 - False - - - - - True - 12 - vertical - 12 - - - True - vertical - 6 - - - True - 0 - <b>Actions</b> - True - - - False - False - 0 - - - - - True - 12 - - - True - vertical - 6 - - - True - 12 - True - - - True - 0 - Put computer to _sleep when inactive for: - True - - - False - 0 - - - - - True - - - 1 - - - - - False - False - 0 - - - - - True - 12 - True - - - True - 0 - When UPS power is l_ow: - True - - - False - 0 - - - - - True - - - 1 - - - - - 1 - - - - - True - 12 - True - - - True - 0 - When UPS power is _critically low: - True - - - False - 0 - - - - - True - - - 1 - - - - - 2 - - - - - - - False - 1 - - - - - False - 0 - - - - - True - vertical - 6 - - - True - 0 - <b>Display</b> - True - - - False - False - 0 - - - - - True - 12 - - - True - vertical - 5 - - - True - 12 - True - - - True - 0 - Put _display to sleep when inactive for: - True - - - False - 0 - - - - - True - - - 1 - - - - - 0 - - - - - - - 1 - - - - - False - 1 - - - - - 2 - - - - - True - On UPS Power - - - 2 - False - - - - - True - 12 - vertical - 12 - - - True - vertical - 6 - - - True - 0 - <b>Actions</b> - True - - - False - False - 0 - - - - - True - 12 - - - True - vertical - 6 - - - True - 12 - True - - - True - 0 - When the power _button is pressed: - True - - - False - 0 - - - - - True - - - 1 - - - - - False - False - 0 - - - - - True - 12 - True - - - True - 0 - When the _suspend button is pressed: - True - - - False - 0 - - - - - True - - - 1 - - - - - 1 - - - - - - - False - 1 - - - - - False - 0 - - - - - True - vertical - 6 - - - True - 0 - <b>Notification Area</b> - True - - - False - False - 0 - - - - - True - 12 - - - True - vertical - 6 - - - _Never display an icon - True - True - False - True - True - - - False - False - 0 - - - - - _Only display an icon when battery power is low - True - True - False - True - True - radiobutton_notification_never - - - False - False - 1 - - - - - Only display an icon when charging or _discharging - True - True - False - True - True - radiobutton_notification_never - - - False - False - 2 - - - - - Only display an icon when a battery is p_resent - True - True - False - True - True - radiobutton_notification_never - - - False - False - 3 - - - - - _Always display an icon - True - True - False - True - True - radiobutton_notification_never - - - False - False - 4 - - - - - - - 1 - - - - - False - 1 - - - - - 3 - - - - - True - General - - - 3 - False - - - - - False - 1 - - - - - True - end - - - gtk-help - True - True - True - False - Provides help about this program - True - - - False - False - 0 - True - - - - - Make Default - True - True - True - Sets this policy to be used by all users - - - False - False - 1 - - - - - gtk-close - True - True - True - True - False - Closes the program - True - - - False - False - 2 - - - - - False - end - 0 - - - - - - button_help - button_defaults - button_close - - - diff --git a/data/gpm-statistics-deprecated.ui b/data/gpm-statistics-deprecated.ui deleted file mode 100644 index 8fe3d04d..00000000 --- a/data/gpm-statistics-deprecated.ui +++ /dev/null @@ -1,504 +0,0 @@ - - - - - - 6 - Power Statistics - center-on-parent - dialog - - - True - vertical - 2 - - - True - 6 - 6 - - - True - True - never - automatic - in - - - True - True - False - - - - - False - 0 - - - - - True - True - - - True - True - 9 - automatic - automatic - in - - - True - True - - - - - - - True - Details - - - False - - - - - True - cursor - 9 - vertical - 9 - - - True - 12 - - - True - 6 - - - True - Graph type: - - - False - 0 - - - - - True - - - 1 - - - - - 0 - - - - - True - 6 - - - True - Data length: - - - False - 0 - - - - - True - - - 1 - - - - - 1 - - - - - False - 0 - - - - - True - vertical - - - True - 6 - - - True - y-axis - 90 - - - False - 0 - - - - - True - There is no data to display. - - - 1 - - - - - 0 - - - - - True - x-axis - - - False - 1 - - - - - 1 - - - - - True - 6 - True - - - Use smoothed line - True - True - False - True - - - False - 0 - - - - - Show data points - True - True - False - True - - - False - 1 - - - - - False - 2 - - - - - 1 - - - - - True - History - - - 1 - False - - - - - True - cursor - 9 - vertical - 9 - - - True - 6 - - - True - Graph type: - - - False - 0 - - - - - True - - - 1 - - - - - False - 0 - - - - - True - vertical - - - True - 6 - - - True - y-axis - 90 - - - False - 0 - - - - - True - There is no data to display. - - - 1 - - - - - 0 - - - - - True - x-axis - - - False - 1 - - - - - 3 - 1 - - - - - True - 6 - True - - - Use smoothed line - True - True - False - True - - - False - 0 - - - - - Show data points - True - True - False - True - - - False - 1 - - - - - False - 2 - - - - - 2 - - - - - True - Statistics - - - 2 - False - - - - - True - 9 - vertical - 9 - - - True - 3 - - - True - Processor wakeups per second: - - - False - 0 - - - - - True - 0 - - - False - 1 - - - - - False - 0 - - - - - True - True - automatic - automatic - in - - - True - True - - - - - 1 - - - - - 3 - - - - - True - Wakeups - - - 3 - False - - - - - 1 - - - - - 1 - - - - - True - end - - - gtk-help - True - True - True - False - True - - - False - False - 0 - True - - - - - gtk-close - True - True - True - False - True - - - False - False - 1 - - - - - False - end - 0 - - - - - - button_help - button_close - - - diff --git a/po/POTFILES.in b/po/POTFILES.in index deef6844..fb97b9f5 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -11,9 +11,7 @@ data/mate-power-preferences.desktop.in.in data/mate-power-statistics.desktop.in.in [type: gettext/glade]data/gpm-feedback-widget.ui [type: gettext/glade]data/gpm-statistics.ui -[type: gettext/glade]data/gpm-statistics-deprecated.ui [type: gettext/glade]data/gpm-prefs.ui -[type: gettext/glade]data/gpm-prefs-deprecated.ui policy/org.mate.power.policy.in2 src/gpm-backlight.c src/gpm-backlight-helper.c diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c index 6abb792c..abafc6ec 100644 --- a/src/gpm-prefs-core.c +++ b/src/gpm-prefs-core.c @@ -193,30 +193,6 @@ gpm_prefs_action_time_changed_cb (GtkWidget *widget, GpmPrefs *prefs) g_settings_set_int (prefs->priv->settings, gpm_pref_key, value); } -/** - * gpm_prefs_set_combo_simple_text: - **/ -static void -gpm_prefs_set_combo_simple_text (GtkWidget *combo_box) -{ - #if !GTK_CHECK_VERSION (2, 24, 0) - GtkCellRenderer *cell; - GtkListStore *store; - - store = gtk_list_store_new (1, G_TYPE_STRING); - gtk_combo_box_set_model (GTK_COMBO_BOX (combo_box), GTK_TREE_MODEL (store)); - g_object_unref (store); - - cell = gtk_cell_renderer_text_new (); - gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), cell, TRUE); - gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), cell, - "text", 0, - NULL); - #else - // nothing to do with GTK_COMBO_BOX_TEXT - #endif -} - /** * gpm_prefs_actions_destroy_cb: **/ @@ -246,7 +222,6 @@ gpm_prefs_setup_action_combo (GpmPrefs *prefs, const gchar *widget_name, GpmActionPolicy *actions_added; widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, widget_name)); - gpm_prefs_set_combo_simple_text (widget); value = g_settings_get_enum (prefs->priv->settings, gpm_pref_key); is_writable = g_settings_is_writable (prefs->priv->settings, gpm_pref_key); @@ -263,57 +238,27 @@ gpm_prefs_setup_action_combo (GpmPrefs *prefs, const gchar *widget_name, if (policy == GPM_ACTION_POLICY_SHUTDOWN && !prefs->priv->can_shutdown) { egg_debug ("Cannot add option, as cannot shutdown."); } else if (policy == GPM_ACTION_POLICY_SHUTDOWN && prefs->priv->can_shutdown) { - #if GTK_CHECK_VERSION (2, 24, 0) - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (widget), _("Shutdown")); - g_ptr_array_add(array, GINT_TO_POINTER (policy)); - #else - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), _("Shutdown")); - g_ptr_array_add (array, GINT_TO_POINTER (policy)); - #endif + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (widget), _("Shutdown")); + g_ptr_array_add(array, GINT_TO_POINTER (policy)); } else if (policy == GPM_ACTION_POLICY_SUSPEND && !prefs->priv->can_suspend) { egg_debug ("Cannot add option, as cannot suspend."); } else if (policy == GPM_ACTION_POLICY_HIBERNATE && !prefs->priv->can_hibernate) { egg_debug ("Cannot add option, as cannot hibernate."); } else if (policy == GPM_ACTION_POLICY_SUSPEND && prefs->priv->can_suspend) { - #if GTK_CHECK_VERSION (2, 24, 0) - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (widget), _("Suspend")); - g_ptr_array_add (array, GINT_TO_POINTER (policy)); - #else - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), _("Suspend")); - g_ptr_array_add (array, GINT_TO_POINTER (policy)); - #endif + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (widget), _("Suspend")); + g_ptr_array_add (array, GINT_TO_POINTER (policy)); } else if (policy == GPM_ACTION_POLICY_HIBERNATE && prefs->priv->can_hibernate) { - #if GTK_CHECK_VERSION (2, 24, 0) - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (widget), _("Hibernate")); - g_ptr_array_add(array, GINT_TO_POINTER (policy)); - #else - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), _("Hibernate")); - g_ptr_array_add (array, GINT_TO_POINTER (policy)); - #endif + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (widget), _("Hibernate")); + g_ptr_array_add(array, GINT_TO_POINTER (policy)); } else if (policy == GPM_ACTION_POLICY_BLANK) { - #if GTK_CHECK_VERSION (2, 24, 0) - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (widget), _("Blank screen")); - g_ptr_array_add (array, GINT_TO_POINTER (policy)); - #else - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), _("Blank screen")); - g_ptr_array_add (array, GINT_TO_POINTER (policy)); - #endif + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (widget), _("Blank screen")); + g_ptr_array_add (array, GINT_TO_POINTER (policy)); } else if (policy == GPM_ACTION_POLICY_INTERACTIVE) { - #if GTK_CHECK_VERSION (2, 24, 0) - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (widget), _("Ask me")); - g_ptr_array_add(array, GINT_TO_POINTER (policy)); - #else - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), _("Ask me")); - g_ptr_array_add (array, GINT_TO_POINTER (policy)); - #endif + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (widget), _("Ask me")); + g_ptr_array_add(array, GINT_TO_POINTER (policy)); } else if (policy == GPM_ACTION_POLICY_NOTHING) { - #if GTK_CHECK_VERSION (2, 24, 0) - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (widget), _("Do nothing")); - g_ptr_array_add(array, GINT_TO_POINTER (policy)); - #else - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), _("Do nothing")); - g_ptr_array_add (array, GINT_TO_POINTER (policy)); - #endif + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (widget), _("Do nothing")); + g_ptr_array_add(array, GINT_TO_POINTER (policy)); } else { egg_warning ("Unknown action read from settings: %i", policy); } @@ -355,7 +300,6 @@ gpm_prefs_setup_time_combo (GpmPrefs *prefs, const gchar *widget_name, GtkWidget *widget; widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, widget_name)); - gpm_prefs_set_combo_simple_text (widget); value = g_settings_get_int (prefs->priv->settings, gpm_pref_key); is_writable = g_settings_is_writable (prefs->priv->settings, gpm_pref_key); @@ -370,18 +314,10 @@ gpm_prefs_setup_time_combo (GpmPrefs *prefs, const gchar *widget_name, /* get translation for number of seconds */ if (values[i] != 0) { text = gpm_get_timestring (values[i]); - #if GTK_CHECK_VERSION (2, 24, 0) - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (widget), text); - #else - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), text); - #endif + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (widget), text); g_free (text); } else { - #if GTK_CHECK_VERSION (2, 24, 0) - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (widget), _("Never")); - #else - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), _("Never")); - #endif + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (widget), _("Never")); } /* matches, so set default */ @@ -546,28 +482,16 @@ prefs_setup_ac (GpmPrefs *prefs) if (prefs->priv->has_button_lid == FALSE) { widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "hbox_ac_lid")); - #if GTK_CHECK_VERSION (2, 24, 0) - gtk_widget_hide(widget); - #else - gtk_widget_hide_all (widget); - #endif + gtk_widget_hide(widget); } if (prefs->priv->has_lcd == FALSE) { widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "hbox_ac_brightness")); - #if GTK_CHECK_VERSION (2, 24, 0) - gtk_widget_hide(widget); - #else - gtk_widget_hide_all (widget); - #endif + gtk_widget_hide(widget); widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "checkbutton_ac_display_dim")); - #if GTK_CHECK_VERSION (2, 24, 0) - gtk_widget_hide(widget); - #else - gtk_widget_hide_all (widget); - #endif + gtk_widget_hide(widget); } } @@ -647,19 +571,11 @@ prefs_setup_battery (GpmPrefs *prefs) if (prefs->priv->has_button_lid == FALSE) { widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "hbox_battery_lid")); - #if GTK_CHECK_VERSION(2, 24, 0) - gtk_widget_hide(widget); - #else - gtk_widget_hide_all (widget); - #endif + gtk_widget_hide(widget); } if (prefs->priv->has_lcd == FALSE) { widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "checkbutton_battery_display_dim")); - #if GTK_CHECK_VERSION(2, 24, 0) - gtk_widget_hide(widget); - #else - gtk_widget_hide_all (widget); - #endif + gtk_widget_hide(widget); } } @@ -741,11 +657,7 @@ prefs_setup_general (GpmPrefs *prefs) if (prefs->priv->has_button_suspend == FALSE) { widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "hbox_general_suspend")); - #if GTK_CHECK_VERSION (2, 24, 0) - gtk_widget_hide(widget); - #else - gtk_widget_hide_all (widget); - #endif + gtk_widget_hide(widget); } } @@ -980,13 +892,7 @@ gpm_prefs_init (GpmPrefs *prefs) prefs->priv->builder = gtk_builder_new (); - #if GTK_CHECK_VERSION(2, 24, 0) - retval = gtk_builder_add_from_file (prefs->priv->builder, GPM_DATA "/gpm-prefs.ui", - &error); - #else - retval = gtk_builder_add_from_file (prefs->priv->builder, - GPM_DATA "/gpm-prefs-deprecated.ui", &error); - #endif + retval = gtk_builder_add_from_file (prefs->priv->builder, GPM_DATA "/gpm-prefs.ui", &error); if (retval == 0) { egg_warning ("failed to load ui: %s", error->message); diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c index ea17703e..795a3727 100644 --- a/src/gpm-statistics.c +++ b/src/gpm-statistics.c @@ -1469,31 +1469,6 @@ gpm_stats_points_checkbox_stats_cb (GtkWidget *widget, gpointer data) gpm_stats_button_update_ui (); } -/** - * gpm_stats_set_combo_simple_text: - **/ -static void -gpm_stats_set_combo_simple_text (GtkWidget *combo_box) -{ - #if GTK_CHECK_VERSION (2, 24, 0) - // nothing to do with GTK_COMBO_BOX_TEXT - return; - #else - GtkCellRenderer *cell; - GtkListStore *store; - - store = gtk_list_store_new (1, G_TYPE_STRING); - gtk_combo_box_set_model (GTK_COMBO_BOX (combo_box), GTK_TREE_MODEL (store)); - g_object_unref (store); - - cell = gtk_cell_renderer_text_new (); - gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_box), cell, TRUE); - gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), cell, - "text", 0, - NULL); - #endif -} - /** * gpm_stats_highlight_device: **/ @@ -1601,11 +1576,7 @@ main (int argc, char *argv[]) /* get UI */ builder = gtk_builder_new (); - #if GTK_CHECK_VERSION (2, 24, 0) - retval = gtk_builder_add_from_file (builder, GPM_DATA "/gpm-statistics.ui", &error); - #else - retval = gtk_builder_add_from_file (builder, GPM_DATA "/gpm-statistics-deprecated.ui", &error); - #endif + retval = gtk_builder_add_from_file (builder, GPM_DATA "/gpm-statistics.ui", &error); if (retval == 0) { egg_warning ("failed to load ui: %s", error->message); @@ -1720,18 +1691,10 @@ main (int argc, char *argv[]) stats_type = GPM_STATS_CHARGE_DATA_VALUE; widget = GTK_WIDGET (gtk_builder_get_object (builder, "combobox_history_type")); - gpm_stats_set_combo_simple_text (widget); - #if GTK_CHECK_VERSION (2, 24, 0) - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_RATE_TEXT); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_CHARGE_TEXT); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_TIME_FULL_TEXT); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_TIME_EMPTY_TEXT); - #else - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), GPM_HISTORY_RATE_TEXT); - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), GPM_HISTORY_CHARGE_TEXT); - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), GPM_HISTORY_TIME_FULL_TEXT); - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), GPM_HISTORY_TIME_EMPTY_TEXT); - #endif + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_RATE_TEXT); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_CHARGE_TEXT); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_TIME_FULL_TEXT); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_TIME_EMPTY_TEXT); if (g_strcmp0 (history_type, GPM_HISTORY_RATE_VALUE) == 0) gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0); else @@ -1740,18 +1703,10 @@ main (int argc, char *argv[]) G_CALLBACK (gpm_stats_history_type_combo_changed_cb), NULL); widget = GTK_WIDGET (gtk_builder_get_object (builder, "combobox_stats_type")); - gpm_stats_set_combo_simple_text (widget); - #if GTK_CHECK_VERSION (2, 24, 0) - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_STATS_CHARGE_DATA_TEXT); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_STATS_CHARGE_ACCURACY_TEXT); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_STATS_DISCHARGE_DATA_TEXT); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_STATS_DISCHARGE_ACCURACY_TEXT); - #else - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), GPM_STATS_CHARGE_DATA_TEXT); - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), GPM_STATS_CHARGE_ACCURACY_TEXT); - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), GPM_STATS_DISCHARGE_DATA_TEXT); - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), GPM_STATS_DISCHARGE_ACCURACY_TEXT); - #endif + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_STATS_CHARGE_DATA_TEXT); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_STATS_CHARGE_ACCURACY_TEXT); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_STATS_DISCHARGE_DATA_TEXT); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_STATS_DISCHARGE_ACCURACY_TEXT); if (g_strcmp0 (stats_type, GPM_STATS_CHARGE_DATA_VALUE) == 0) gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0); else if (g_strcmp0 (stats_type, GPM_STATS_CHARGE_DATA_VALUE) == 0) @@ -1766,20 +1721,11 @@ main (int argc, char *argv[]) G_CALLBACK (gpm_stats_type_combo_changed_cb), NULL); widget = GTK_WIDGET (gtk_builder_get_object (builder, "combobox_history_time")); - gpm_stats_set_combo_simple_text (widget); - #if GTK_CHECK_VERSION (2, 24, 0) - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_MINUTE_TEXT); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_HOUR_TEXT); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_HOURS_TEXT); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_DAY_TEXT); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_WEEK_TEXT); - #else - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), GPM_HISTORY_MINUTE_TEXT); - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), GPM_HISTORY_HOUR_TEXT); - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), GPM_HISTORY_HOURS_TEXT); - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), GPM_HISTORY_DAY_TEXT); - gtk_combo_box_append_text (GTK_COMBO_BOX (widget), GPM_HISTORY_WEEK_TEXT); - #endif + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_MINUTE_TEXT); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_HOUR_TEXT); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_HOURS_TEXT); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_DAY_TEXT); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), GPM_HISTORY_WEEK_TEXT); gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 1); if (history_time == GPM_HISTORY_MINUTE_VALUE) gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0); diff --git a/src/gpm-tray-icon.c b/src/gpm-tray-icon.c index ec6aea64..ad44f834 100644 --- a/src/gpm-tray-icon.c +++ b/src/gpm-tray-icon.c @@ -95,11 +95,8 @@ gpm_tray_icon_set_tooltip (GpmTrayIcon *icon, const gchar *tooltip) g_return_val_if_fail (GPM_IS_TRAY_ICON (icon), FALSE); g_return_val_if_fail (tooltip != NULL, FALSE); -#if GTK_CHECK_VERSION(2,15,0) gtk_status_icon_set_tooltip_text (icon->priv->status_icon, tooltip); -#else - gtk_status_icon_set_tooltip (icon->priv->status_icon, tooltip); -#endif + return TRUE; }