From 02572c7ed18a8911e3074ab20aa4cf8464a9a181 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 22 Jan 2025 16:30:08 +0600 Subject: [PATCH] Added default parameter for HWCLOCK_SYNC --- source/ubl-settings-datetime.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/ubl-settings-datetime.c b/source/ubl-settings-datetime.c index 70824f1..18b1122 100644 --- a/source/ubl-settings-datetime.c +++ b/source/ubl-settings-datetime.c @@ -53,9 +53,10 @@ void yon_save_parameters(main_window *widgets){ free(zone_parameter); } - if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->TimeSyncTypeCombo))==0){ + int hwclock_sync = gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->TimeSyncTypeCombo)); + if (hwclock_sync==1){ yon_config_register(HWCLOCK_SYNC_parameter,HWCLOCK_SYNC_parameter_command,"localtime"); - } else { + } else if (hwclock_sync == 2) { yon_config_register(HWCLOCK_SYNC_parameter,HWCLOCK_SYNC_parameter_command,"utc"); } @@ -207,9 +208,9 @@ void yon_interface_update(main_window *widgets){ char *hwclock_sync = config(HWCLOCK_SYNC_parameter); if (!yon_char_is_empty(hwclock_sync)){ if (!strcmp(hwclock_sync,"utc")){ + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->TimeSyncTypeCombo),2); + } else if (!strcmp(hwclock_sync,"localtime")){ gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->TimeSyncTypeCombo),1); - } else { - gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->TimeSyncTypeCombo),0); } }