[gnome-system-monitor] Fix loading values into update interval spinners
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-monitor] Fix loading values into update interval spinners
- Date: Sun, 17 Nov 2013 05:29:21 +0000 (UTC)
commit 8c3f49eb49a87b1d2a0dbd36e4fdfdc7e3f81b0a
Author: Edward Sheldrake <ejsheldrake gmail com>
Date: Sat Nov 16 18:34:19 2013 +0000
Fix loading values into update interval spinners
https://bugzilla.gnome.org/show_bug.cgi?id=712518
src/prefsdialog.cpp | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/src/prefsdialog.cpp b/src/prefsdialog.cpp
index 6e466b6..2af0d74 100644
--- a/src/prefsdialog.cpp
+++ b/src/prefsdialog.cpp
@@ -234,14 +234,14 @@ create_preferences_dialog (GsmApplication *app)
spin_button = GTK_WIDGET (gtk_builder_get_object (builder, "processes_interval_spinner"));
update = (gfloat) app->config.update_interval;
- adjustment = (GtkAdjustment *) gtk_adjustment_new(update / 1000.0,
- MIN_UPDATE_INTERVAL / 1000,
- MAX_UPDATE_INTERVAL / 1000,
- 0.25,
- 1.0,
- 0);
-
- gtk_spin_button_set_adjustment (GTK_SPIN_BUTTON(spin_button), adjustment);
+ adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON(spin_button));
+ gtk_adjustment_configure (adjustment,
+ update / 1000.0,
+ MIN_UPDATE_INTERVAL / 1000,
+ MAX_UPDATE_INTERVAL / 1000,
+ 0.25,
+ 1.0,
+ 0);
g_signal_connect (G_OBJECT (spin_button), "focus_out_event",
G_CALLBACK (SBU::callback), &interval_updater);
@@ -266,10 +266,10 @@ create_preferences_dialog (GsmApplication *app)
create_field_page (builder, app->tree, "proctree");
update = (gfloat) app->config.graph_update_interval;
- adjustment = (GtkAdjustment *) gtk_adjustment_new(update / 1000.0, 0.25,
- 100.0, 0.25, 1.0, 0);
- spin_button = GTK_WIDGET (gtk_builder_get_object (builder, "resources_interval_spinner"));
- gtk_spin_button_set_adjustment (GTK_SPIN_BUTTON(spin_button), adjustment);
+ spin_button = GTK_WIDGET (gtk_builder_get_object (builder, "resources_interval_spinner"));
+ adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON(spin_button));
+ gtk_adjustment_configure (adjustment, update / 1000.0, 0.25,
+ 100.0, 0.25, 1.0, 0);
g_signal_connect (G_OBJECT (spin_button), "focus_out_event",
G_CALLBACK(SBU::callback),
&graph_interval_updater);
@@ -280,10 +280,10 @@ create_preferences_dialog (GsmApplication *app)
G_SETTINGS_BIND_DEFAULT);
update = (gfloat) app->config.disks_update_interval;
- adjustment = (GtkAdjustment *) gtk_adjustment_new (update / 1000.0, 1.0,
- 100.0, 1.0, 1.0, 0);
spin_button = GTK_WIDGET (gtk_builder_get_object (builder, "devices_interval_spinner"));
- gtk_spin_button_set_adjustment (GTK_SPIN_BUTTON(spin_button), adjustment);
+ adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON(spin_button));
+ gtk_adjustment_configure (adjustment, update / 1000.0, 1.0,
+ 100.0, 1.0, 1.0, 0);
g_signal_connect (G_OBJECT (spin_button), "focus_out_event",
G_CALLBACK(SBU::callback),
&disks_interval_updater);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]