@ -46,29 +46,26 @@ 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 }
{
: Glib : : OptionGroup { p_name , p_description , p_help } {
Glib : : OptionEntry socketIDArg ;
socketIDArg . set_long_name ( " socket-id " ) ;
socketIDArg . set_short_name ( ' s ' ) ;
socketIDArg . set_flags ( Glib : : OptionEntry : : FLAG_IN_MAIN ) ;
socketIDArg . set_description ( " Settings manager socket " ) ;
cout < < m_socketID < < endl ;
add_entry ( socketIDArg , m_socketID ) ;
}
: : Window CmdArgParser : : GetSocketID ( ) const {
: : Window CmdArgParser : : GetSocketID ( ) const {
return m_socketID ;
}
MainWindow : : MainWindow ( BaseObjectType * obj , Glib : : RefPtr < Gtk : : Builder > const & builder )
: Gtk : : ApplicationWindow ( obj )
, builder { builder } {
this - > settings ( ) ;
: Gtk : : ApplicationWindow ( obj ) , builder { builder } {
this - > builder = builder ;
this - > settings ( ) ;
}
MainWindow : : MainWindow ( Glib : : RefPtr < Gtk : : Builder > const & builder ) {
this - > builder = builder ;
this - > builder = builder ;
this - > settings ( ) ;
}
@ -126,7 +123,7 @@ int MainWindow::check_root(){
void MainWindow : : lacalization ( ) {
txtDate - > set_tooltip_text ( _ ( " Date of \n Format: DD.MM.YYYY " ) ) ;
txtNtpServer - > set_tooltip_text ( _ ( " Enter the name of the ntp-server or its ip-address. \n When entering multiple addresses, separate them with commas. " ) ) ;
lblSynchronizebChkGLob - > set_text ( _ ( " Synchronize via NTP " ) ) ;
lblSynchronizebChkGLob - > set_text ( _ ( " Synchronize via NTP : " ) ) ;
cbDhcp - > append ( _ ( " Default " ) ) ;
cbDhcp - > append ( _ ( " DHCP " ) ) ;
cbDhcp - > append ( _ ( " Manual " ) ) ;
@ -202,8 +199,10 @@ void MainWindow::add_CSS(){
styleContext - > add_provider_for_screen ( screen , cssProvider , GTK_STYLE_PROVIDER_PRIORITY_APPLICATION ) ; //add provider for screen in all application
Glib : : RefPtr < Gtk : : StyleContext > context = boxColor - > get_style_context ( ) ;
Glib : : RefPtr < Gtk : : StyleContext > context_lbl_head = lblHead - > get_style_context ( ) ;
//Glib::RefPtr<Gtk::StyleContext> context_button = btnHardwareTime->get_style_context();
context - > add_class ( " cssboxColor1 " ) ;
context_lbl_head - > add_class ( " textHead " ) ;
//context_button->add_class("textHead");
}
void MainWindow : : get_builder ( ) {
@ -385,13 +384,15 @@ void MainWindow::event_entry_cbDhcp(){
}
cbDhcp - > set_active ( activ_index ) ;
}
}
}
else if ( activ_index = = 3 ) {
system ( " /usr/bin/ubconfig remove network NTPSERVERS " ) ;
string cmd = " /usr/bin/ubconfig remove network NTPSERVERS " ;
system ( cmd . c_str ( ) ) ;
txtNtpServer - > set_text ( " " ) ;
txtNtpServer - > set_sensitive ( false ) ;
}
}
else {
string cmd = " /usr/bin/ubconfig set network NTPSERVERS=dhcp " ;
system ( cmd . c_str ( ) ) ;
@ -865,14 +866,14 @@ void MainWindow::sort_zone(vector<string> *time_reg_map_local,vector<string> *ti
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 ;
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 ;
b = ( * time_reg_map ) [ j ] ;
( * time_reg_map ) [ j ] = ( * time_reg_map ) [ j + 1 ] ;
( * time_reg_map ) [ j + 1 ] = b ;
}
}
}
@ -925,9 +926,10 @@ vector<std::string> MainWindow::split(const std::string &s, char delim){
}
SettingsPlug : : SettingsPlug ( : : Window p_socketID , Glib : : RefPtr < Gtk : : Builder > builder )
: Gtk : : Plug { p_socketID }
{
builder - > get_widget ( " id_plug " , plugBox ) ;
: Gtk : : Plug { p_socketID } {
MainWindow * wnd = nullptr ;
builder - > get_widget_derived ( " window " , wnd ) ;
builder - > get_widget ( " plugBox " , plugBox ) ;
plugBox - > get_parent ( ) - > remove ( * plugBox ) ;
add ( * plugBox ) ;
show_all_children ( ) ;