From 55bc2d3f00656af5732066aa59447512882ff7ee Mon Sep 17 00:00:00 2001 From: zhuyaliang <15132211195@163.com> Date: Fri, 14 Jun 2019 15:09:44 +0800 Subject: Do not reload NTP and modify the button arrangement when starting the service --- capplets/time-admin/src/main.c | 15 +++++---------- capplets/time-admin/src/time-tool.c | 28 ---------------------------- capplets/time-admin/src/time-tool.h | 3 --- 3 files changed, 5 insertions(+), 41 deletions(-) (limited to 'capplets/time-admin') diff --git a/capplets/time-admin/src/main.c b/capplets/time-admin/src/main.c index 8b339cc2..96d0df6d 100644 --- a/capplets/time-admin/src/main.c +++ b/capplets/time-admin/src/main.c @@ -96,7 +96,6 @@ static void UpdatePermission(TimeAdmin *ta) gtk_widget_set_sensitive(ta->NtpSyncSwitch, is_authorized); } - static void on_permission_changed (GPermission *permission, GParamSpec *pspec, gpointer data) @@ -269,10 +268,6 @@ static GtkWidget * TimeZoneAndNtp(TimeAdmin *ta) ta->NtpSyncSwitch = gtk_switch_new(); NtpState = GetNtpState(ta); - if(NtpState) - { - ReloadNtp(ta->proxy,NtpState); - } ta->NtpState = NtpState; gtk_switch_set_state (GTK_SWITCH(ta->NtpSyncSwitch), NtpState); @@ -356,8 +351,8 @@ static GtkWidget *SetDate(TimeAdmin *ta) gtk_grid_set_column_homogeneous(GTK_GRID(table),TRUE); DateLabel = gtk_label_new(NULL); - SetLableFontType(DateLabel,12,_("Set Date")); - gtk_grid_attach(GTK_GRID(table) ,DateLabel, 1 , 0 , 1 , 1); + SetLableFontType(DateLabel,13,_("Set Date")); + gtk_grid_attach(GTK_GRID(table) ,DateLabel, 1 , 0 , 2 , 2); LocalTime = GetCurrentTime(); ta->Calendar = gtk_calendar_new (); @@ -365,16 +360,16 @@ static GtkWidget *SetDate(TimeAdmin *ta) SetTooltip(ta->Calendar,!ta->NtpState); gtk_calendar_mark_day(GTK_CALENDAR(ta->Calendar),LocalTime->tm_mday); ta->OldDay = LocalTime->tm_mday; - gtk_grid_attach(GTK_GRID(table) ,ta->Calendar, 0 , 1 , 3 , 3); + gtk_grid_attach(GTK_GRID(table) ,ta->Calendar, 0 , 2 , 4 , 3); ta->CloseButton = gtk_button_new_with_label (_("Close")); - gtk_grid_attach(GTK_GRID(table) ,ta->CloseButton, 0 , 5 , 1 , 1); + gtk_grid_attach(GTK_GRID(table) ,ta->CloseButton, 3 , 5 , 1 , 1); g_signal_connect (ta->CloseButton, "clicked", G_CALLBACK (CloseWindow), ta); - gtk_grid_attach(GTK_GRID(table) ,ta->ButtonLock, 1 , 5 , 1 , 1); + gtk_grid_attach(GTK_GRID(table) ,ta->ButtonLock, 0 , 5 , 1 , 1); ta->SaveButton = gtk_button_new_with_label (_("Save")); gtk_widget_set_sensitive(ta->SaveButton,!ta->NtpState); diff --git a/capplets/time-admin/src/time-tool.c b/capplets/time-admin/src/time-tool.c index e48f9368..f2375808 100644 --- a/capplets/time-admin/src/time-tool.c +++ b/capplets/time-admin/src/time-tool.c @@ -200,34 +200,6 @@ static void ChangeSpinBttonState(TimeAdmin *ta,gboolean State) SetTooltip(ta->Calendar,!ta->NtpState); } -void ReloadNtp(GDBusProxy *proxy,gboolean state) -{ - GError *error = NULL; - GVariant *ret1,*ret2; - - ret1 = g_dbus_proxy_call_sync (proxy, - "SetNTP", - g_variant_new ("(bb)",!state,!state), - G_DBUS_CALL_FLAGS_NONE, - -1, - NULL, - &error); - - ret2 = g_dbus_proxy_call_sync (proxy, - "SetNTP", - g_variant_new ("(bb)",state,state), - G_DBUS_CALL_FLAGS_NONE, - -1, - NULL, - &error); - - if(ret1 == NULL || ret2 == NULL) - { - MessageReport(_("Reload Ntp sync"),error->message,ERROR); - g_error_free(error); - } - -} gboolean ChangeNtpSync(GtkSwitch *widget,gboolean state,gpointer data) { TimeAdmin *ta = (TimeAdmin *)data; diff --git a/capplets/time-admin/src/time-tool.h b/capplets/time-admin/src/time-tool.h index 393c43a5..ad098bce 100644 --- a/capplets/time-admin/src/time-tool.h +++ b/capplets/time-admin/src/time-tool.h @@ -36,9 +36,6 @@ void SaveModifyTime (GtkButton *button, gboolean GetNtpState (TimeAdmin *ta); -void ReloadNtp (GDBusProxy *proxy, - gboolean state); - const gchar *GetTimeZone (TimeAdmin *ta); void SetTimeZone (GDBusProxy *proxy, -- cgit v1.2.1