diff --git a/#ubl-settings-datetime.glade# b/#ubl-settings-datetime.glade# new file mode 100644 index 0000000..d46c97a --- /dev/null +++ b/#ubl-settings-datetime.glade# @@ -0,0 +1,820 @@ + + + + + + False + Внимание! + + + True + False + vertical + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 50 + gtk-dialog-warning + + + True + True + 0 + + + + + 160 + True + False + start + center + 6 + 6 + Введите DHCP ! + + + True + True + 1 + + + + + False + True + 1 + + + + + OK + True + True + True + 5 + 5 + 5 + 5 + 3 + 3 + + + False + True + 1 + + + + + + + False + Настройки даты и времени + + + True + False + vertical + + + True + False + + + 90 + True + False + 5 + 5 + 5 + 5 + 6 + 6 + 69 + ubl-settings-datetime + + + False + True + 0 + + + + + 145 + True + False + 5 + 5 + 5 + 5 + 3 + 6 + Настройка даты и времени + True + 28 + 0 + + + + + + + False + True + 1 + + + + + 100 + True + False + 15 + 5 + 15 + 5 + + + + + + False + True + 2 + + + + + False + True + 0 + + + + + True + False + 10 + vertical + + + True + False + 5 + 5 + 5 + 5 + 0.019999999552965164 + in + + + True + False + 5 + 5 + vertical + + + True + False + + + 145 + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Время + 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 + + + + + False + True + 1 + + + + + True + False + + + 145 + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Дата + True + 0 + + + False + True + 0 + + + + + 221 + True + True + Дата +Формат: ДД.ММ.ГГГГ + 5 + 14 + 5 + 5 + 6 + 6 + + + False + True + 1 + + + + + True + True + True + Интерактивный выбор даты + 5 + 5 + 5 + 5 + 6 + 6 + + + True + False + x-office-calendar + + + + + False + True + 2 + + + + + False + True + 2 + + + + + True + False + + + 145 + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Часовой пояс + True + 0 + + + False + True + 0 + + + + + True + False + + + False + True + 1 + + + + + True + False + Регион + 5 + 5 + 5 + 5 + 6 + 6 + Регион + 0 + + + False + True + 2 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + + + False + True + 3 + + + + + True + False + Зона + 5 + 5 + 5 + 5 + 6 + 6 + Зона + 0 + + + False + True + 4 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + + + False + True + 5 + + + + + 5 + True + False + + + False + True + 6 + + + + + True + True + True + end + 5 + 5 + 6 + 6 + + + True + False + + + True + False + media-playlist-repeat + + + False + True + 0 + + + + + True + False + Синхронизировать + + + False + True + 1 + + + + + + + False + True + 7 + + + + + True + True + 3 + + + + + + + True + False + Настройка даты и времени + + + + + False + True + 0 + + + + + False + True + 1 + + + + + True + False + 10 + vertical + + + True + False + 5 + 5 + 5 + 5 + 0.019999999552965164 + in + + + True + False + 5 + 5 + vertical + + + True + False + + + True + True + False + Автоматическая синхронизация времени + 5 + 5 + 5 + 6 + 6 + True + + + True + False + Синхронизировать через NTP + + + + + False + True + 0 + + + + + True + False + 6 + 6 + + + False + True + 1 + + + + + -1 + True + True + center + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 3 + + + + + False + True + 0 + + + + + True + False + + + 145 + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Часовой пояс + True + 28 + 0 + + + False + True + 0 + + + + + True + False + + + False + True + 1 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Регион + 0 + + + False + True + 2 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + + + False + True + 3 + + + + + True + False + 5 + 5 + 5 + 5 + Зона + 0 + + + False + True + 4 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + + + False + True + 5 + + + + + 5 + True + False + 15 + 5 + 15 + 5 + + + False + True + 6 + + + + + True + True + 1 + + + + + + + True + False + Настройка даты и времени в глобальной конфигурации + + + + + False + True + 0 + + + + + False + True + 2 + + + + + + + 240 + 185 + False + btnChooseDate + bottom + none + + + True + True + 10 + 10 + 10 + 10 + 10 + 10 + 2023 + 1 + 10 + + + + diff --git a/ubl-settings-datetime.po b/messages.pot similarity index 52% rename from ubl-settings-datetime.po rename to messages.pot index 8ec03b7..df07366 100644 --- a/ubl-settings-datetime.po +++ b/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-24 15:14+0000\n" +"POT-Creation-Date: 2023-01-25 12:51+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,61 +21,45 @@ msgstr "" msgid "Внимание!" msgstr "" -#: ubl-settings-datetime.glade:46 +#: ubl-settings-datetime.glade:45 msgid "Введите DHCP !" msgstr "" -#: ubl-settings-datetime.glade:63 +#: ubl-settings-datetime.glade:62 msgid "OK" msgstr "" #. Date and Time Settings -#: ubl-settings-datetime.glade:85 +#: ubl-settings-datetime.glade:84 msgctxt "Settings the date and time" msgid "Настройки даты и времени" msgstr "" -#: ubl-settings-datetime.glade:120 -msgid "Изменить параметр NTPSERVERS" -msgstr "" - #. Setting the date and time -#: ubl-settings-datetime.glade:127 ubl-settings-datetime.glade:536 +#: ubl-settings-datetime.glade:125 ubl-settings-datetime.glade:531 msgctxt "Setting the date and time" msgid "Настройка даты и времени" msgstr "" #. Time -#: ubl-settings-datetime.glade:206 +#: ubl-settings-datetime.glade:204 msgctxt "Time" msgid "Время" msgstr "" -#. Clock -#: ubl-settings-datetime.glade:220 -msgctxt "Clock" -msgid "Часы" -msgstr "" - -#: ubl-settings-datetime.glade:241 +#: ubl-settings-datetime.glade:238 msgid ":" msgstr "" -#. Minutes -#: ubl-settings-datetime.glade:253 -msgctxt "Minutes" -msgid "Минуты" -msgstr "" - #. Date -#: ubl-settings-datetime.glade:291 +#: ubl-settings-datetime.glade:287 msgctxt "Date" msgid "Дата" msgstr "" #. Date of #. Format: DD.MM.YYYY -#: ubl-settings-datetime.glade:306 +#: ubl-settings-datetime.glade:302 msgctxt "" "Date of\n" "Format: DD.MM.YYYY" @@ -85,76 +69,55 @@ msgid "" msgstr "" #. Interactive date picker -#: ubl-settings-datetime.glade:325 +#: ubl-settings-datetime.glade:321 msgctxt "Interactive date picker" msgid "Интерактивный выбор даты" msgstr "" -#. Change zone setting -#: ubl-settings-datetime.glade:362 ubl-settings-datetime.glade:658 -msgctxt "Change zone setting" -msgid "Изменить параметр зоны" -msgstr "" - #. time zone -#: ubl-settings-datetime.glade:369 +#: ubl-settings-datetime.glade:364 msgctxt "time zone" msgid "Часовой пояс" msgstr "" #. Region -#: ubl-settings-datetime.glade:394 ubl-settings-datetime.glade:401 -#: ubl-settings-datetime.glade:691 ubl-settings-datetime.glade:698 +#: ubl-settings-datetime.glade:389 ubl-settings-datetime.glade:396 +#: ubl-settings-datetime.glade:687 msgctxt "Region" msgid "Регион" msgstr "" #. Zone -#: ubl-settings-datetime.glade:431 ubl-settings-datetime.glade:438 -#: ubl-settings-datetime.glade:728 ubl-settings-datetime.glade:733 +#: ubl-settings-datetime.glade:426 ubl-settings-datetime.glade:433 +#: ubl-settings-datetime.glade:721 msgctxt "Zone" msgid "Зона" msgstr "" -#: ubl-settings-datetime.glade:506 +#: ubl-settings-datetime.glade:501 msgid "Синхронизировать" msgstr "" #. Automatic time synchronization -#: ubl-settings-datetime.glade:585 +#: ubl-settings-datetime.glade:580 msgctxt "Automatic time synchronization" msgid "Автоматическая синхронизация времени" msgstr "" -#: ubl-settings-datetime.glade:597 +#. Synchronize via NTP +#: ubl-settings-datetime.glade:591 +msgctxt "Synchronize via NTP" msgid "Синхронизировать через NTP" msgstr "" -#. Synchronization method -#: ubl-settings-datetime.glade:611 -msgctxt "Synchronization method" -msgid "Способ синхронизации" -msgstr "" - -#. Server input for date and time synchronization: -#. Local (DHCP) or arbitrary -#: ubl-settings-datetime.glade:626 -msgctxt "" -"Server input for date and time synchronization:\n" -"Local (DHCP) or arbitrary" -msgid "" -"Ввод сервера для синхронизации даты и времени:\n" -"Локальный (DHCP) или произвольный" -msgstr "" - #. Time zone -#: ubl-settings-datetime.glade:665 +#: ubl-settings-datetime.glade:655 msgctxt "Time zone" msgid "Часовой пояс" msgstr "" #. Setting date and time in global configuration -#: ubl-settings-datetime.glade:788 +#: ubl-settings-datetime.glade:776 msgctxt "Setting date and time in global configuration" msgid "Настройка даты и времени в глобальной конфигурации" msgstr "" diff --git a/source/main.cc b/source/main.cc index eb6b45a..46295a7 100644 --- a/source/main.cc +++ b/source/main.cc @@ -1,7 +1,6 @@ #include #include #include -#include #include #include #include @@ -11,35 +10,30 @@ #include #include #include -#include -#include +#include #include #include #include #include #include #include +#include #include "ubl-settings-datetime.h" int main(int argc, char* argv[]) { string str_argv=""; string str_cmd_argv = ""; for (int i=1; i1){ str_argv = argv[1]; } @@ -69,11 +63,8 @@ int main(int argc, char* argv[]) { } MainWindow* wnd = nullptr; - builder->get_widget_derived("window", wnd); - auto r = app->run(*wnd); - delete wnd; return r; } @@ -88,20 +79,12 @@ int main(int argc, char* argv[]) { "Command line argument for socket ID communication.", "No help available, sorry" }; - context.set_main_group(parser); context.parse(argc, argv); - ::Window socketID = parser.GetSocketID(); - - // Handle plug: SettingsPlug plug{socketID, builder}; plug.show(); - app->run(plug); return 0; - } - - } \ No newline at end of file diff --git a/source/ubl-settings-datetime.cc b/source/ubl-settings-datetime.cc index fca8e89..45536bf 100644 --- a/source/ubl-settings-datetime.cc +++ b/source/ubl-settings-datetime.cc @@ -12,8 +12,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -47,15 +46,13 @@ CmdArgParser::CmdArgParser(const std::string& p_name, const std::string& p_descr add_entry(socketIDArg, m_socketID); } -::Window CmdArgParser::GetSocketID() const -{ +::Window CmdArgParser::GetSocketID() const { return m_socketID; } MainWindow::MainWindow(BaseObjectType* obj, Glib::RefPtr const& builder) : Gtk::ApplicationWindow(obj) - , builder{builder} -{ + , builder{builder} { this->settings(); } @@ -67,21 +64,23 @@ MainWindow::MainWindow(Glib::RefPtr const& builder) { void MainWindow::settings(){ year=0, month=0, day=0; this->get_builder(); + this->lacalization(); _numTimeHrs->set_range(0,23); _numTimeMin->set_range(0,59); _numTimeHrs->set_increments(1.0,1.0); _numTimeMin->set_increments(1.0,1.0); - this->lacalization(); this->get_config(); this->flag_block_gui(); this->event(); this->parse_text_date(); } void MainWindow::lacalization(){ + _txtDate->set_tooltip_text("Date of\nFormat: DD.MM.YYYY"); + _lblSynchronizebChk->set_text(gettext("Synchronize via NTP")); _cbDhcp->append(gettext("DHCP")); _cbDhcp->append(gettext("Manually")); - _lblDateTimeSetting->set_text(gettext("Setting the date and time")); - _lblNtpServer1->set_text(gettext("Setting the date and time")); + _lblDateTimeSetting->set_text(gettext("Settings the date and time")); + _lblNtpServer1->set_text(gettext("Settings the date and time")); _lblTime->set_text(gettext("Time")); _lblData->set_text(gettext("Date")); _lblTimeZone->set_text(gettext("Time zone")); @@ -90,11 +89,9 @@ void MainWindow::lacalization(){ _lblRegGlob->set_text(gettext("Region")); _lblZone1Glob->set_text(gettext("Zone")); _lblTimeZoneGlob->set_text(gettext("Time zone")); - _lblSynchronizebChk->set_text(gettext("Synchronize via NTP")); _lblSynchronizeBtn->set_text(gettext("Sync by")); _lblDateTimeSettingGlob->set_text(gettext("Setting date and time in global configuration")); this->set_title(gettext("ubl-settings-datetime")); - _txtDate->set_tooltip_text("Date of\nFormat: DD.MM.YYYY"); _mess_dchp->set_title("Warning!"); } diff --git a/source/ubl-settings-datetime.h b/source/ubl-settings-datetime.h index 772f81a..a976a16 100644 --- a/source/ubl-settings-datetime.h +++ b/source/ubl-settings-datetime.h @@ -14,8 +14,7 @@ #include #include #include -#include -#include +#include #include #include #include diff --git a/ubl-settings-datetime.glade b/ubl-settings-datetime.glade index 6bc0f3c..46cce72 100644 --- a/ubl-settings-datetime.glade +++ b/ubl-settings-datetime.glade @@ -579,7 +579,6 @@ False Автоматическая синхронизация времени 5 - 5 5 5 6 @@ -617,8 +616,6 @@ -1 True True - Ввод сервера для синхронизации даты и времени: -Локальный (DHCP) или произвольный center 5 5 diff --git a/ubl-settings-datetime_ru.po b/ubl-settings-datetime_ru.po index 408fa7b..9c9da17 100644 --- a/ubl-settings-datetime_ru.po +++ b/ubl-settings-datetime_ru.po @@ -18,143 +18,71 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -#: ubl-settings-datetime.glade:7 msgid "Warning!" msgstr "Внимание!" msgid "Manually" msgstr "Вручную" -#: ubl-settings-datetime.glade:46 msgid "Enter DHCP !" msgstr "Введите DHCP !" -#: ubl-settings-datetime.glade:63 msgid "OK" msgstr "OK" -#. Date and Time Settings -#: ubl-settings-datetime.glade:85 -msgctxt "Settings the date and time" -msgid "Date and time settings" +msgid "Settings the date and time" msgstr "Настройки даты и времени" -#: ubl-settings-datetime.glade:120 msgid "Change the NTPSERVERS parameter" msgstr "Изменить параметр NTPSERVERS" -#. Setting the date and time -#: ubl-settings-datetime.glade:127 ubl-settings-datetime.glade:536 -msgctxt "ubl-settings-datetime" msgid "ubl-settings-datetime" msgstr "Настройки даты и времени" -#. Time -#: ubl-settings-datetime.glade:206 -msgctxt "Time" msgid "Time" msgstr "Время" -#. Clock -#: ubl-settings-datetime.glade:220 -msgctxt "Clock" msgid "Clock" msgstr "Часы" -#: ubl-settings-datetime.glade:241 msgid ":" msgstr ":" -#. Minutes -#: ubl-settings-datetime.glade:253 -msgctxt "Minutes" msgid "Minutes" msgstr "Минуты" -#. Date -#: ubl-settings-datetime.glade:291 -msgctxt "Date" msgid "Date" msgstr "Дата" -#. Date of -#. Format: DD.MM.YYYY -#: ubl-settings-datetime.glade:306 -msgctxt "Date of\nFormat: DD.MM.YYYY" msgid "Date of\nFormat: DD.MM.YYYY" msgstr "Дата\nФормат: ДД.ММ.ГГГГ" -#. Interactive date picker -#: ubl-settings-datetime.glade:325 -msgctxt "Interactive date picker" msgid "Interactive date picker" msgstr "Интерактивный выбор даты" -#. Change zone setting -#: ubl-settings-datetime.glade:362 ubl-settings-datetime.glade:658 -msgctxt "Change zone setting" msgid "Change zone setting" msgstr "Изменить параметр зоны" -#. Region -#: ubl-settings-datetime.glade:394 ubl-settings-datetime.glade:401 -#: ubl-settings-datetime.glade:691 ubl-settings-datetime.glade:698 -msgctxt "Region" msgid "Region" msgstr "Регион" -#. Zone -#: ubl-settings-datetime.glade:431 ubl-settings-datetime.glade:438 -#: ubl-settings-datetime.glade:728 ubl-settings-datetime.glade:733 -msgctxt "Zone" msgid "Zone" msgstr "Зона" -#: ubl-settings-datetime.glade:506 msgid "Sync by" msgstr "Синхронизировать" -#. Automatic time synchronization -#: ubl-settings-datetime.glade:585 -msgctxt "Automatic time synchronization" msgid "Automatic time synchronization" msgstr "Автоматическая синхронизация времени" -#: ubl-settings-datetime.glade:597 msgid "Synchronize via NTP" msgstr "Синхронизировать через NTP" -#. Synchronization method -#: ubl-settings-datetime.glade:611 -msgctxt "Synchronization method" -msgid "Synchronize via NTP" -msgstr "Способ синхронизации" - -#. Server input for date and time synchronization: -#. Local (DHCP) or arbitrary -#: ubl-settings-datetime.glade:626 -msgctxt "" -"Server input for date and time synchronization:\n" -"Local (DHCP) or arbitrary" -msgid "" -"Server input for date and time synchronization:\n" -"Local (DHCP) or arbitrary" -msgstr "" -"Ввод сервера для синхронизации даты и времени:\n" -"Локальный (DHCP) или произвольный" - -#. Time zone -#: ubl-settings-datetime.glade:665 -msgctxt "Time zone" msgid "Time zone" msgstr "Часовой пояс" -#. Setting date and time in global configuration -#: ubl-settings-datetime.glade:788 -msgctxt "Setting date and time in global configuration" msgid "Setting date and time in global configuration" msgstr "Настройка даты и времени в глобальной конфигурации" -msgctxt "Incorrect date format" msgid "Incorrect date format" msgstr "Не верный формат даты"