|
|
|
|
@ -332,6 +332,14 @@ void MainWindow::event() {
|
|
|
|
|
btnSaveGlob->signal_activate().connect([&]() {save_global_cfg();});
|
|
|
|
|
cbZone->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::event_zone));
|
|
|
|
|
cbHw->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::event_log_hw));
|
|
|
|
|
txtNtpServer->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_ntp));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool MainWindow::focus_ntp(GdkEventFocus* event) {
|
|
|
|
|
if (event!=NULL){
|
|
|
|
|
}
|
|
|
|
|
this->focus_ntp_text();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::event_log_hw() {
|
|
|
|
|
@ -741,7 +749,7 @@ void MainWindow::gui_mess_close() {
|
|
|
|
|
windowMessDchp->hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool MainWindow::focus_ntp(string &cmd_set_ntp) {
|
|
|
|
|
bool MainWindow::focus_ntp_text() {
|
|
|
|
|
if (txtNtpServer->get_text() == "" || txtNtpServer->get_text() == " ") {
|
|
|
|
|
lblMessage->set_text(_("Enter DHCP!"));
|
|
|
|
|
windowMessDchp->show();
|
|
|
|
|
@ -764,9 +772,8 @@ bool MainWindow::focus_ntp(string &cmd_set_ntp) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ((flag_error == false) && (flag_error_check_ntp == false)) {
|
|
|
|
|
cmd = cmd_set_ntp + str_ntp + "\"";
|
|
|
|
|
this->write_config(str_ntp, "dhcp");
|
|
|
|
|
wrapper_system(cmd, "&");
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (flag_error == true) {
|
|
|
|
|
@ -777,6 +784,7 @@ bool MainWindow::focus_ntp(string &cmd_set_ntp) {
|
|
|
|
|
lblMessage->set_text(_("Error in the ntp name"));
|
|
|
|
|
windowMessDchp->show();
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
@ -921,6 +929,9 @@ void MainWindow::event_entry_cbDhcp() {
|
|
|
|
|
string response = this->get_ubconfig_value(cmd);
|
|
|
|
|
if (response != "dhcp" && response != "default") {
|
|
|
|
|
txtNtpServer->set_text(response);
|
|
|
|
|
txtNtpServer->grab_focus();
|
|
|
|
|
txtNtpServer->unset_cursor();
|
|
|
|
|
cout << 222 << endl;
|
|
|
|
|
}
|
|
|
|
|
this->write_config(response, "dhcp");
|
|
|
|
|
txtNtpServer->set_sensitive(true);
|
|
|
|
|
@ -952,7 +963,13 @@ void MainWindow::save_Dhcp(string &cmd_default, string &cmd_dhcp, string &remove
|
|
|
|
|
}
|
|
|
|
|
else if (activ_index == 2) {
|
|
|
|
|
|
|
|
|
|
this->focus_ntp(cmd_set_ntp);
|
|
|
|
|
if (this->focus_ntp_text()){
|
|
|
|
|
string str_ntp = txtNtpServer->get_text();
|
|
|
|
|
string cmd = cmd_set_ntp + str_ntp + "\"";
|
|
|
|
|
this->write_config(str_ntp, "dhcp");
|
|
|
|
|
wrapper_system(cmd, "&");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (activ_index== 3) {
|
|
|
|
|
int start_error = error_info;
|
|
|
|
|
|