gnome-power-manager r3320 - in trunk: . src



Author: rhughes
Date: Mon Mar  2 10:18:31 2009
New Revision: 3320
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=3320&view=rev

Log:
2009-03-02  Richard Hughes  <richard hughsie com>

* src/gpm-prefs-core.c: (gpm_prefs_setup_sleep_slider):
Increase the size of the timeout widget to two hours, which fixes
things when gnome-screensaver has a long timeout.
Based on a patch from Michael Terry, many thanks.
Fixes #529214


Modified:
   trunk/ChangeLog
   trunk/src/gpm-prefs-core.c

Modified: trunk/src/gpm-prefs-core.c
==============================================================================
--- trunk/src/gpm-prefs-core.c	(original)
+++ trunk/src/gpm-prefs-core.c	Mon Mar  2 10:18:31 2009
@@ -88,8 +88,11 @@
 #define ACTION_BLANK_TEXT		_("Blank screen")
 #define ACTION_NOTHING_TEXT		_("Do nothing")
 
-/* If sleep time in a slider is set to 61 it is considered as never */
-const int NEVER_TIME_ON_SLIDER = 61;
+/* If sleep time in a slider is set to 122 it is considered as never.
+ * We use 122 because gnome-screensaver's idle delay can be pushed to 120.
+ * We leave ourselves an extra minute past that (because our slider is always
+ * at least idle_delay+1).  Then 122 is the special value 'never'. */
+const int NEVER_TIME_ON_SLIDER = 122;
 
 /**
  * gpm_prefs_class_init:
@@ -330,6 +333,7 @@
 	GtkWidget *widget;
 	gint value;
 	gboolean is_writable;
+	GtkAdjustment *adjustment;
 
 	widget = glade_xml_get_widget (prefs->priv->glade_xml, widget_name);
 	g_signal_connect (G_OBJECT (widget), "format-value",
@@ -348,6 +352,10 @@
 		value += prefs->priv->idle_delay;
 	}
 
+	/* set upper */
+	adjustment = gtk_range_get_adjustment (GTK_RANGE (widget));
+	gtk_adjustment_set_upper (adjustment, NEVER_TIME_ON_SLIDER);
+
 	gtk_range_set_value (GTK_RANGE (widget), value);
 
 	g_object_set_data (G_OBJECT (widget), "conf_key", (gpointer) gpm_pref_key);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]