|
|
|
|
@ -338,7 +338,6 @@ bool MainWindow::focus_ntp(GdkEventFocus* event){
|
|
|
|
|
string str_ntp = txtNtpServer->get_text();
|
|
|
|
|
for (const auto &simvol: array_simvol){
|
|
|
|
|
if (str_ntp.find(simvol)!=std::string::npos){
|
|
|
|
|
cout << simvol << 2222 << endl;
|
|
|
|
|
flag_error=true;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
@ -450,7 +449,6 @@ void MainWindow::calendar_show(){
|
|
|
|
|
|
|
|
|
|
void MainWindow::enry_dhcp_mess(){
|
|
|
|
|
string str_dhcp = this->call("/usr/bin/ubconfig get network NTPSERVERS");
|
|
|
|
|
cout << str_dhcp << endl;
|
|
|
|
|
if (str_dhcp.find("(null)")==std::string::npos){
|
|
|
|
|
|
|
|
|
|
cbxSynchronizeNtpGlob->set_active(true);
|
|
|
|
|
@ -843,6 +841,7 @@ void MainWindow::read_file(){
|
|
|
|
|
}
|
|
|
|
|
in1.close();
|
|
|
|
|
}
|
|
|
|
|
this->sort_zone(&zone_local, &zone);
|
|
|
|
|
time_reg_map.insert({key_reg, zone});
|
|
|
|
|
time_reg_map_local.insert({key_reg, zone_local});
|
|
|
|
|
}}}}
|
|
|
|
|
@ -852,6 +851,56 @@ void MainWindow::read_file(){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::sort_zone(vector<string> *time_reg_map_local,vector<string> *time_reg_map){
|
|
|
|
|
string str_j = "";
|
|
|
|
|
int j_i;
|
|
|
|
|
string str_j_1 = "";
|
|
|
|
|
int j_i_1;
|
|
|
|
|
int size_vec = time_reg_map_local->size();
|
|
|
|
|
for (int i = 0; i < size_vec; i++) {
|
|
|
|
|
for (int j = 0; j < size_vec-1; j++) {
|
|
|
|
|
str_j=(*time_reg_map_local)[j];
|
|
|
|
|
str_j = str_j.substr(5,str_j.find(")")-5);
|
|
|
|
|
if (str_j[1]=='0'){
|
|
|
|
|
str_j.replace(1,1,"0");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (str_j.find("+") != std::string::npos){
|
|
|
|
|
str_j.replace(0,1,"+");
|
|
|
|
|
j_i = stoi(str_j);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
str_j.replace(0,1,"-");
|
|
|
|
|
j_i = stoi(str_j);
|
|
|
|
|
j_i=-j_i;
|
|
|
|
|
}
|
|
|
|
|
str_j_1=(*time_reg_map_local)[j+1];
|
|
|
|
|
str_j_1 = str_j_1.substr(5,str_j_1.find(")")-5);
|
|
|
|
|
if (str_j_1[1]=='0'){
|
|
|
|
|
str_j_1.replace(1,1,"0");
|
|
|
|
|
}
|
|
|
|
|
if (str_j_1.find("+") != std::string::npos){
|
|
|
|
|
str_j_1.replace(0,1,"+");
|
|
|
|
|
j_i_1 = stoi(str_j_1);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
str_j_1.replace(0,1,"-");
|
|
|
|
|
j_i_1 = stoi(str_j_1);
|
|
|
|
|
j_i_1 = -j_i_1;
|
|
|
|
|
}
|
|
|
|
|
if (j_i > j_i_1) {
|
|
|
|
|
string b = (*time_reg_map_local)[j];
|
|
|
|
|
(*time_reg_map_local)[j] = (*time_reg_map_local)[j + 1];
|
|
|
|
|
(*time_reg_map_local)[j + 1] = b;
|
|
|
|
|
|
|
|
|
|
b = (*time_reg_map)[j];
|
|
|
|
|
(*time_reg_map)[j] = (*time_reg_map)[j + 1];
|
|
|
|
|
(*time_reg_map)[j + 1] = b;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string MainWindow::zone_file_read(string zone){
|
|
|
|
|
if (zone.length()==1){
|
|
|
|
|
return "";
|
|
|
|
|
|