From 20ec428af7639eb527464aa05e2f3d0d204cc38d Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Wed, 15 Mar 2023 09:14:44 +0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B2=20=D0=B8=D0=BC=D0=B5=D0=BD=D0=B0=D1=85=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD=D1=8B=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- #ubl-settings-datetime.glade# | 1350 +++++++++++++++++++++++++++++++ source/ubl-settings-datetime.cc | 53 +- source/ubl-settings-datetime.h | 18 +- ubl-settings-datetime.glade | 17 +- ubl-settings-datetime_ru.po | 2 +- 5 files changed, 1395 insertions(+), 45 deletions(-) create mode 100644 #ubl-settings-datetime.glade# diff --git a/#ubl-settings-datetime.glade# b/#ubl-settings-datetime.glade# new file mode 100644 index 0000000..104ec18 --- /dev/null +++ b/#ubl-settings-datetime.glade# @@ -0,0 +1,1350 @@ + + + + + + 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 + + + + + + + + + + True + False + False + False + 4 + + + True + False + Load global configuration + + + + + + True + False + Load local configuration + + + + + + True + False + False + False + 4 + + + True + False + Help + + + + + + True + False + About + + + + + + True + False + False + False + 4 + + + True + False + Save to global and local configuration + + + + + + True + False + Save global configuration + + + + + + True + False + Save local configuration + + + + + + False + + + True + False + vertical + + + True + False + vertical + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + checked + + + False + True + 0 + + + + + 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 + False + + + True + False + + + True + False + vertical + + + 255 + True + False + Date and time settings + + + + + + + + + True + True + 0 + + + + + False + True + 0 + + + + + True + True + 0 + + + + + True + False + + + False + True + 1 + + + + + True + True + 1 + + + + + False + True + 0 + + + + + False + True + 1 + + + + + True + False + vertical + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 + vertical + + + True + False + + + 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 + + + + + -1 + True + True + Date +Format: DD.MM.YYYY + 5 + 5 + 5 + 5 + 6 + 6 + + + False + True + 5 + + + + + True + True + True + Интерактивный выбор даты + 5 + 10 + 5 + 10 + 6 + 6 + + + True + False + x-office-calendar + + + + + False + True + 6 + + + + + False + True + 1 + + + + + True + False + + + True + True + True + 7 + 5 + 7 + 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 + True + 0 + + + + + True + False + + + False + True + 1 + + + + + True + False + + + False + True + 2 + + + + + True + True + True + 5 + 10 + 5 + 10 + 6 + 6 + + + True + False + center + center + Synchronize hardware time + + + + + True + True + 3 + + + + + False + True + 3 + + + + + + + True + False + Current date and time + + + + + False + True + 0 + + + + + False + True + 1 + + + + + True + False + vertical + + + True + False + 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 + + + + + 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 + 2 + + + + + True + False + 5 + 5 + 5 + 5 + 5 + 0.019999999552965164 + in + + + True + False + vertical + + + True + False + + + True + False + start + 8 + 5 + 8 + 5 + 6 + 13 + Synchronize hardware time: + + + True + True + 0 + + + + + True + False + 55 + + + False + True + 1 + + + + + True + False + 10 + 5 + 5 + 10 + 6 + 10 + False + False + + + True + True + 2 + + + + + False + True + 0 + + + + + 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 + 10 + False + False + + + True + True + 3 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 13 + Area + 0 + + + False + True + 4 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 10 + False + False + + + True + True + 5 + + + + + 5 + True + False + + + False + True + 6 + + + + + True + False + + + False + True + 7 + + + + + False + True + 1 + + + + + + + True + False + Time Zone + + + + + False + True + 3 + + + + + False + True + 2 + + + + + False + True + 0 + + + + + + + True + False + True + + + True + False + start + 5 + 5 + 5 + 5 + 1 + False + ubl-settings-datetime + + + + + + + + True + False + 5 + 5 + 5 + 5 + 32 + ubl-settings-datetime + + + + + True + False + + + True + True + False + True + True + menu + none + + + True + False + + + True + False + 5 + 5 + 5 + 5 + Load + + + False + True + 0 + + + + + True + False + pan-down-symbolic + + + False + True + 1 + + + + + + + False + True + 0 + + + + + 1 + + + + + True + False + + + True + True + False + True + True + menu2 + none + + + True + False + + + True + False + 5 + 5 + 5 + 5 + Save + + + + False + True + 0 + + + + + True + False + pan-down-symbolic + + + False + True + 1 + + + + + + + False + True + 0 + + + + + True + True + False + True + True + menu1 + none + + + True + False + open-menu-symbolic + + + + + False + True + 1 + + + + + end + 3 + + + + + + + both + True + + + + + + + both + True + + + + + + + both + True + + + + + + + 240 + 185 + False + btnChooseDate + bottom + none + + + True + True + 10 + 10 + 10 + 10 + 10 + 10 + 2023 + 1 + 10 + + + + + False + Внимание! + dialog + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + + + True + False + 5 + 5 + 5 + 6 + 6 + 50 + gtk-dialog-warning + + + True + True + 0 + + + + + 160 + True + False + start + center + 6 + 6 + Enter DHCP ! + + + True + True + 1 + + + + + False + True + 1 + + + + + OK + True + True + True + 5 + 5 + 5 + 5 + 3 + 3 + + + False + True + 1 + + + + + + + False + popup + Внимание! + center + dialog + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + + + True + False + 5 + 5 + 5 + 6 + 6 + 50 + gtk-dialog-warning + + + True + True + 0 + + + + + 160 + True + False + start + center + 5 + 5 + 5 + 5 + 6 + 6 + Enter DHCP ! + + + True + True + 1 + + + + + False + True + 1 + + + + + OK + True + True + True + 5 + 5 + 5 + 5 + 3 + 3 + + + False + True + 1 + + + + + + diff --git a/source/ubl-settings-datetime.cc b/source/ubl-settings-datetime.cc index f9c5ef9..9547664 100644 --- a/source/ubl-settings-datetime.cc +++ b/source/ubl-settings-datetime.cc @@ -98,14 +98,14 @@ void MainWindow::settings() { btnBoxAboutDialog->set_visible(false); this->event(); this->parse_text_date(); - this->download_local_cfg(); + this->load_local_cfg(); } else { lblHW->set_sensitive(false); cbHw->set_sensitive(false); boxButton->set_sensitive(false); boxSave->set_sensitive(false); - btnDownload->set_sensitive(false); + btnLoad->set_sensitive(false); numTimeHrs->set_sensitive(false); numTimeMin->set_sensitive(false); lblTime->set_sensitive(false); @@ -135,7 +135,7 @@ void MainWindow::settings() { int MainWindow::check_root() { if (geteuid() != 0) { lblMessageSudo->set_text(_("The program must be run as root")); - mess_sudo->show(); + windowMessSudo->show(); return 1; } return 0; @@ -152,7 +152,7 @@ void MainWindow::lacalization() { aboutWindows->set_version(_(version_application.c_str())); aboutWindows->set_website_label(_("Project Home Page")); lblSave->set_label(_("Save")); - lblDownload->set_label(_("Download")); + lblLoad->set_label(_("Load")); 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:")); @@ -169,8 +169,8 @@ void MainWindow::lacalization() { lblZone->set_text(_("Zone")); lblSynchronizeBtn->set_text(_("Sync by")); lblHeader->set_text(_("ubl-settings-datetime")); - mess_sudo->set_title(_("Warning!")); - mess_dchp->set_title(_("Warning!")); + windowMessSudo->set_title(_("Warning!")); + windowMessDchp->set_title(_("Warning!")); lblTimeBios->set_text(_("Synchronize hardware time")); lblHW->set_text(_("Synchronize hardware time:")); cbHw->append(_("Local time")); @@ -202,7 +202,7 @@ void MainWindow::flag_block_gui() { txtNtpServer->set_sensitive(false); } if (flag_load_global == true) { - btnDonwlolGlob->set_sensitive(false); + btnLoadGlob->set_sensitive(false); } if (flag_save == true) { btnSave->set_sensitive(false); @@ -255,7 +255,7 @@ void MainWindow::get_builder() { builder->get_widget("cbZone", cbZone); builder->get_widget("txtNtpServer", txtNtpServer); builder->get_widget("cldrDate", cldrDate); - builder->get_widget("mess_dchp", mess_dchp); + builder->get_widget("windowMessDchp", windowMessDchp); builder->get_widget("lblMessage", lblMessage); builder->get_widget("lblDateTimeSetting", lblDateTimeSetting); builder->get_widget("lblHead", lblHead); @@ -268,11 +268,11 @@ void MainWindow::get_builder() { builder->get_widget("lblSynchronizeBtn", lblSynchronizeBtn); builder->get_widget("lblTimeBios", lblTimeBios); builder->get_widget("btnHardwareTime",btnHardwareTime); - builder->get_widget("mess_sudo",mess_sudo); + builder->get_widget("windowMessSudo",windowMessSudo); builder->get_widget("lblMessageSudo", lblMessageSudo); builder->get_widget("btnMessCloseSudo",btnMessCloseSudo); builder->get_widget("lblSave", lblSave); - builder->get_widget("lblDownload", lblDownload); + builder->get_widget("lblLoad", lblLoad); builder->get_widget("aboutWindows", aboutWindows); builder->get_widget("btnBoxAboutDialog", btnBoxAboutDialog); builder->get_widget("boxInfoError", boxInfoError); @@ -280,11 +280,11 @@ void MainWindow::get_builder() { builder->get_widget("imgInfo", imgInfo); builder->get_widget("btnSave", btnSave); builder->get_widget("btnSettings", btnSettings); - builder->get_widget("btnDownload", btnDownload); + builder->get_widget("btnLoad", btnLoad); builder->get_widget("btnSynopsis", btnSynopsis); builder->get_widget("btnAbout", btnAbout); - builder->get_widget("btnDonwlodLocal", btnDonwlodLocal); - builder->get_widget("btnDonwlolGlob", btnDonwlolGlob); + builder->get_widget("btnLoadLocal", btnLoadLocal); + builder->get_widget("btnLoadGlob", btnLoadGlob); builder->get_widget("btnSaveLocalGlob", btnSaveLocalGlob); builder->get_widget("btnSaveLocal", btnSaveLocal); builder->get_widget("btnSaveGlob", btnSaveGlob); @@ -299,8 +299,7 @@ void MainWindow::get_builder() { builder->get_widget("standartHead", standartHead); builder->get_widget("plugBox", plugBox); builder->get_widget("window" ,window); - builder->get_widget("imgDonwload", imgDonwload); - builder->get_widget("imgDonwload", imgDonwload); + builder->get_widget("imgLoad", imgLoad); builder->get_widget("imgSettings", imgSettings); builder->get_widget("imgSave", imgSave); } @@ -326,11 +325,11 @@ void MainWindow::event() { cbDhcp->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::event_entry_cbDhcp)); cbRegion->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::append_zone)); 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)); + windowMessSudo->signal_delete_event().connect(sigc::mem_fun(*this, &MainWindow::gui_exit_2)); btnAbout->signal_activate().connect([&]() {aboutWindows->show();}); btnSynopsis->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::synopsis_show)); - btnDonwlodLocal->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::download_local_cfg)); - btnDonwlolGlob->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::download_globl_cfg)); + btnLoadLocal->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::load_local_cfg)); + btnLoadGlob->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::load_globl_cfg)); btnSaveLocalGlob->signal_activate().connect([&]() {save_global_local_cfg();}); btnSaveLocal->signal_activate().connect([&]() {save_local_cfg();}); btnSaveGlob->signal_activate().connect([&]() {save_global_cfg();}); @@ -345,7 +344,7 @@ void MainWindow::synopsis_show() { } } -void MainWindow::download_local_cfg() { +void MainWindow::load_local_cfg() { string cmd = "/usr/bin/ubconfig --default --source system get clock ZONE"; this->fill_in_reg_zone(cmd); this->update_hour_minute(); @@ -359,7 +358,7 @@ void MainWindow::download_local_cfg() { info_warning_error(0); } -void MainWindow::download_globl_cfg() { +void MainWindow::load_globl_cfg() { string cmd_get_dhcp = "/usr/bin/ubconfig --default --source 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); @@ -555,13 +554,13 @@ void MainWindow::hardware_clock() { } void MainWindow::gui_mess_close() { - mess_dchp->hide(); + windowMessDchp->hide(); } bool MainWindow::focus_ntp(string &cmd_set_ntp) { if (txtNtpServer->get_text() == "" || txtNtpServer->get_text() == " ") { lblMessage->set_text(_("Enter DHCP!")); - mess_dchp->show(); + windowMessDchp->show(); } else { string cmd = ""; @@ -587,11 +586,11 @@ bool MainWindow::focus_ntp(string &cmd_set_ntp) { else { if (flag_error == true) { lblMessage->set_text(_("An invalid character is entered")); - mess_dchp->show(); + windowMessDchp->show(); } else if (flag_error_check_ntp == true) { lblMessage->set_text(_("Error in the ntp name")); - mess_dchp->show(); + windowMessDchp->show(); } } } @@ -789,7 +788,7 @@ void MainWindow::entry_dhcp_mess(string cmd_get_dhcp, string cmd_default_get_dhc btnUpdateDateTime->set_sensitive(false); if (str_dhcp == "") { lblMessage->set_text(_("Enter DHCP!")); - mess_dchp->show(); + windowMessDchp->show(); } else if (str_dhcp == "(null)") { cbDhcp->set_active(0); @@ -1124,12 +1123,12 @@ void MainWindow::post_entry_data() { size_t index = str_error_clock.find("date:"); if (index != std::string::npos) { lblMessage->set_text(_("Incorrect date format")); - mess_dchp->show(); + windowMessDchp->show(); } } else { lblMessage->set_text(_("Incorrect date format")); - mess_dchp->show(); + windowMessDchp->show(); } } diff --git a/source/ubl-settings-datetime.h b/source/ubl-settings-datetime.h index f35ccef..dd466a6 100755 --- a/source/ubl-settings-datetime.h +++ b/source/ubl-settings-datetime.h @@ -60,8 +60,8 @@ class MainWindow : public Gtk::ApplicationWindow { Gtk::Box *boxColor; Gtk::ComboBoxText *cbRegion; Gtk::ComboBoxText *cbZone; - Gtk::Window *mess_dchp; - Gtk::Window *mess_sudo; + Gtk::Window *windowMessDchp; + Gtk::Window *windowMessSudo; Gtk::Popover *popCalendar; Gtk::Calendar *cldrDate; Gtk::Label *lblMessage; @@ -78,12 +78,12 @@ class MainWindow : public Gtk::ApplicationWindow { Gtk::Label *lblSynchronizeBtn; Gtk::Label *lblTimeBios; Gtk::Label *lblSave; - Gtk::Label *lblDownload; + Gtk::Label *lblLoad; Gtk::Button *btnHardwareTime; Gtk::CheckButton *cbxSynchronizeNtp; Gtk::Entry *txtNtpServer; Gtk::Entry *txtDate; - Gtk::Button *btnDownload; + Gtk::Button *btnLoad; Gtk::Button *btnSave; Gtk::Button *btnSettings; Gtk::AboutDialog *aboutWindows; @@ -97,8 +97,8 @@ class MainWindow : public Gtk::ApplicationWindow { Gtk::MenuItem *btnSaveLocalGlob; Gtk::MenuItem *btnSaveLocal; Gtk::MenuItem *btnSaveGlob; - Gtk::MenuItem *btnDonwlolGlob; - Gtk::MenuItem *btnDonwlodLocal; + Gtk::MenuItem *btnLoadGlob; + Gtk::MenuItem *btnLoadLocal; Gtk::MenuItem *btnAbout; Gtk::MenuItem *btnSynopsis; Gtk::HeaderBar *headerBar; @@ -111,7 +111,7 @@ class MainWindow : public Gtk::ApplicationWindow { Gtk::Widget *standartHead; Gtk::Widget *plugBox; Gtk::Window *window; - Gtk::Image *imgDonwload; + Gtk::Image *imgLoad; Gtk::Image *imgSave; Gtk::Image *imgSettings; @@ -147,11 +147,11 @@ class MainWindow : public Gtk::ApplicationWindow { void entry_hardware_clock_default(string &cmd_default); void save_global_local_cfg(); void fill_in_reg_zone(string &cmd); - void download_globl_cfg(); + void load_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 load_local_cfg(); void post_entry_data(); void lacalization(); void settings(); diff --git a/ubl-settings-datetime.glade b/ubl-settings-datetime.glade index 9db607c..209863f 100644 --- a/ubl-settings-datetime.glade +++ b/ubl-settings-datetime.glade @@ -56,7 +56,7 @@ False 4 - + True False Load global configuration @@ -66,7 +66,7 @@ - + True False Load local configuration @@ -989,7 +989,7 @@ Format: DD.MM.YYYY True False - + True True False @@ -1002,14 +1002,14 @@ Format: DD.MM.YYYY True False - + True False 5 5 5 5 - Download + Load False @@ -1018,7 +1018,7 @@ Format: DD.MM.YYYY - + True False pan-down-symbolic @@ -1179,7 +1179,7 @@ Format: DD.MM.YYYY - + False Внимание! dialog @@ -1260,8 +1260,9 @@ Format: DD.MM.YYYY - + False + popup Внимание! center dialog diff --git a/ubl-settings-datetime_ru.po b/ubl-settings-datetime_ru.po index d423663..7472b4e 100644 --- a/ubl-settings-datetime_ru.po +++ b/ubl-settings-datetime_ru.po @@ -1687,7 +1687,7 @@ msgstr "Загрузить локальную конфигурацию" msgid "Disabled" msgstr "Отключено" -msgid "Download" +msgid "Load" msgstr "Загрузить" msgid "Argument not recognized\n"