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); } }