|
|
|
|
@ -76,7 +76,9 @@ void MainWindow::settings(){
|
|
|
|
|
this->event();
|
|
|
|
|
this->parse_text_date();
|
|
|
|
|
}
|
|
|
|
|
void MainWindow::lacalization(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
void MainWindow::flag_block_gui(){
|
|
|
|
|
if (flag_datetime==true){
|
|
|
|
|
_numTimeHrs->set_sensitive(false);
|
|
|
|
|
@ -90,6 +92,7 @@ void MainWindow::flag_block_gui(){
|
|
|
|
|
_cbRegionGlob->set_sensitive(false);
|
|
|
|
|
_cbZoneGlob->set_sensitive(false);
|
|
|
|
|
_btnChooseDate->set_sensitive(false);
|
|
|
|
|
_cbDhcp->set_sensitive(false);
|
|
|
|
|
}
|
|
|
|
|
if (flag_ntp==true){
|
|
|
|
|
_cbxSynchronizeNtp->set_sensitive(false);
|
|
|
|
|
@ -110,7 +113,7 @@ void MainWindow::add_CSS(){
|
|
|
|
|
context->add_class("myButton");
|
|
|
|
|
}
|
|
|
|
|
void MainWindow::get_builder(){
|
|
|
|
|
builder->set_translation_domain(app_name);
|
|
|
|
|
|
|
|
|
|
builder->get_widget("btnUpdateDateTime", _btnUpdateDateTime);
|
|
|
|
|
builder->get_widget("btnChooseDate", _btnChooseDate);
|
|
|
|
|
builder->get_widget("btnMessClose", _btnMessClose);
|
|
|
|
|
@ -142,15 +145,13 @@ void MainWindow::event(){
|
|
|
|
|
_cbZone->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::enter_zone));
|
|
|
|
|
_cbZoneGlob->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::enter_zone_glob));
|
|
|
|
|
_txtNtpServer->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_ntp));
|
|
|
|
|
//_btnMessClose->signal_day_selected_double_click().connect(sigc::mem_fun(*this, &MainWindow::close_calendar));
|
|
|
|
|
//_cldrDate->signal_day_selected_double_click().connect(sigc::mem_fun(*this, &MainWindow::get_calendar));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::gui_mess_close(){
|
|
|
|
|
_mess_dchp->hide();
|
|
|
|
|
}
|
|
|
|
|
void MainWindow::close_calendar(){
|
|
|
|
|
_popCalendar->hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool MainWindow::focus_ntp(GdkEventFocus* event){
|
|
|
|
|
if (event!=NULL){}
|
|
|
|
|
@ -201,15 +202,15 @@ void MainWindow::event_entry_cbDhcp(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::get_calendar(){
|
|
|
|
|
_cldrDate->get_date(year, month, day);
|
|
|
|
|
string str_month = "";
|
|
|
|
|
string str_day = "";
|
|
|
|
|
month+=1;
|
|
|
|
|
_cldrDate->get_date(year, month, day);
|
|
|
|
|
|
|
|
|
|
if (month <10){
|
|
|
|
|
str_month = "0"+to_string(month);
|
|
|
|
|
str_month = "0"+to_string(month+1);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
str_month = to_string(month);
|
|
|
|
|
str_month = to_string(month+1);
|
|
|
|
|
}
|
|
|
|
|
if (day <10){
|
|
|
|
|
str_day = "0"+to_string(day);
|
|
|
|
|
@ -219,10 +220,12 @@ void MainWindow::get_calendar(){
|
|
|
|
|
}
|
|
|
|
|
string date = str_day + '.' + str_month + '.' + to_string(year);
|
|
|
|
|
_txtDate->set_text(date);
|
|
|
|
|
_popCalendar->hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::calendar_show(){
|
|
|
|
|
if (year==0){
|
|
|
|
|
time_t now = time(0);
|
|
|
|
|
tm *ltm = localtime(&now);
|
|
|
|
|
unsigned int y=1900+ ltm->tm_year;
|
|
|
|
|
@ -230,6 +233,12 @@ void MainWindow::calendar_show(){
|
|
|
|
|
unsigned int d=ltm->tm_mday;
|
|
|
|
|
_cldrDate->select_month(m,y);
|
|
|
|
|
_cldrDate->select_day(d);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
_cldrDate->select_month(month,year);
|
|
|
|
|
_cldrDate->select_day(day);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
_popCalendar->show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|