|
|
|
|
@ -33,6 +33,7 @@ bool flag_datetime = false;
|
|
|
|
|
bool flag_timezone = false;
|
|
|
|
|
bool flag_ntp = false;
|
|
|
|
|
bool flag_update = false;
|
|
|
|
|
|
|
|
|
|
CmdArgParser::CmdArgParser(const std::string& p_name, const std::string& p_description, const std::string& p_help)
|
|
|
|
|
: Glib::OptionGroup{p_name, p_description, p_help}
|
|
|
|
|
{
|
|
|
|
|
@ -72,6 +73,7 @@ void MainWindow::settings(){
|
|
|
|
|
this->get_config();
|
|
|
|
|
this->flag_block_gui();
|
|
|
|
|
this->event();
|
|
|
|
|
this->parse_text_date();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::flag_block_gui(){
|
|
|
|
|
@ -301,6 +303,17 @@ void MainWindow::enter_zone(){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::parse_text_date(){
|
|
|
|
|
string data = _txtDate->get_text();
|
|
|
|
|
if (data.length()==10){
|
|
|
|
|
string day = data.substr(0,2);
|
|
|
|
|
string month1 = data.substr(3,2);
|
|
|
|
|
string year = data.substr(6,data.length());
|
|
|
|
|
cout << day << " " << month1 << " " << year << endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::enter_zone_glob(){
|
|
|
|
|
Glib::ustring zone_text = _cbZoneGlob->get_active_text();
|
|
|
|
|
Glib::ustring reg_text = _cbRegionGlob->get_active_text();
|
|
|
|
|
@ -449,6 +462,20 @@ void MainWindow::update_time_date(){
|
|
|
|
|
system(cmd.c_str());
|
|
|
|
|
_txtDate->set_text(str_day+"." + str_month+"." + to_string(year));
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
string cmd = "";
|
|
|
|
|
string data = _txtDate->get_text();
|
|
|
|
|
if (data.length()==10){
|
|
|
|
|
string str_day = data.substr(0,2);
|
|
|
|
|
string str_month = data.substr(3,2);
|
|
|
|
|
string str_year = data.substr(6,data.length());
|
|
|
|
|
cmd = "date +%Y%m%d -s \"" + str_year+
|
|
|
|
|
str_month+str_day+"\"";
|
|
|
|
|
system(cmd.c_str());
|
|
|
|
|
}
|
|
|
|
|
cmd = "hwclock --systohc";
|
|
|
|
|
system(cmd.c_str());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|