From 6d4750ec7e46ee056b292124c1d1d735c39e7240 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Fri, 10 Feb 2023 14:03:55 -0100 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D1=81=20=D0=B1=D0=B0=D0=B3=D0=B8=20=D1=81?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=BF=D1=80=D0=BE=D1=81=D0=B0=D0=BC=D0=B8=20?= =?UTF-8?q?=D0=BA=20=D0=B1=D1=8D=D0=BA=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-datetime.cc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/source/ubl-settings-datetime.cc b/source/ubl-settings-datetime.cc index 288efb3..34f3c84 100644 --- a/source/ubl-settings-datetime.cc +++ b/source/ubl-settings-datetime.cc @@ -73,7 +73,6 @@ MainWindow::MainWindow(Glib::RefPtr const& builder) { void MainWindow::settings(){ year=0, month=0, day=0; this->get_builder(); - this->event(); this->lacalization(); if (this->check_root()==0){ numTimeHrs->set_range(0,23); @@ -82,7 +81,10 @@ void MainWindow::settings(){ numTimeMin->set_increments(1.0,1.0); this->get_config(); this->flag_block_gui(); + this->event(); this->parse_text_date(); + + } else{ numTimeHrs->set_sensitive(false); @@ -107,6 +109,7 @@ void MainWindow::settings(){ lblRegGlob->set_sensitive(false); lblZone1Glob->set_sensitive(false); lblDateTimeSetting->set_sensitive(false); + this->event(); } } @@ -383,7 +386,7 @@ void MainWindow::event_entry_cbDhcp(){ str_dhcp = str_dhcp.substr(str_dhcp.find("=")+1,str_dhcp.length()); str_dhcp = str_dhcp.substr(0,str_dhcp.find("\n")); if (str_dhcp!="dhcp" && str_dhcp!="(null)"){ - txtNtpServer->set_text(""); + txtNtpServer->set_text(str_dhcp); } cbDhcp->set_active(activ_index); } @@ -447,8 +450,8 @@ void MainWindow::calendar_show(){ void MainWindow::enry_dhcp_mess(){ string str_dhcp = this->call("/usr/bin/ubconfig get network NTPSERVERS"); if ((str_dhcp!="") && (str_dhcp!="(null)")){ - this->set_ntp_toggle_glob(); cbxSynchronizeNtpGlob->set_active(1); + this->set_ntp_toggle_glob(); str_dhcp = str_dhcp.substr(str_dhcp.find("=")+1,str_dhcp.length()); str_dhcp = str_dhcp.substr(0,str_dhcp.find("\n")); if (str_dhcp=="dhcp"){ @@ -497,8 +500,7 @@ void MainWindow::get_config(){ string str_filling_zon = read_reg_zon_cfg.substr(read_reg_zon_cfg.find("/")+1,read_reg_zon_cfg.length()); str_filling_zon = str_filling_zon.substr(0,str_filling_zon.find("\n")); string str_zone_check = ""; - this->append_region_zone(str_filling_reg,str_filling_zon); - //this->append_region_zone("Africa","Abidjan"); + this->append_region_zone(str_filling_reg,str_filling_zon); } else { this->append_region_zone("Africa","Abidjan"); @@ -584,7 +586,10 @@ void MainWindow::set_ntp_toggle_glob(){ } else{ cbDhcp->set_sensitive(true); - txtNtpServer->set_sensitive(true); + int activ_index = cbDhcp->get_active_row_number(); + if (activ_index==2){ + txtNtpServer->set_sensitive(true); + } } } @@ -613,8 +618,8 @@ void MainWindow::append_region_zone(string region, string zone){ path_reg_zone=region+"/"+zone; zone_offest = this->zone_file_read(path_reg_zone) + _(zone.c_str()); for (string &_str_zone : time_reg_map_local.at(region)){ - cbZone->append(zone_mixing); - cbZoneGlob->append(zone_mixing); + cbZone->append(_str_zone); + cbZoneGlob->append(_str_zone); if (_str_zone!=""){ if (zone_offest == _str_zone){ cbZone->set_active(index);