Исправлен баг с вводом ip адреса

pull/55/head
Igor Belitskiy 3 years ago
parent c0680032f9
commit e6b1c664ff

@ -88,7 +88,6 @@ void MainWindow::settings(){
lblReg->set_sensitive(false);
lblZone->set_sensitive(false);
lblTimeZone->set_sensitive(false);
lblDateTimeSettingGlob->set_sensitive(false);
lblSynchronizebChkGLob->set_sensitive(false);
cbDhcp->set_sensitive(false);
txtNtpServer->set_sensitive(false);
@ -122,7 +121,7 @@ void MainWindow::lacalization(){
cbDhcp->append(_("DHCP"));
cbDhcp->append(_("Manual"));
cbDhcp->append(_("Disabled"));
lblDateTimeSetting->set_text(_("Local Configuration"));
lblDateTimeSetting->set_text(_("Current date and time"));
lblHead->set_text(_("Settings the date and time"));
lblTime->set_text(_("Time"));
lblData->set_text(_("Date"));
@ -130,7 +129,6 @@ void MainWindow::lacalization(){
lblReg->set_text(_("Region"));
lblZone->set_text(_("Zone"));
lblSynchronizeBtn->set_text(_("Sync by"));
lblDateTimeSettingGlob->set_text(_("Global customization"));
this->set_title(_("ubl-settings-datetime"));
windowsNnpClose->set_title(_("Warning!"));
mess_sudo->set_title(_("Warning!"));
@ -168,7 +166,6 @@ void MainWindow::flag_block_gui(){
txtNtpServer->set_sensitive(false);
}
if (flag_update==true){
lblDateTimeSettingGlob->set_sensitive(false);
txtNtpServer->set_sensitive(false);
cbDhcp->set_sensitive(false);
}
@ -215,7 +212,6 @@ void MainWindow::get_builder(){
//builder->get_widget("lblSynchronizebChk",_lblSynchronizebChk);
builder->get_widget("lblSynchronizebChkGLob",lblSynchronizebChkGLob);
builder->get_widget("lblSynchronizeBtn",lblSynchronizeBtn);
builder->get_widget("lblDateTimeSettingGlob",lblDateTimeSettingGlob);
builder->get_widget("lblTimeBios",lblTimeBios);
builder->get_widget("btnHardwareTime",btnHardwareTime);
builder->get_widget("mess_sudo",mess_sudo);
@ -279,6 +275,8 @@ void MainWindow::download_globl_cfg(){
void MainWindow::download_local_cfg(){
string cmd = "/usr/bin/ubconfig --default --source system get clock ZONE";
this->fill_in_reg_zone(cmd);
this->update_hour_minute();
this->update_calendar();
}
void MainWindow::save_local_cfg(){
@ -401,11 +399,10 @@ bool MainWindow::check_ntp(string &str_ntp){
((str_ntp.length()-index_str_ntp_2)<=3)) {
string simvol;
bool flag_error=false;
char char_ntp;
char char_ntp[1]={0};
for (size_t i = 0; i < str_ntp.size(); i++){
flag_error=false;
cout << str_ntp[i] << endl;
char_ntp = char(str_ntp[i]);
char_ntp[0] = str_ntp[i];
cout << char_ntp << endl;
for (int index=0;index<11;index++){
@ -415,9 +412,9 @@ bool MainWindow::check_ntp(string &str_ntp){
else{
simvol = to_string(index);
}
cout << (simvol==to_string(char_ntp)) << endl;
cout << simvol << " " << to_string(char_ntp) << endl;
if (simvol==to_string(char_ntp)){
cout << (simvol==char_ntp) << endl;
cout << simvol << " " << char_ntp << endl;
if (simvol==char_ntp){
flag_error=false;
break;
@ -678,7 +675,6 @@ void MainWindow::get_config(){
this->read_file();
this->update_hour_minute();
this->update_calendar();
this->entry_dhcp_mess();
}

@ -71,7 +71,6 @@ class MainWindow : public Gtk::ApplicationWindow {
Gtk::Label *lblSynchronizebChk;
Gtk::Label *lblSynchronizebChkGLob;
Gtk::Label *lblSynchronizeBtn;
Gtk::Label *lblDateTimeSettingGlob;
Gtk::Label *lblTimeBios;
Gtk::Label *lblSave;
Gtk::Label *lblDownload;

@ -450,89 +450,58 @@ Format: DD.MM.YYYY</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkFrame">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">10</property>
<property name="margin-start">5</property>
<property name="margin-end">10</property>
<property name="margin-bottom">6</property>
<property name="label-xalign">0.019999999552965164</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel">
</object>
</child>
<child type="label">
<object class="GtkLabel" id="lblDateTimeSetting">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="Setting the date and time" comments="Setting the date and time">Current date and time</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lblReg">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">8</property>
<property name="margin-right">5</property>
<property name="margin-start">8</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">13</property>
<property name="label" translatable="yes" context="Region" comments="Region">Region</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="cbRegion">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkFrame">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">13</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<property name="label-xalign">0.019999999552965164</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkLabel" id="lblZone">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">10</property>
<property name="margin-right">5</property>
<property name="margin-start">10</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">13</property>
<property name="label" translatable="yes" context="Zone" comments="Zone">Area</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<property name="margin-left">5</property>
<property name="margin-start">5</property>
<property name="margin-bottom">5</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkComboBoxText" id="cbZone">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkComboBoxText" id="cbDhcp">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
@ -540,60 +509,48 @@ Format: DD.MM.YYYY</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">13</property>
<property name="margin-bottom">5</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="width-request">5</property>
<object class="GtkEntry" id="txtNtpServer">
<property name="width-request">-1</property>
<property name="visible">True</property>
<property name="can-focus">False</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="margin-left">5</property>
<property name="margin-right">10</property>
<property name="margin-start">5</property>
<property name="margin-end">10</property>
<property name="margin-top">6</property>
<property name="margin-bottom">5</property>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">6</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">7</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="lblTimeZone">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Time Zone</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="lblDateTimeSetting">
<object class="GtkLabel" id="lblSynchronizebChkGLob">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="Setting the date and time" comments="Setting the date and time">Local Configuration</property>
<property name="label" translatable="yes" context="Setting date and time in global configuration" comments="Setting date and time in global configuration">Synchronize via NTP:</property>
</object>
</child>
</object>
@ -607,120 +564,144 @@ Format: DD.MM.YYYY</property>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkFrame">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-right">10</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-end">10</property>
<property name="margin-bottom">6</property>
<property name="label-xalign">0.019999999552965164</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-start">5</property>
<property name="margin-bottom">5</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lblSynchronizebChkGLob">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="margin-left">5</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lblReg">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">8</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-start">8</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="label" translatable="yes" context="Synchronize via NTP" comments="Synchronize via NTP">Synchronize via NTP:</property>
<property name="margin-bottom">13</property>
<property name="label" translatable="yes" context="Region" comments="Region">Region</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkBox">
<object class="GtkComboBoxText" id="cbRegion">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">13</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="cbDhcp">
<object class="GtkLabel" id="lblZone">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-left">10</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-start">10</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">5</property>
<property name="margin-bottom">13</property>
<property name="label" translatable="yes" context="Zone" comments="Zone">Area</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="txtNtpServer">
<property name="width-request">-1</property>
<object class="GtkComboBoxText" id="cbZone">
<property name="visible">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="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">10</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">10</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">5</property>
<property name="margin-bottom">13</property>
</object>
<packing>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="width-request">5</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">6</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="lblDateTimeSettingGlob">
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes" context="Setting date and time in global configuration" comments="Setting date and time in global configuration">Global customization</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="position">7</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="lblTimeZone">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Time Zone</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
</object>

@ -52,8 +52,8 @@ msgstr "OK"
msgid "Settings the date and time"
msgstr "Настройки даты и времени"
msgid "Local Configuration"
msgstr "Локальная настройка"
msgid "Current date and time"
msgstr "Текущие дата и время"
msgid "Global customization"
msgstr "Глобальная настройка"

Loading…
Cancel
Save