From d86ae86e6cd5a87547434b416b79fc677d9b3ae9 Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Tue, 20 Mar 2012 17:40:58 +0100 Subject: fix gpm-prefs, need to fix gpm-statistics --- configure.ac | 2 +- data/gpm-prefs.ui | 12 +- data/gpm-statistics-deprecated.ui | 505 ++++++++++++++++++++++++++++++++++++++ data/gpm-statistics-fix.ui | 505 -------------------------------------- data/gpm-statistics.ui | 6 +- po/POTFILES.in | 2 + src/gpm-prefs-core.c | 28 ++- src/gpm-statistics.c | 33 +-- 8 files changed, 552 insertions(+), 541 deletions(-) create mode 100644 data/gpm-statistics-deprecated.ui delete mode 100644 data/gpm-statistics-fix.ui diff --git a/configure.ac b/configure.ac index 09a55aa..748a509 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ(2.63) -AC_INIT([mate-power-manager], [1.2.0], [http://www.mate-desktop.org/]) +AC_INIT([mate-power-manager], [1.2.1], [http://www.mate-desktop.org/]) AC_CONFIG_SRCDIR(src) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) AM_INIT_AUTOMAKE([foreign]) diff --git a/data/gpm-prefs.ui b/data/gpm-prefs.ui index 0efc33b..87a0f42 100644 --- a/data/gpm-prefs.ui +++ b/data/gpm-prefs.ui @@ -118,7 +118,7 @@ - + True @@ -236,7 +236,7 @@ - + True @@ -373,7 +373,7 @@ - + True @@ -521,7 +521,7 @@ - + True @@ -642,7 +642,7 @@ - + True @@ -775,7 +775,7 @@ - + True diff --git a/data/gpm-statistics-deprecated.ui b/data/gpm-statistics-deprecated.ui new file mode 100644 index 0000000..6b40dcd --- /dev/null +++ b/data/gpm-statistics-deprecated.ui @@ -0,0 +1,505 @@ + + + + + + 6 + Power Statistics + center-on-parent + dialog + False + + + 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/data/gpm-statistics-fix.ui b/data/gpm-statistics-fix.ui deleted file mode 100644 index 80f3b9b..0000000 --- a/data/gpm-statistics-fix.ui +++ /dev/null @@ -1,505 +0,0 @@ - - - - - - 6 - Power Statistics - center-on-parent - dialog - False - - - 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/data/gpm-statistics.ui b/data/gpm-statistics.ui index 6b40dcd..80f3b9b 100644 --- a/data/gpm-statistics.ui +++ b/data/gpm-statistics.ui @@ -93,7 +93,7 @@ - + True @@ -120,7 +120,7 @@ - + True @@ -260,7 +260,7 @@ - + True diff --git a/po/POTFILES.in b/po/POTFILES.in index 1e124a0..e26d395 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -11,7 +11,9 @@ 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 7304d1a..a35b268 100644 --- a/src/gpm-prefs-core.c +++ b/src/gpm-prefs-core.c @@ -298,18 +298,22 @@ gpm_prefs_action_time_changed_cb (GtkWidget *widget, GpmPrefs *prefs) static void gpm_prefs_set_combo_simple_text (GtkWidget *combo_box) { - 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); + #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 } /** diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c index d526617..38e2942 100644 --- a/src/gpm-statistics.c +++ b/src/gpm-statistics.c @@ -1478,18 +1478,22 @@ gpm_stats_points_checkbox_stats_cb (GtkWidget *widget, gpointer data) static void gpm_stats_set_combo_simple_text (GtkWidget *combo_box) { - 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); + #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 } /** @@ -1603,10 +1607,11 @@ main (int argc, char *argv[]) builder = gtk_builder_new (); #if GTK_CHECK_VERSION (2, 24, 0) - retval = gtk_builder_add_from_file (builder, GPM_DATA "/gpm-statistics-fix.ui", &error); - #else 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 + if (retval == 0) { egg_warning ("failed to load ui: %s", error->message); g_error_free (error); -- cgit v1.2.1