From 0f6c42dc90645d71feb76f24b9fc167c193e2580 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Tue, 21 Feb 2023 09:30:18 +0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D1=91=D0=BD=20?= =?UTF-8?q?=D0=B4=D0=B8=D0=B7=D0=B0=D0=B9=D0=BD=20=D0=BA=D0=BD=D0=BE=D0=BF?= =?UTF-8?q?=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-datetime.cc | 44 +- source/ubl-settings-datetime.h | 2 + ubl-settings-datetime.glade | 1094 ++++++++++++++++--------------- ubl-settings-datetime_ru.po | 65 ++ 4 files changed, 673 insertions(+), 532 deletions(-) diff --git a/source/ubl-settings-datetime.cc b/source/ubl-settings-datetime.cc index 8a05a04..36a39f7 100644 --- a/source/ubl-settings-datetime.cc +++ b/source/ubl-settings-datetime.cc @@ -56,15 +56,15 @@ void MainWindow::settings(){ Gtk::Widget *plugBox; Gtk::Window *window; Gtk::Widget *boxButton; - Gtk::Widget *btnSave; + 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("btnSave",btnSave); + builder->get_widget("boxSave",boxSave); - ubl_make_plugs(boxButton,btnSave, socket_ext_id_I, socket_trd_id_I); + ubl_make_plugs(boxButton,boxSave, socket_ext_id_I, socket_trd_id_I); year=0, month=0, day=0; this->get_builder(); this->lacalization(); @@ -79,8 +79,7 @@ void MainWindow::settings(){ this->event(); this->parse_text_date(); btnSaveGlobl->set_sensitive(false); - this->download_local_cfg(); - + this->download_local_cfg(); } else{ btnSaveLocal->set_sensitive(false); @@ -106,8 +105,20 @@ void MainWindow::settings(){ lblDateTimeSetting->set_sensitive(false); btnBoxAboutDialog->set_visible(false); this->event(); + } + //popCalendar->show_all(); + +} + +bool MainWindow::gui_set_orientation(GdkEventConfigure* event){ + if (event){} + //int w; + //w = this->get_width(); + //popWarning->set_default_widget(w); + return false; + } int MainWindow::check_root(){ @@ -248,7 +259,8 @@ void MainWindow::get_builder(){ builder->get_widget("btnSettings", btnSettings); builder->get_widget("aboutWindows", aboutWindows); builder->get_widget("btnBoxAboutDialog", btnBoxAboutDialog); - //builder->get_widget("cbxSynchronizeNtp",cbxSynchronizeNtp); + + this->add_CSS(); } void MainWindow::gui_exit(){ @@ -279,6 +291,7 @@ void MainWindow::event(){ btnSaveGlobl->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::save_global_cfg)); btnDownloadlocal->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::download_local_cfg)); btnSettings->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::about_Dialog_show)); + signal_configure_event().connect(sigc::mem_fun(*this, &MainWindow::gui_set_orientation), false); } void MainWindow::about_Dialog_show(){ @@ -975,9 +988,24 @@ void MainWindow::read_file(){ 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; + 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 index fea3c82..322d986 100644 --- a/source/ubl-settings-datetime.h +++ b/source/ubl-settings-datetime.h @@ -88,6 +88,7 @@ class MainWindow : public Gtk::ApplicationWindow { Gtk::Widget *btnDownload; Gtk::MenuItem *btnSaveLocal; Gtk::MenuItem *btnSaveGlobl; + Gtk::MenuItem *btnDownloadGlobal; Gtk::MenuItem *btnDownloadlocal; @@ -162,6 +163,7 @@ class MainWindow : public Gtk::ApplicationWindow { void stop_ntp(); void wind_close_ntp(); void wrapper_update_time_date(); + bool gui_set_orientation(GdkEventConfigure* event); string zone_file_read(string zone); void sort_zone(vector *time_reg_map_local,vector *time_reg_map); array split_region_zone(string read_reg_zon_cfg); diff --git a/ubl-settings-datetime.glade b/ubl-settings-datetime.glade index 39e93de..e4945fe 100644 --- a/ubl-settings-datetime.glade +++ b/ubl-settings-datetime.glade @@ -2,6 +2,16 @@ + + True + False + start + True + vertical + + + + False О Программе @@ -83,43 +93,43 @@ False - + True False - vertical - + True False vertical - + True False + vertical - - 90 - True - False - 5 - 5 - 5 - 5 - 6 - 6 - 69 - ubl-settings-datetime - - - False - True - 0 - - - - + True False + + + 90 + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 69 + ubl-settings-datetime + + + False + True + 0 + + True @@ -128,56 +138,67 @@ 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 @@ -187,256 +208,178 @@ 0 - - - False - True - 0 - - - - - True - False - vertical True 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 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + 2 + 0.099999999776482579 + True + + + False + True + 1 + - - - False - True - 6 - - - - - False - True - 1 - - - - - True - False - - - True - True - True - 5 - 5 - 5 - 5 - 6 - 6 - + True False - center - center + : + + + 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 True False - 5 - 5 - 5 - 5 - media-playlist-repeat - - - False - True - 0 - - - - - True - False - center - center - Sync by + x-office-calendar - - False - True - 1 - + + False + True + 6 + - - False - True - 0 - - - - - True - False - False True @@ -444,110 +387,208 @@ Format: DD.MM.YYYY - + True False - - - False - True - 2 - - - - - True - True - True - 5 - 10 - 5 - 10 - 6 - 6 - + + True + True + True + 5 + 5 + 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 + + + + + + + False + True + 0 + + + + True False - center - center - Synchronize hardware time + + 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 + - True + False True 3 - - False - True - 3 - + + + + True + False + Current date and time + - - - - True - False - Current date and time - + + False + True + 0 + False True - 0 + 1 - - - False - True - 1 - - - - - True - 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 - + True False - 5 - 5 - 5 - 5 - 6 - 5 + + + True + False + 5 + 5 + 5 + 5 + 6 + 5 + + + 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 + 5 + + + True + True + 3 + + False @@ -555,26 +596,48 @@ Format: DD.MM.YYYY 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 - 5 - - - True - True - 3 - - + + + + + True + False + Synchronize via NTP: + + + + + False + True + 0 + + + + + False + True + 2 + + + + + True + False + 5 + 10 + 5 + 10 + 6 + 0.019999999552965164 + in + + + True + False + + + True + False False @@ -582,76 +645,170 @@ Format: DD.MM.YYYY 1 + + + True + False + 8 + 5 + 8 + 5 + 6 + 13 + Region + 0 + + + False + True + 2 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 13 + False + False + + + False + True + 3 + + + + + True + False + 10 + 5 + 10 + 5 + 6 + 13 + Area + 0 + + + False + True + 4 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 13 + False + False + + + False + True + 5 + + + + + 5 + True + False + + + False + True + 6 + + + + + True + False + + + False + True + 7 + + - + True False - Synchronize via NTP: + Time Zone False True - 0 + 3 False True - 2 + 1 + + + -1 + + + + + + + True + False + True + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + ubl-settings-datetime + + + + + True + False - + True - False - 5 - 10 - 5 - 10 - 6 - 0.019999999552965164 - in + True + False + True + menu1 True False - - True - False - - - False - True - 1 - - - - - True - False - 8 - 5 - 8 - 5 - 6 - 13 - Region - 0 - - - False - True - 2 - - - - + True False 5 @@ -659,35 +816,17 @@ Format: DD.MM.YYYY 5 5 6 - 13 - - - False - True - 3 - - - - - True - False - 10 - 5 - 10 - 5 - 6 - 13 - Area - 0 + 6 + go-bottom False True - 4 + 0 - + True False 5 @@ -695,129 +834,30 @@ Format: DD.MM.YYYY 5 5 6 - 13 - - - False - True - 5 - - - - - 5 - True - False - - - False - True - 6 - - - - - True - False + 6 + Save False True - 7 + 1 - - - True - False - Time Zone - - + False True - 3 + 0 - - - True - True - 1 - - - - - - - True - False - True - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - ubl-settings-datetime - - - - - True - True - False - True - menu1 - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - go-bottom - - - False - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Save - - - False - True - 1 - - - - + 1 @@ -867,6 +907,9 @@ Format: DD.MM.YYYY 6 6 Download + False @@ -903,6 +946,9 @@ Format: DD.MM.YYYY 1 + end diff --git a/ubl-settings-datetime_ru.po b/ubl-settings-datetime_ru.po index 323798f..ba88644 100644 --- a/ubl-settings-datetime_ru.po +++ b/ubl-settings-datetime_ru.po @@ -1660,3 +1660,68 @@ msgstr "Загрузить" msgid "Argument not recognized\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 "Winamac" + +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 "Андорра" \ No newline at end of file