patches/gnome-panel-15-use-time-admin.diff
author yippi
Mon, 27 Sep 2010 21:07:51 +0000
changeset 20108 51df67ca9307
parent 16553 11e13d0e977f
permissions -rw-r--r--
I had these modules listed as being owned by me, but they are really owned by wangke, correcting.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16553
11e13d0e977f * patches/gnome-panel-08-launch-menu.diff : Re-Apply for 2.27.92
mattman
parents: 16014
diff changeset
     1
/jds/bin/diff -uprN gnome-panel-2.27.92.old/applets/clock/clock.c gnome-panel-2.27.92/applets/clock/clock.c
11e13d0e977f * patches/gnome-panel-08-launch-menu.diff : Re-Apply for 2.27.92
mattman
parents: 16014
diff changeset
     2
--- gnome-panel-2.27.92.old/applets/clock/clock.c	2009-09-14 12:10:47.125484000 +0100
11e13d0e977f * patches/gnome-panel-08-launch-menu.diff : Re-Apply for 2.27.92
mattman
parents: 16014
diff changeset
     3
+++ gnome-panel-2.27.92/applets/clock/clock.c	2009-09-14 12:12:17.726975000 +0100
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     4
@@ -40,6 +40,7 @@
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     5
 #include <sys/time.h>
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     6
 #include <math.h>
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     7
 #include <locale.h>
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     8
+#include <stdlib.h>
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     9
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    10
 #include <panel-applet.h>
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    11
 #include <panel-applet-gconf.h>
16553
11e13d0e977f * patches/gnome-panel-08-launch-menu.diff : Re-Apply for 2.27.92
mattman
parents: 16014
diff changeset
    12
@@ -1882,14 +1883,16 @@ ensure_time_settings_window_is_created (
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    13
 static void
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    14
 run_time_settings (GtkWidget *unused, ClockData *cd)
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    15
 {
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    16
-	ensure_time_settings_window_is_created (cd);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    17
-	fill_time_settings_window (cd);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    18
-
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    19
-	update_set_time_button (cd);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    20
-
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    21
-	gtk_window_present (GTK_WINDOW (cd->set_time_window));
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    22
-
16553
11e13d0e977f * patches/gnome-panel-08-launch-menu.diff : Re-Apply for 2.27.92
mattman
parents: 16014
diff changeset
    23
-        refresh_click_timeout_time_only (cd);
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    24
+    /* Launch time-admin to set the timezone/and system time */
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    25
+    /* This is a Solaris specific workaround as we don't have PolicyKit */
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    26
+    /* To determine if user has permissions */
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    27
+    gchar *time_admin = g_find_program_in_path ("time-admin");
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    28
+
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    29
+    if (time_admin) {
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    30
+        system (time_admin);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    31
+        g_free (time_admin);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    32
+    }
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    33
+    refresh_clock_timeout (cd);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    34
 }
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    35
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    36
 static void
16553
11e13d0e977f * patches/gnome-panel-08-launch-menu.diff : Re-Apply for 2.27.92
mattman
parents: 16014
diff changeset
    37
/jds/bin/diff -uprN gnome-panel-2.27.92.old/applets/clock/set-timezone-dummy.c gnome-panel-2.27.92/applets/clock/set-timezone-dummy.c
11e13d0e977f * patches/gnome-panel-08-launch-menu.diff : Re-Apply for 2.27.92
mattman
parents: 16014
diff changeset
    38
--- gnome-panel-2.27.92.old/applets/clock/set-timezone-dummy.c	2009-09-14 12:10:47.141765000 +0100
11e13d0e977f * patches/gnome-panel-08-launch-menu.diff : Re-Apply for 2.27.92
mattman
parents: 16014
diff changeset
    39
+++ gnome-panel-2.27.92/applets/clock/set-timezone-dummy.c	2009-09-14 12:13:07.772153000 +0100
14982
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    40
@@ -23,14 +23,24 @@
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    41
 gint
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    42
 can_set_system_timezone (void)
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    43
 {
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    44
-	return 0;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    45
+    /* Workaround for Solaris as PolicyKit does not exist */
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    46
+    gchar *time_admin = g_find_program_in_path ("time-admin");
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    47
+    gint ret_val = 0;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    48
+
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    49
+    if (time_admin)
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    50
+	    ret_val = 1;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    51
+
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    52
+    g_free (time_admin);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    53
+
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    54
+	return (ret_val);
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    55
 }
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    56
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    57
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    58
 gint
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    59
 can_set_system_time (void)
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    60
 {
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    61
-	return 0;
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    62
+    /* Workaround for Solaris as PolicyKit does not exist */
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    63
+    return (can_set_system_timezone ());
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    64
 }
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    65
 
7ca1f0ff9d98 2009-01-28 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    66
 void