Добавлен tooltip, исправлены команды

pull/33/head^2
Igor Belitskiy 3 years ago
parent f545794334
commit b3c3a948d7

@ -122,6 +122,7 @@ int MainWindow::check_root(){
} }
void MainWindow::lacalization(){ void MainWindow::lacalization(){
txtDate->set_tooltip_text(_("Date of\nFormat: DD.MM.YYYY")); txtDate->set_tooltip_text(_("Date of\nFormat: DD.MM.YYYY"));
txtNtpServer->set_tooltip_text(_("Enter the name of the ntp server or its ip address.\nWhen entering multiple addresses, separate them with spaces."));
lblSynchronizebChkGLob->set_text(_("Synchronize via NTP")); lblSynchronizebChkGLob->set_text(_("Synchronize via NTP"));
cbDhcp->append(_("By default")); cbDhcp->append(_("By default"));
cbDhcp->append(_("DHCP")); cbDhcp->append(_("DHCP"));
@ -290,15 +291,21 @@ void MainWindow::wind_close_ntp(){
void MainWindow::stop_ntp(){ void MainWindow::stop_ntp(){
windowsNnpClose->hide(); windowsNnpClose->hide();
string cmd = "SEL_SERVICE=\"systemd-timesyncd\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service; " string cmd = "SEL_SERVICE=\"systemd-timesyncd\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service; ";
"SEL_SERVICE=\"ntpd\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ${SEL_SERVICE}; " system(cmd.c_str());
"SEL_SERVICE=\"ntpdate\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ${SEL_SERVICE}; " cmd ="SEL_SERVICE=\"ntpd\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ${SEL_SERVICE}; ";
"SEL_SERVICE=\"chronyd\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ${SEL_SERVICE}; " system(cmd.c_str());
"SEL_SERVICE=\"openntpd\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ntpd; " cmd ="SEL_SERVICE=\"ntpdate\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ${SEL_SERVICE}; ";
"SEL_SERVICE=\"ptp4l\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ${SEL_SERVICE}; " system(cmd.c_str());
"SEL_SERVICE=\"phc2sys\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ${SEL_SERVICE} "; cmd = "SEL_SERVICE=\"chronyd\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ${SEL_SERVICE}; ";
system(cmd.c_str());
cmd ="SEL_SERVICE=\"openntpd\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ntpd; ";
system(cmd.c_str()); system(cmd.c_str());
cmd ="SEL_SERVICE=\"ptp4l\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ${SEL_SERVICE}; ";
system(cmd.c_str());
cmd ="SEL_SERVICE=\"phc2sys\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ${SEL_SERVICE} ";
system(cmd.c_str());
this->update_time_date(); this->update_time_date();
} }
@ -463,8 +470,6 @@ void MainWindow::get_config(){
this->update_hour_minute(); this->update_hour_minute();
this->update_calendar(); this->update_calendar();
this->enry_dhcp_mess(); this->enry_dhcp_mess();
string read_reg_zon_cfg = this->call("/usr/bin/ubconfig get clock ZONE"); string read_reg_zon_cfg = this->call("/usr/bin/ubconfig get clock ZONE");
if ((read_reg_zon_cfg != "") && (strstr(read_reg_zon_cfg.c_str() ,"(null)")==NULL)){ if ((read_reg_zon_cfg != "") && (strstr(read_reg_zon_cfg.c_str() ,"(null)")==NULL)){
read_reg_zon_cfg = read_reg_zon_cfg.substr(read_reg_zon_cfg.find("=")+1,read_reg_zon_cfg.length()); read_reg_zon_cfg = read_reg_zon_cfg.substr(read_reg_zon_cfg.find("=")+1,read_reg_zon_cfg.length());
@ -688,7 +693,6 @@ void MainWindow::update_time_date(){
cmd = "date +%Y%m%d -s \"" + to_string(year)+ cmd = "date +%Y%m%d -s \"" + to_string(year)+
str_month+str_day+"\""; str_month+str_day+"\"";
system(cmd.c_str()); system(cmd.c_str());
txtDate->set_text(str_data); txtDate->set_text(str_data);
year=0; year=0;
month=0; month=0;
@ -794,7 +798,6 @@ void MainWindow::read_file(){
} }
in1.close(); in1.close();
} }
time_reg_map.insert({key_reg, zone}); time_reg_map.insert({key_reg, zone});
time_reg_map_local.insert({key_reg, zone_local}); time_reg_map_local.insert({key_reg, zone_local});
}}}} }}}}
@ -805,7 +808,6 @@ void MainWindow::read_file(){
} }
string MainWindow::zone_file_read(string zone){ string MainWindow::zone_file_read(string zone){
if (zone.length()==1){ if (zone.length()==1){
return ""; return "";
} }

@ -807,6 +807,7 @@ Format: DD.MM.YYYY</property>
<property name="width-request">-1</property> <property name="width-request">-1</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="tooltip-text" translatable="yes">Enter the name of the ntp server or its ip address. When entering multiple addresses, separate them with spaces.</property>
<property name="valign">center</property> <property name="valign">center</property>
<property name="margin-left">5</property> <property name="margin-left">5</property>
<property name="margin-right">5</property> <property name="margin-right">5</property>

@ -1593,3 +1593,6 @@ msgstr "Майотта"
msgid "BajaSur" msgid "BajaSur"
msgstr "Южная Нижняя Калифорния" msgstr "Южная Нижняя Калифорния"
msgid "Enter the name of the ntp server or its ip address.\nWhen entering multiple addresses, separate them with spaces."
msgstr "Введите имя ntp-сервера или его ip-адрес.\nПри вводе нескольких адресов, разделяйте их пробелами."

Loading…
Cancel
Save