|
|
|
|
@ -104,6 +104,15 @@ void MainWindow::flag_block_gui(){
|
|
|
|
|
//_numTimeMin->set_sensitive(false);
|
|
|
|
|
//_txtDate->set_sensitive(false);
|
|
|
|
|
_btnUpdateDateTime->set_sensitive(false);
|
|
|
|
|
_numTimeHrs->set_sensitive(false);
|
|
|
|
|
_numTimeMin->set_sensitive(false);
|
|
|
|
|
_btnChooseDate->set_sensitive(false);
|
|
|
|
|
_txtDate->set_sensitive(false);
|
|
|
|
|
_lblTimeBios->set_sensitive(false);
|
|
|
|
|
_btnHardwareTime->set_sensitive(false);
|
|
|
|
|
_lblTime->set_sensitive(false);
|
|
|
|
|
_lblData->set_sensitive(false);
|
|
|
|
|
//_cbxSynchronizeNtp->set_sensitive(false);
|
|
|
|
|
}
|
|
|
|
|
if (flag_timezone==true){
|
|
|
|
|
_cbRegion->set_sensitive(false);
|
|
|
|
|
@ -204,7 +213,7 @@ void MainWindow::event(){
|
|
|
|
|
|
|
|
|
|
void MainWindow::set_ntp_toggle(){
|
|
|
|
|
bool flag = _cbxSynchronizeNtp->get_active();
|
|
|
|
|
if (flag_ntp==true){
|
|
|
|
|
if (flag_ntp==true || flag_datetime==true){
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_numTimeHrs->set_sensitive(!flag);
|
|
|
|
|
@ -212,6 +221,9 @@ void MainWindow::set_ntp_toggle(){
|
|
|
|
|
_btnChooseDate->set_sensitive(!flag);
|
|
|
|
|
_txtDate->set_sensitive(!flag);
|
|
|
|
|
_lblTimeBios->set_sensitive(!flag);
|
|
|
|
|
_btnUpdateDateTime->set_sensitive(!flag);
|
|
|
|
|
_lblTime->set_sensitive(!flag);
|
|
|
|
|
_lblData->set_sensitive(!flag);
|
|
|
|
|
}
|
|
|
|
|
string cmd = "";
|
|
|
|
|
if (flag==false){
|
|
|
|
|
@ -251,6 +263,8 @@ bool MainWindow::focus_ntp(GdkEventFocus* event){
|
|
|
|
|
|
|
|
|
|
void MainWindow::event_entry_cbDhcp(){
|
|
|
|
|
Glib::ustring str_dhcp = _cbDhcp->get_active_text();
|
|
|
|
|
int index_activ = _cbDhcp->get_entry_text_column();
|
|
|
|
|
cout << index_activ << endl;
|
|
|
|
|
if (str_dhcp.length()!=0){
|
|
|
|
|
if (str_dhcp=="DHCP"){
|
|
|
|
|
string cmd = "/usr/bin/ubconfig set network NTPSERVERS=dhcp";
|
|
|
|
|
@ -264,7 +278,7 @@ void MainWindow::event_entry_cbDhcp(){
|
|
|
|
|
if ((str_dhcp!="") && (str_dhcp!="(null)") ){
|
|
|
|
|
str_dhcp = str_dhcp.substr(str_dhcp.find("=")+1,str_dhcp.length());
|
|
|
|
|
str_dhcp = str_dhcp.substr(0,str_dhcp.find("\n"));
|
|
|
|
|
if (str_dhcp!="dhcp"){
|
|
|
|
|
if (str_dhcp!="dhcp" && str_dhcp!="(null)"){
|
|
|
|
|
_txtNtpServer->set_text(str_dhcp);
|
|
|
|
|
}
|
|
|
|
|
_txtNtpServer->set_sensitive(true);
|
|
|
|
|
@ -333,6 +347,10 @@ void MainWindow::enry_dhcp_mess(){
|
|
|
|
|
_lblMessage->set_text(gettext("Enter DHCP !"));
|
|
|
|
|
_mess_dchp->show();
|
|
|
|
|
}
|
|
|
|
|
else if (str_dhcp=="(null)"){
|
|
|
|
|
_cbDhcp->set_active(0);
|
|
|
|
|
_txtNtpServer->set_text("");
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
_cbDhcp->set_active(1);
|
|
|
|
|
_txtNtpServer->set_text(str_dhcp);
|
|
|
|
|
@ -426,12 +444,15 @@ void MainWindow::enter_zone_glob(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::set_ntp_toggle_glob(){
|
|
|
|
|
bool flag = _cbxSynchronizeNtp->get_active();
|
|
|
|
|
bool flag = _cbxSynchronizeNtpGlob->get_active();
|
|
|
|
|
if (flag==false){
|
|
|
|
|
system("/usr/bin/ubconfig remove network NTPSERVERS");
|
|
|
|
|
_cbDhcp->set_sensitive(false);
|
|
|
|
|
_txtNtpServer->set_sensitive(false);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
|
|
|
|
|
_cbDhcp->set_sensitive(true);
|
|
|
|
|
_txtNtpServer->set_sensitive(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|