diff -urN -x'*.orig' gnome-panel-2.30.2/applets/clock/clock.c ../SUNWgnome-panel-2.30.0.hacked/gnome-panel-2.30.2/applets/clock/clock.c
--- gnome-panel-2.30.2/applets/clock/clock.c 2011-02-08 13:00:04.215680521 +0000
+++ ../SUNWgnome-panel-2.30.0.hacked/gnome-panel-2.30.2/applets/clock/clock.c 2011-02-08 15:52:37.762813392 +0000
@@ -40,6 +40,7 @@
#include <sys/time.h>
#include <math.h>
#include <locale.h>
+#include <stdlib.h>
#include <panel-applet.h>
#include <panel-applet-gconf.h>
@@ -1647,7 +1648,10 @@
can_set = can_set_system_time ();
if (cd->time_settings_button)
- gtk_widget_set_sensitive (cd->time_settings_button, can_set);
+ if (can_set)
+ gtk_widget_set_sensitive (cd->time_settings_button, can_set);
+ else // hide widget rather than make it insensitive
+ gtk_widget_hide (cd->time_settings_button);
if (cd->set_time_button) {
gtk_widget_set_sensitive (cd->set_time_button, can_set != 0);
@@ -1848,14 +1852,12 @@
static void
run_time_settings (GtkWidget *unused, ClockData *cd)
{
- 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_click_timeout_time_only (cd);
+ if (can_set_system_timezone())
+ {
+ /* Launch 'vp time' to set the timezone/and system time. Was 'time-admin' */
+ system ("vp time");
+ }
+ refresh_clock_timeout (cd);
}
static void
diff -urN -x'*.orig' gnome-panel-2.30.2/applets/clock/set-timezone-dummy.c ../SUNWgnome-panel-2.30.0.hacked/gnome-panel-2.30.2/applets/clock/set-timezone-dummy.c
--- gnome-panel-2.30.2/applets/clock/set-timezone-dummy.c 2010-02-09 12:32:08.000000000 +0000
+++ ../SUNWgnome-panel-2.30.0.hacked/gnome-panel-2.30.2/applets/clock/set-timezone-dummy.c 2011-02-08 15:41:31.761124143 +0000
@@ -18,19 +18,35 @@
*/
#include <glib.h>
+#include <sys/stat.h>
#include "set-timezone.h"
gint
can_set_system_timezone (void)
{
- return 0;
+ /* Workaround for Solaris as PolicyKit does not exist */
+ gchar *time_admin = g_find_program_in_path ("vp");
+ gint ret_val = 0;
+
+ if (time_admin) {
+ int status;
+ struct stat buffer;
+
+ status = stat ("/usr/share/vpanels/panel/vpanels-panels-time.jar", &buffer);
+ if (status == 0)
+ ret_val = 1;
+ }
+ g_free (time_admin);
+
+ return (ret_val);
}
gint
can_set_system_time (void)
{
- return 0;
+ /* Workaround for Solaris as PolicyKit does not exist */
+ return (can_set_system_timezone ());
}
void