gnome-panel r11096 - trunk/applets/clock



Author: matthiasc
Date: Sat May 10 01:32:05 2008
New Revision: 11096
URL: http://svn.gnome.org/viewvc/gnome-panel?rev=11096&view=rev

Log:
Desensitise "Set System Time" button when privileges are missing.


Modified:
   trunk/applets/clock/ChangeLog
   trunk/applets/clock/clock.c

Modified: trunk/applets/clock/clock.c
==============================================================================
--- trunk/applets/clock/clock.c	(original)
+++ trunk/applets/clock/clock.c	Sat May 10 01:32:05 2008
@@ -1681,18 +1681,20 @@
 static void
 update_set_time_button (ClockData *cd)
 {
-	gboolean can_set;
+	gint can_set;
 
-	can_set = can_set_system_time () != 0; /* this can return 0, 1, 2 */
+	can_set = can_set_system_time (); /* this can return 0, 1, 2 */
 
 	if (cd->time_settings_button)
 		gtk_widget_set_sensitive (cd->time_settings_button, can_set);
 
-	if (cd->set_time_button)
+	if (cd->set_time_button) {
+		gtk_widget_set_sensitive (cd->set_time_button, can_set != 0); 
 		gtk_button_set_label (GTK_BUTTON (cd->set_time_button),
-				      can_set ?
+				      can_set == 1 ?
 					_("Set System Time...") :
 					_("Set System Time"));
+	}
 }
 
 static void
@@ -1864,6 +1866,8 @@
 	ensure_time_settings_window_is_created (cd);
 	fill_time_settings_window (cd);
 
+	update_set_time_button (cd);
+
 	gtk_window_present (GTK_WINDOW (cd->set_time_window));
 
         refresh_clock_timeout (cd);



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