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

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

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

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

@ -450,150 +450,13 @@ Format: DD.MM.YYYY</property>
<property name="position">3</property> <property name="position">3</property>
</packing> </packing>
</child> </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">
<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>
</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>
</packing>
</child>
<child>
<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="GtkLabel" id="lblZone">
<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>
<child>
<object class="GtkComboBoxText" id="cbZone">
<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">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">6</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>
</packing>
</child>
</object> </object>
</child> </child>
<child type="label"> <child type="label">
<object class="GtkLabel" id="lblDateTimeSetting"> <object class="GtkLabel" id="lblDateTimeSetting">
<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" context="Setting the date and time" comments="Setting the date and time">Local Configuration</property> <property name="label" translatable="yes" context="Setting the date and time" comments="Setting the date and time">Current date and time</property>
</object> </object>
</child> </child>
</object> </object>
@ -633,25 +496,6 @@ Format: DD.MM.YYYY</property>
<property name="margin-start">5</property> <property name="margin-start">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lblSynchronizebChkGLob">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</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">6</property>
<property name="label" translatable="yes" context="Synchronize via NTP" comments="Synchronize via NTP">Synchronize via NTP:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
@ -703,10 +547,10 @@ Format: DD.MM.YYYY</property>
</object> </object>
</child> </child>
<child type="label"> <child type="label">
<object class="GtkLabel" id="lblDateTimeSettingGlob"> <object class="GtkLabel" id="lblSynchronizebChkGLob">
<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" context="Setting date and time in global configuration" comments="Setting date and time in global configuration">Global customization</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> </object>
</child> </child>
</object> </object>
@ -723,6 +567,143 @@ Format: DD.MM.YYYY</property>
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </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">
<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>
</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>
</packing>
</child>
<child>
<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="GtkLabel" id="lblZone">
<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>
<child>
<object class="GtkComboBoxText" id="cbZone">
<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">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">6</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">3</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>

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

Loading…
Cancel
Save