Сделана локализация окна отключения ntp, исправен баг с проверкой активных ntp

pull/30/head
Igor Belitskiy 3 years ago
parent 4e530933e8
commit f6bced3bed

@ -132,6 +132,9 @@ void MainWindow::lacalization(){
this->set_title(gettext("ubl-settings-datetime")); this->set_title(gettext("ubl-settings-datetime"));
mess_dchp->set_title(gettext("Warning!")); mess_dchp->set_title(gettext("Warning!"));
lblTimeBios->set_text(gettext("Synchronize hardware time")); lblTimeBios->set_text(gettext("Synchronize hardware time"));
lblBanerStopNtp->set_text(gettext("Active service detected\nAutomatic time and date synchronization service detected"));
lblNtpStop->set_text(gettext("Stop the synchronization service"));
lblNtpClose->set_text(gettext("Close"));
//_lblSynchronizebChk->set_text(gettext("Synchronize via NTP")); //_lblSynchronizebChk->set_text(gettext("Synchronize via NTP"));
} }
@ -328,7 +331,9 @@ void MainWindow::event_entry_cbDhcp(){
} }
else if (activ_index==2){ else if (activ_index==2){
txtNtpServer->set_sensitive(true); txtNtpServer->set_sensitive(true);
txtNtpServer->set_text(""); if (txtNtpServer->get_text().find("default")!=std::string::npos){
txtNtpServer->set_text("");
}
string str_dhcp = this->call("/usr/bin/ubconfig get network NTPSERVERS"); string str_dhcp = this->call("/usr/bin/ubconfig get network NTPSERVERS");
if ((str_dhcp!="") && (str_dhcp!="(null)") && (str_dhcp.find("default")==std::string::npos)){ if ((str_dhcp!="") && (str_dhcp!="(null)") && (str_dhcp.find("default")==std::string::npos)){
str_dhcp = str_dhcp.substr(str_dhcp.find("=")+1,str_dhcp.length()); str_dhcp = str_dhcp.substr(str_dhcp.find("=")+1,str_dhcp.length());
@ -578,7 +583,7 @@ void MainWindow::append_zone_glob(){
} }
} }
void MainWindow::wrapper_update_time_date(){ void MainWindow::wrapper_update_time_date(){
string cmd = "pidof -q systemd-timesyncd ntpd chronyd"; string cmd = "pidof systemd-timesyncd ntpd chronyd";
string response = this->call(cmd); string response = this->call(cmd);
if (response.length()==0){ if (response.length()==0){
this->update_time_date(); this->update_time_date();

@ -119,6 +119,7 @@ class MainWindow : public Gtk::ApplicationWindow {
Gtk::Label *lblSynchronizeBtn; Gtk::Label *lblSynchronizeBtn;
Gtk::Label *lblDateTimeSettingGlob; Gtk::Label *lblDateTimeSettingGlob;
Gtk::Label *lblTimeBios; Gtk::Label *lblTimeBios;
Gtk::Label *lblBanerStopNtp;
Gtk::Button *btnHardwareTime; Gtk::Button *btnHardwareTime;
Gtk::CheckButton *cbxSynchronizeNtp; Gtk::CheckButton *cbxSynchronizeNtp;
Gtk::Window *windowsNnpClose; Gtk::Window *windowsNnpClose;

@ -1040,7 +1040,7 @@ Format: DD.MM.YYYY</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel"> <object class="GtkLabel" id="lblBanerStopNtp">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="margin-left">5</property> <property name="margin-left">5</property>
@ -1049,8 +1049,8 @@ Format: DD.MM.YYYY</property>
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">6</property> <property name="margin-top">6</property>
<property name="margin-bottom">6</property> <property name="margin-bottom">6</property>
<property name="label" translatable="yes">Обнаружен активный сервис <property name="label" translatable="yes">Active service detected
автоматической синхронизации времени и даты</property> Automatic time and date synchronization service detected</property>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
@ -1104,7 +1104,7 @@ Format: DD.MM.YYYY</property>
<object class="GtkLabel" id="lblNtpStop"> <object class="GtkLabel" id="lblNtpStop">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Остановить сервис синхронизации</property> <property name="label" translatable="yes">Stop the synchronization service</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1156,7 +1156,7 @@ Format: DD.MM.YYYY</property>
<object class="GtkLabel" id="lblNtpClose"> <object class="GtkLabel" id="lblNtpClose">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="label" translatable="yes">Закрыть</property> <property name="label" translatable="yes">Close</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>

@ -6,6 +6,15 @@
msgid "" msgid ""
msgstr "" msgstr ""
msgid "Stop the synchronization service"
msgstr "Остановить сервис синхронизации"
msgid "Close"
msgstr "Закрыть"
msgid "Active service detected\nAutomatic time and date synchronization service detected"
msgstr "Обнаружен активный сервис\nавтоматической синхронизации времени и даты"
msgid "By default" msgid "By default"
msgstr "По умолчанию" msgstr "По умолчанию"

Loading…
Cancel
Save