diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 index 39c6a5d..3e7f1a4 --- a/Makefile +++ b/Makefile @@ -111,6 +111,8 @@ install: check uninstall @install -Dm644 -t "${pkgdir}/usr/share/${pkgname}/images/" "${pkgname}.svg" @install -Dm644 -t "${pkgdir}/usr/share/${pkgname}/images/" "${pkgname}.png" @install -Dm644 -t "${pkgdir}/usr/share/${pkgname}/images/" bg_top.png + @install -Dm644 -t "${pkgdir}/usr/share/${pkgname}/images/" checked.svg + @install -Dm644 -t "${pkgdir}/usr/share/${pkgname}/images/" warning.svg @gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ @update-desktop-database --quiet 2>/dev/null @touch /usr/share/applications diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/VERSION.md b/VERSION.md old mode 100644 new mode 100755 diff --git a/alert.svg b/alert.svg new file mode 100755 index 0000000..c14c381 --- /dev/null +++ b/alert.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/bg_top.png b/bg_top.png old mode 100644 new mode 100755 diff --git a/checked.svg b/checked.svg new file mode 100755 index 0000000..e3cab42 --- /dev/null +++ b/checked.svg @@ -0,0 +1,327 @@ + + + + + + + + + + + + + + + + diff --git a/close.svg b/close.svg new file mode 100755 index 0000000..d869d85 --- /dev/null +++ b/close.svg @@ -0,0 +1,54 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/ru.ublinux.pkexec.ubl-settings-datetime.exec.policy b/ru.ublinux.pkexec.ubl-settings-datetime.exec.policy old mode 100644 new mode 100755 diff --git a/screenshot/screenshot.png b/screenshot/screenshot.png old mode 100644 new mode 100755 index b69565f..083519f Binary files a/screenshot/screenshot.png and b/screenshot/screenshot.png differ diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt old mode 100644 new mode 100755 index 27292b0..b0d3007 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -13,9 +13,11 @@ find_package(ICU REQUIRED COMPONENTS uc dt in io) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \ -O2 -pipe -fno-plt -fexceptions \ -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \ - -fstack-clash-protection -fcf-protection ") + -fstack-clash-protection -fcf-protection") set(SOURCE_FILES + ubl-util-standard.h + ubl-util-standard.c main.cc ubl-settings-datetime.cc ubl-settings-datetime.h) diff --git a/source/main.cc b/source/main.cc old mode 100644 new mode 100755 index 4c57ffb..42b4f43 --- a/source/main.cc +++ b/source/main.cc @@ -1,10 +1,7 @@ -#include -#include -#include -#include -#include -#include #include "ubl-settings-datetime.h" + +void pars_flag(int index_start, int argc, char* argv[]); + int main(int argc, char* argv[]) { string str_argv=""; string str_cmd_argv = ""; @@ -20,8 +17,9 @@ int main(int argc, char* argv[]) { str_argv = argv[1]; } - if ((str_argv.find("-s")!=std::string::npos) || (str_argv.find("--socket-id")!=std::string::npos)){ + if (str_argv.find("--socket-id")!=std::string::npos){ + pars_flag(3, argc, argv); auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example.plug"); auto builder = Gtk::Builder::create_from_file(path_glade + "ubl-settings-datetime.glade"); Glib::init(); @@ -50,29 +48,7 @@ int main(int argc, char* argv[]) { int len_argv = 1; auto app = Gtk::Application::create(len_argv, argv, "org.gtkmm.example.plug"); auto builder = Gtk::Builder::create_from_file(path_glade + "ubl-settings-datetime.glade"); - for (int i=1; iget_widget_derived("window", wnd); auto r = app->run(*wnd); @@ -83,4 +59,45 @@ int main(int argc, char* argv[]) { cout << gettext("Argument not recognized"); return 0; } +} + +void pars_flag(int index_start, int argc, char* argv[]){ + string str_argv=""; + for (int i=index_start; i -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + #include "ubl-settings-datetime.h" using namespace std; @@ -23,17 +9,35 @@ string path_locale = "/usr/share/locale/"; string path_css = "/usr/share/ubl-settings-datetime/css/style.css"; bool flag_datetime = false; bool flag_timezone = false; -bool flag_ntp = false; -bool flag_update = false; +bool flag_ntp_mode = false; +bool flag_ntp_edit = false; +bool flag_save = false; +bool flag_save_local = false; +bool flag_save_global = false; +bool flag_load_global = false; +int socket_ext_id_I=0; +int socket_trd_id_I=0; 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::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"); + + Glib::OptionEntry socketExtId; + socketExtId.set_long_name("socket-ext-id"); + socketExtId.set_flags(Glib::OptionEntry::FLAG_IN_MAIN); + socketExtId.set_description("Settings manager secondary socket"); + + Glib::OptionEntry socketTrdId; + socketTrdId.set_long_name("socket-trd-id"); + socketTrdId.set_flags(Glib::OptionEntry::FLAG_IN_MAIN); + socketTrdId.set_description("Settings manager secondary socket"); + add_entry(socketIDArg, m_socketID); + add_entry(socketExtId, socket_ext_id_I); + add_entry(socketTrdId, socket_trd_id_I); } ::Window CmdArgParser::GetSocketID() const{ return m_socketID; @@ -51,6 +55,19 @@ MainWindow::MainWindow(Glib::RefPtr const& builder) { } void MainWindow::settings(){ + Gtk::Widget *standartHead; + Gtk::Widget *plugBox; + Gtk::Window *window; + Gtk::Widget *boxButton; + Gtk::Widget *boxSave; + builder->get_widget("standartHead",standartHead); + builder->get_widget("plugBox",plugBox); + builder->get_widget("window",window); + builder->get_widget("boxButton",boxButton); + builder->get_widget("boxSave",boxSave); + + + ubl_make_plugs(boxSave,boxButton, socket_ext_id_I, socket_trd_id_I); year=0, month=0, day=0; this->get_builder(); this->lacalization(); @@ -61,12 +78,13 @@ void MainWindow::settings(){ numTimeMin->set_increments(1.0,1.0); this->get_config(); this->flag_block_gui(); + btnBoxAboutDialog->set_visible(false); this->event(); this->parse_text_date(); - - + this->download_local_cfg(); } else{ + btnDownload->set_sensitive(false); numTimeHrs->set_sensitive(false); numTimeMin->set_sensitive(false); lblTime->set_sensitive(false); @@ -80,19 +98,19 @@ void MainWindow::settings(){ lblReg->set_sensitive(false); lblZone->set_sensitive(false); lblTimeZone->set_sensitive(false); - lblDateTimeSettingGlob->set_sensitive(false); lblSynchronizebChkGLob->set_sensitive(false); cbDhcp->set_sensitive(false); txtNtpServer->set_sensitive(false); - lblTimeZoneGlob->set_sensitive(false); - lblRegGlob->set_sensitive(false); lblZone1Glob->set_sensitive(false); lblDateTimeSetting->set_sensitive(false); + btnBoxAboutDialog->set_visible(false); this->event(); - + imgInfo->set("/usr/share/ubl-settings-datetime/images/checked.svg"); } + } + int MainWindow::check_root(){ if (geteuid()!=0){ lblMessageSudo->set_text(_("The program must be run with \nsuperuser privileges!")); @@ -101,7 +119,19 @@ int MainWindow::check_root(){ } return 0; } + void MainWindow::lacalization(){ + //btnSynopsis->set_label(_("Synopsis")); + //btnAbout->set_label(_("About the program")); + //btnDonwlodLocal->set_label(_("Download local")); + //btnDonwlolGlob->set_label(_("Download global")); + //btnSaveGlob->set_label(_("Save to Global configuration")); + //btnSaveLocal->set_label(_("Save to local configuration")); + //btnSaveLocalGlob->set_label(_("Save to global and local configuration")); + aboutWindows->set_comments(_("Setting the date and time")); + aboutWindows->set_website_label(_("Project Home Page")); + lblSave->set_label(_("Save")); + lblDownload->set_label(_("Download")); txtDate->set_tooltip_text(_("Date of\nFormat: DD.MM.YYYY")); txtNtpServer->set_tooltip_text(_("Enter the name of the ntp-server or its ip-address.\nWhen entering multiple addresses, separate them with commas.")); lblSynchronizebChkGLob->set_text(_("Synchronize via NTP:")); @@ -109,34 +139,27 @@ void MainWindow::lacalization(){ cbDhcp->append(_("DHCP")); cbDhcp->append(_("Manual")); cbDhcp->append(_("Disabled")); - lblDateTimeSetting->set_text(_("Local Configuration")); + + lblDateTimeSetting->set_text(_("Current date and time")); lblHead->set_text(_("Settings the date and time")); lblTime->set_text(_("Time")); lblData->set_text(_("Date")); lblTimeZone->set_text(_("Time zone")); lblReg->set_text(_("Region")); lblZone->set_text(_("Zone")); - lblRegGlob->set_text(_("Region")); - lblZone1Glob->set_text(_("Zone")); - lblTimeZoneGlob->set_text(_("Time zone")); lblSynchronizeBtn->set_text(_("Sync by")); - lblDateTimeSettingGlob->set_text(_("Global customization")); - this->set_title(_("ubl-settings-datetime")); - windowsNnpClose->set_title(_("Warning!")); + lblHeader->set_text(_("ubl-settings-datetime")); mess_sudo->set_title(_("Warning!")); mess_dchp->set_title(_("Warning!")); lblTimeBios->set_text(_("Synchronize hardware time")); - lblBanerStopNtp->set_text(_("Active service detected\nAutomatic time and date synchronization service detected")); - lblNtpStop->set_text(_("Stop the synchronization service")); - lblNtpClose->set_text(_("Close")); - //_lblSynchronizebChk->set_text(_("Synchronize via NTP")); + lblHW->set_text(_("Synchronize hardware time:")); + cbHw->append(_("Local time")); + cbHw->append(_("UTC time")); + } void MainWindow::flag_block_gui(){ if (flag_datetime==true){ - //numTimeHrs->set_sensitive(false); - //numTimeMin->set_sensitive(false); - //txtDate->set_sensitive(false); btnUpdateDateTime->set_sensitive(false); numTimeHrs->set_sensitive(false); numTimeMin->set_sensitive(false); @@ -150,26 +173,28 @@ void MainWindow::flag_block_gui(){ if (flag_timezone==true){ cbRegion->set_sensitive(false); cbZone->set_sensitive(false); - cbRegionGlob->set_sensitive(false); - cbZoneGlob->set_sensitive(false); - //btnChooseDate->set_sensitive(false); - cbDhcp->set_sensitive(false); } - if (flag_ntp==true){ + if (flag_ntp_mode==true){ cbDhcp->set_sensitive(false); txtNtpServer->set_sensitive(false); + flag_ntp_edit = true; } - if (flag_update==true){ - lblDateTimeSettingGlob->set_sensitive(false); - //lblSynchronizebChkGLob->set_sensitive(false); - lblTimeZoneGlob->set_sensitive(false); - lblRegGlob->set_sensitive(false); - cbRegionGlob->set_sensitive(false); - lblZone1Glob->set_sensitive(false); - cbZoneGlob->set_sensitive(false); + if (flag_ntp_edit==true){ txtNtpServer->set_sensitive(false); - cbDhcp->set_sensitive(false); } + if (flag_load_global==true){ + btnDonwlolGlob->set_sensitive(false); + } + if (flag_save==true){ + btnSave->set_sensitive(false); + } + if (flag_save_local==true){ + btnSaveLocal->set_sensitive(false); + } + if (flag_save_global==true){ + btnSaveGlob->set_sensitive(false); + } + } void MainWindow::add_CSS(){ @@ -180,10 +205,16 @@ 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 context = boxColor->get_style_context(); Glib::RefPtr context_lbl_head = lblHead->get_style_context(); - //Glib::RefPtr context_button = btnHardwareTime->get_style_context(); context->add_class("cssboxColor1"); context_lbl_head->add_class("textHead"); - //context_button->add_class("textHead"); +} + + +void MainWindow::info_status_app(string stule){ + Glib::RefPtr boxInfo = boxInfoError->get_style_context(); + boxInfo->remove_class("boxInfoMessOK"); + boxInfo->remove_class("boxInfoMessError"); + boxInfo->add_class(stule); } void MainWindow::get_builder(){ @@ -198,9 +229,7 @@ void MainWindow::get_builder(){ builder->get_widget("cbDhcp", cbDhcp); builder->get_widget("txtDate", txtDate); builder->get_widget("cbRegion", cbRegion); - builder->get_widget("cbRegionGlob", cbRegionGlob); builder->get_widget("cbZone", cbZone); - builder->get_widget("cbZoneGlob", cbZoneGlob); builder->get_widget("txtNtpServer", txtNtpServer); builder->get_widget("cldrDate", cldrDate); builder->get_widget("mess_dchp", mess_dchp); @@ -212,27 +241,37 @@ void MainWindow::get_builder(){ builder->get_widget("lblTimeZone",lblTimeZone); builder->get_widget("lblReg",lblReg); builder->get_widget("lblZone",lblZone); - builder->get_widget("lblRegGlob",lblRegGlob); - builder->get_widget("lblZone1Glob",lblZone1Glob); - builder->get_widget("lblTimeZoneGlob",lblTimeZoneGlob); - //builder->get_widget("lblSynchronizebChk",_lblSynchronizebChk); builder->get_widget("lblSynchronizebChkGLob",lblSynchronizebChkGLob); builder->get_widget("lblSynchronizeBtn",lblSynchronizeBtn); - builder->get_widget("lblDateTimeSettingGlob",lblDateTimeSettingGlob); builder->get_widget("lblTimeBios",lblTimeBios); builder->get_widget("btnHardwareTime",btnHardwareTime); builder->get_widget("mess_sudo",mess_sudo); builder->get_widget("lblMessageSudo",lblMessageSudo); builder->get_widget("btnMessCloseSudo",btnMessCloseSudo); - builder->get_widget("windowsNnpClose",windowsNnpClose); - builder->get_widget("btnNtpStop",btnNtpStop); - builder->get_widget("btnNtpWinClose",btnNtpWinClose); - builder->get_widget("lblNtpStop",lblNtpStop); - builder->get_widget("lblNtpClose",lblNtpClose); - builder->get_widget("lblBanerStopNtp",lblBanerStopNtp); - - //builder->get_widget("cbxSynchronizeNtp",cbxSynchronizeNtp); - + builder->get_widget("lblSave",lblSave); + builder->get_widget("lblDownload",lblDownload); + builder->get_widget("aboutWindows", aboutWindows); + builder->get_widget("btnBoxAboutDialog", btnBoxAboutDialog); + builder->get_widget("boxInfoError", boxInfoError); + builder->get_widget("lblWarning", lblWarning); + builder->get_widget("imgInfo", imgInfo); + builder->get_widget("popDownloadMenu", popDownloadMenu); + builder->get_widget("popSaveMenu", popSaveMenu); + builder->get_widget("popAbout", popAbout); + builder->get_widget("btnSave", btnSave); + builder->get_widget("btnSettings", btnSettings); + builder->get_widget("btnDownload", btnDownload); + builder->get_widget("btnSynopsis", btnSynopsis); + builder->get_widget("btnAbout", btnAbout); + builder->get_widget("btnDonwlodLocal", btnDonwlodLocal); + builder->get_widget("btnDonwlolGlob", btnDonwlolGlob); + builder->get_widget("btnSaveLocalGlob", btnSaveLocalGlob); + builder->get_widget("btnSaveLocal", btnSaveLocal); + builder->get_widget("btnSaveGlob", btnSaveGlob); + builder->get_widget("headerBar", headerBar); + builder->get_widget("lblHeader", lblHeader); + builder->get_widget("lblHW", lblHW); + builder->get_widget("cbHw", cbHw); this->add_CSS(); } void MainWindow::gui_exit(){ @@ -254,48 +293,181 @@ void MainWindow::event(){ btnChooseDate->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::calendar_show)); cbDhcp->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::event_entry_cbDhcp)); cbRegion->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::append_zone)); - cbRegionGlob->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::append_zone_glob)); - 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)); cldrDate->signal_day_selected_double_click().connect(sigc::mem_fun(*this, &MainWindow::get_calendar)); mess_sudo->signal_delete_event().connect(sigc::mem_fun(*this, &MainWindow::gui_exit_2)); - btnNtpWinClose->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::wind_close_ntp)); - btnNtpStop->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::stop_ntp)); + btnDownload->signal_clicked().connect([&](){popDownloadMenu->show();}); + btnSave->signal_clicked().connect([&](){popSaveMenu->show();}); + btnSettings->signal_clicked().connect([&](){popAbout->show();}); + btnAbout->signal_clicked().connect([&](){aboutWindows->show();}); + btnSynopsis->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::synopsis_show)); + btnDonwlodLocal->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::download_local_cfg)); + btnDonwlolGlob->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::download_globl_cfg)); + btnSaveLocalGlob->signal_clicked().connect([&](){save_global_local_cfg();}); + btnSaveLocal->signal_clicked().connect([&](){save_local_cfg();}); + btnSaveGlob->signal_clicked().connect([&](){save_global_cfg();}); + +} + +void MainWindow::synopsis_show(){ + int start_error = error_info; + wrapper_system("xdg-open https://wiki.ublinux.ru/ru/home &"); + //gtk_show_uri_on_window(NULL, "https://wiki.ublinux.ru/ru/home", 0, 0); + if (start_error!=error_info){ + error_info=start_error; + } +} + +void MainWindow::download_local_cfg(){ + string cmd = "/usr/bin/ubconfig --default --source system get clock ZONE"; + this->fill_in_reg_zone(cmd); + this->update_hour_minute(); + this->update_calendar(); + string cmd_get_dhcp = "/usr/bin/ubconfig --source system get network NTPSERVERS"; + string cmd_default_get_dhcp = "/usr/bin/ubconfig --source=default get NTPSERVERS_DEFAULT"; + this->entry_dhcp_mess(cmd_get_dhcp, cmd_default_get_dhcp); + string hw = "/usr/bin/ubconfig --default --source system get clock HWCLOCK_SYNC"; + this->entry_hardware_clock(hw); + info_warning_error(0); +} + +void MainWindow::download_globl_cfg(){ + string cmd_get_dhcp = "/usr/bin/ubconfig --target global get network NTPSERVERS"; + string cmd_default_get_dhcp = "/usr/bin/ubconfig --source=default get NTPSERVERS_DEFAULT"; + this->entry_dhcp_mess(cmd_get_dhcp, cmd_default_get_dhcp); + string cmd = "/usr/bin/ubconfig --default --source global get clock ZONE"; + this->fill_in_reg_zone(cmd); + string hw = "/usr/bin/ubconfig --default --source global get clock HWCLOCK_SYNC"; + this->entry_hardware_clock(hw); + info_warning_error(1); +} + +void MainWindow::save_local_cfg(){ + string cmd = "/usr/bin/ubconfig --target system set clock ZONE="; + this->enter_zone(cmd); + string cmd_default = "/usr/bin/ubconfig --target system set network NTPSERVERS=default"; + string cmd_dhcp = "/usr/bin/ubconfig --target system set network NTPSERVERS=dhcp"; + string cmd_set_ntp = "/usr/bin/ubconfig --target system set network NTPSERVERS=\""; + string remove = "/usr/bin/ubconfig --target system remove network NTPSERVERS"; + this->save_Dhcp(cmd_default, cmd_dhcp, remove, cmd_set_ntp); + string local = "/usr/bin/ubconfig --target system set clock HWCLOCK_SYNC=localtime"; + string hw = "/usr/bin/ubconfig --target system set clock HWCLOCK_SYNC=utc"; + this->hardware_clock_global(local, hw); + info_warning_error(2); +} + +void MainWindow::save_global_cfg(){ + string cmd = "/usr/bin/ubconfig --target global set clock ZONE="; + this->enter_zone(cmd); + string cmd_default = "/usr/bin/ubconfig --target global set network NTPSERVERS=default"; + string cmd_dhcp = "/usr/bin/ubconfig --target global set network NTPSERVERS=dhcp"; + string cmd_set_ntp = "/usr/bin/ubconfig --target global set network NTPSERVERS=\""; + string remove = "/usr/bin/ubconfig --target global remove network NTPSERVERS"; + this->save_Dhcp(cmd_default, cmd_dhcp, remove, cmd_set_ntp); + string local = "/usr/bin/ubconfig --target global set clock HWCLOCK_SYNC=localtime"; + string hw = "/usr/bin/ubconfig --target global set clock HWCLOCK_SYNC=utc"; + this->hardware_clock_global(local, hw); + info_warning_error(3); +} +void MainWindow::save_global_local_cfg(){ + string cmd = ""; + string cmd_default = ""; + string cmd_dhcp = ""; + string cmd_set_ntp = ""; + string remove = ""; + if (flag_save_global==false){ + this->save_local_cfg(); + + } + if (flag_save_local==false){ + this->save_global_cfg(); + } + info_warning_error(4); +} + +void MainWindow::info_warning_error(int mess){ + if (error_info>0 || warning_info>0){ + info_status_app("boxInfoMessError"); + imgInfo->set("/usr/share/ubl-settings-datetime/images/warning.svg"); + error_info=0; + warning_info=0; + if (mess == 0){ + lblWarning->set_text(_("Local configuration reading error")); + } + else if (mess == 1){ + lblWarning->set_text(_("Global configuration read error")); + } + else if (mess == 2){ + lblWarning->set_text(_("Local configuration write error")); + } + else if (mess == 3){ + lblWarning->set_text(_("Global configuration write error")); + } + else if (mess == 4){ + lblWarning->set_text(_("Error saved local and global configuration")); + } + } + else{ + info_status_app("boxInfoMessOK"); + imgInfo->set("/usr/share/ubl-settings-datetime/images/checked.svg"); + if (mess == 0){ + lblWarning->set_text(_("Local configuration downloaded successfully")); + } + else if (mess == 1){ + lblWarning->set_text(_("Global configuration downloaded successfully")); + } + else if (mess == 2){ + lblWarning->set_text(_("Local configuration successfully written")); + } + else if (mess == 3){ + lblWarning->set_text(_("Global configuration successfully written")); + } + else if (mess == 4){ + lblWarning->set_text(_("Successfully saved local and global configuration")); + } + } } -void MainWindow::wind_close_ntp(){ - windowsNnpClose->hide(); + + +void MainWindow::wrapper_system(string cmd){ + int response_cmd = system(cmd.c_str()); + if (response_cmd!=0){ + error_info+=1; + } + } -void MainWindow::stop_ntp(){ - string cmd = "SEL_SERVICE=\"systemd-timesyncd\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service; "; - response_cmd=system(cmd.c_str()); - cmd ="SEL_SERVICE=\"ntpd\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ${SEL_SERVICE}; "; - response_cmd=system(cmd.c_str()); - cmd ="SEL_SERVICE=\"ntpdate\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ${SEL_SERVICE}; "; - response_cmd=system(cmd.c_str()); - cmd = "SEL_SERVICE=\"chronyd\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ${SEL_SERVICE}; "; - response_cmd=system(cmd.c_str()); - cmd ="SEL_SERVICE=\"openntpd\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ntpd; "; - response_cmd=system(cmd.c_str()); - cmd ="SEL_SERVICE=\"ptp4l\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ${SEL_SERVICE}; "; - response_cmd=system(cmd.c_str()); - cmd ="SEL_SERVICE=\"phc2sys\"; systemctl --quiet is-active ${SEL_SERVICE}.service &>/dev/null && systemctl stop ${SEL_SERVICE}.service || pkill -9 ${SEL_SERVICE} "; - response_cmd=system(cmd.c_str()); +void MainWindow::hardware_clock_global(string &local, string &utc){ + int index = cbHw->get_active_row_number(); + if (index == 0){ + wrapper_system(local); + } + else if (index == 1){ + wrapper_system(utc); + } +} +void MainWindow::entry_hardware_clock(string &cmd){ + struct Result obj_result = this->wrapper_call(cmd); + if (obj_result.error == 0){ + if (obj_result.response == "localtime"){ + cbHw->set_active(0); + } + else{ + cbHw->set_active(1); + } + } } void MainWindow::hardware_clock(){ string cmd = "hwclock --systohc"; - response_cmd=system(cmd.c_str()); + wrapper_system(cmd); } void MainWindow::gui_mess_close(){ mess_dchp->hide(); } -bool MainWindow::focus_ntp(GdkEventFocus* event){ - if (event!=NULL){} +bool MainWindow::focus_ntp(string &cmd_set_ntp){ if (txtNtpServer->get_text()=="" || txtNtpServer->get_text()==" "){ lblMessage->set_text(_("Enter DHCP!")); mess_dchp->show(); @@ -307,7 +479,9 @@ bool MainWindow::focus_ntp(GdkEventFocus* event){ "@","[","]","\\","{","}","|","~", " " }; bool flag_error = false; + bool flag_error_check_ntp = false; string str_ntp = txtNtpServer->get_text(); + flag_error_check_ntp = this->check_ntp(str_ntp); for (const auto &simvol: array_simvol){ if (str_ntp.find(simvol)!=std::string::npos){ flag_error=true; @@ -315,19 +489,98 @@ bool MainWindow::focus_ntp(GdkEventFocus* event){ } } - if (flag_error==false){ - cmd = "/usr/bin/ubconfig set network NTPSERVERS=\"" + str_ntp + "\""; - response_cmd = system(cmd.c_str()); + if ((flag_error==false) && (flag_error_check_ntp==false)){ + cmd = cmd_set_ntp + str_ntp + "\""; + wrapper_system(cmd); } else{ - lblMessage->set_text(_("An invalid character is entered")); - mess_dchp->show(); - } + if (flag_error==true){ + lblMessage->set_text(_("An invalid character is entered")); + mess_dchp->show(); + } + else if (flag_error_check_ntp==true){ + lblMessage->set_text(_("Error in the ntp name")); + mess_dchp->show(); + } } + + } + return true; } +vector MainWindow::find_all(string &str_ntp, string substr){ + size_t index = 0; + vector sub_index; + while ((index = str_ntp.find(substr, index)) != std::string::npos) { + index += substr.length(); + sub_index.push_back(index); + } + return sub_index; +} + +bool MainWindow::check_ntp(string &str_ntp){ + vector sub_index = this->find_all(str_ntp,"."); + if (sub_index.size()==1){ + int index_point = sub_index[0]; + int len_str_ntp = str_ntp.length(); + if (((len_str_ntp-index_point)>=2) && (index_point>2)){ + return false; + } + else{ + return true; + } + } + else if (sub_index.size()==3){ + int index_str_ntp = sub_index[0]; + int index_str_ntp_1 = sub_index[1]; + int index_str_ntp_2 = sub_index[2]; + if (((index_str_ntp>0) && (index_str_ntp<=4)) && + (index_str_ntp_1>(index_str_ntp+1)) && + ((index_str_ntp_1-index_str_ntp)<=4) && + (index_str_ntp_2>(index_str_ntp_1+1)) && + ((index_str_ntp_2-index_str_ntp_1)<=4) && + ((str_ntp.length()-index_str_ntp_2)<=3)) { + string simvol; + bool flag_error=false; + char char_ntp[1]={0}; + for (size_t i = 0; i < str_ntp.size(); i++){ + flag_error=false; + char_ntp[0] = str_ntp[i]; + for (int index=0;index<11;index++){ + + if (index==10){ + simvol="."; + } + else{ + simvol = to_string(index); + } + if (simvol==char_ntp){ + flag_error=false; + + break; + } + else{ + flag_error=true; + } + } + if (flag_error==true){ + return true; + } + } + } + else{ + return true; + } + } + else{ + return true; + } + return false; + +} + struct MainWindow::Result MainWindow::wrapper_call(string cmd){ struct Result obj_result; string response=this->call(cmd); @@ -342,88 +595,130 @@ struct MainWindow::Result MainWindow::wrapper_call(string cmd){ else{ obj_result.response = response; obj_result.error = 1; + warning_info+=1; } } else{ obj_result.response = response; obj_result.error = 2; + warning_info+=1; } } else{ obj_result.response = response; obj_result.error = 3; + warning_info+=1; } return obj_result; } - void MainWindow::event_entry_cbDhcp(){ - Glib::ustring str_dhcp = cbDhcp->get_active_text(); + string str_dhcp = cbDhcp->get_active_text(); + string cmd = ""; int activ_index = cbDhcp->get_active_row_number(); - if (str_dhcp.length()!=0){ - if (activ_index==0){ - btnUpdateDateTime->set_sensitive(false); - string cmd = "/usr/bin/ubconfig set network NTPSERVERS=default"; - response_cmd=system(cmd.c_str()); + if (str_dhcp.length()==0){ + cbDhcp->set_active(0); + } + else if (activ_index==0){ + txtNtpServer->set_text(""); + btnUpdateDateTime->set_sensitive(false); + txtNtpServer->set_sensitive(false); + + + } + else if (activ_index==1){ + btnUpdateDateTime->set_sensitive(false); + txtNtpServer->set_sensitive(false); + txtNtpServer->set_text(""); + } + else if (activ_index==2){ + if (flag_ntp_edit==false){ + txtNtpServer->set_sensitive(true); + } + } + else if (activ_index==3){ + txtNtpServer->set_text(""); + txtNtpServer->set_sensitive(false); + btnUpdateDateTime->set_sensitive(true); + } +} + +void MainWindow::save_Dhcp(string &cmd_default, string &cmd_dhcp, string &remove, string &cmd_set_ntp){ + int activ_index = cbDhcp->get_active_row_number(); + string str_dhcp = cbDhcp->get_active_text(); + if (str_dhcp.length()==0){ + + } + else if (activ_index==0){ + wrapper_system(cmd_default); + } + else if (activ_index==1){ + wrapper_system(cmd_dhcp); + } + else if (activ_index==2){ + this->focus_ntp(cmd_set_ntp); + } + else if (activ_index==3){ + int start_error = error_info; + wrapper_system(remove); + if (start_error != error_info){ + error_info=start_error; + } + } +} + +void MainWindow::entry_dhcp_mess(string cmd_get_dhcp, string cmd_default_get_dhcp){ + string cmd = cmd_get_dhcp; + struct Result obj_result = this->wrapper_call(cmd); + if (obj_result.error==0){ + string str_dhcp = obj_result.response; + btnUpdateDateTime->set_sensitive(false); + 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"){ + cbDhcp->set_active(1); + txtNtpServer->set_text(""); txtNtpServer->set_sensitive(false); - cbDhcp->set_active(activ_index); - cmd = "/usr/bin/ubconfig --source=default get NTPSERVERS_DEFAULT"; + } + else if (str_dhcp=="default"){ + btnUpdateDateTime->set_sensitive(false); + cbDhcp->set_active(0); + cmd = cmd_default_get_dhcp; struct Result obj_result = this->wrapper_call(cmd); + txtNtpServer->set_sensitive(false); if (obj_result.error==0){ txtNtpServer->set_text(obj_result.response); } else{ - //string error = ""; - //error = string(_("ERROR")) + "\n" + obj_result.response; - //lblMessage->set_text(error); - //mess_dchp->show(); + if (obj_result.error==2){ + warning_info-=1; + } } } - else if (activ_index==1){ - btnUpdateDateTime->set_sensitive(false); - string cmd = "/usr/bin/ubconfig set network NTPSERVERS=dhcp"; - response_cmd=system(cmd.c_str()); - txtNtpServer->set_sensitive(false); - cbDhcp->set_active(activ_index); - txtNtpServer->set_text(""); - } - else if (activ_index==2){ + else{ btnUpdateDateTime->set_sensitive(false); - txtNtpServer->set_sensitive(true); - if (txtNtpServer->get_text().find("default")!=std::string::npos){ + if (str_dhcp==""){ + lblMessage->set_text(_("Enter DHCP!")); + mess_dchp->show(); + } + else if (str_dhcp=="(null)"){ + cbDhcp->set_active(0); txtNtpServer->set_text(""); } - string cmd = "/usr/bin/ubconfig get network NTPSERVERS"; - struct Result obj_result = this->wrapper_call(cmd); - if (obj_result.error==0){ - if (obj_result.response.find("default")==std::string::npos){ - if (obj_result.response.find("dhcp")==std::string::npos){ - txtNtpServer->set_text(obj_result.response); - } - cbDhcp->set_active(activ_index); + else{ + cbDhcp->set_active(2); + txtNtpServer->set_text(str_dhcp); + if (flag_ntp_edit==false){ + txtNtpServer->set_sensitive(true); } } - else if (obj_result.error==3){} - else{ - string error = ""; - error = string(_("ERROR")) + "\n" + obj_result.response; - lblMessage->set_text(error); - mess_dchp->show(); - } } - else if (activ_index==3){ - string cmd = "/usr/bin/ubconfig remove network NTPSERVERS"; - response_cmd=system(cmd.c_str()); - txtNtpServer->set_text(""); - txtNtpServer->set_sensitive(false); - btnUpdateDateTime->set_sensitive(true); - this->stop_ntp(); - } } - else{ - string cmd = "/usr/bin/ubconfig set network NTPSERVERS=dhcp"; - response_cmd=system(cmd.c_str()); - cbDhcp->set_active(0); + cbDhcp->set_active(3); + txtNtpServer->set_text(""); + txtNtpServer->set_sensitive(false); + btnUpdateDateTime->set_sensitive(true); + warning_info-=1; } } @@ -474,82 +769,8 @@ void MainWindow::calendar_show(){ } popCalendar->show(); } - -void MainWindow::enry_dhcp_mess(){ - string cmd = "/usr/bin/ubconfig get network NTPSERVERS"; - struct Result obj_result = this->wrapper_call(cmd); - if (obj_result.error==0){ - string str_dhcp = obj_result.response; - btnUpdateDateTime->set_sensitive(false); - 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"){ - cbDhcp->set_active(1); - txtNtpServer->set_text(""); - txtNtpServer->set_sensitive(false); - } - else if (str_dhcp=="default"){ - btnUpdateDateTime->set_sensitive(false); - cbDhcp->set_active(0); - string cmd = "/usr/bin/ubconfig --source=default get NTPSERVERS_DEFAULT"; - struct Result obj_result = this->wrapper_call(cmd); - txtNtpServer->set_sensitive(false); - if (obj_result.error==0){ - txtNtpServer->set_text(obj_result.response); - } - else{ - //string error = ""; - //error = string(_("ERROR")) + "\n" + obj_result.response; - //lblMessage->set_text(error); - //mess_dchp->show(); - } - } - else{ - btnUpdateDateTime->set_sensitive(false); - if (str_dhcp==""){ - lblMessage->set_text(_("Enter DHCP!")); - mess_dchp->show(); - } - else if (str_dhcp=="(null)"){ - cbDhcp->set_active(0); - txtNtpServer->set_text(""); - } - else{ - cbDhcp->set_active(2); - txtNtpServer->set_text(str_dhcp); - txtNtpServer->set_sensitive(true); - } - } - } - else{ - cbDhcp->set_active(3); - txtNtpServer->set_text(""); - txtNtpServer->set_sensitive(false); - btnUpdateDateTime->set_sensitive(true); - } -} - -void MainWindow::get_config(){ - this->read_file(); - this->update_hour_minute(); - this->update_calendar(); - this->enry_dhcp_mess(); - string cmd = "/usr/bin/ubconfig --default --source global get clock ZONE"; - struct Result obj_result = this->wrapper_call(cmd); - if (obj_result.error==0){ - auto arr_reg_zone_glob = this->split_region_zone(obj_result.response); - if (arr_reg_zone_glob[0].length()!=0){ - this->append_region_zone(arr_reg_zone_glob[0],arr_reg_zone_glob[1],cbRegionGlob,cbZoneGlob); - } - else{ - this->append_region_zone("","",cbRegionGlob,cbZoneGlob); - } +void MainWindow::fill_in_reg_zone(string &cmd){ - } - else { - this->append_region_zone("","",cbRegionGlob,cbZoneGlob); - } - cmd = "/usr/bin/ubconfig --default --source system get clock ZONE"; struct Result obj_result_1 = this->wrapper_call(cmd); if (obj_result_1.error==0){ auto arr_reg_zone = this->split_region_zone(obj_result_1.response); @@ -563,7 +784,14 @@ void MainWindow::get_config(){ else { this->append_region_zone("","",cbRegion,cbZone); } +} + + +void MainWindow::get_config(){ + this->read_file(); + this->update_hour_minute(); + this->update_calendar(); } array MainWindow::split_region_zone(string read_reg_zon_cfg){ @@ -584,7 +812,7 @@ array MainWindow::split_region_zone(string read_reg_zon_cfg){ } -void MainWindow::enter_zone(){ +void MainWindow::enter_zone(string &cmd){ int activ_index_reg = cbRegion->get_active_row_number(); string reg_text=array_region[activ_index_reg]; int activ_index = cbZone->get_active_row_number(); @@ -600,9 +828,8 @@ void MainWindow::enter_zone(){ if (!(zone_text.empty())){ str_zone=zone_text; str_region=reg_text; - string cmd = ""; - cmd = " ubconfig --target system set clock ZONE=" + str_region + "/" + str_zone; - response_cmd=system(cmd.c_str()); + cmd = cmd + str_region + "/" + str_zone; + wrapper_system(cmd); } else{ str_zone=""; @@ -624,39 +851,8 @@ void MainWindow::parse_text_date(){ } } -void MainWindow::enter_zone_glob(){ - int activ_index_reg = cbRegionGlob->get_active_row_number(); - string reg_text=array_region[activ_index_reg]; - int activ_index = cbZoneGlob->get_active_row_number(); - string zone_text=""; - if(!(reg_text.empty())){ - int index=0; - for (const auto &zone :time_reg_map.at(reg_text)){ - if (index==activ_index){ - zone_text=zone; - } - index+=1; - } - if (!(zone_text.empty())){ - //str_zoneGlob = zone_text.substr(zone_text.find(") ")+2,zone_text.length()); - string cmd = "/usr/bin/ubconfig --target global set clock ZONE=" +reg_text +"/" + zone_text; - response_cmd=system(cmd.c_str()); - } - else{ - str_zoneGlob=""; - str_region_glob=""; - } - } - else{ - str_zoneGlob=""; - str_region_glob=""; - } -} - - void MainWindow::append_region_zone(string region, string zone, Gtk::ComboBoxText *tmpCbReg, Gtk::ComboBoxText *tmpCbZone){ str_region=region; - str_region_glob=region; int index = 0; Glib::ustring reg_local = ""; int size_vec = array_region_local.size(); @@ -689,6 +885,7 @@ void MainWindow::append_region_zone(string region, string zone, Gtk::ComboBoxTex tmpCbReg->set_active_text(reg); } } + tmpCbZone->remove_all(); index = 0; string zone_mixing = ""; string path_reg_zone = ""; @@ -715,6 +912,12 @@ void MainWindow::append_region_zone(string region, string zone, Gtk::ComboBoxTex index+=1; } } + if (region=="Etc" && zone==""){ + warning_info-=1; + } + else if (region==""){ + warning_info+=1; + } } string MainWindow::call(string cmd){ @@ -726,7 +929,6 @@ string MainWindow::call(string cmd){ exit(1); } while (fgets(path, PATH_MAX, fp) != NULL){ - //printf("%s", path); break; } status = pclose(fp); @@ -738,7 +940,6 @@ string MainWindow::call(string cmd){ } void MainWindow::append_zone(){ - //int length_zone = time_reg_map.at(str_region).size(); cbZone->remove_all(); int index = cbRegion->get_active_row_number(); string str_region = array_region[index]; @@ -752,23 +953,7 @@ void MainWindow::append_zone(){ cbZone->set_active(0); } -void MainWindow::append_zone_glob(){ - cbZoneGlob->remove_all(); - int index = cbRegionGlob->get_active_row_number(); - string str_region_glob = array_region[index]; - string zone_mixing=""; - string path_dir=""; - - if(str_region_glob.length()!=0){ - for (const auto &_str_zone : time_reg_map_local.at(str_region_glob)){ - cbZoneGlob->append(Glib::ustring(_str_zone)); - } - } - cbZoneGlob->set_active(0); -} - void MainWindow::update_time_date(){ - //this->enter_zone(); string cmd = ""; if ((year!=0) && (month !=0) && (day !=0)){ string str_month = ""; @@ -792,7 +977,7 @@ void MainWindow::update_time_date(){ if (str_data==str_data_entry){ cmd = "date +%Y%m%d -s \"" + to_string(year)+ str_month+str_day+"\""; - response_cmd=system(cmd.c_str()); + wrapper_system(cmd); txtDate->set_text(str_data); year=0; month=0; @@ -812,7 +997,7 @@ void MainWindow::update_time_date(){ cmd = "date +%T -s \""+ to_string(hour) + ":" + to_string(minute) + ":" + to_string(ltm->tm_sec) +"\""; - response_cmd=system(cmd.c_str()); + wrapper_system(cmd); } void MainWindow::post_entry_data(){ @@ -873,25 +1058,39 @@ void MainWindow::read_file(){ string path_reg_zone = ""; namespace fs = std::filesystem; for (const auto & entry : fs::directory_iterator("/usr/share/zoneinfo/")){ - std::ifstream in(entry.path()); // окрываем файл для чтения + std::ifstream in(entry.path()); if (in.is_open()){ string key_reg = entry.path().filename().string(); string path_dir = "/usr/share/zoneinfo/"+key_reg; if (fs::is_directory(path_dir)){ if (key_reg!="Pacific"){ if (key_reg!="posix"){ - //if (key_reg!="Etc"){ if (key_reg!="right"){ vector zone; vector zone_local; for (const auto & entry_zone : fs::directory_iterator(path_dir)){ - std::ifstream in1(entry_zone.path()); // окрываем файл для чтения + std::ifstream in1(entry_zone.path()); if (in1.is_open()){ string key_zone = entry_zone.path().filename().string(); - if (key_zone.length()!=0 || key_zone!=" "){ + + if (fs::is_directory(path_dir+"/"+key_zone)){ + string reg_reg_zone = path_dir+"/"+key_zone; + for (const auto & entry_reg_reg_zone : fs::directory_iterator(reg_reg_zone)){ + std::ifstream in2(entry_zone.path()); + if (in2.is_open()){ + 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) +_(reg_reg_zone.c_str()); + zone_local.push_back(key_zone_local); + } + in2.close(); + } + } + 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) +_(key_zone.c_str()); + path_reg_zone = key_reg + "/" + key_zone; + key_zone_local = this->zone_file_read(path_reg_zone) + _(key_zone.c_str()); zone_local.push_back(key_zone_local); } } diff --git a/source/ubl-settings-datetime.h b/source/ubl-settings-datetime.h old mode 100644 new mode 100755 index c1572ab..2069e94 --- a/source/ubl-settings-datetime.h +++ b/source/ubl-settings-datetime.h @@ -1,14 +1,21 @@ #ifndef UBL_SETTINGS_DATETIME_H #define UBL_SETTINGS_DATETIME_H #include -#include -#include -#include -#include -#include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ubl-util-standard.c" using namespace std; @@ -20,9 +27,14 @@ extern string path_locale; extern string path_css; extern bool flag_datetime; extern bool flag_timezone; -extern bool flag_ntp; -extern bool flag_update; - +extern bool flag_ntp_mode; +extern bool flag_ntp_edit; +extern bool flag_save; +extern bool flag_save_local; +extern bool flag_save_global; +extern bool flag_load_global; +extern int socket_ext_id_I; +extern int socket_trd_id_I; class CmdArgParser : public Glib::OptionGroup { public: @@ -46,12 +58,13 @@ class MainWindow : public Gtk::ApplicationWindow { Gtk::CheckButton *cbxSynchronizeNtpGlob; Gtk::Box *boxColor; Gtk::ComboBoxText *cbRegion; - Gtk::ComboBoxText *cbRegionGlob; Gtk::ComboBoxText *cbZone; - Gtk::ComboBoxText *cbZoneGlob; Gtk::Window *mess_dchp; Gtk::Window *mess_sudo; Gtk::Popover *popCalendar; + Gtk::Popover *popSaveMenu; + Gtk::Popover *popDownloadMenu; + Gtk::Popover *popAbout; Gtk::Calendar *cldrDate; Gtk::Label *lblMessage; Gtk::Label *lblMessageSudo; @@ -62,38 +75,49 @@ class MainWindow : public Gtk::ApplicationWindow { Gtk::Label *lblTimeZone; Gtk::Label *lblReg; Gtk::Label *lblZone; - Gtk::Label *lblRegGlob; Gtk::Label *lblZone1Glob; - Gtk::Label *lblTimeZoneGlob; Gtk::Label *lblSynchronizebChk; Gtk::Label *lblSynchronizebChkGLob; Gtk::Label *lblSynchronizeBtn; - Gtk::Label *lblDateTimeSettingGlob; Gtk::Label *lblTimeBios; - Gtk::Label *lblBanerStopNtp; + Gtk::Label *lblSave; + Gtk::Label *lblDownload; Gtk::Button *btnHardwareTime; Gtk::CheckButton *cbxSynchronizeNtp; - Gtk::Window *windowsNnpClose; - Gtk::Button *btnNtpStop; - Gtk::Button *btnNtpWinClose; - Gtk::Label *lblNtpStop; - Gtk::Label *lblNtpClose; Gtk::Entry *txtNtpServer; Gtk::Entry *txtDate; + Gtk::Button *btnDownload; + Gtk::Button *btnSave; + Gtk::Button *btnSettings; + Gtk::AboutDialog *aboutWindows; + Gtk::ButtonBox *btnBoxAboutDialog; + + Gtk::Box *boxInfoError; + Gtk::Label *lblWarning; + Gtk::Image *imgInfo; std::map > time_reg_map; std::map > time_reg_map_local; + Gtk::ModelButton *btnSaveLocalGlob; + Gtk::ModelButton *btnSaveLocal; + Gtk::ModelButton *btnSaveGlob; + Gtk::ModelButton *btnDonwlolGlob; + Gtk::ModelButton *btnDonwlodLocal; + Gtk::ModelButton *btnAbout; + Gtk::ModelButton *btnSynopsis; + Gtk::HeaderBar *headerBar; + Gtk::Label *lblHeader; + Gtk::Label *lblHW; + Gtk::ComboBoxText *cbHw; unsigned int year=0; unsigned int month=0; unsigned int day=0; + int error_info = 0; + int warning_info = 0; int hour; int minute; string str_region=""; - string str_region_glob=""; - string str_txtDate; - string strtxtNtpServer; string str_zone=""; - string str_zoneGlob; - int response_cmd; + bool bool_close_banner_info=true; template struct Result{ Type response; @@ -101,10 +125,22 @@ class MainWindow : public Gtk::ApplicationWindow { }; vector array_region_local; vector array_region; + public: MainWindow(BaseObjectType* obj, Glib::RefPtr const& builder); MainWindow(Glib::RefPtr const& builder); virtual ~MainWindow() = default; + void hardware_clock_global(string &local, string &utc); + void info_warning_error(int mess); + void synopsis_show(); + void entry_hardware_clock(string &cmd); + void save_global_local_cfg(); + void fill_in_reg_zone(string &cmd); + void download_globl_cfg(); + void save_local_cfg(); + void save_global_cfg(); + void save_Dhcp(string &cmd_default, string &cmd_dhcp, string &remove, string &cmd_set_ntp); + void download_local_cfg(); void post_entry_data(); void lacalization(); void settings(); @@ -113,14 +149,13 @@ class MainWindow : public Gtk::ApplicationWindow { void get_builder(); void event(); void gui_mess_close(); - bool focus_ntp(GdkEventFocus* event); + bool focus_ntp(string &cmd_set_ntp); void event_entry_cbDhcp(); void get_calendar(); void calendar_show(); - void enry_dhcp_mess(); + void entry_dhcp_mess(string cmd_get_dhcp, string cmd_default_get_dhcp); void get_config(); - void enter_zone(); - void enter_zone_glob(); + void enter_zone(string &cmd); void set_ntp_toggle(); void append_region_zone(string region, string zone, Gtk::ComboBoxText *tmpCbReg, Gtk::ComboBoxText *tmpCbZone); string call(string cmd); @@ -136,8 +171,9 @@ class MainWindow : public Gtk::ApplicationWindow { int check_root(); void gui_exit(); bool gui_exit_2(GdkEventAny* event); - void stop_ntp(); void wind_close_ntp(); + void wrapper_system(string cmd); + void info_status_app(string stule); void wrapper_update_time_date(); string zone_file_read(string zone); void sort_zone(vector *time_reg_map_local,vector *time_reg_map); @@ -145,6 +181,8 @@ class MainWindow : public Gtk::ApplicationWindow { string str_remove(std::string& source, const std::string to_remove); vector split(const std::string &s, char delim); struct Result wrapper_call(string cmd); + bool check_ntp(string &str_ntp); + vector find_all(string &str_ntp, string substr); }; diff --git a/source/ubl-util-standard.c b/source/ubl-util-standard.c new file mode 100644 index 0000000..8cff122 --- /dev/null +++ b/source/ubl-util-standard.c @@ -0,0 +1,69 @@ +#include "ubl-util-standard.h" +#ifndef __cplusplus +#ifndef UBL_GET_STANDARD_UI +#define UBL_GET_STANDARD_UI + + +inline returnstruct *ubl_make_plugs(GtkWidget *LeftWidget, GtkWidget *RightWidget, int left_plug_id, int right_plug_id){ + returnstruct *ret=(returnstruct*)malloc(sizeof(returnstruct*)); + if (left_plug_id>0&&LeftWidget){ + GtkWidget *plug=gtk_plug_new(left_plug_id); + GtkWidget *toplug=LeftWidget; + if (gtk_widget_get_parent(GTK_WIDGET(toplug))){ + g_object_ref(G_OBJECT(toplug)); + GtkWidget *parent=gtk_widget_get_parent(toplug); + gtk_container_remove(GTK_CONTAINER(parent),toplug); + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + } else + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + gtk_widget_show(GTK_WIDGET(plug)); + ret->plugLeft=plug; + } + if (right_plug_id>0&&RightWidget){ + GtkWidget *plug=gtk_plug_new(right_plug_id); + GtkWidget *toplug=RightWidget; + if (gtk_widget_get_parent(GTK_WIDGET(toplug))){ + g_object_ref(G_OBJECT(toplug)); + GtkWidget *parent=gtk_widget_get_parent(toplug); + gtk_container_remove(GTK_CONTAINER(parent),toplug); + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + } else + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + gtk_widget_show(GTK_WIDGET(plug)); + ret->plugRight=plug; + } + return ret; +} + +#endif + +#else + + +inline void ubl_make_plugs(Gtk::Widget *LeftWidget, Gtk::Widget *RightWidget, int left_plug_id, int right_plug_id){ + if (left_plug_id>0&&LeftWidget){ + GtkWidget *plug=gtk_plug_new(left_plug_id); + GtkWidget *toplug=GTK_WIDGET(LeftWidget->gobj()); + if (gtk_widget_get_parent(GTK_WIDGET(toplug))){ + g_object_ref(G_OBJECT(toplug)); + GtkWidget *parent=gtk_widget_get_parent(toplug); + gtk_container_remove(GTK_CONTAINER(parent),toplug); + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + } else + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + gtk_widget_show(GTK_WIDGET(plug)); + } + if (right_plug_id>0&&RightWidget){ + GtkWidget *plug=gtk_plug_new(right_plug_id); + GtkWidget *toplug=GTK_WIDGET(RightWidget->gobj()); + if (gtk_widget_get_parent(GTK_WIDGET(toplug))){ + g_object_ref(G_OBJECT(toplug)); + GtkWidget *parent=gtk_widget_get_parent(toplug); + gtk_container_remove(GTK_CONTAINER(parent),toplug); + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + } else + gtk_container_add(GTK_CONTAINER(plug),GTK_WIDGET(toplug)); + gtk_widget_show(GTK_WIDGET(plug)); + } +} +#endif \ No newline at end of file diff --git a/source/ubl-util-standard.h b/source/ubl-util-standard.h new file mode 100644 index 0000000..3209625 --- /dev/null +++ b/source/ubl-util-standard.h @@ -0,0 +1,20 @@ +#ifndef __cplusplus +#include +#include + +typedef struct { + GtkWidget *plugLeft; + GtkWidget *plugRight; + + +} returnstruct; +static returnstruct *ubl_make_plugs(GtkWidget *LeftWidget, GtkWidget *RightWidget, int left_plug_id, int right_plug_id); +#else +#include +#include +#include +#include + + +static void ubl_make_plugs(Gtk::Widget *LeftWidget, Gtk::Widget *RightWidget, int left_plug_id, int right_plug_id); +#endif \ No newline at end of file diff --git a/style.css b/style.css old mode 100644 new mode 100755 index 88c8a58..d8a3e99 --- a/style.css +++ b/style.css @@ -1,6 +1,16 @@ +.boxInfoMessError{ + background-color: #ea9999; +} .cssboxColor1{ background: url("/usr/share/ubl-settings-datetime/images/bg_top.png") no-repeat; } +.boxInfoMessOK{ + background-color: #f3f0ac; +} .textHead{ text-shadow: 1px 1px #ffffff; } +.textHeaderBar{ + font-weight: bold; +} + diff --git a/ubl-settings-datetime.desktop b/ubl-settings-datetime.desktop old mode 100644 new mode 100755 index 1037bf7..9c4cd2e --- a/ubl-settings-datetime.desktop +++ b/ubl-settings-datetime.desktop @@ -11,4 +11,5 @@ Exec=pkexec ubl-settings-datetime Icon=ubl-settings-datetime Terminal=false X-XfcePluggable=true +X-UBLPluggable=true Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;X-UBL-SettingsManager;X-UBL-SystemSettings; \ No newline at end of file diff --git a/ubl-settings-datetime.glade b/ubl-settings-datetime.glade index ccf56b9..e4f42de 100644 --- a/ubl-settings-datetime.glade +++ b/ubl-settings-datetime.glade @@ -2,6 +2,53 @@ + + False + О Программе + False + True + center + ubl-settings-datetime + dialog + True + ubl-settings-datetime + 1.2 + Copyright © 2023 - UBSoft Software LLC + Setting the date and time + https://ublinux.ru/ + Project Home Page + Это приложение распространяется без каких-либо гарантий. +Подробнее в <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, версии 2 или позднее</a>. + UBGroup + UBGroup + ubl-settings-datetime + True + gpl-2-0 + + + False + vertical + 2 + + + False + end + + + + + + False + False + 0 + + + + + + + + False Внимание! @@ -169,26 +216,208 @@ + + False + + + True + False + 0 + none + + + True + False + 5 + 5 + 5 + 5 + + + True + False + vertical + + + True + True + True + Synopsis + + + False + True + 2 + + + + + True + True + True + About the program + + + False + True + 3 + + + + + + + + + + + + + + False + + + True + False + 0 + none + + + True + False + 5 + 5 + 5 + 5 + + + True + False + vertical + + + True + True + True + Download local + + + False + True + 2 + + + + + True + True + True + Download global + + + False + True + 3 + + + + + + + + + + + + + + False + + + True + False + 0 + none + + + True + False + 5 + 5 + 5 + 5 + + + True + False + vertical + + + True + True + True + Save to global and local configuration + + + False + True + 3 + + + + + True + True + True + Save to local configuration + + + False + True + 4 + + + + + True + True + True + Save to Global configuration + + + False + True + 5 + + + + + + + + + + + + False - Настройки даты и времени - + True False vertical - + True False vertical - + True False - - 90 + True False 5 @@ -197,8 +426,7 @@ 5 6 6 - 69 - ubl-settings-datetime + gtk-missing-image False @@ -207,9 +435,63 @@ - + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + + + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + vertical + + True False + + + 90 + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 69 + ubl-settings-datetime + + + False + True + 0 + + True @@ -218,63 +500,74 @@ True False - vertical - - 255 + True False - Date and time settings - - - - - - + vertical + + + 255 + True + False + Date and time settings + + + + + + + + + True + True + 0 + + - True + False True 0 - False + True True 0 + + + True + False + + + False + True + 1 + + True True - 0 - - - - - True - False - - - False - True 1 - True + False True - 1 + 0 False True - 0 + 1 @@ -283,397 +576,247 @@ False vertical - + True False - 5 - 5 - 5 - 5 - 0.019999999552965164 - in + vertical - + True False 5 + 5 5 - 5 - vertical + 5 + 0.019999999552965164 + in True False + 5 + 5 + 5 + vertical - - 0 + True False - 5 - 5 - 5 - 5 - 6 - 6 - Time - True - 0 - - - False - True - 0 - - - - - True - True - 5 - 5 - 5 - 5 - 6 - 6 - 2 - 0.099999999776482579 - True - - - False - True - 1 - - - - - True - False - : - - - False - True - 2 - - - - - True - True - 5 - 5 - 5 - 5 - 6 - 6 - 2 - True - - - False - True - 3 - - - - - 20 - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Date - True - 0 - - - False - True - 4 - - - - - 191 - True - True - Date -Format: DD.MM.YYYY - 5 - 5 - 5 - 5 - 6 - 6 - - - False - True - 5 - - - - - True - True - True - Интерактивный выбор даты - 5 - 5 - 5 - 5 - 6 - 6 - + + 0 True False - x-office-calendar + 5 + 5 + 5 + 5 + 6 + 6 + Time + True + 0 + + False + True + 0 + - - - False - True - 6 - - - - - False - True - 1 - - - - - True - False - - - True - True - True - 5 - 8 - 5 - 5 - 6 - 6 - + True - False - center - center - - - True - False - 5 - 5 - 5 - 5 - media-playlist-repeat - - - False - True - 0 - - - - - True - False - center - center - Sync by - - - False - True - 1 - - + True + 5 + 5 + 5 + 5 + 6 + 6 + 2 + 0.099999999776482579 + True + + False + True + 1 + - - - False - True - 0 - - - - - True - False - - - False - True - 1 - - - - - True - False - - - False - True - 2 - - - - - True - True - True - 5 - 8 - 5 - 10 - 6 - 6 - + True False - center - center - Synchronize hardware time + : + + False + True + 2 + - - - True - True - 3 - - - - - False - True - 3 - - - - - True - False - 5 - 10 - 5 - 10 - 6 - 0.019999999552965164 - in - - - True - False - + True - False + True + 5 + 5 + 5 + 5 + 6 + 6 + 2 + True False True - 1 + 3 - + + 20 True False - 8 + 5 5 - 8 + 5 5 6 - 13 - Region + 6 + Date + True 0 False True - 2 + 4 - + + -1 True - False + True + Date +Format: DD.MM.YYYY 5 5 5 5 6 - 13 + 6 - False + True True - 3 + 5 - + True - False - 10 - 5 - 10 - 5 + True + True + Интерактивный выбор даты + 5 + 10 + 5 + 10 6 - 13 - Area - 0 + 6 + + + True + False + x-office-calendar + + False True - 4 + 6 + + + False + True + 1 + + + + + True + False - + True - False - 5 + True + True + 7 5 - 5 + 7 5 6 - 13 + 6 + + + True + False + center + center + + + True + False + 5 + 5 + 5 + 5 + media-playlist-repeat + + + False + True + 0 + + + + + True + False + center + center + Sync by + + + False + True + 1 + + + + False True - 5 + 0 - 5 True False False True - 6 + 1 @@ -684,53 +827,160 @@ Format: DD.MM.YYYY False True - 7 + 2 + + + + + True + True + True + 5 + 10 + 5 + 10 + 6 + 6 + + + True + False + center + center + Synchronize hardware time + + + + + True + True + 3 - - - - True - False - Time Zone - + + False + True + 3 + - - False - True - 5 - + + + + True + False + Current date and time + + + False + True + 0 + - - + + + False + True + 1 + + + + + True + False + vertical + + True False - Local Configuration + 5 + 5 + 5 + 5 + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 + vertical + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + + + False + True + 1 + + + + + -1 + True + True + Enter the name of the ntp server or its ip address. When entering multiple addresses, separate them with spaces. + center + 5 + 10 + 5 + 10 + 6 + 6 + + + True + True + 3 + + + + + False + True + 1 + + + + + + + True + False + Synchronize via NTP: + + + + False + True + 0 + False True - 0 + 2 - - - False - True - 1 - - - - - True - False - vertical True @@ -739,28 +989,56 @@ Format: DD.MM.YYYY 5 5 5 + 5 0.019999999552965164 in True False - 5 - 5 - 5 vertical - + True False - start - 5 - 5 - 5 - 5 - 6 - 6 - Synchronize via NTP: + + + True + False + start + 8 + 31 + 8 + 31 + 6 + 13 + Synchronize hardware time: + + + False + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 10 + False + False + + + False + True + 1 + + False @@ -773,7 +1051,37 @@ Format: DD.MM.YYYY True False - + + True + False + + + False + True + 1 + + + + + True + False + 8 + 5 + 8 + 5 + 6 + 6 + Region + 0 + + + False + True + 2 + + + + True False 5 @@ -781,187 +1089,98 @@ Format: DD.MM.YYYY 5 5 6 - 5 + 10 + False + False False True - 1 + 3 - - -1 + True - True - Enter the name of the ntp server or its ip address. When entering multiple addresses, separate them with spaces. - center + False + 10 + 5 + 10 + 5 + 6 + 13 + Area + 0 + + + False + True + 4 + + + + + True + False 5 - 10 + 5 5 - 10 + 5 6 - 5 + 10 + False + False - True + False True - 3 + 5 - - - False - True - 1 - - - - - True - False - 5 - 10 - 5 - 10 - 6 - 0.019999999552965164 - in - + + 5 True False - - - True - False - - - False - True - 1 - - - - - True - False - 8 - 5 - 8 - 5 - 6 - 13 - Region - 0 - - - False - True - 2 - - - - - True - False - 5 - 5 - 5 - 5 - 6 - 13 - - - False - True - 3 - - - - - True - False - 10 - 5 - 10 - 5 - 5 - 13 - Area - 0 - - - False - True - 4 - - - - - True - False - 5 - 5 - 5 - 5 - 6 - 13 - - - False - True - 5 - - - - - 5 - True - False - 15 - 5 - 15 - 5 - 5 - 5 - - - False - True - 6 - - + + False + True + 6 + - - + + True False - Часовой пояс + + False + True + 7 + False True - 2 + 1 - + True False - Global customization + Time Zone False True - 0 + 3 @@ -980,114 +1199,65 @@ Format: DD.MM.YYYY - - - 240 - 185 - False - btnChooseDate - bottom - none - - - True - True - 10 - 10 - 10 - 10 - 10 - 10 - 2023 - 1 - 10 - - - - - False - - + + True False - vertical + True + + + True + False + 5 + 5 + 5 + 5 + 2 + False + ubl-settings-datetime + + + + + - + True False - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - 50 - emblem-important - - - False - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Active service detected -Automatic time and date synchronization service detected - - - True - True - 1 - - + 5 + 5 + 5 + 5 + 32 + ubl-settings-datetime - - True - True - 0 - - + True False - + True True + False True - 5 - 5 - 5 - 5 - 6 - 6 + True + none + popDownloadMenu True False - + True False 5 5 5 5 - media-playback-stop + Download False @@ -1096,50 +1266,54 @@ Automatic time and date synchronization service detected - - True - False - Stop the synchronization service - - - False - True - 1 - + - True + False True 0 + + + + 1 + + + + + True + False - + True True + False True - 5 - 5 - 5 - 5 - 6 - 6 + True + none + popSaveMenu True False - + True False - 6 + 5 5 5 5 - window-close + Save + False @@ -1148,34 +1322,69 @@ Automatic time and date synchronization service detected - - True - False - Close - - - False - True - 1 - + - True + False + True + 0 + + + + + True + True + False + True + True + none + popAbout + + + + + + False True 1 + - False - True - 1 + end + 3 + + 240 + 185 + False + btnChooseDate + bottom + none + + + True + True + 10 + 10 + 10 + 10 + 10 + 10 + 2023 + 1 + 10 + + + diff --git a/ubl-settings-datetime.png b/ubl-settings-datetime.png old mode 100644 new mode 100755 diff --git a/ubl-settings-datetime.svg b/ubl-settings-datetime.svg old mode 100644 new mode 100755 diff --git a/ubl-settings-datetime_ru.po b/ubl-settings-datetime_ru.po old mode 100644 new mode 100755 index e6017e0..25c7331 --- a/ubl-settings-datetime_ru.po +++ b/ubl-settings-datetime_ru.po @@ -16,12 +16,27 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +msgid "Select the method of hardware time synchronization" +msgstr "Выберите способ синхронизации аппаратного времени" + +msgid "Local time" +msgstr "Локальное время" + +msgid "UTC time" +msgstr "Время по UTC" + +msgid "Synchronize hardware time:" +msgstr "Синхронизировать аппаратное время:" + msgid "An invalid character is entered" msgstr "Введён недопустимый символ" msgid "Longyearbyen" msgstr "Лонгйир" +msgid "Error in the ntp name" +msgstr "Ошибка в имени ntp" + msgid "Stop the synchronization service" msgstr "Остановить сервис синхронизации" @@ -46,11 +61,20 @@ msgstr "Введите DHCP!" msgid "OK" msgstr "OK" +msgid "Setting the date and time" +msgstr "Настройка даты времени" + +msgid "Successfully saved local and global configuration" +msgstr "Успешно сохранена локальная и глобальная конфигурация" + +msgid "Error saved local and global configuration" +msgstr "Ошибка сохранена локальной и глобальной конфигурации" + msgid "Settings the date and time" msgstr "Настройки даты и времени" -msgid "Local Configuration" -msgstr "Локальная настройка" +msgid "Current date and time" +msgstr "Текущие дата и время" msgid "Global customization" msgstr "Глобальная настройка" @@ -1633,9 +1657,132 @@ msgstr " --lock-update Отключить сохранение измене msgid "Options:\n" msgstr "Опции:\n" +msgid "Save" +msgstr "Сохранить" + +msgid "Save to global and local configuration" +msgstr "Сохранить в глобальную и локальную конфигурацию" + +msgid "Save to Global configuration" +msgstr "Сохранить в глобальную конфигурацию" + +msgid "Save to local configuration" +msgstr "Сохранить в локальную конфигурацию" + +msgid "Download global" +msgstr "Загрузить глобально" + +msgid "Download local" +msgstr "Загрузить локально" + msgid "Disabled" msgstr "Отключено" +msgid "Download" +msgstr "Загрузить" + msgid "Argument not recognized\n" -msgstr "Не распознанный аргумент\n" +msgstr "Нepacпoзнaнный аргумент\n" + +msgid "La_Rioja" +msgstr "Риоха" + +msgid "Rio_Gallegos" +msgstr "Рио-Гальегос" + +msgid "Salta" +msgstr "Сальта" + +msgid "San_Juan" +msgstr "Сан-Хуан" + +msgid "San_Luis" +msgstr "Сан-Луис" + +msgid "Tucuman" +msgstr "Тукуман" + +msgid "Ushuaia" +msgstr "Ушуая" + +msgid "Knox" +msgstr "Ноксвилл" + +msgid "Marengo" +msgstr "Маренго" + +msgid "Petersburg" +msgstr "Петербург" + +msgid "Tell_City" +msgstr "Телл-Сити" + +msgid "Vevay" +msgstr "Вевей" + +msgid "Vincennes" +msgstr "Венсен" + +msgid "Winamac" +msgstr "Винамаке" + +msgid "Project Home Page" +msgstr "Домашняя страница проекта" + +msgid "ComodRivadavia" +msgstr "Комодоро-Ривадавия" + +msgid "Monticello" +msgstr "Монтиселло" + +msgid "Beulah" +msgstr "Беула" + +msgid "Center" +msgstr "Центр" + +msgid "New_Salem" +msgstr "Нью-Салем" + +msgid "Windhoek" +msgstr "Виндхук" + +msgid "Iqaluit" +msgstr "Икалуит" + +msgid "EasterIsland" +msgstr "Остров Пасхи" + +msgid "Andorra" +msgstr "Андорра" + +msgid "About the program" +msgstr "О программе" + +msgid "Synopsis" +msgstr "Справка" + +msgid "Local configuration reading error" +msgstr "Ошибка чтения локальной конфигурации" + +msgid "Local configuration write error" +msgstr "Ошибка записи локальной конфигурации" + +msgid "Global configuration read error" +msgstr "Ошибка чтения глобальной конфигурации" + +msgid "Global configuration write error" +msgstr "Ошибка записи глобальной конфигурации" + +msgid "Local configuration downloaded successfully" +msgstr "Успешно загружена локальная конфигурация" + +msgid "Global configuration downloaded successfully" +msgstr "Успешно загружена глобальная конфигурация" + +msgid "Global configuration successfully written" +msgstr "Успешно записана глобальная конфигурация" + +msgid "Local configuration successfully written" +msgstr "Успешно записана локальная конфигурация" diff --git a/warning.svg b/warning.svg new file mode 100755 index 0000000..9a90dba --- /dev/null +++ b/warning.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + +