#! /bin/sh /usr/share/dpatch/dpatch-run ## 17_ntpdate.dpatch by Vincent Untz ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: No description. @DPATCH@ diff -urNad gnome-system-tools-2.14.0~/interfaces/time.glade.in gnome-system-tools-2.14.0/interfaces/time.glade.in --- gnome-system-tools-2.14.0~/interfaces/time.glade.in 2006-01-30 23:40:32.000000000 +0100 +++ gnome-system-tools-2.14.0/interfaces/time.glade.in 2006-04-20 18:21:18.000000000 +0200 @@ -177,7 +177,7 @@ True True - S_ynchronize clock with Internet servers: + Periodically s_ynchronize clock with Internet servers: True GTK_RELIEF_NORMAL True @@ -472,6 +472,106 @@ + + + + True + True + GTK_RELIEF_NORMAL + True + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gnome-stock-timer + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Synchronize _Now + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 2 + 3 + 4 + 5 + fill + + + + + + + True + Synchronize only once with Internet servers: + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + + + 0 + 2 + 4 + 5 + + + 0 diff -urNad gnome-system-tools-2.14.0~/src/time/main.c gnome-system-tools-2.14.0/src/time/main.c --- gnome-system-tools-2.14.0~/src/time/main.c 2006-04-20 18:21:17.000000000 +0200 +++ gnome-system-tools-2.14.0/src/time/main.c 2006-04-20 18:22:08.000000000 +0200 @@ -57,6 +57,7 @@ static void on_server_list_element_toggled (GtkCellRendererToggle*, gchar*, gpointer); static void on_timezone_help_button_clicked (GtkWidget*, gpointer); static void on_time_server_help_button_clicked (GtkWidget*, gpointer); +static void on_synchronize_button_clicked (GtkWidget*, gpointer); static char *ntp_servers[] = { @@ -133,6 +134,7 @@ { "ntp_add_server", "clicked", G_CALLBACK (gst_dialog_modify_cb) }, { "time_zone_help_button", "clicked", G_CALLBACK (on_timezone_help_button_clicked) }, { "time_server_help_button", "clicked", G_CALLBACK (on_time_server_help_button_clicked) }, + { "synchronize_button", "clicked", G_CALLBACK (on_synchronize_button_clicked) }, { NULL } }; @@ -445,6 +447,12 @@ } static void +on_synchronize_button_clicked (GtkWidget *w, gpointer data) +{ + g_spawn_command_line_async ("/etc/network/if-up.d/ntpdate", NULL); +} + +static void ntp_use_toggled (GtkWidget *w, GstDialog *dialog) { gboolean active, configured, ntp_installed; @@ -489,6 +497,7 @@ gst_dialog_modify (dialog); gtk_widget_set_sensitive (gst_dialog_get_widget (dialog, "timeserver_button"), active); + gtk_widget_set_sensitive (gst_dialog_get_widget (dialog, "synchronize_button"), !active); } GST_TOOL_MAKE_TYPE(time,Time) @@ -784,6 +793,13 @@ gst_time_init_timezone (GST_TIME_TOOL (tool)); gst_tool_main (tool, TRUE); + if (!(gboolean) g_object_get_data (G_OBJECT (tool), "ntpdate")) { + gtk_widget_hide (gst_dialog_get_widget (tool->main_dialog, + "synchronize_label")); + gtk_widget_hide (gst_dialog_get_widget (tool->main_dialog, + "synchronize_button")); + } + gst_time_clock_start (GST_TIME_TOOL (tool)); gtk_main (); diff -urNad gnome-system-tools-2.14.0~/src/time/transfer.c gnome-system-tools-2.14.0/src/time/transfer.c --- gnome-system-tools-2.14.0~/src/time/transfer.c 2005-08-08 21:00:04.000000000 +0200 +++ gnome-system-tools-2.14.0/src/time/transfer.c 2006-04-20 18:21:18.000000000 +0200 @@ -239,6 +239,9 @@ } g_object_set_data (G_OBJECT (tool), "ntpinstalled", (gpointer) res); + node = gst_xml_element_find_first (root, "ntpinstalled"); + g_object_set_data (G_OBJECT (tool), "ntpdate", + (gpointer) (node != NULL)); } void