@ -55,31 +55,31 @@ MainWindow::MainWindow(Glib::RefPtr<Gtk::Builder> const& builder) {
}
void MainWindow : : settings ( ) {
map_error [ get_system_ZONE ] = string ( gettext( " : \" Time Zone \" " ) ) ;
map_error [ set_hwclock ] = string ( gettext( " : \" Hardware time \" " ) ) ;
map_error [ get_system_NTPSERVERS ] = string ( gettext( " : \" NTP \" " ) ) ;
map_error [ get_system_HWCLOCK_SYNC ] = string ( gettext( " : \" Hardware time \" " ) ) ;
map_error [ get_global_NTPSERVERS ] = string ( gettext( " : \" NTP \" " ) ) ;
map_error [ get_global_ZONE ] = string ( gettext( " : \" Time Zone \" " ) ) ;
map_error [ get_global_defalult_HWCLOCK_SYNC ] = string ( gettext( " : \" Hardware time \" " ) ) ;
map_error [ get_global_HWCLOCK_SYNC ] = string ( gettext( " : \" Hardware time \" " ) ) ;
map_error [ set_system_ZONE ] = string ( gettext( " : \" Time Zone \" " ) ) ;
map_error [ set_system_NTPSERVERS_default ] = string ( gettext( " : \" NTP \" " ) ) ;
map_error [ set_system_NTPSERVERS_dhcp ] = string ( gettext( " : \" NTP \" " ) ) ;
map_error [ set_system_NTPSERVERS ] = string ( gettext( " : \" NTP \" " ) ) ;
map_error [ remove_system_NTPSERVERS ] = string ( gettext( " : \" NTP \" " ) ) ;
map_error [ set_system_HWCLOCK_SYNC_localtime ] = string ( gettext( " : \" Hardware time \" " ) ) ;
map_error [ set_system_HWCLOCK_SYNC_utc ] = string ( gettext( " : \" Hardware time \" " ) ) ;
map_error [ set_global_ZONE ] = string ( gettext( " : \" Time Zone \" " ) ) ;
map_error [ set_global_NTPSERVERS_default ] = string ( gettext( " : \" NTP \" " ) ) ;
map_error [ set_global_NTPSERVERS_dhcp ] = string ( gettext( " : \" NTP \" " ) ) ;
map_error [ set_global_NTPSERVERS ] = string ( gettext( " : \" NTP \" " ) ) ;
map_error [ remove_global_NTPSERVERS ] = string ( gettext( " : \" NTP \" " ) ) ;
map_error [ set_global_HWCLOCK_SYNC_localtime ] = string ( gettext( " : \" Hardware time \" " ) ) ;
map_error [ set_global_HWCLOCK_SYNC_utc ] = string ( gettext( " : \" Hardware time \" " ) ) ;
map_error [ get_NTPSERVERS_DEFAULT ] = string ( gettext( " : \" NTP \" " ) ) ;
map_error [ " date +%Y%m%d -s \" " ] = string ( gettext( " : \" Date \" " ) ) ;
map_error [ " date +%T -s \" " ] = string ( gettext( " : \" Date \" " ) ) ;
map_error [ get_system_ZONE ] = string ( str_time_zone_flag ) ;
map_error [ set_hwclock ] = string ( str_hardware_time_flag ) ;
map_error [ get_system_NTPSERVERS ] = string ( str_NTP_flag ) ;
map_error [ get_system_HWCLOCK_SYNC ] = string ( str_hardware_time_flag ) ;
map_error [ get_global_NTPSERVERS ] = string ( str_NTP_flag ) ;
map_error [ get_global_ZONE ] = string ( str_time_zone_flag ) ;
map_error [ get_global_defalult_HWCLOCK_SYNC ] = string ( str_hardware_time_flag ) ;
map_error [ get_global_HWCLOCK_SYNC ] = string ( str_hardware_time_flag ) ;
map_error [ set_system_ZONE ] = string ( str_time_zone_flag ) ;
map_error [ set_system_NTPSERVERS_default ] = string ( str_NTP_flag ) ;
map_error [ set_system_NTPSERVERS_dhcp ] = string ( str_NTP_flag ) ;
map_error [ set_system_NTPSERVERS ] = string ( str_NTP_flag ) ;
map_error [ remove_system_NTPSERVERS ] = string ( str_NTP_flag ) ;
map_error [ set_system_HWCLOCK_SYNC_localtime ] = string ( str_hardware_time_flag ) ;
map_error [ set_system_HWCLOCK_SYNC_utc ] = string ( str_hardware_time_flag ) ;
map_error [ set_global_ZONE ] = string ( str_time_zone_flag ) ;
map_error [ set_global_NTPSERVERS_default ] = string ( str_NTP_flag ) ;
map_error [ set_global_NTPSERVERS_dhcp ] = string ( str_NTP_flag ) ;
map_error [ set_global_NTPSERVERS ] = string ( str_NTP_flag ) ;
map_error [ remove_global_NTPSERVERS ] = string ( str_NTP_flag ) ;
map_error [ set_global_HWCLOCK_SYNC_localtime ] = string ( str_hardware_time_flag ) ;
map_error [ set_global_HWCLOCK_SYNC_utc ] = string ( str_hardware_time_flag ) ;
map_error [ get_NTPSERVERS_DEFAULT ] = string ( str_NTP_flag ) ;
map_error [ " date +%Y%m%d -s \" " ] = string ( str_date_flag ) ;
map_error [ " date +%T -s \" " ] = string ( str_date_flag ) ;
this - > get_builder ( ) ;
this - > add_CSS ( ) ;
Gtk : : Widget * boxWidget ;
@ -117,9 +117,9 @@ void MainWindow::settings() {
boxButton - > set_sensitive ( false ) ;
btnSave - > set_sensitive ( false ) ;
this - > event ( ) ;
imgInfo - > set_from_icon_name ( " com.ublinux.ubl-settings-datetime.warning " , Gtk : : ICON_SIZE_MENU ) ;
imgInfo - > set_from_icon_name ( icon_warning , Gtk : : ICON_SIZE_MENU ) ;
info_status_app ( " boxInfoMessError " ) ;
lblWarning - > set_text ( gettext( " The program must be run as root " ) ) ;
lblWarning - > set_text ( program_as_root ) ;
}
}
@ -127,51 +127,50 @@ void MainWindow::lacalization() {
time_t now = time ( 0 ) ;
tm * ltm = localtime ( & now ) ;
unsigned int year = 1900 + ltm - > tm_year ;
string str_authors = string ( gettext( " Copyright © UBSoft LLC, 2022 - " ) ) + to_string ( year ) ;
aboutWindows - > set_program_name ( gettext( " ubl-settings-datetime " ) ) ;
string str_authors = string ( copyright ) + to_string ( year ) ;
aboutWindows - > set_program_name ( name_app ) ;
aboutWindows - > set_copyright ( str_authors ) ;
aboutWindows - > set_comments ( gettext( " Date and Time " ) ) ;
aboutWindows - > set_website ( gettext( " https://wiki.ublinux.com " ) ) ;
aboutWindows - > set_version ( gettext ( version_application . c_str ( ) ) ) ;
aboutWindows - > set_website_label ( gettext( " Project Home Page " ) ) ;
lblHeaderAboutTopic - > set_label ( gettext( " About ubl-settings-datetime " ) ) ;
lblSave - > set_label ( gettext( " Save " ) ) ;
lblLoad - > set_label ( gettext( " Load " ) ) ;
txtDate - > set_tooltip_text ( gettext( " Date of \n Format: DD.MM.YYYY " ) ) ;
txtNtpServer - > set_tooltip_text ( gettext( " Enter the name of the ntp-server or its ip-address. \n When entering multiple addresses, separate them with commas. " ) ) ;
lblSynchronizebChkGLob - > set_text ( gettext( " Synchronize via NTP " ) ) ;
cbDhcp - > append ( gettext( " Default " ) ) ;
cbDhcp - > append ( gettext( " DHCP " ) ) ;
cbDhcp - > append ( gettext( " Manual " ) ) ;
cbDhcp - > append ( gettext( " Disabled " ) ) ;
lblDateTimeSetting - > set_text ( gettext( " Current date and time " ) ) ;
lblHead - > set_text ( gettext( " Setting the date and time " ) ) ;
lblTime - > set_text ( gettext( " Time: " ) ) ;
lblData - > set_text ( gettext( " Date: " ) ) ;
lblTimeZone - > set_text ( gettext( " Time zone " ) ) ;
lblReg - > set_text ( gettext( " Region: " ) ) ;
lblZone - > set_text ( gettext( " Zone: " ) ) ;
lblSynchronizeBtn - > set_text ( gettext( " Sync by " ) ) ;
lblHeader - > set_text ( gettext( " ubl-settings-datetime " ) ) ;
lblHeadeWndWeb - > set_text ( gettext( " ubl-settings-datetime " ) ) ;
windowMessDchp - > set_title ( gettext( " Attention " ) ) ;
lblTimeBios - > set_text ( gettext( " Synchronize hardware time " ) ) ;
lblHW - > set_text ( gettext( " Synchronize hardware time: " ) ) ;
array_hw_local [ 0 ] = gettext( " UTC time " ) ;
array_hw_local [ 1 ] = gettext( " Local time " ) ;
aboutWindows - > set_comments ( str_date_time ) ;
aboutWindows - > set_website ( website ) ;
aboutWindows - > set_version ( _ ( version_application . c_str ( ) ) ) ;
aboutWindows - > set_website_label ( home_page ) ;
lblHeaderAboutTopic - > set_label ( str_about ) ;
lblSave - > set_label ( str_save ) ;
lblLoad - > set_label ( str_load ) ;
txtDate - > set_tooltip_text ( data_format_d_m_y ) ;
txtNtpServer - > set_tooltip_text ( enter_name_ntp_tooltip ) ;
lblSynchronizebChkGLob - > set_text ( synchronize_ntp ) ;
cbDhcp - > append ( str_default ) ;
cbDhcp - > append ( str_DHCP ) ;
cbDhcp - > append ( str_manual ) ;
cbDhcp - > append ( str_disabled ) ;
lblDateTimeSetting - > set_text ( current_date_time ) ;
lblHead - > set_text ( setting_date_time ) ;
lblTime - > set_text ( str_time ) ;
lblData - > set_text ( str_date ) ;
lblTimeZone - > set_text ( str_time_zone ) ;
lblReg - > set_text ( str_region ) ;
lblZone - > set_text ( str_zone ) ;
lblSynchronizeBtn - > set_text ( str_sync_by ) ;
lblHeader - > set_text ( name_app ) ;
lblHeadeWndWeb - > set_text ( name_app ) ;
windowMessDchp - > set_title ( str_attention ) ;
lblTimeBios - > set_text ( synchronize_hw ) ;
lblHW - > set_text ( string( synchronize_hw ) + " : " ) ;
array_hw_local [ 0 ] = utc_time ;
array_hw_local [ 1 ] = str_local_time ;
array_hw [ 0 ] = " utc " ;
array_hw [ 1 ] = " localtime " ;
this - > bubble_sort ( array_hw , array_hw_local , 2 ) ;
cbHw - > append ( array_hw_local [ 0 ] ) ;
cbHw - > append ( array_hw_local [ 1 ] ) ;
lblhelpHeader - > set_text ( _ ( " Would you like to read documentation in the Web? " ) ) ;
lblhelpText - > set_text ( _ ( " You will be redirected to documentation site, where user help pages are "
" translated and supported by community. " ) ) ;
btnReadHelp - > set_label ( _ ( " Read online " ) ) ;
btnCancelHelp - > set_label ( _ ( " Cancel " ) ) ;
chkAlwaysOpenHelp - > set_label ( _ ( " Always redirect " ) ) ;
lblwebHeaderName - > set_label ( _ ( " ubl-settings-datetime " ) ) ;
lblhelpHeader - > set_text ( read_documentation_web ) ;
lblhelpText - > set_text ( redirected_documentation ) ;
btnReadHelp - > set_label ( read_online ) ;
btnCancelHelp - > set_label ( cancel ) ;
chkAlwaysOpenHelp - > set_label ( always_redirect ) ;
lblwebHeaderName - > set_label ( name_app ) ;
}
void MainWindow : : bubble_sort ( string arr [ ] , string arr_local [ ] , int len_arr ) {
@ -426,7 +425,7 @@ void MainWindow::open_browser() {
webkit_web_view_load_uri ( one , link_doc ) ;
wndWeb - > show_all ( ) ;
# else
string cmd = cmd_xdg + string ( gettext ( link_doc ) ) + " & " ;
string cmd = cmd_xdg + string ( _ ( link_doc ) ) + " & " ;
string buf = " " ;
if ( geteuid ( ) = = 0 ) {
string response_user = getlogin ( ) ;
@ -470,7 +469,7 @@ void MainWindow::save_local_cfg() {
if ( ( this - > check_config ( " region " , 0 ) & & this - > check_config ( " zone " , 0 ) & &
this - > check_config ( " dhcp " , 0 ) & & this - > check_config ( " hw " , 0 ) ) ) {
info_status_app ( " boxInfoMessOK " ) ;
lblWarning - > set_text ( gettext( " Nothing to save! " ) ) ;
lblWarning - > set_text ( nothing_save ) ;
}
else {
string cmd_zone = set_system_ZONE ;
@ -499,7 +498,7 @@ void MainWindow::save_global_cfg() {
if ( ( this - > check_config ( " region " , 1 ) & & this - > check_config ( " zone " , 1 ) & &
this - > check_config ( " dhcp " , 1 ) & & this - > check_config ( " hw " , 1 ) ) ) {
info_status_app ( " boxInfoMessOK " ) ;
lblWarning - > set_text ( gettext( " Nothing to save! " ) ) ;
lblWarning - > set_text ( nothing_save ) ;
}
else {
string cmd = set_global_ZONE ;
@ -530,7 +529,7 @@ void MainWindow::save_global_local_cfg() {
( this - > check_config ( " region " , 1 ) & & this - > check_config ( " zone " , 1 ) & &
this - > check_config ( " dhcp " , 1 ) & & this - > check_config ( " hw " , 1 ) ) ) {
info_status_app ( " boxInfoMessOK " ) ;
lblWarning - > set_text ( gettext( " Nothing to save! " ) ) ;
lblWarning - > set_text ( nothing_save ) ;
}
else {
string cmd = " " ;
@ -721,49 +720,49 @@ string MainWindow::get_ubconfig_value(string cmd){
void MainWindow : : info_warning_error ( int mess ) {
if ( error_info > 0 | | warning_info > 0 ) {
info_status_app ( " boxInfoMessError " ) ;
imgInfo - > set_from_icon_name ( " com.ublinux.ubl-settings-datetime.warning " , Gtk : : ICON_SIZE_MENU ) ;
imgInfo - > set_from_icon_name ( icon_warning , Gtk : : ICON_SIZE_MENU ) ;
error_info = 0 ;
warning_info = 0 ;
string mess_error = " " ;
if ( mess = = 0 ) {
mess_error = string ( gettext( " Local configuration reading error " ) ) + cmd_error ;
mess_error = string ( local_read_error ) + cmd_error ;
lblWarning - > set_text ( mess_error ) ;
}
else if ( mess = = 1 ) {
mess_error = string ( g ettext( " Global configuration read error " ) ) + cmd_error ;
mess_error = string ( g lobal_read_error ) + cmd_error ;
lblWarning - > set_text ( mess_error ) ;
}
else if ( mess = = 2 ) {
mess_error = string ( gettext( " Local configuration write error " ) ) + cmd_error ;
mess_error = string ( local_write_error ) + cmd_error ;
lblWarning - > set_text ( mess_error ) ;
}
else if ( mess = = 3 ) {
mess_error = string ( g ettext( " Global configuration write error " ) ) + cmd_error ;
mess_error = string ( g lobal_write_error ) + cmd_error ;
lblWarning - > set_text ( mess_error ) ;
}
else if ( mess = = 4 ) {
mess_error = string ( gettext( " Error saved local and global configuration " ) ) + cmd_error ;
mess_error = string ( error_save_all ) + cmd_error ;
lblWarning - > set_text ( mess_error ) ;
}
cmd_error = " " ;
}
else {
info_status_app ( " boxInfoMessOK " ) ;
imgInfo - > set_from_icon_name ( " com.ublinux.ubl-settings-datetime.checked " , Gtk : : ICON_SIZE_MENU ) ; //Gtk::IconSize::INHERIT);
imgInfo - > set_from_icon_name ( icon_checked , Gtk : : ICON_SIZE_MENU ) ; //Gtk::IconSize::INHERIT);
if ( mess = = 0 ) {
lblWarning - > set_text ( gettext( " Local configuration downloaded successfully " ) ) ;
lblWarning - > set_text ( local_load_ok ) ;
}
else if ( mess = = 1 ) {
lblWarning - > set_text ( g ettext( " Global configuration downloaded successfully " ) ) ;
lblWarning - > set_text ( g lobal_load_ok ) ;
}
else if ( mess = = 2 ) {
lblWarning - > set_text ( gettext( " Local configuration successfully written " ) ) ;
lblWarning - > set_text ( local_ok_written ) ;
}
else if ( mess = = 3 ) {
lblWarning - > set_text ( g ettext( " Global configuration successfully written " ) ) ;
lblWarning - > set_text ( g lobal_ok_written ) ;
}
else if ( mess = = 4 ) {
lblWarning - > set_text ( gettext( " Successfully saved local and global configuration " ) ) ;
lblWarning - > set_text ( successfully_save_all ) ;
}
}
}
@ -849,11 +848,11 @@ void MainWindow::hardware_clock() {
string cmd = set_hwclock ;
wrapper_system ( cmd ) ;
if ( error_hw ! = error_info ) {
lblWarning - > set_text ( gettext( " Hardware clock synchronization error " ) ) ;
lblWarning - > set_text ( hardware_clock_error ) ;
info_status_app ( " boxInfoMessError " ) ;
}
else {
lblWarning - > set_text ( gettext( " Hardware clock successfully synchronized " ) ) ;
lblWarning - > set_text ( hardware_clock_ok ) ;
info_status_app ( " boxInfoMessOK " ) ;
}
}
@ -864,7 +863,7 @@ void MainWindow::gui_mess_close() {
bool MainWindow : : focus_ntp_text ( ) {
if ( txtNtpServer - > get_text ( ) = = " " | | txtNtpServer - > get_text ( ) = = " " ) {
lblWarning - > set_text ( gettext( " Enter a list of NTP servers " ) ) ;
lblWarning - > set_text ( entry_list_ntp ) ;
info_status_app ( " boxInfoMessError " ) ;
btnSave - > set_sensitive ( false ) ;
return false ;
@ -888,19 +887,19 @@ bool MainWindow::focus_ntp_text() {
}
if ( ( flag_error = = false ) & & ( flag_error_check_ntp = = false ) ) {
this - > write_config ( str_ntp , " dhcp " ) ;
lblWarning - > set_text ( gettext( " NTP server name is correct " ) ) ;
lblWarning - > set_text ( ntp_server_ok ) ;
info_status_app ( " boxInfoMessOK " ) ;
btnSave - > set_sensitive ( true ) ;
return true ;
}
else {
if ( flag_error = = true ) {
lblWarning - > set_text ( gettext( " An invalid character is entered " ) ) ;
lblWarning - > set_text ( invalid_character_entry ) ;
info_status_app ( " boxInfoMessError " ) ;
btnSave - > set_sensitive ( false ) ;
}
else if ( flag_error_check_ntp = = true ) {
lblWarning - > set_text ( gettext( " Error in the NTP server name " ) ) ;
lblWarning - > set_text ( error_ntp_name ) ;
info_status_app ( " boxInfoMessError " ) ;
btnSave - > set_sensitive ( false ) ;
}
@ -1136,7 +1135,7 @@ void MainWindow::entry_dhcp_mess(string cmd_get_dhcp, string cmd_default_get_dhc
// btnUpdateDateTime->set_sensitive(false);
if ( str_dhcp = = " " ) {
this - > write_config ( " " , " dhcp " ) ;
lblWarning - > set_text ( gettext( " Enter a list of NTP servers " ) ) ;
lblWarning - > set_text ( entry_list_ntp ) ;
info_status_app ( " boxInfoMessError " ) ;
btnSave - > set_sensitive ( false ) ;
}
@ -1282,19 +1281,19 @@ void MainWindow::enter_zone(string &cmd) {
index + = 1 ;
}
if ( ! ( zone_text . empty ( ) ) ) {
str_zone = zone_text ;
str_region = reg_text ;
cmd = cmd + str_region + " / " + str_zone ;
str_zone _buff = zone_text ;
str_region _buff = reg_text ;
cmd = cmd + str_region _buff + " / " + str_zone _buff ;
wrapper_system ( cmd , " & " ) ;
}
else {
str_zone = " " ;
str_region = " " ;
str_zone _buff = " " ;
str_region _buff = " " ;
}
}
else {
str_zone = " " ;
str_region = " " ;
str_zone _buff = " " ;
str_region _buff = " " ;
}
}
@ -1310,13 +1309,13 @@ void MainWindow::parse_text_date() {
void MainWindow : : append_region_zone ( string region , string zone , Gtk : : ComboBoxText * tmpCbReg , Gtk : : ComboBoxText * tmpCbZone ) {
this - > write_config ( region , " region " ) ;
this - > write_config ( zone , " zone " ) ;
str_region = region ;
str_region _buff = region ;
int index = 0 ;
Glib : : ustring reg_local = " " ;
int size_vec = array_region_local . size ( ) ;
if ( size_vec = = 0 ) {
for ( auto & [ key , value ] : time_reg_map ) {
array_region_local . push_back ( string ( gettext ( key . c_str ( ) ) ) ) ;
array_region_local . push_back ( string ( _ ( key . c_str ( ) ) ) ) ;
array_region . push_back ( key ) ;
index + = 1 ;
}
@ -1342,7 +1341,7 @@ void MainWindow::append_region_zone(string region, string zone, Gtk::ComboBoxTex
if ( size_vec = = 0 ) {
tmpCbReg - > append ( Glib : : ustring ( reg ) ) ;
}
if ( reg = = string ( gettext ( region . c_str ( ) ) ) ) {
if ( reg = = string ( _ ( region . c_str ( ) ) ) ) {
tmpCbReg - > set_active_text ( reg ) ;
}
}
@ -1352,7 +1351,7 @@ void MainWindow::append_region_zone(string region, string zone, Gtk::ComboBoxTex
string path_reg_zone = " " ;
string zone_offest = " " ;
path_reg_zone = region + " / " + zone ;
zone_offest = this - > zone_file_read ( path_reg_zone ) + gettext ( zone . c_str ( ) ) ;
zone_offest = this - > zone_file_read ( path_reg_zone ) + _ ( zone . c_str ( ) ) ;
if ( region = = " " ) {
tmpCbZone - > append ( " " ) ;
tmpCbZone - > set_active ( 0 ) ;
@ -1412,12 +1411,12 @@ void MainWindow::append_zone() {
cbZone - > remove_all ( ) ;
int index = cbRegion - > get_active_row_number ( ) ;
if ( index ! = - 1 ) {
string str_region = array_region [ index ] ;
string str_region _buff = array_region [ index ] ;
string zone_mixing = " " ;
this - > write_config ( str_region , " region " ) ;
this - > write_config ( str_region _buff , " region " ) ;
string path_dir = " " ;
if ( str_region . length ( ) ! = 0 ) {
for ( const auto & _str_zone : time_reg_map_local . at ( str_region ) ) {
if ( str_region _buff . length ( ) ! = 0 ) {
for ( const auto & _str_zone : time_reg_map_local . at ( str_region _buff ) ) {
cbZone - > append ( Glib : : ustring ( _str_zone ) ) ;
}
}
@ -1456,7 +1455,7 @@ void MainWindow::update_time_date() {
year = 0 ;
month = 0 ;
day = 0 ;
lblWarning - > set_text ( gettext( " Date and time are successfully synchronized " ) ) ;
lblWarning - > set_text ( date_time_ok_synchronized ) ;
info_status_app ( " boxInfoMessOK " ) ;
flag_error_time = false ;
}
@ -1474,7 +1473,7 @@ void MainWindow::update_time_date() {
day = 0 ;
}
if ( flag_error_time = = false ) {
lblWarning - > set_text ( gettext( " Date and time are successfully synchronized " ) ) ;
lblWarning - > set_text ( date_time_ok_synchronized ) ;
info_status_app ( " boxInfoMessOK " ) ;
hour = numTimeHrs - > get_value_as_int ( ) ;
minute = numTimeMin - > get_value_as_int ( ) ;
@ -1500,18 +1499,18 @@ bool MainWindow::post_entry_data() {
string str_error_clock = this - > call ( cmd ) ;
size_t index = str_error_clock . find ( " date: " ) ;
if ( index ! = std : : string : : npos ) {
lblWarning - > set_text ( gettext( " Incorrect date format " ) ) ;
lblWarning - > set_text ( incorrect_date_f ) ;
info_status_app ( " boxInfoMessError " ) ;
return true ;
}
else {
lblWarning - > set_text ( gettext( " Date and time are successfully synchronized " ) ) ;
lblWarning - > set_text ( date_time_ok_synchronized ) ;
info_status_app ( " boxInfoMessOK " ) ;
return false ;
}
}
else {
lblWarning - > set_text ( gettext( " Incorrect date format " ) ) ;
lblWarning - > set_text ( incorrect_date_f ) ;
info_status_app ( " boxInfoMessError " ) ;
return true ;
}
@ -1577,7 +1576,7 @@ void MainWindow::read_file() {
string reg_reg_zone = entry_reg_reg_zone . path ( ) . filename ( ) . string ( ) ;
zone . push_back ( reg_reg_zone ) ;
path_reg_zone = key_reg + " / " + reg_reg_zone ;
key_zone_local = this - > zone_file_read ( path_reg_zone ) + gettext ( reg_reg_zone . c_str ( ) ) ;
key_zone_local = this - > zone_file_read ( path_reg_zone ) + _ ( reg_reg_zone . c_str ( ) ) ;
zone_local . push_back ( key_zone_local ) ;
}
in2 . close ( ) ;
@ -1586,7 +1585,7 @@ void MainWindow::read_file() {
else if ( key_zone . length ( ) ! = 0 | | key_zone ! = " " ) {
zone . push_back ( key_zone ) ;
path_reg_zone = key_reg + " / " + key_zone ;
key_zone_local = this - > zone_file_read ( path_reg_zone ) + gettext ( key_zone . c_str ( ) ) ;
key_zone_local = this - > zone_file_read ( path_reg_zone ) + _ ( key_zone . c_str ( ) ) ;
zone_local . push_back ( key_zone_local ) ;
}
}
@ -1714,24 +1713,9 @@ SettingsPlug::SettingsPlug(::Window p_socketID, Glib::RefPtr<Gtk::Builder> build
}
void help ( ) {
string version = string ( gettext ( " ubl-settings-datetime version: " ) ) + version_application + " \n " ;
cout < < version . c_str ( ) ;
string help ;
help = " GTK settings datetime for UBLinux \n \n "
" Usage: ubl-settings-datetime [OPTIONS...] \n "
" Options: \n "
" -h, --help Show this help \n "
" -V, --version Show package version \n "
" --lock-datetime Lock date and time changes \n "
" --lock-timezone Lock time zone changes \n "
" --lock-ntp-mode Lock NTP mode selection \n "
" --lock-ntp-edit Lock editing NTP servers \n "
" --lock-sync-hwclock Lock sync hwclock mode selection \n "
" --lock-save Lock saving local and global configuration \n "
" --lock-save-local Lock save global configuration \n "
" --lock-save-global Lock load global configuration \n "
" --lock-load-global Lock load global configuration \n " ;
cout < < gettext ( help . c_str ( ) ) ;
string version = string ( str_version ) + version_application + " \n " ;
cout < < version . c_str ( ) ; ;
cout < < str_help_h ;
}