From 2bf830fc342217c37e8996b1e84495bc5ffe651f Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Tue, 16 May 2023 12:37:11 +0600 Subject: [PATCH 01/20] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=B4=D0=B8=D0=B7=D0=B0=D0=B9=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-bootloader.cc | 1 - ubl-settings-bootloader.glade | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index e865002..e7a3586 100644 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -1161,7 +1161,6 @@ void MainWindow::temp_help_show() { else { wndShowWeb->show_all(); } - } void MainWindow::open_help() { diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade index 8b01366..6f675cb 100644 --- a/ubl-settings-bootloader.glade +++ b/ubl-settings-bootloader.glade @@ -328,7 +328,7 @@ specified priority 5 - + From 66cb00ea44ebdd0636733eae723847ef39df6c5c Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Tue, 16 May 2023 12:50:02 +0600 Subject: [PATCH 02/20] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=20=D1=86=D0=B2=D0=B5=D1=82=20=D1=82=D0=B5?= =?UTF-8?q?=D0=BA=D1=81=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ubl-settings-bootloader.glade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade index 6f675cb..8b01366 100644 --- a/ubl-settings-bootloader.glade +++ b/ubl-settings-bootloader.glade @@ -328,7 +328,7 @@ specified priority 5 - + From a2651c6007209fd23d1669fd8bb55f6387c267f0 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 18 May 2023 09:20:25 +0600 Subject: [PATCH 03/20] =?UTF-8?q?=D0=9F=D0=BE=D0=BC=D0=B5=D0=BD=D1=8F?= =?UTF-8?q?=D0=BB=20=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-bootloader.cc | 6 ++---- ubl-settings-bootloader.desktop | 2 -- ubl-settings-bootloader_ru.po | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index e7a3586..0a29560 100644 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -445,19 +445,17 @@ void MainWindow::localization() { tm *ltm = localtime(&now); unsigned int year = 1900+ ltm->tm_year; string str_authors = string(copyright) + to_string(year); - aboutWindows->set_program_name(name_app); + aboutWindows->set_program_name(app_name); aboutWindows->set_copyright(str_authors); aboutWindows->set_comments(name_app); aboutWindows->set_website(web_url); aboutWindows->set_version(_(version_application.c_str())); aboutWindows->set_website_label(project_Home_page); - lblInfoHead->set_text(configuring_system_boot); + lblInfoHead->set_text(name_app); lblHeaderName->set_text(name_app); - aboutWindows->set_comments(system_boot); lblHeaderAboutTopic->set_label(str_about); lblBootMenuUsers->set_text(str_title_Boot_Menu_Users); lblRingtoneStartup->set_text(str_title_Ringtone_Startup); - aboutWindows->set_website_label(project_Home_page); lblInfoCommand->set_text(command_line_parameters); lblInfoCommand1->set_text(command_line_parameters); lblInfoCommand2->set_text(command_line_parameters); diff --git a/ubl-settings-bootloader.desktop b/ubl-settings-bootloader.desktop index 9bdf501..1cf2d0c 100644 --- a/ubl-settings-bootloader.desktop +++ b/ubl-settings-bootloader.desktop @@ -10,6 +10,4 @@ Type=Application Exec=pkexec ubl-settings-bootloader Icon=com.ublinux.ubl-settings-bootloader Terminal=false -X-XfcePluggable=true -X-UBLPluggable=true Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-HardwareSettings;X-UBL-SettingsManager;X-UBL-SystemSettings; \ No newline at end of file diff --git a/ubl-settings-bootloader_ru.po b/ubl-settings-bootloader_ru.po index ba664af..1770e7b 100644 --- a/ubl-settings-bootloader_ru.po +++ b/ubl-settings-bootloader_ru.po @@ -24,7 +24,7 @@ msgstr "О программе" #: source/ubl-settings-bootloader.h:44 source/ubl-settings-bootloader.h:43 msgid "About ubl-settings-bootloader" -msgstr "О программе Настройка загрузки системы" +msgstr "О программе Загрузка системы" #: source/ubl-settings-bootloader.h:92 source/ubl-settings-bootloader.h:91 #: source/ubl-settings-bootloader.cc:337 source/ubl-settings-bootloader.cc:199 @@ -579,7 +579,7 @@ msgstr "splash (Показать окно приветствия)" #: source/ubl-settings-bootloader.cc:439 source/ubl-settings-bootloader.cc:281 #: source/ubl-settings-bootloader.cc:286 source/ubl-settings-bootloader.cc:309 msgid "ubl-settings-bootloader" -msgstr "Настройка загрузки системы" +msgstr "Загрузка системы" #: source/ubl-settings-bootloader.h:79 source/ubl-settings-bootloader.h:78 #: source/ubl-settings-bootloader.cc:947 source/ubl-settings-bootloader.cc:547 From 174564d8a9a3145c2be32f0f24daa463e2cbf324 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 18 May 2023 09:30:26 +0600 Subject: [PATCH 04/20] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D0=BB=20plug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ubl-settings-bootloader.desktop | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ubl-settings-bootloader.desktop b/ubl-settings-bootloader.desktop index 1cf2d0c..9bdf501 100644 --- a/ubl-settings-bootloader.desktop +++ b/ubl-settings-bootloader.desktop @@ -10,4 +10,6 @@ Type=Application Exec=pkexec ubl-settings-bootloader Icon=com.ublinux.ubl-settings-bootloader Terminal=false +X-XfcePluggable=true +X-UBLPluggable=true Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-HardwareSettings;X-UBL-SettingsManager;X-UBL-SystemSettings; \ No newline at end of file From 34a572f1ae46f00cef3f06c0fc2b380fad668e4d Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 18 May 2023 10:11:28 +0600 Subject: [PATCH 05/20] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=20=D0=B0=D0=BB=D0=B3=D0=BE=D1=80=D0=B8=D1=82?= =?UTF-8?q?=D0=BC=20=D0=B2=D1=8B=D0=B1=D0=BE=D1=80=D0=B0=20=D0=BE=D0=BF?= =?UTF-8?q?=D1=86=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-bootloader.cc | 70 +++++++++++++++++++++++++------ source/ubl-settings-bootloader.h | 1 + 2 files changed, 58 insertions(+), 13 deletions(-) diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index 0a29560..29b5162 100644 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -230,11 +230,13 @@ void MainWindow::item_selected_kernel(const Gtk::TreeModel::Path&, const Gtk::Tr treeViewOTT->get_selection()->unselect_all(); treeViewUser->get_selection()->unselect_all(); treeViewMelody->get_selection()->unselect_all(); - if (flag_blocked_tree_view == false) { - string str_flags = template_item_selected(size_kernel, list_store_kernel, "GRUB_CMDLINE_LINUX"); - map_cmd_selection["GRUB_CMDLINE_LINUX"] = str_flags; - // Utils::str_replace_all(str_flags, " ", ", "); - entryKernel->set_text(str_flags); + if (flag_blocked_tree_view == false) { + if (this->intel_idle_cstate_check(size_kernel, list_store_kernel, "GRUB_CMDLINE_LINUX") == false) { + string str_flags = template_item_selected(size_kernel, list_store_kernel, "GRUB_CMDLINE_LINUX"); + map_cmd_selection["GRUB_CMDLINE_LINUX"] = str_flags; + // Utils::str_replace_all(str_flags, " ", ", "); + entryKernel->set_text(str_flags); + } } } @@ -244,10 +246,12 @@ void MainWindow::item_selected_OTT(const Gtk::TreeModel::Path&, const Gtk::TreeM treeViewUser->get_selection()->unselect_all(); treeViewMelody->get_selection()->unselect_all(); if (flag_blocked_tree_view == false) { - string str_flags = template_item_selected(size_OTT, list_store_OTT, "GRUB_TERMINAL_OUTPUT"); - map_cmd_selection["GRUB_TERMINAL_OUTPUT"] = str_flags; - // Utils::str_replace_all(str_flags, " ", ", "); - entryOTT->set_text(str_flags); + if (this->intel_idle_cstate_check(size_OTT, list_store_OTT, "GRUB_TERMINAL_OUTPUT") == false) { + string str_flags = template_item_selected(size_OTT, list_store_OTT, "GRUB_TERMINAL_OUTPUT"); + map_cmd_selection["GRUB_TERMINAL_OUTPUT"] = str_flags; + // Utils::str_replace_all(str_flags, " ", ", "); + entryOTT->set_text(str_flags); + } } } @@ -257,10 +261,12 @@ void MainWindow::item_selected_IPT(const Gtk::TreeModel::Path&, const Gtk::TreeM treeViewUser->get_selection()->unselect_all(); treeViewMelody->get_selection()->unselect_all(); if (flag_blocked_tree_view == false) { - string str_flags = template_item_selected(size_IPT, list_store_IPT, "GRUB_TERMINAL_INPUT"); - map_cmd_selection["GRUB_TERMINAL_INPUT"] = str_flags; - // Utils::str_replace_all(str_flags, " ", ", "); - entryIPT->set_text(str_flags); + if (this->intel_idle_cstate_check(size_IPT, list_store_IPT, "GRUB_TERMINAL_INPUT") == false) { + string str_flags = template_item_selected(size_IPT, list_store_IPT, "GRUB_TERMINAL_INPUT"); + map_cmd_selection["GRUB_TERMINAL_INPUT"] = str_flags; + // Utils::str_replace_all(str_flags, " ", ", "); + entryIPT->set_text(str_flags); + } } } @@ -317,6 +323,44 @@ void MainWindow::set_download_mode() { map_cmd_selection["GRUB_BOOT_SILENT"] = key; } +bool MainWindow::intel_idle_cstate_check(int size, Glib::RefPtr &list_store, string key) { + string cmds_old = map_cmd_selection[key]; + string cmds = ""; + string param = ""; + int index_1 = -1; + int index_4 = -1; + bool active = false; + for (int index = 0; index < size; index++) { + Gtk::TreeModel::Row row = list_store->children()[index]; + if(row) { + param = row[m_columns.name] + ""; + active = row[m_columns.check_button]; + if (param == "intel_idle.max_cstate=1" && active == true) { + index_1 = index; + } + else if (param == "intel_idle.max_cstate=4" && active == true) { + index_4 = index; + } + } + } + if (index_1 != -1 && index_4 != -1) { + if (cmds_old.find("intel_idle.max_cstate=1") == string::npos) { + Gtk::TreeModel::Row row = list_store->children()[index_4]; + row[m_columns.check_button] = false; + return true; + } + else if (cmds_old.find("intel_idle.max_cstate=4") == string::npos) { + Gtk::TreeModel::Row row = list_store->children()[index_1]; + row[m_columns.check_button] = false; + return true; + } + else { + return false; + } + } + return false; +} + string MainWindow::template_item_selected(int size, Glib::RefPtr &list_store, string key) { string cmds_old = map_cmd_selection[key]; string cmds = ""; diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index effb636..7a115fb 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -404,6 +404,7 @@ public: void set_add_data_user(Gtk::TreeModel::Row &row, bool flag, string &name, string &password); void set_init_data_user(std::map &map_temp); void set_init_data_superuser(std::map &map_temp); + bool intel_idle_cstate_check(int size, Glib::RefPtr &list_store, string key); }; class SettingsPlug : public Gtk::Plug From a8e5cd1fdc1dfbcb70f8f6687049d3415096f31a Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 18 May 2023 10:23:35 +0600 Subject: [PATCH 06/20] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=80=20=D0=BE=D0=BA?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B2=D1=8B=D0=B7=D0=BE=D0=B2=D0=B0=20=D0=B1?= =?UTF-8?q?=D1=80=D0=B0=D1=83=D0=B7=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-bootloader.h | 3 +-- ubl-settings-bootloader.pot | 2 +- ubl-settings-bootloader_ru.po | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index 7a115fb..ce0c52a 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -68,8 +68,7 @@ void me_thread(string cmd); #define boot_menu_user_password _("Boot menu user password:") #define last_successful_upload _("Last successful upload") #define read_documentation_web _("Would you like to read documentation in the Web?") -#define redirected_documentation _("You will be redirected to documentation site, where user help pages are " \ - "translated and supported by community.") +#define redirected_documentation _("You will be redirected to documentation website where documentation is\n""translated and supported by community.") #define user_name_configuration_editing_code _("User name to enter boot configuration editing mode") #define user_password_configuration_edit_mode _("User password to enter boot configuration edit mode") #define loading_animation_with _("Loading animation with the magazine") diff --git a/ubl-settings-bootloader.pot b/ubl-settings-bootloader.pot index 51cc8f7..036d4f5 100644 --- a/ubl-settings-bootloader.pot +++ b/ubl-settings-bootloader.pot @@ -457,7 +457,7 @@ msgstr "" #: source/ubl-settings-bootloader.h:70 source/ubl-settings-bootloader.h:69 msgid "" -"You will be redirected to documentation site, where user help pages are " +"You will be redirected to documentation website where documentation is\n" "translated and supported by community." msgstr "" diff --git a/ubl-settings-bootloader_ru.po b/ubl-settings-bootloader_ru.po index 1770e7b..47cb711 100644 --- a/ubl-settings-bootloader_ru.po +++ b/ubl-settings-bootloader_ru.po @@ -481,10 +481,10 @@ msgstr "Вы хотите прочитать справку в Сети?" #: source/ubl-settings-bootloader.h:70 source/ubl-settings-bootloader.h:69 msgid "" -"You will be redirected to documentation site, where user help pages are " +"You will be redirected to documentation website where documentation is\n" "translated and supported by community." msgstr "" -"Вы будете перенаправлены на сайт с документацией где страницы помощи " +"Вы будете перенаправлены на сайт с документацией где страницы помощи\n" "переводятся и поддерживаются сообществом." msgid "acpi=off (Disable ACPI)" From fe6523216e14ada0ab489229a612358fe466455b Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 18 May 2023 10:57:36 +0600 Subject: [PATCH 07/20] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=BC=D0=B8=D0=BD=D0=B8=D0=BC=D0=B0=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D1=8B=D0=B9=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=80=20?= =?UTF-8?q?=D0=BE=D0=BA=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- #ubl-settings-bootloader.glade# | 1978 +++++++++++++++++++++++++++++ source/ubl-settings-bootloader.cc | 70 +- source/ubl-settings-bootloader.h | 4 +- ubl-settings-bootloader.glade | 4 +- ubl-settings-bootloader_ru.po | 8 +- 5 files changed, 1999 insertions(+), 65 deletions(-) create mode 100644 #ubl-settings-bootloader.glade# diff --git a/#ubl-settings-bootloader.glade# b/#ubl-settings-bootloader.glade# new file mode 100644 index 0000000..b3c7b21 --- /dev/null +++ b/#ubl-settings-bootloader.glade# @@ -0,0 +1,1978 @@ + + + + + + + both + True + + + + + False + False + True + center + com.ublinux.ubl-settings-diskquota + dialog + True + True + ubl-settings-bootloader + 1.0 + Copyright © 2022 - 2023, UBSoft LLC + ubl-settings-bootloader + https://wiki.ublinux.com/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 + UBGroup + UBGroup + com.ublinux.ubl-settings-bootloader + True + gpl-2-0 + + + True + False + vertical + 2 + + + False + end + + + False + False + 1 + + + + + + + + + + True + False + True + + + True + False + 5 + 5 + 5 + 5 + 2 + ubl-settings-bootloader + + + + + + + + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + 69 + com.ublinux.ubl-settings-bootloader + + + False + True + 0 + + + + + True + False + start + 5 + 5 + 5 + 5 + 5 + 5 + Running applications as a user with a +specified priority + + + + + + + + True + True + 1 + + + + + True + False + + + 1 + 1 + True + False + **** + 0.009999999776482582 + + + True + True + 0 + + + + + 1 + 1 + True + True + True + + + True + False + gtk-goto-last + + + + + + False + True + 1 + + + + + 1 + 1 + True + True + True + + + 1 + 1 + True + False + 0 + + + + + True + False + + + 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 + + + + + + 650 + 500 + False + com.ublinux.ubl-settings-bootloader + + + True + False + vertical + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + 25 + 1 + + + False + True + 0 + + + + + True + False + start + 5 + 5 + 5 + 5 + 5 + 5 + + + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + + + 81 + True + False + start + + + -1 + + + + + False + True + 1 + + + + + True + True + always + in + + + True + False + + + True + False + vertical + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + 0.019999999552965164 + in + + + True + False + 5 + + + True + False + vertical + + + True + False + + + Boot selection menu timer + True + True + False + 3 + 5 + 3 + 5 + 5 + 5 + True + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 5 + 5 + + + False + True + 1 + + + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + Seconds + + + False + True + 2 + + + + + False + True + 0 + + + + + True + False + + + True + False + start + 5 + 5 + 5 + 5 + 5 + 5 + Default load + start + 0 + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 5 + 5 + + + True + True + 2 + + + + + True + True + True + 5 + 10 + 5 + 10 + 5 + 5 + + + True + False + open-menu-symbolic + + + + + False + True + 3 + + + + + False + True + 1 + + + + + True + False + + + True + False + start + 5 + 5 + 5 + 5 + 5 + 5 + Load screen display mode: + start + 0 + + + False + True + 0 + + + + + True + False + 5 + 10 + 5 + 10 + 5 + 5 + + + True + True + 1 + + + + + False + True + 2 + + + + + True + False + 5 + 10 + 5 + 10 + 5 + 5 + 0.019999999552965164 + in + + + True + False + + + True + False + 5 + + + True + False + vertical + + + 65 + True + True + 3 + 5 + 3 + 5 + in + + + True + False + + + True + True + + + + + + + + + + False + True + 0 + + + + + + + True + True + 0 + + + + + True + False + vertical + + + True + True + True + 5 + 10 + 5 + 10 + 5 + 5 + + + True + False + list-add + + + + + False + True + 0 + + + + + True + True + True + 5 + 10 + 5 + 10 + 3 + 10 + + + True + False + gtk-remove + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + True + False + start + 5 + 5 + 5 + 5 + 5 + 5 + Boot Menu Users + start + + + + + False + True + 5 + + + + + True + False + 5 + 10 + 5 + 10 + 5 + 5 + 0.019999999552965164 + in + + + True + False + + + True + False + 5 + + + True + False + vertical + + + 65 + True + True + 5 + 5 + 5 + 5 + in + + + True + False + + + True + True + + + + + + + + + + False + True + 0 + + + + + + + True + True + 0 + + + + + True + False + vertical + + + True + True + True + 5 + 10 + 5 + 10 + 5 + 5 + + + True + False + list-add + + + + + False + True + 0 + + + + + True + True + True + 5 + 10 + 5 + 10 + 3 + 10 + + + True + False + gtk-remove + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + True + False + start + 5 + 5 + 5 + 5 + 5 + 5 + Ringtone at startup + start + + + + + False + True + 5 + + + + + + + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + Download menu + + + + + False + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + 0.019999999552965164 + in + + + True + False + 5 + + + True + False + vertical + + + 140 + True + True + 5 + 10 + 5 + 10 + 5 + 5 + in + + + True + False + + + True + True + + + + + + + + + + False + True + 0 + + + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 1 + 5 + Command line parameters: + + + False + True + 0 + + + + + True + True + 5 + 10 + 5 + 10 + 5 + 5 + + + True + True + 1 + + + + + False + True + 10 + + + + + + + + + True + False + start + 5 + 5 + 5 + 5 + 5 + 5 + Parameters passed to the kernel + start + + + + + False + True + 1 + + + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + 0.019999999552965164 + in + + + True + False + 5 + + + True + False + vertical + + + 140 + True + True + 5 + 10 + 5 + 10 + 5 + 5 + in + + + True + False + + + True + True + + + + + + + + + + False + True + 1 + + + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 1 + 5 + Command line parameters: + + + False + True + 0 + + + + + True + True + 5 + 10 + 5 + 10 + 5 + 5 + + + True + True + 1 + + + + + False + True + 7 + + + + + + + + + True + False + start + 5 + 5 + 5 + 5 + 5 + 5 + Terminal for input + start + + + + + False + True + 2 + + + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + 0.019999999552965164 + in + + + True + False + 5 + + + True + False + vertical + + + 140 + True + True + 5 + 10 + 5 + 10 + 5 + 5 + in + + + True + False + + + True + True + + + + + + + + + + False + True + 0 + + + + + True + False + + + True + False + 5 + 5 + 5 + 5 + 1 + 5 + Command line parameters: + + + False + True + 0 + + + + + True + True + 5 + 10 + 5 + 10 + 5 + 5 + + + True + True + 1 + + + + + False + True + 7 + + + + + + + + + True + False + start + 5 + 5 + 5 + 5 + 5 + 5 + Terminal for output + start + + + + + False + True + 3 + + + + + False + True + 5 + + + + + + + + + True + True + 2 + + + + + + + True + False + True + + + True + False + ubl-settings-bootloader + + + + + + + + True + False + 32 + com.ublinux.ubl-settings-bootloader + + + + + True + False + + + 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 + + + + + + False + True + 0 + + + + + end + 1 + + + + + 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 + + + + + + 2 + + + + + + + both + True + + + + + + + + both + True + + + + + + + + + + + + + + + False + btnOpenMenuOS + bottom + + + True + False + + + 0 + 0 + True + False + none + + + True + False + vertical + + + + + + + + True + True + 0 + + + + + 0 + 0 + True + False + none + True + + + True + False + vertical + + + 1 + 1 + True + True + True + + + True + False + start + 0 + gtk-goto-first + + + + + False + True + 0 + + + + + True + False + vertical + + + + + + False + True + 1 + + + + + + + False + True + 1 + + + + + + + False + Внимание! + center + dialog + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + 50 + gtk-dialog-warning + + + True + True + 0 + + + + + 160 + True + False + start + center + 5 + 5 + 5 + 5 + 5 + 5 + Warning! + + + True + True + 1 + + + + + False + True + 1 + + + + + OK + True + True + True + 5 + 5 + 5 + 5 + 3 + 3 + + + False + True + 1 + + + + + + + True + False + none + + + True + False + vertical + + + + + + + + False + start + start + False + 450 + 250 + dialog-question-symbolic + + + True + False + vertical + + + True + False + + + True + False + start + 20 + 20 + dialog-question-symbolic + 5 + + + False + True + 0 + + + + + True + False + vertical + + + True + False + start + 10 + 5 + Would you like to read documentation in the Web? + True + 0 + + + + + + + False + True + 0 + + + + + True + False + start + start + 10 + 10 + You will be redirected to documentation website where documentation is translated and supported by community. + True + 0 + + + + True + True + 1 + + + + + Always redirect to online documentation + True + True + False + end + 10 + True + + + + False + True + 2 + + + + + + True + True + 1 + + + + + + True + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + 30 + True + + + Cancel + True + True + True + + + + True + True + 0 + + + + + Read Online + True + True + True + + + + True + True + 1 + + + + + False + True + 1 + + + + + + + True + False + True + + + True + False + ubl-settings-bootloader + + + + + + + + True + False + 32 + dialog-question-symbolic + + + + + + + 800 + 600 + False + True + True + com.ublinux.ubl-settings-datetime + + + + + + True + False + True + + + True + False + ubl-settings-bootloader + + + + + True + False + 32 + com.ublinux.ubl-settings-bootloader + 5 + + + + + + diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index 29b5162..0a29560 100644 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -230,13 +230,11 @@ void MainWindow::item_selected_kernel(const Gtk::TreeModel::Path&, const Gtk::Tr treeViewOTT->get_selection()->unselect_all(); treeViewUser->get_selection()->unselect_all(); treeViewMelody->get_selection()->unselect_all(); - if (flag_blocked_tree_view == false) { - if (this->intel_idle_cstate_check(size_kernel, list_store_kernel, "GRUB_CMDLINE_LINUX") == false) { - string str_flags = template_item_selected(size_kernel, list_store_kernel, "GRUB_CMDLINE_LINUX"); - map_cmd_selection["GRUB_CMDLINE_LINUX"] = str_flags; - // Utils::str_replace_all(str_flags, " ", ", "); - entryKernel->set_text(str_flags); - } + if (flag_blocked_tree_view == false) { + string str_flags = template_item_selected(size_kernel, list_store_kernel, "GRUB_CMDLINE_LINUX"); + map_cmd_selection["GRUB_CMDLINE_LINUX"] = str_flags; + // Utils::str_replace_all(str_flags, " ", ", "); + entryKernel->set_text(str_flags); } } @@ -246,12 +244,10 @@ void MainWindow::item_selected_OTT(const Gtk::TreeModel::Path&, const Gtk::TreeM treeViewUser->get_selection()->unselect_all(); treeViewMelody->get_selection()->unselect_all(); if (flag_blocked_tree_view == false) { - if (this->intel_idle_cstate_check(size_OTT, list_store_OTT, "GRUB_TERMINAL_OUTPUT") == false) { - string str_flags = template_item_selected(size_OTT, list_store_OTT, "GRUB_TERMINAL_OUTPUT"); - map_cmd_selection["GRUB_TERMINAL_OUTPUT"] = str_flags; - // Utils::str_replace_all(str_flags, " ", ", "); - entryOTT->set_text(str_flags); - } + string str_flags = template_item_selected(size_OTT, list_store_OTT, "GRUB_TERMINAL_OUTPUT"); + map_cmd_selection["GRUB_TERMINAL_OUTPUT"] = str_flags; + // Utils::str_replace_all(str_flags, " ", ", "); + entryOTT->set_text(str_flags); } } @@ -261,12 +257,10 @@ void MainWindow::item_selected_IPT(const Gtk::TreeModel::Path&, const Gtk::TreeM treeViewUser->get_selection()->unselect_all(); treeViewMelody->get_selection()->unselect_all(); if (flag_blocked_tree_view == false) { - if (this->intel_idle_cstate_check(size_IPT, list_store_IPT, "GRUB_TERMINAL_INPUT") == false) { - string str_flags = template_item_selected(size_IPT, list_store_IPT, "GRUB_TERMINAL_INPUT"); - map_cmd_selection["GRUB_TERMINAL_INPUT"] = str_flags; - // Utils::str_replace_all(str_flags, " ", ", "); - entryIPT->set_text(str_flags); - } + string str_flags = template_item_selected(size_IPT, list_store_IPT, "GRUB_TERMINAL_INPUT"); + map_cmd_selection["GRUB_TERMINAL_INPUT"] = str_flags; + // Utils::str_replace_all(str_flags, " ", ", "); + entryIPT->set_text(str_flags); } } @@ -323,44 +317,6 @@ void MainWindow::set_download_mode() { map_cmd_selection["GRUB_BOOT_SILENT"] = key; } -bool MainWindow::intel_idle_cstate_check(int size, Glib::RefPtr &list_store, string key) { - string cmds_old = map_cmd_selection[key]; - string cmds = ""; - string param = ""; - int index_1 = -1; - int index_4 = -1; - bool active = false; - for (int index = 0; index < size; index++) { - Gtk::TreeModel::Row row = list_store->children()[index]; - if(row) { - param = row[m_columns.name] + ""; - active = row[m_columns.check_button]; - if (param == "intel_idle.max_cstate=1" && active == true) { - index_1 = index; - } - else if (param == "intel_idle.max_cstate=4" && active == true) { - index_4 = index; - } - } - } - if (index_1 != -1 && index_4 != -1) { - if (cmds_old.find("intel_idle.max_cstate=1") == string::npos) { - Gtk::TreeModel::Row row = list_store->children()[index_4]; - row[m_columns.check_button] = false; - return true; - } - else if (cmds_old.find("intel_idle.max_cstate=4") == string::npos) { - Gtk::TreeModel::Row row = list_store->children()[index_1]; - row[m_columns.check_button] = false; - return true; - } - else { - return false; - } - } - return false; -} - string MainWindow::template_item_selected(int size, Glib::RefPtr &list_store, string key) { string cmds_old = map_cmd_selection[key]; string cmds = ""; diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index ce0c52a..6c7b31e 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -63,7 +63,7 @@ void me_thread(string cmd); #define cancel _("Cancel") #define always_redirect _("Always redirect") #define boot_screen_display_mode _("Boot screen display mode:") -#define no_loading_animation _("No loading animation, full log") +#define no_loading_animation _("No loading animation,\nfull log") #define boot_menu_user_name _("Boot menu user name:") #define boot_menu_user_password _("Boot menu user password:") #define last_successful_upload _("Last successful upload") @@ -73,7 +73,7 @@ void me_thread(string cmd); #define user_password_configuration_edit_mode _("User password to enter boot configuration edit mode") #define loading_animation_with _("Loading animation with the magazine") #define loading_animation_without _("Loading animation without a magazine") -#define lack_loading_animation _("Lack of loading animation with the output of the abbreviated log") +#define lack_loading_animation _("Lack of loading animation with the\noutput of the abbreviated log") #define web_url _("https://wiki.ublinux.com") #define enter_password _("Enter your password") #define enter_login _("Enter login") diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade index 8b01366..64bf3da 100644 --- a/ubl-settings-bootloader.glade +++ b/ubl-settings-bootloader.glade @@ -283,8 +283,8 @@ specified priority - 760 - 560 + 650 + 500 False com.ublinux.ubl-settings-bootloader diff --git a/ubl-settings-bootloader_ru.po b/ubl-settings-bootloader_ru.po index 47cb711..d2ed953 100644 --- a/ubl-settings-bootloader_ru.po +++ b/ubl-settings-bootloader_ru.po @@ -205,8 +205,8 @@ msgstr "Терминал для вывода" #: source/ubl-settings-bootloader.h:75 source/ubl-settings-bootloader.h:74 #: source/ubl-settings-bootloader.cc:451 -msgid "Lack of loading animation with the output of the abbreviated log" -msgstr "Отсутствие анимации загрузки с выводом сокращенного журнала" +msgid "Lack of loading animation with the\noutput of the abbreviated log" +msgstr "Отсутствие анимации загрузки с\nвыводом сокращенного журнала" #, fuzzy msgid "Last Successful Download" @@ -294,8 +294,8 @@ msgid "Maximum performance, power management" msgstr "Максимальная производительность, управление питанием" #: source/ubl-settings-bootloader.h:65 source/ubl-settings-bootloader.h:64 -msgid "No loading animation, full log" -msgstr "Отсутствие анимации загрузки с выводом журнала" +msgid "No loading animation,\nfull log" +msgstr "Отсутствие анимации загрузки\nс выводом журнала" #: source/ubl-settings-bootloader.cc:444 source/ubl-settings-bootloader.cc:446 msgid "Not available" From c41ebe896888f420d128105022e60b234f8a2fc3 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 18 May 2023 10:58:50 +0600 Subject: [PATCH 08/20] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=84=D0=B0=D0=B9=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- #ubl-settings-bootloader.glade# | 1978 ------------------------------- 1 file changed, 1978 deletions(-) delete mode 100644 #ubl-settings-bootloader.glade# diff --git a/#ubl-settings-bootloader.glade# b/#ubl-settings-bootloader.glade# deleted file mode 100644 index b3c7b21..0000000 --- a/#ubl-settings-bootloader.glade# +++ /dev/null @@ -1,1978 +0,0 @@ - - - - - - - both - True - - - - - False - False - True - center - com.ublinux.ubl-settings-diskquota - dialog - True - True - ubl-settings-bootloader - 1.0 - Copyright © 2022 - 2023, UBSoft LLC - ubl-settings-bootloader - https://wiki.ublinux.com/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 - UBGroup - UBGroup - com.ublinux.ubl-settings-bootloader - True - gpl-2-0 - - - True - False - vertical - 2 - - - False - end - - - False - False - 1 - - - - - - - - - - True - False - True - - - True - False - 5 - 5 - 5 - 5 - 2 - ubl-settings-bootloader - - - - - - - - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 69 - com.ublinux.ubl-settings-bootloader - - - False - True - 0 - - - - - True - False - start - 5 - 5 - 5 - 5 - 5 - 5 - Running applications as a user with a -specified priority - - - - - - - - True - True - 1 - - - - - True - False - - - 1 - 1 - True - False - **** - 0.009999999776482582 - - - True - True - 0 - - - - - 1 - 1 - True - True - True - - - True - False - gtk-goto-last - - - - - - False - True - 1 - - - - - 1 - 1 - True - True - True - - - 1 - 1 - True - False - 0 - - - - - True - False - - - 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 - - - - - - 650 - 500 - False - com.ublinux.ubl-settings-bootloader - - - True - False - vertical - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 25 - 1 - - - False - True - 0 - - - - - True - False - start - 5 - 5 - 5 - 5 - 5 - 5 - - - - - - - True - True - 1 - - - - - False - True - 0 - - - - - True - False - - - 81 - True - False - start - - - -1 - - - - - False - True - 1 - - - - - True - True - always - in - - - True - False - - - True - False - vertical - - - True - False - vertical - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 0.019999999552965164 - in - - - True - False - 5 - - - True - False - vertical - - - True - False - - - Boot selection menu timer - True - True - False - 3 - 5 - 3 - 5 - 5 - 5 - True - - - False - True - 0 - - - - - True - True - 5 - 5 - 5 - 5 - 5 - 5 - - - False - True - 1 - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - Seconds - - - False - True - 2 - - - - - False - True - 0 - - - - - True - False - - - True - False - start - 5 - 5 - 5 - 5 - 5 - 5 - Default load - start - 0 - - - False - True - 0 - - - - - True - True - 5 - 5 - 5 - 5 - 5 - 5 - - - True - True - 2 - - - - - True - True - True - 5 - 10 - 5 - 10 - 5 - 5 - - - True - False - open-menu-symbolic - - - - - False - True - 3 - - - - - False - True - 1 - - - - - True - False - - - True - False - start - 5 - 5 - 5 - 5 - 5 - 5 - Load screen display mode: - start - 0 - - - False - True - 0 - - - - - True - False - 5 - 10 - 5 - 10 - 5 - 5 - - - True - True - 1 - - - - - False - True - 2 - - - - - True - False - 5 - 10 - 5 - 10 - 5 - 5 - 0.019999999552965164 - in - - - True - False - - - True - False - 5 - - - True - False - vertical - - - 65 - True - True - 3 - 5 - 3 - 5 - in - - - True - False - - - True - True - - - - - - - - - - False - True - 0 - - - - - - - True - True - 0 - - - - - True - False - vertical - - - True - True - True - 5 - 10 - 5 - 10 - 5 - 5 - - - True - False - list-add - - - - - False - True - 0 - - - - - True - True - True - 5 - 10 - 5 - 10 - 3 - 10 - - - True - False - gtk-remove - - - - - False - True - 1 - - - - - False - True - 1 - - - - - - - True - False - start - 5 - 5 - 5 - 5 - 5 - 5 - Boot Menu Users - start - - - - - False - True - 5 - - - - - True - False - 5 - 10 - 5 - 10 - 5 - 5 - 0.019999999552965164 - in - - - True - False - - - True - False - 5 - - - True - False - vertical - - - 65 - True - True - 5 - 5 - 5 - 5 - in - - - True - False - - - True - True - - - - - - - - - - False - True - 0 - - - - - - - True - True - 0 - - - - - True - False - vertical - - - True - True - True - 5 - 10 - 5 - 10 - 5 - 5 - - - True - False - list-add - - - - - False - True - 0 - - - - - True - True - True - 5 - 10 - 5 - 10 - 3 - 10 - - - True - False - gtk-remove - - - - - False - True - 1 - - - - - False - True - 1 - - - - - - - True - False - start - 5 - 5 - 5 - 5 - 5 - 5 - Ringtone at startup - start - - - - - False - True - 5 - - - - - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - Download menu - - - - - False - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 0.019999999552965164 - in - - - True - False - 5 - - - True - False - vertical - - - 140 - True - True - 5 - 10 - 5 - 10 - 5 - 5 - in - - - True - False - - - True - True - - - - - - - - - - False - True - 0 - - - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 1 - 5 - Command line parameters: - - - False - True - 0 - - - - - True - True - 5 - 10 - 5 - 10 - 5 - 5 - - - True - True - 1 - - - - - False - True - 10 - - - - - - - - - True - False - start - 5 - 5 - 5 - 5 - 5 - 5 - Parameters passed to the kernel - start - - - - - False - True - 1 - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 0.019999999552965164 - in - - - True - False - 5 - - - True - False - vertical - - - 140 - True - True - 5 - 10 - 5 - 10 - 5 - 5 - in - - - True - False - - - True - True - - - - - - - - - - False - True - 1 - - - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 1 - 5 - Command line parameters: - - - False - True - 0 - - - - - True - True - 5 - 10 - 5 - 10 - 5 - 5 - - - True - True - 1 - - - - - False - True - 7 - - - - - - - - - True - False - start - 5 - 5 - 5 - 5 - 5 - 5 - Terminal for input - start - - - - - False - True - 2 - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 0.019999999552965164 - in - - - True - False - 5 - - - True - False - vertical - - - 140 - True - True - 5 - 10 - 5 - 10 - 5 - 5 - in - - - True - False - - - True - True - - - - - - - - - - False - True - 0 - - - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 1 - 5 - Command line parameters: - - - False - True - 0 - - - - - True - True - 5 - 10 - 5 - 10 - 5 - 5 - - - True - True - 1 - - - - - False - True - 7 - - - - - - - - - True - False - start - 5 - 5 - 5 - 5 - 5 - 5 - Terminal for output - start - - - - - False - True - 3 - - - - - False - True - 5 - - - - - - - - - True - True - 2 - - - - - - - True - False - True - - - True - False - ubl-settings-bootloader - - - - - - - - True - False - 32 - com.ublinux.ubl-settings-bootloader - - - - - True - False - - - 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 - - - - - - False - True - 0 - - - - - end - 1 - - - - - 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 - - - - - - 2 - - - - - - - both - True - - - - - - - - both - True - - - - - - - - - - - - - - - False - btnOpenMenuOS - bottom - - - True - False - - - 0 - 0 - True - False - none - - - True - False - vertical - - - - - - - - True - True - 0 - - - - - 0 - 0 - True - False - none - True - - - True - False - vertical - - - 1 - 1 - True - True - True - - - True - False - start - 0 - gtk-goto-first - - - - - False - True - 0 - - - - - True - False - vertical - - - - - - False - True - 1 - - - - - - - False - True - 1 - - - - - - - False - Внимание! - center - dialog - - - True - False - vertical - - - True - False - 5 - 5 - 5 - 5 - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 50 - gtk-dialog-warning - - - True - True - 0 - - - - - 160 - True - False - start - center - 5 - 5 - 5 - 5 - 5 - 5 - Warning! - - - True - True - 1 - - - - - False - True - 1 - - - - - OK - True - True - True - 5 - 5 - 5 - 5 - 3 - 3 - - - False - True - 1 - - - - - - - True - False - none - - - True - False - vertical - - - - - - - - False - start - start - False - 450 - 250 - dialog-question-symbolic - - - True - False - vertical - - - True - False - - - True - False - start - 20 - 20 - dialog-question-symbolic - 5 - - - False - True - 0 - - - - - True - False - vertical - - - True - False - start - 10 - 5 - Would you like to read documentation in the Web? - True - 0 - - - - - - - False - True - 0 - - - - - True - False - start - start - 10 - 10 - You will be redirected to documentation website where documentation is translated and supported by community. - True - 0 - - - - True - True - 1 - - - - - Always redirect to online documentation - True - True - False - end - 10 - True - - - - False - True - 2 - - - - - - True - True - 1 - - - - - - True - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 30 - True - - - Cancel - True - True - True - - - - True - True - 0 - - - - - Read Online - True - True - True - - - - True - True - 1 - - - - - False - True - 1 - - - - - - - True - False - True - - - True - False - ubl-settings-bootloader - - - - - - - - True - False - 32 - dialog-question-symbolic - - - - - - - 800 - 600 - False - True - True - com.ublinux.ubl-settings-datetime - - - - - - True - False - True - - - True - False - ubl-settings-bootloader - - - - - True - False - 32 - com.ublinux.ubl-settings-bootloader - 5 - - - - - - From e279a946726678864d35b5974d247831e63a4f61 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 18 May 2023 11:03:32 +0600 Subject: [PATCH 09/20] fix --- source/ubl-settings-bootloader.cc | 70 +++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 13 deletions(-) diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index 0a29560..29b5162 100644 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -230,11 +230,13 @@ void MainWindow::item_selected_kernel(const Gtk::TreeModel::Path&, const Gtk::Tr treeViewOTT->get_selection()->unselect_all(); treeViewUser->get_selection()->unselect_all(); treeViewMelody->get_selection()->unselect_all(); - if (flag_blocked_tree_view == false) { - string str_flags = template_item_selected(size_kernel, list_store_kernel, "GRUB_CMDLINE_LINUX"); - map_cmd_selection["GRUB_CMDLINE_LINUX"] = str_flags; - // Utils::str_replace_all(str_flags, " ", ", "); - entryKernel->set_text(str_flags); + if (flag_blocked_tree_view == false) { + if (this->intel_idle_cstate_check(size_kernel, list_store_kernel, "GRUB_CMDLINE_LINUX") == false) { + string str_flags = template_item_selected(size_kernel, list_store_kernel, "GRUB_CMDLINE_LINUX"); + map_cmd_selection["GRUB_CMDLINE_LINUX"] = str_flags; + // Utils::str_replace_all(str_flags, " ", ", "); + entryKernel->set_text(str_flags); + } } } @@ -244,10 +246,12 @@ void MainWindow::item_selected_OTT(const Gtk::TreeModel::Path&, const Gtk::TreeM treeViewUser->get_selection()->unselect_all(); treeViewMelody->get_selection()->unselect_all(); if (flag_blocked_tree_view == false) { - string str_flags = template_item_selected(size_OTT, list_store_OTT, "GRUB_TERMINAL_OUTPUT"); - map_cmd_selection["GRUB_TERMINAL_OUTPUT"] = str_flags; - // Utils::str_replace_all(str_flags, " ", ", "); - entryOTT->set_text(str_flags); + if (this->intel_idle_cstate_check(size_OTT, list_store_OTT, "GRUB_TERMINAL_OUTPUT") == false) { + string str_flags = template_item_selected(size_OTT, list_store_OTT, "GRUB_TERMINAL_OUTPUT"); + map_cmd_selection["GRUB_TERMINAL_OUTPUT"] = str_flags; + // Utils::str_replace_all(str_flags, " ", ", "); + entryOTT->set_text(str_flags); + } } } @@ -257,10 +261,12 @@ void MainWindow::item_selected_IPT(const Gtk::TreeModel::Path&, const Gtk::TreeM treeViewUser->get_selection()->unselect_all(); treeViewMelody->get_selection()->unselect_all(); if (flag_blocked_tree_view == false) { - string str_flags = template_item_selected(size_IPT, list_store_IPT, "GRUB_TERMINAL_INPUT"); - map_cmd_selection["GRUB_TERMINAL_INPUT"] = str_flags; - // Utils::str_replace_all(str_flags, " ", ", "); - entryIPT->set_text(str_flags); + if (this->intel_idle_cstate_check(size_IPT, list_store_IPT, "GRUB_TERMINAL_INPUT") == false) { + string str_flags = template_item_selected(size_IPT, list_store_IPT, "GRUB_TERMINAL_INPUT"); + map_cmd_selection["GRUB_TERMINAL_INPUT"] = str_flags; + // Utils::str_replace_all(str_flags, " ", ", "); + entryIPT->set_text(str_flags); + } } } @@ -317,6 +323,44 @@ void MainWindow::set_download_mode() { map_cmd_selection["GRUB_BOOT_SILENT"] = key; } +bool MainWindow::intel_idle_cstate_check(int size, Glib::RefPtr &list_store, string key) { + string cmds_old = map_cmd_selection[key]; + string cmds = ""; + string param = ""; + int index_1 = -1; + int index_4 = -1; + bool active = false; + for (int index = 0; index < size; index++) { + Gtk::TreeModel::Row row = list_store->children()[index]; + if(row) { + param = row[m_columns.name] + ""; + active = row[m_columns.check_button]; + if (param == "intel_idle.max_cstate=1" && active == true) { + index_1 = index; + } + else if (param == "intel_idle.max_cstate=4" && active == true) { + index_4 = index; + } + } + } + if (index_1 != -1 && index_4 != -1) { + if (cmds_old.find("intel_idle.max_cstate=1") == string::npos) { + Gtk::TreeModel::Row row = list_store->children()[index_4]; + row[m_columns.check_button] = false; + return true; + } + else if (cmds_old.find("intel_idle.max_cstate=4") == string::npos) { + Gtk::TreeModel::Row row = list_store->children()[index_1]; + row[m_columns.check_button] = false; + return true; + } + else { + return false; + } + } + return false; +} + string MainWindow::template_item_selected(int size, Glib::RefPtr &list_store, string key) { string cmds_old = map_cmd_selection[key]; string cmds = ""; From 2377caedbb5a6985cc561321bb35021952c29c1f Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 18 May 2023 11:23:53 +0600 Subject: [PATCH 10/20] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D1=83=20?= =?UTF-8?q?=D0=BF=D1=83=D1=81=D1=82=D0=BE=D0=B9=20=D1=81=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=BF=D1=80=D0=B8=20=D0=B4=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8F=20=D0=B8=20?= =?UTF-8?q?=D0=BC=D0=B5=D0=BB=D0=BE=D0=B4=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-bootloader.cc | 46 ++++++++++++++++++++++++++++--- source/ubl-settings-bootloader.h | 2 ++ 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index 29b5162..c7b0558 100644 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -642,10 +642,8 @@ void MainWindow::event() { g_signal_connect(G_OBJECT(aboutWindows->gobj()), "activate-link", G_CALLBACK(wrapper_help_show), NULL); btnRemoveUser->signal_clicked().connect([&]() {remove_user();}); btnRemoveMusic->signal_clicked().connect([&]() {remove_melody();}); - btnAddUser->signal_clicked().connect([&]() {string name = "", passwd = ""; - set_add_data_user(row_user, false, name, passwd);}); - btnAddMusic->signal_clicked().connect([&]() {string code = "", name = ""; - set_add_data_melody(row_melody, false,name, code);}); + btnAddUser->signal_clicked().connect([&]() {wrapper_add_data_user();}); + btnAddMusic->signal_clicked().connect([&]() {wrapper_add_data_melody();}); btnOpenMenuOS->signal_clicked().connect([&]() {obj_menu_os.show();}); btnCancelHelp->signal_clicked().connect([&]() {wndShowWeb->hide();}); chkAlwaysOpenHelp->signal_toggled().connect([&]() {flag_open_browser = true;}); @@ -801,6 +799,27 @@ void MainWindow::set_data_csv_melody() { } } +void MainWindow::wrapper_add_data_user() { + string name; + string password; + bool flag_no_add_user = false; + Glib::RefPtr treeViewUser_model = treeViewUser->get_model(); + Gtk::TreeModel::Children children = treeViewUser_model->children(); + for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) { + Gtk::TreeModel::Row row = *iter; + name = row[m_columns_user.name] + ""; + password = row[m_columns_user.password] + ""; + if (name.length() == 0 || password.length() == 0) { + flag_no_add_user = true; + } + } + if (!flag_no_add_user) { + string name1 = ""; + string passwd = ""; + set_add_data_user(row_user, false, name1, passwd); + } +} + void MainWindow::set_add_data_user(Gtk::TreeModel::Row &row, bool flag, string &name, string &password) { row = *(list_store_user->append()); row[m_columns_user.check_button] = flag; @@ -836,6 +855,25 @@ void MainWindow::set_add_data_melody(Gtk::TreeModel::Row &row, bool flag, string row[m_columns_melody.melody_code] = code; len_old_melody += 1; } +void MainWindow::wrapper_add_data_melody() { + string code_melodyes = ""; + string melody_title = ""; + bool flag_no_add_melody = false; + Glib::RefPtr treeViewMelody_model = treeViewMelody->get_model(); + Gtk::TreeModel::Children children = treeViewMelody_model->children(); + for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) { + Gtk::TreeModel::Row row = *iter; + code_melodyes = row[m_columns_melody.melody_code] + ""; + melody_title = row[m_columns_melody.title] + ""; + if (code_melodyes.length() == 0 || melody_title.length() == 0) { + flag_no_add_melody = true; + } + } + if (flag_no_add_melody == false) { + string code = "", name = ""; + set_add_data_melody(row_melody, false, name, code); + } +} void MainWindow::remove_user() { if (flag_validate_del_user && list_store_user->iter_is_valid(iter_user_del)) { diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index 6c7b31e..54c0200 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -404,6 +404,8 @@ public: void set_init_data_user(std::map &map_temp); void set_init_data_superuser(std::map &map_temp); bool intel_idle_cstate_check(int size, Glib::RefPtr &list_store, string key); + void wrapper_add_data_user(); + void wrapper_add_data_melody(); }; class SettingsPlug : public Gtk::Plug From dc2a2d52bbe8fc498e3adfa411ed48a3124be7d1 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 18 May 2023 12:23:57 +0600 Subject: [PATCH 11/20] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20tooltip=20=D0=BA=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA?= =?UTF-8?q?=D0=B0=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-bootloader.cc | 5 +++++ source/ubl-settings-bootloader.h | 5 +++++ ubl-settings-bootloader.pot | 15 +++++++++++++++ ubl-settings-bootloader_ru.po | 15 +++++++++++++++ 4 files changed, 40 insertions(+) diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index c7b0558..184a659 100644 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -533,6 +533,11 @@ void MainWindow::localization() { btnCancelHelp->set_label(cancel); chkAlwaysOpenHelp->set_label(always_redirect); lblwebHeaderName->set_label(name_app); + btnRemoveMusic->set_tooltip_text(str_tooltip_del_melody); + btnAddMusic->set_tooltip_text(str_tooltip_add_melody); + btnRemoveUser->set_tooltip_text(str_tooltip_del_user); + btnAddUser->set_tooltip_text(str_tooltip_add_user); + btnOpenMenuOS->set_tooltip_text(str_tooltip_boot_menu); } vector MainWindow::get_setting_entry_all(string key, std::map * map_temp) { diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index 54c0200..9c6e8b8 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -36,6 +36,11 @@ extern bool flag_load_global; extern bool flag_lock_help; void me_thread(string cmd); +#define str_tooltip_add_user _("Add user") +#define str_tooltip_del_user _("Delete user") +#define str_tooltip_add_melody _("Add melody") +#define str_tooltip_del_melody _("Delete melody") +#define str_tooltip_boot_menu _("Selecting the loading mode option") #define copyright _("Copyright © UBSoft LLC, 2022 - ") #define name_app _("ubl-settings-bootloader") #define website _("https://wiki.ublinux.com") diff --git a/ubl-settings-bootloader.pot b/ubl-settings-bootloader.pot index 036d4f5..8a45f74 100644 --- a/ubl-settings-bootloader.pot +++ b/ubl-settings-bootloader.pot @@ -17,6 +17,21 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +msgid "Selecting the loading mode option" +msgstr "" + +msgid "Add user" +msgstr "" + +msgid "Delete user" +msgstr "" + +msgid "Add melody" +msgstr "" + +msgid "Delete melody" +msgstr "Удалить мелодию" + msgid "Melody added" msgstr "" diff --git a/ubl-settings-bootloader_ru.po b/ubl-settings-bootloader_ru.po index d2ed953..74a5f8c 100644 --- a/ubl-settings-bootloader_ru.po +++ b/ubl-settings-bootloader_ru.po @@ -17,6 +17,21 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +msgid "Selecting the loading mode option" +msgstr "Выбор варианта режима загрузки" + +msgid "Add user" +msgstr "Добавить пользователя" + +msgid "Delete user" +msgstr "Удалить пользователя" + +msgid "Add melody" +msgstr "Добавить мелодию" + +msgid "Delete melody" +msgstr "Удалить мелодию" + #: source/ubl-settings-bootloader.h:53 source/ubl-settings-bootloader.h:52 #: source/ubl-settings-bootloader.cc:431 source/ubl-settings-bootloader.cc:301 msgid "About" From 95198f87d39931449791ff0037711b1e90705514 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 18 May 2023 17:06:29 +0600 Subject: [PATCH 12/20] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=BE=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5?= =?UTF-8?q?=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=80=D0=BE=D0=B2=20=D0=BE?= =?UTF-8?q?=D0=BA=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/main.cc | 2 + source/ubl-settings-bootloader.cc | 107 +++++++++++++++++++++++------- source/ubl-settings-bootloader.h | 16 ++++- ubl-settings-bootloader.glade | 18 +---- ubl-settings-bootloader.pot | 6 ++ ubl-settings-bootloader_ru.po | 6 ++ 6 files changed, 112 insertions(+), 43 deletions(-) diff --git a/source/main.cc b/source/main.cc index 8b88c69..d5802e3 100644 --- a/source/main.cc +++ b/source/main.cc @@ -52,6 +52,8 @@ int main(int argc, char** argv) { pars_flag(1, argc, argv); MainWindow* wnd = nullptr; builder->get_widget_derived("window", wnd); + wnd->settings(); + wnd->event(); auto r = app->run(*wnd); delete wnd; return r; diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index 184a659..c6cfffa 100644 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -46,6 +46,9 @@ SettingsPlug::SettingsPlug(::Window p_socketID, Glib::RefPtr build MainWindow* wnd = nullptr; builder->get_widget_derived("window", wnd); builder->get_widget("plugBox", plugBox); + wnd->settings(); + wnd->set_plug(plugBox); + wnd->event(); plugBox->get_parent()->remove(*plugBox); add(*plugBox); show_all_children(); @@ -60,13 +63,11 @@ int MainWindow::check_root() { MainWindow::MainWindow(BaseObjectType* obj, Glib::RefPtr const& builder) : Gtk::ApplicationWindow(obj), builder{builder} { - this->builder = builder; - this->settings(); + this->builder = builder; } MainWindow::MainWindow(Glib::RefPtr const& builder) { this->builder = builder; - this->settings(); } void MainWindow::settings() { @@ -89,6 +90,7 @@ void MainWindow::settings() { overHead->add_overlay(*boxWidget); btnBoxAboutDialog->set_visible(false); ubl_make_plugs(boxSave,boxButton, socket_ext_id_I, socket_trd_id_I); + #ifdef WEBKIT_FOUND one = WEBKIT_WEB_VIEW(webkit_web_view_new()); three = Glib::wrap(GTK_WIDGET(one)); @@ -125,7 +127,10 @@ void MainWindow::settings() { this->set_active_boot_second(); this->fill_in_view(); } - this->event(); +} + +void MainWindow::set_plug(Gtk::Widget *plug) { + this->plug = plug; } vector>> MainWindow::format_os_list(vector &os_control_list) { @@ -520,13 +525,11 @@ void MainWindow::localization() { btnSave->set_label(str_save); btnLoad->set_label(str_load); this->set_title(name_app); - // Todo: check - lblDownloadMode->set_text(boot_screen_display_mode); cmbDownloadMode->append(loading_animation_with); cmbDownloadMode->append(loading_animation_without); cmbDownloadMode->append(no_loading_animation); cmbDownloadMode->append(lack_loading_animation); - + lblDownloadMode->set_text(boot_screen_display_mode); lblhelpHeader->set_text(read_documentation_web); lblhelpText->set_text(_(redirected_documentation)); btnReadHelp->set_label(read_online); @@ -676,6 +679,45 @@ void MainWindow::event() { } this->signal_delete_event().connect(sigc::mem_fun(*this, &MainWindow::gui_exit)); chbLoadVariantSelectionTimer->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::set_active_boot_second)); + if (plug == NULL) { + this->signal_check_resize().connect(sigc::mem_fun(*this, &MainWindow::check_resize_window)); + } + else { + plug->get_parent()->signal_check_resize().connect(sigc::mem_fun(*this, &MainWindow::check_resize_window)); + } +} + +void MainWindow::check_resize_window() { + int height = 0; + int width = 0; + if (plug == NULL) { + height = this->get_window()->get_height(); + width = this->get_window()->get_width(); + } + else { + height = plug->get_window()->get_height(); + width = plug->get_window()->get_width(); + // lblInfoHead->set_text(to_string(height)); + } + if (height != old_height) { + if (minimal_height >= height) { + cmbDownloadMode->remove_all(); + cmbDownloadMode->append(loading_animation_with); + cmbDownloadMode->append(loading_animation_without); + cmbDownloadMode->append(no_loading_animation_800_600); + cmbDownloadMode->append(lack_loading_animation_800_600); + } + else { + cmbDownloadMode->remove_all(); + cmbDownloadMode->append(loading_animation_with); + cmbDownloadMode->append(loading_animation_without); + cmbDownloadMode->append(no_loading_animation); + cmbDownloadMode->append(lack_loading_animation); + } + } + old_height = height; + old_width = width; + } void MainWindow::set_tree_view_user() { @@ -747,6 +789,7 @@ void MainWindow::set_init_data_user(std::map &map_temp) { } } Glib::RefPtr treeViewUserModel = treeViewUser->get_model(); + treeViewUser->signal_cursor_changed().connect(sigc::mem_fun(*this, &MainWindow::check_space_user)); treeViewUserModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::select_line_user)); this->view_add_colums_user(*treeViewUser); } @@ -849,6 +892,7 @@ void MainWindow::set_init_data_melody(std::map &map_temp) { this->set_add_data_melody(row_melody, flag, name, code); } Glib::RefPtr treeViewMelodyModel = treeViewMelody->get_model(); + treeViewMelody->signal_cursor_changed().connect(sigc::mem_fun(*this, &MainWindow::check_space_melody)); treeViewMelodyModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::select_line_melody)); this->view_add_colums_melody(*treeViewMelody); } @@ -908,13 +952,7 @@ void MainWindow::remove_melody() { flag_validate_del_melody = false; } -void MainWindow::select_line_user(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter) { - treeViewKernel->get_selection()->unselect_all(); - treeViewOTT->get_selection()->unselect_all(); - treeViewIPT->get_selection()->unselect_all(); - treeViewMelody->get_selection()->unselect_all(); - iter_user_del = iter; - flag_validate_del_user = true; +void MainWindow::check_space_user() { bool flag_error = false; string name = ""; string password = ""; @@ -943,16 +981,8 @@ void MainWindow::select_line_user(const Gtk::TreeModel::Path&, const Gtk::TreeMo lblWarning->set_text(str_add_user); } } - len_old_user = len_new_user; } - -void MainWindow::select_line_melody(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter) { - treeViewKernel->get_selection()->unselect_all(); - treeViewOTT->get_selection()->unselect_all(); - treeViewIPT->get_selection()->unselect_all(); - treeViewUser->get_selection()->unselect_all(); - iter_melody_del = iter; - flag_validate_del_melody = true; +void MainWindow::check_space_melody() { string code_melodyes = ""; string melody_title = ""; size_t len_new_melody = 0; @@ -980,6 +1010,37 @@ void MainWindow::select_line_melody(const Gtk::TreeModel::Path&, const Gtk::Tree lblWarning->set_text(str_add_melody); } } +} + +void MainWindow::select_line_user(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter) { + treeViewKernel->get_selection()->unselect_all(); + treeViewOTT->get_selection()->unselect_all(); + treeViewIPT->get_selection()->unselect_all(); + treeViewMelody->get_selection()->unselect_all(); + iter_user_del = iter; + size_t len_new_user = 0; + flag_validate_del_user = true; + Glib::RefPtr treeViewUser_model = treeViewUser->get_model(); + Gtk::TreeModel::Children children = treeViewUser_model->children(); + for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) { + len_new_user += 1; + } + len_old_user = len_new_user; +} + +void MainWindow::select_line_melody(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter) { + treeViewKernel->get_selection()->unselect_all(); + treeViewOTT->get_selection()->unselect_all(); + treeViewIPT->get_selection()->unselect_all(); + treeViewUser->get_selection()->unselect_all(); + iter_melody_del = iter; + size_t len_new_melody = 0; + flag_validate_del_melody = true; + Glib::RefPtr treeViewMelody_model = treeViewMelody->get_model(); + Gtk::TreeModel::Children children = treeViewMelody_model->children(); + for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) { + len_new_melody += 1; + } this->validate_melody(); len_old_melody = len_new_melody; } diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index 9c6e8b8..dea3d24 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -36,6 +36,8 @@ extern bool flag_load_global; extern bool flag_lock_help; void me_thread(string cmd); +#define minimal_width 640 +#define minimal_height 500 #define str_tooltip_add_user _("Add user") #define str_tooltip_del_user _("Delete user") #define str_tooltip_add_melody _("Add melody") @@ -68,7 +70,8 @@ void me_thread(string cmd); #define cancel _("Cancel") #define always_redirect _("Always redirect") #define boot_screen_display_mode _("Boot screen display mode:") -#define no_loading_animation _("No loading animation,\nfull log") +#define no_loading_animation_800_600 _("No loading animation,\nfull log") +#define no_loading_animation _("No loading animation, full log") #define boot_menu_user_name _("Boot menu user name:") #define boot_menu_user_password _("Boot menu user password:") #define last_successful_upload _("Last successful upload") @@ -78,7 +81,8 @@ void me_thread(string cmd); #define user_password_configuration_edit_mode _("User password to enter boot configuration edit mode") #define loading_animation_with _("Loading animation with the magazine") #define loading_animation_without _("Loading animation without a magazine") -#define lack_loading_animation _("Lack of loading animation with the\noutput of the abbreviated log") +#define lack_loading_animation_800_600 _("Lack of loading animation with the\noutput of the abbreviated log") +#define lack_loading_animation _("Lack of loading animation with the output of the abbreviated log") #define web_url _("https://wiki.ublinux.com") #define enter_password _("Enter your password") #define enter_login _("Enter login") @@ -211,6 +215,7 @@ public: ModelColumnsUser m_columns_user; ModelColumnsMelody m_columns_melody; Glib::RefPtr builder; + Gtk::Widget *plug = NULL; Gtk::SpinButton *spbSecond; Gtk::Label *lblBootMenuUsers; Gtk::Label *lblRingtoneStartup; @@ -321,7 +326,8 @@ public: size_t size_OTT = 0; size_t len_old_melody = 0; size_t len_old_user = 0; - + int old_height = 0; + int old_width = 0; Glib::RefPtr boxInfo; string str_cmd_error = ""; template @@ -411,6 +417,10 @@ public: bool intel_idle_cstate_check(int size, Glib::RefPtr &list_store, string key); void wrapper_add_data_user(); void wrapper_add_data_melody(); + void check_resize_window(); + void set_plug(Gtk::Widget *plug); + void check_space_user(); + void check_space_melody(); }; class SettingsPlug : public Gtk::Plug diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade index 64bf3da..3569cfc 100644 --- a/ubl-settings-bootloader.glade +++ b/ubl-settings-bootloader.glade @@ -111,8 +111,7 @@ 5 5 5 - Running applications as a user with a -specified priority + ubl-settings-bootloader @@ -640,9 +639,6 @@ specified priority True True - - - @@ -793,9 +789,6 @@ specified priority True True - - - @@ -968,9 +961,6 @@ specified priority True True - - - @@ -1096,9 +1086,6 @@ specified priority True True - - - @@ -1224,9 +1211,6 @@ specified priority True True - - - diff --git a/ubl-settings-bootloader.pot b/ubl-settings-bootloader.pot index 8a45f74..e0c0e5b 100644 --- a/ubl-settings-bootloader.pot +++ b/ubl-settings-bootloader.pot @@ -29,6 +29,12 @@ msgstr "" msgid "Add melody" msgstr "" +msgid "No loading animation, full log" +msgstr "" + +msgid "Lack of loading animation with the output of the abbreviated log" +msgstr "" + msgid "Delete melody" msgstr "Удалить мелодию" diff --git a/ubl-settings-bootloader_ru.po b/ubl-settings-bootloader_ru.po index 74a5f8c..1ea37f9 100644 --- a/ubl-settings-bootloader_ru.po +++ b/ubl-settings-bootloader_ru.po @@ -223,6 +223,9 @@ msgstr "Терминал для вывода" msgid "Lack of loading animation with the\noutput of the abbreviated log" msgstr "Отсутствие анимации загрузки с\nвыводом сокращенного журнала" +msgid "Lack of loading animation with the output of the abbreviated log" +msgstr "Отсутствие анимации загрузки с выводом сокращенного журнала" + #, fuzzy msgid "Last Successful Download" msgstr "Последняя удачная загрузка" @@ -312,6 +315,9 @@ msgstr "Максимальная производительность, упра msgid "No loading animation,\nfull log" msgstr "Отсутствие анимации загрузки\nс выводом журнала" +msgid "No loading animation, full log" +msgstr "Отсутствие анимации загрузки с выводом журнала" + #: source/ubl-settings-bootloader.cc:444 source/ubl-settings-bootloader.cc:446 msgid "Not available" msgstr "Отсутствует" From dd63a66c2fe13d96dca8f9675b97b68f8a496b78 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Thu, 18 May 2023 17:59:47 +0600 Subject: [PATCH 13/20] =?UTF-8?q?=D0=9D=D0=B0=D1=87=D0=B0=D1=82=D0=B0=20?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D0=BF=D0=BE=20=D0=BE?= =?UTF-8?q?=D0=BA=D0=BD=D1=83=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-bootloader.cc | 79 ++++++- source/ubl-settings-bootloader.h | 46 +++- ubl-settings-bootloader.glade | 342 +++++++++++++++++++++++++++++- 3 files changed, 461 insertions(+), 6 deletions(-) diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index c6cfffa..081d48c 100644 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -61,6 +61,77 @@ int MainWindow::check_root() { return 0; } +// ================================================================= +View_edit_add_table::View_edit_add_table() { + builder = Gtk::Builder::create_from_file(path_glade); + this->settings(); +} + +void View_edit_add_table::settings() { + this->get_builder(); + this->localization(); + this->event(); + +} + +void View_edit_add_table::event() { + btnCancel->signal_clicked().connect([&]() {cancel();}); + btnSave->signal_clicked().connect([&]() {save();}); +} + +void View_edit_add_table::localization() { + +} +void View_edit_add_table::get_builder() { + builder->get_widget("wndQuotasAddProject", wndQuotasAddProject); + builder->get_widget("btnCancel", btnCancel); + builder->get_widget("btnSave", btnSave); + builder->get_widget("chkAddEdit", chkAddEdit); + builder->get_widget("entryCol1", entryCol1); + builder->get_widget("entryCol2", entryCol2); + builder->get_widget("lblAddEditTitle", lblAddEditTitle); + builder->get_widget("lblAddEditCheckBox", lblAddEditCheckBox); + builder->get_widget("lblAddEditCol1", lblAddEditCol1); + builder->get_widget("lblAddEditCol2", lblAddEditCol2); + builder->get_widget("lblAddEdittTableName", lblAddEdittTableName); +} + +void View_edit_add_table::cancel() { + wndQuotasAddProject->hide(); + flag_save = false; +} + +void View_edit_add_table::save() { + wndQuotasAddProject->hide(); + flag_save = true; +} +struct Data View_edit_add_table::get_data() { + if (flag_save == true) { + return new_data; + } + return old_data; +} +void Data View_edit_add_table::show() { + flag_save = false; + wndQuotasAddProject->show(); +} + +void View_edit_add_table::set_data(bool check, string colmn1, string colmn2) { + old_data.check = check; + old_data.colmn1 = colmn1; + old_data.colomn2 = colomn2; +} + +void View_edit_add_table::show_edit() { + this->show(); +} + +void View_edit_add_table::show_add() { + this->show(); +} + +// ================================================================= + MainWindow::MainWindow(BaseObjectType* obj, Glib::RefPtr const& builder) : Gtk::ApplicationWindow(obj), builder{builder} { this->builder = builder; @@ -70,6 +141,8 @@ MainWindow::MainWindow(Glib::RefPtr const& builder) { this->builder = builder; } + + void MainWindow::settings() { obj_main = this; map_cmd_error[""] = ""; @@ -487,6 +560,10 @@ void MainWindow::get_builder() { builder->get_widget("btnRemoveUser", btnRemoveUser); builder->get_widget("btnAddMusic", btnAddMusic); builder->get_widget("btnRemoveMusic", btnRemoveMusic); + builder->get_widget("btnEditMusic", btnEditMusic); + builder->get_widget("btnEditUser", btnEditUser); + + } void MainWindow::localization() { @@ -533,7 +610,7 @@ void MainWindow::localization() { lblhelpHeader->set_text(read_documentation_web); lblhelpText->set_text(_(redirected_documentation)); btnReadHelp->set_label(read_online); - btnCancelHelp->set_label(cancel); + btnCancelHelp->set_label(str_cancel); chkAlwaysOpenHelp->set_label(always_redirect); lblwebHeaderName->set_label(name_app); btnRemoveMusic->set_tooltip_text(str_tooltip_del_melody); diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index dea3d24..3a0938f 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -67,7 +67,7 @@ void me_thread(string cmd); #define load_global _("Load global configuration") #define load_local _("Load local configuration") #define read_online _("Read online") -#define cancel _("Cancel") +#define str_cancel _("Cancel") #define always_redirect _("Always redirect") #define boot_screen_display_mode _("Boot screen display mode:") #define no_loading_animation_800_600 _("No loading animation,\nfull log") @@ -158,6 +158,47 @@ void me_thread(string cmd); #define str_del_user _("User deleted") #define str_del_melody _("Melody deleted") +class View_edit_add_table { +private: + Glib::RefPtr builder; + Gtk::Window* wndQuotasAddProject; + Gtk::Button* btnCancel; + Gtk::Button* btnSave; + Gtk::CheckButton* chkAddEdit; + Gtk::Entry* entryCol1; + Gtk::Entry* entryCol2; + Gtk::Label* lblAddEditTitle; + Gtk::Label* lblAddEditCheckBox; + Gtk::Label* lblAddEditCol1; + Gtk::Label* lblAddEditCol2; + Gtk::Label* lblAddEdittTableName; + +private: + View_edit_add_table(); + ~View_edit_add_table(); + struct Data { + bool check; + string colomn1; + string colomn2; + }; + struct Data old_data; + struct Data new_data; + string flag_save = false; +public: + void settings(); + void event(); + void localization(); + void cancel(); + void save(); + void set_data(bool check, string colmn1, string colmn2); + void get_data(); + void show(); + void get_builder(); + void show_edit(); + void show_add(); +}; + + class CmdArgParser : public Glib::OptionGroup { public: @@ -234,6 +275,8 @@ public: Gtk::Button *btnRemoveUser; Gtk::Button *btnAddMusic; Gtk::Button *btnRemoveMusic; + Gtk::Button *btnEditUser; + Gtk::Button *btnEditMusic; Gtk::CheckButton *chbVgaText; Gtk::CheckButton *chbLoadVariantSelectionTimer; Gtk::Entry *entryKernel; @@ -313,6 +356,7 @@ public: vector vec_param_names; My_Process::My_Process_system obj_process_system = My_Process::My_Process_system(); My_Process::My_Process_call obj_process_call = My_Process::My_Process_call(); + View_edit_add_table obj_view_edit_add_table = View_edit_add_table(); bool flag_load = false; bool flag_save_all = false; bool flag_blocked_tree_view = false; diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade index 3569cfc..796e699 100644 --- a/ubl-settings-bootloader.glade +++ b/ubl-settings-bootloader.glade @@ -623,7 +623,7 @@ vertical - 65 + 100 True True 3 @@ -689,6 +689,31 @@ 0 + + + True + True + True + 5 + 10 + 5 + 10 + 3 + 5 + + + True + False + gtk-select-all + + + + + False + True + 1 + + True @@ -711,7 +736,7 @@ False True - 1 + 2 @@ -773,7 +798,7 @@ vertical - 65 + 100 True True 5 @@ -839,6 +864,31 @@ 0 + + + True + True + True + 5 + 10 + 5 + 10 + 3 + 5 + + + True + False + gtk-select-all + + + + + False + True + 1 + + True @@ -861,7 +911,7 @@ False True - 1 + 2 @@ -1724,6 +1774,290 @@ + + False + True + True + com.ublinux.ubl-settings-datetime + + + True + False + vertical + + + True + False + + + True + False + label + + + False + True + 0 + + + + + True + False + label + + + False + True + 1 + + + + + + + + False + True + 0 + + + + + True + False + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + label + + + False + True + 0 + + + + + True + True + False + 5 + 5 + 5 + 5 + 7 + 5 + True + + + + + + False + True + 1 + + + + + True + True + 0 + + + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + label + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 5 + 5 + + + False + True + 1 + + + + + True + True + 1 + + + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + label + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 5 + 5 + + + False + True + 1 + + + + + True + True + 2 + + + + + True + True + 1 + + + + + True + False + end + 5 + True + + + gtk-cancel + True + True + True + 5 + 5 + 5 + 5 + 5 + 5 + True + + + False + True + 0 + + + + + gtk-save + True + True + True + 5 + 5 + 5 + 5 + 5 + 5 + True + + + False + True + 1 + + + + + False + True + 2 + + + + + + + True + False + + + True + False + ubl-settings-bootloader + + + + + True + False + 32 + com.ublinux.ubl-settings-bootloader + 5 + + + + + False start From 8c3cec9d570fc6abcf9cd52149da83fdfef53d3b Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Fri, 19 May 2023 12:25:14 +0600 Subject: [PATCH 14/20] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D1=8E=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B8=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=82=D0=B0=D0=B1=D0=BB=D0=B8?= =?UTF-8?q?=D1=86=20user,=20melody?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-bootloader.cc | 283 +++++++++++++++++------------- source/ubl-settings-bootloader.h | 47 +++-- ubl-settings-bootloader.css | 7 + ubl-settings-bootloader.glade | 179 ++++++++++--------- ubl-settings-bootloader.pot | 6 + ubl-settings-bootloader_ru.po | 6 + 6 files changed, 307 insertions(+), 221 deletions(-) diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index 081d48c..9c8d6a2 100644 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -76,60 +76,143 @@ void View_edit_add_table::settings() { void View_edit_add_table::event() { btnCancel->signal_clicked().connect([&]() {cancel();}); - btnSave->signal_clicked().connect([&]() {save();}); + btnSaveEditSave->signal_clicked().connect([&]() {save();}); + wndAddEditData->signal_hide().connect([&]() {this->get_data();}); + entryCol1->signal_changed().connect([&]() {this->check_space_entry();}); + entryCol2->signal_changed().connect([&]() {this->check_space_entry();}); +} + +void View_edit_add_table::check_space_entry() { + if (entryCol1->get_text().length() == 0 || entryCol2->get_text().length() == 0) { + btnSaveEditSave->set_sensitive(false); + } + else { + btnSaveEditSave->set_sensitive(true); + } } void View_edit_add_table::localization() { } void View_edit_add_table::get_builder() { - builder->get_widget("wndQuotasAddProject", wndQuotasAddProject); + builder->get_widget("wndAddEditData", wndAddEditData); builder->get_widget("btnCancel", btnCancel); - builder->get_widget("btnSave", btnSave); + builder->get_widget("btnSaveEditSave", btnSaveEditSave); builder->get_widget("chkAddEdit", chkAddEdit); builder->get_widget("entryCol1", entryCol1); builder->get_widget("entryCol2", entryCol2); - builder->get_widget("lblAddEditTitle", lblAddEditTitle); builder->get_widget("lblAddEditCheckBox", lblAddEditCheckBox); builder->get_widget("lblAddEditCol1", lblAddEditCol1); builder->get_widget("lblAddEditCol2", lblAddEditCol2); - builder->get_widget("lblAddEdittTableName", lblAddEdittTableName); + builder->get_widget("lblEditAddHead", lblEditAddHead); + } + void View_edit_add_table::cancel() { - wndQuotasAddProject->hide(); + wndAddEditData->hide(); flag_save = false; } void View_edit_add_table::save() { - wndQuotasAddProject->hide(); flag_save = true; + new_data.check = chkAddEdit->get_active(); + new_data.column1 = entryCol1->get_text(); + new_data.column2 = entryCol2->get_text(); + wndAddEditData->hide(); } -struct Data View_edit_add_table::get_data() { +struct View_edit_add_table::struct_data View_edit_add_table::get_data() { if (flag_save == true) { + if (mode_show == "ue" && new_data.column1.length() != 0 && new_data.column2.length() != 0) { + obj_main->wrapper_edit_user(new_data.check, new_data.column1, new_data.column2); + } + else if (mode_show == "me" && new_data.column1.length() != 0 && new_data.column2.length() != 0) { + obj_main->wrapper_edit_melody(new_data.check, new_data.column1, new_data.column2); + } + else if (mode_show == "ua" && new_data.column1.length() != 0 && new_data.column2.length() != 0) { + obj_main->wrapper_set_add_data_user(new_data.check, new_data.column1, new_data.column2); + } + else if (mode_show == "ma" && new_data.column1.length() != 0 && new_data.column2.length() != 0) { + obj_main->wrapper_set_add_data_melody(new_data.check, new_data.column1, new_data.column2); + } return new_data; } + if (mode_show == "ue" && old_data.column1.length() != 0 && old_data.column2.length() != 0) { + obj_main->wrapper_edit_user(old_data.check, old_data.column1, old_data.column2); + } + else if (mode_show == "me" && old_data.column1.length() != 0 && old_data.column2.length() != 0) { + obj_main->wrapper_edit_melody(old_data.check, old_data.column1, old_data.column2); + } + else if (mode_show == "ua" && old_data.column1.length() != 0 && old_data.column2.length() != 0){ + obj_main->wrapper_set_add_data_user(old_data.check, old_data.column1, old_data.column2); + } + else if (mode_show == "ma" && old_data.column1.length() != 0 && old_data.column2.length() != 0) { + obj_main->wrapper_set_add_data_melody(old_data.check, old_data.column1, old_data.column2); + } return old_data; } -void Data View_edit_add_table::show() { +void View_edit_add_table::show() { flag_save = false; - wndQuotasAddProject->show(); + wndAddEditData->show(); } -void View_edit_add_table::set_data(bool check, string colmn1, string colmn2) { +void View_edit_add_table::set_data(bool check, string column1, string column2) { old_data.check = check; - old_data.colmn1 = colmn1; - old_data.colomn2 = colomn2; + old_data.column1 = column1; + old_data.column2 = column2; + chkAddEdit->set_active(check); + entryCol1->set_text(column1); + entryCol2->set_text(column2); +} + +void View_edit_add_table::show_melody_edit() { + lblAddEditCheckBox->set_text(string(str_active) + ":"); + lblAddEditCol1->set_text(string(str_option) + ":"); + lblAddEditCol2->set_text(string(str_melody_code) + ":"); + string title = string(str_ringtone_at_startup) + " - " + string(str_edit); + lblEditAddHead->set_text(title); + mode_show = "me"; + this->show(); } -void View_edit_add_table::show_edit() { +void View_edit_add_table::show_melody_add() { + btnSaveEditSave->set_sensitive(false); + chkAddEdit->set_active(false); + entryCol1->set_text(""); + entryCol2->set_text(""); + lblAddEditCheckBox->set_text(string(str_active) + ":"); + lblAddEditCol1->set_text(string(str_option) + ":"); + lblAddEditCol2->set_text(string(str_melody_code) + ":"); + string title = string(str_ringtone_at_startup) + " - " + string(str_adding); + lblEditAddHead->set_text(title); + mode_show = "ma"; + btnSaveEditSave->set_sensitive(false); this->show(); } - -void View_edit_add_table::show_add() { +void View_edit_add_table::show_user_edit() { + lblAddEditCheckBox->set_text(string(str_administrator) + ":"); + lblAddEditCol1->set_text(string(str_user) + ":"); + lblAddEditCol2->set_text(string(str_password) + ":"); + string title = string(str_title_Boot_Menu_Users) + " - " + string(str_edit); + lblEditAddHead->set_text(title); + mode_show = "ue"; this->show(); } +void View_edit_add_table::show_user_add() { + btnSaveEditSave->set_sensitive(false); + chkAddEdit->set_active(false); + entryCol1->set_text(""); + entryCol2->set_text(""); + lblAddEditCheckBox->set_text(string(str_administrator) + ":"); + lblAddEditCol1->set_text(string(str_user) + ":"); + lblAddEditCol2->set_text(string(str_password) + ":"); + string title = string(str_title_Boot_Menu_Users) + " - " + string(str_adding); + lblEditAddHead->set_text(title); + btnSaveEditSave->set_sensitive(false); + this->show(); + mode_show = "ua"; +} // ================================================================= MainWindow::MainWindow(BaseObjectType* obj, Glib::RefPtr const& builder) @@ -293,14 +376,14 @@ void MainWindow::fill_in_view() { void MainWindow::view_add_colums_user(Gtk::TreeView &treeView) { treeView.append_column_editable(str_administrator, m_columns_user.check_button); - treeView.append_column_editable(str_user, m_columns_user.name); - treeView.append_column_editable(str_password, m_columns_user.password); + treeView.append_column(str_user, m_columns_user.name); + treeView.append_column(str_password, m_columns_user.password); } void MainWindow::view_add_colums_melody(Gtk::TreeView &treeView) { treeView.append_column_editable(str_active, m_columns_melody.check_button); - treeView.append_column_editable(str_option, m_columns_melody.title); - treeView.append_column_editable(str_melody_code, m_columns_melody.melody_code); + treeView.append_column(str_option, m_columns_melody.title); + treeView.append_column(str_melody_code, m_columns_melody.melody_code); } void MainWindow::item_selected_kernel(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&) { @@ -727,6 +810,8 @@ void MainWindow::event() { g_signal_connect(G_OBJECT(aboutWindows->gobj()), "activate-link", G_CALLBACK(wrapper_help_show), NULL); btnRemoveUser->signal_clicked().connect([&]() {remove_user();}); btnRemoveMusic->signal_clicked().connect([&]() {remove_melody();}); + btnEditUser->signal_clicked().connect([&]() {wrapper_edit_show_user();}); + btnEditMusic->signal_clicked().connect([&]() {wrapper_edit_show_melody();}); btnAddUser->signal_clicked().connect([&]() {wrapper_add_data_user();}); btnAddMusic->signal_clicked().connect([&]() {wrapper_add_data_melody();}); btnOpenMenuOS->signal_clicked().connect([&]() {obj_menu_os.show();}); @@ -763,6 +848,54 @@ void MainWindow::event() { plug->get_parent()->signal_check_resize().connect(sigc::mem_fun(*this, &MainWindow::check_resize_window)); } } +void MainWindow::wrapper_edit_user(bool check, string column1, string column2) { + if (flag_validate_del_user && list_store_user->iter_is_valid(iter_user_del)) { + Gtk::TreeModel::Row row = *iter_user_del; + if(row) { + row[m_columns_user.check_button] = check; + row[m_columns_user.name] = column1; + row[m_columns_user.password] = column2; + } + } +} +void MainWindow::wrapper_edit_melody(bool check, string column1, string column2) { + if (flag_validate_del_melody && list_store_melody->iter_is_valid(iter_melody_del)) { + Gtk::TreeModel::Row row = *iter_melody_del; + if(row) { + row[m_columns_user.check_button] = check; + row[m_columns_user.name] = column1; + row[m_columns_user.password] = column2; + } + } +} + +void MainWindow::wrapper_edit_show_user() { + if (flag_validate_del_user && list_store_user->iter_is_valid(iter_user_del)) { + Gtk::TreeModel::Row row = *iter_user_del; + if(row) { + bool flag_activ = row[m_columns_user.check_button]; + string name = row[m_columns_user.name] + ""; + string password = row[m_columns_user.password] + ""; + obj_view_edit_add_table.set_data(flag_activ, name, password); + obj_view_edit_add_table.show_user_edit(); + + } + } + +} +void MainWindow::wrapper_edit_show_melody() { + if (flag_validate_del_melody && list_store_melody->iter_is_valid(iter_melody_del)) { + Gtk::TreeModel::Row row = *iter_melody_del; + if(row) { + bool flag_activ = row[m_columns_melody.check_button]; + string title = row[m_columns_melody.title] + ""; + string melody_code = row[m_columns_melody.melody_code] + ""; + obj_view_edit_add_table.set_data(flag_activ, title, melody_code); + obj_view_edit_add_table.show_melody_edit(); + + } + } +} void MainWindow::check_resize_window() { int height = 0; @@ -866,7 +999,6 @@ void MainWindow::set_init_data_user(std::map &map_temp) { } } Glib::RefPtr treeViewUserModel = treeViewUser->get_model(); - treeViewUser->signal_cursor_changed().connect(sigc::mem_fun(*this, &MainWindow::check_space_user)); treeViewUserModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::select_line_user)); this->view_add_colums_user(*treeViewUser); } @@ -925,24 +1057,8 @@ void MainWindow::set_data_csv_melody() { } void MainWindow::wrapper_add_data_user() { - string name; - string password; - bool flag_no_add_user = false; - Glib::RefPtr treeViewUser_model = treeViewUser->get_model(); - Gtk::TreeModel::Children children = treeViewUser_model->children(); - for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) { - Gtk::TreeModel::Row row = *iter; - name = row[m_columns_user.name] + ""; - password = row[m_columns_user.password] + ""; - if (name.length() == 0 || password.length() == 0) { - flag_no_add_user = true; - } - } - if (!flag_no_add_user) { - string name1 = ""; - string passwd = ""; - set_add_data_user(row_user, false, name1, passwd); - } + obj_view_edit_add_table.show_user_add(); + } void MainWindow::set_add_data_user(Gtk::TreeModel::Row &row, bool flag, string &name, string &password) { @@ -952,7 +1068,10 @@ void MainWindow::set_add_data_user(Gtk::TreeModel::Row &row, bool flag, string & row[m_columns_user.password] = password; len_old_user += 1; } - +void MainWindow::wrapper_set_add_data_user(bool flag, string &name, string &password) { + Gtk::TreeModel::Row row; + this->set_add_data_user(row, flag, name, password); +} void MainWindow::set_init_data_melody(std::map &map_temp) { treeViewMelody->remove_all_columns(); list_store_melody = Gtk::ListStore::create(m_columns_melody); @@ -969,7 +1088,6 @@ void MainWindow::set_init_data_melody(std::map &map_temp) { this->set_add_data_melody(row_melody, flag, name, code); } Glib::RefPtr treeViewMelodyModel = treeViewMelody->get_model(); - treeViewMelody->signal_cursor_changed().connect(sigc::mem_fun(*this, &MainWindow::check_space_melody)); treeViewMelodyModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::select_line_melody)); this->view_add_colums_melody(*treeViewMelody); } @@ -981,24 +1099,13 @@ void MainWindow::set_add_data_melody(Gtk::TreeModel::Row &row, bool flag, string row[m_columns_melody.melody_code] = code; len_old_melody += 1; } +void MainWindow::wrapper_set_add_data_melody(bool flag, string &name, string &code) { + Gtk::TreeModel::Row row; + this->set_add_data_melody(row,flag, name, code); +} + void MainWindow::wrapper_add_data_melody() { - string code_melodyes = ""; - string melody_title = ""; - bool flag_no_add_melody = false; - Glib::RefPtr treeViewMelody_model = treeViewMelody->get_model(); - Gtk::TreeModel::Children children = treeViewMelody_model->children(); - for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) { - Gtk::TreeModel::Row row = *iter; - code_melodyes = row[m_columns_melody.melody_code] + ""; - melody_title = row[m_columns_melody.title] + ""; - if (code_melodyes.length() == 0 || melody_title.length() == 0) { - flag_no_add_melody = true; - } - } - if (flag_no_add_melody == false) { - string code = "", name = ""; - set_add_data_melody(row_melody, false, name, code); - } + obj_view_edit_add_table.show_melody_add(); } void MainWindow::remove_user() { @@ -1029,66 +1136,6 @@ void MainWindow::remove_melody() { flag_validate_del_melody = false; } -void MainWindow::check_space_user() { - bool flag_error = false; - string name = ""; - string password = ""; - size_t len_new_user = 0; - Glib::RefPtr treeViewUser_model = treeViewUser->get_model(); - Gtk::TreeModel::Children children = treeViewUser_model->children(); - for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) { - Gtk::TreeModel::Row row = *iter; - name = row[m_columns_user.name] + ""; - password = row[m_columns_user.password] + ""; - len_new_user += 1; - if (name.length() == 0 || password.length() == 0) { - flag_error = true; - - } - } - if (flag_error == true) { - imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU); - info_status_app(info_box_error_css); - lblWarning->set_text(str_null_username); - } - else { - if ((len_old_user-1) != len_new_user) { - info_status_app(info_box_ok_css); - imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU); - lblWarning->set_text(str_add_user); - } - } -} -void MainWindow::check_space_melody() { - string code_melodyes = ""; - string melody_title = ""; - size_t len_new_melody = 0; - bool flag_error = false; - Glib::RefPtr treeViewMelody_model = treeViewMelody->get_model(); - Gtk::TreeModel::Children children = treeViewMelody_model->children(); - for(Gtk::TreeModel::iterator iter = children.begin(); iter != children.end(); ++iter) { - Gtk::TreeModel::Row row = *iter; - code_melodyes = row[m_columns_melody.melody_code] + ""; - melody_title = row[m_columns_melody.title] + ""; - len_new_melody += 1; - if (code_melodyes.length() == 0 || melody_title.length() == 0) { - flag_error = true; - } - } - if (flag_error == true) { - imgInfo->set_from_icon_name(icon_warning, Gtk::ICON_SIZE_MENU); - info_status_app(info_box_error_css); - lblWarning->set_text(str_null_melody_name); - } - else { - if ((len_old_melody-1) != len_new_melody) { - info_status_app(info_box_ok_css); - imgInfo->set_from_icon_name(icon_checked, Gtk::ICON_SIZE_MENU); - lblWarning->set_text(str_add_melody); - } - } -} - void MainWindow::select_line_user(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter) { treeViewKernel->get_selection()->unselect_all(); treeViewOTT->get_selection()->unselect_all(); diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index 3a0938f..3254043 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -61,6 +61,8 @@ void me_thread(string cmd); #define str_about_1 _("About") #define str_save _("Save") #define str_load _("Load") +#define str_edit _("Edit") +#define str_adding _("Adding") #define save_all _("Save configuration") #define save_local _("Save in local configuration") #define save_global _("Save in global configuration") @@ -161,41 +163,44 @@ void me_thread(string cmd); class View_edit_add_table { private: Glib::RefPtr builder; - Gtk::Window* wndQuotasAddProject; + Gtk::Window* wndAddEditData; Gtk::Button* btnCancel; - Gtk::Button* btnSave; + Gtk::Button* btnSaveEditSave; Gtk::CheckButton* chkAddEdit; Gtk::Entry* entryCol1; Gtk::Entry* entryCol2; - Gtk::Label* lblAddEditTitle; Gtk::Label* lblAddEditCheckBox; Gtk::Label* lblAddEditCol1; Gtk::Label* lblAddEditCol2; - Gtk::Label* lblAddEdittTableName; + Gtk::Label* lblEditAddHead; + bool flag_save = false; + string mode_show = ""; -private: - View_edit_add_table(); - ~View_edit_add_table(); - struct Data { +public: + struct struct_data { bool check; - string colomn1; - string colomn2; + string column1; + string column2; }; - struct Data old_data; - struct Data new_data; - string flag_save = false; + struct struct_data old_data; + struct struct_data new_data; public: + View_edit_add_table(); + //~View_edit_add_table(); void settings(); void event(); void localization(); void cancel(); void save(); - void set_data(bool check, string colmn1, string colmn2); - void get_data(); + void check_space_entry(); + void set_data(bool check, string column1, string column2); + struct struct_data get_data(); void show(); + void show_melody_edit(); + void show_melody_add(); + void show_user_edit(); + void show_user_add(); void get_builder(); - void show_edit(); - void show_add(); }; @@ -463,8 +468,12 @@ public: void wrapper_add_data_melody(); void check_resize_window(); void set_plug(Gtk::Widget *plug); - void check_space_user(); - void check_space_melody(); + void wrapper_edit_show_user(); + void wrapper_edit_show_melody(); + void wrapper_edit_melody(bool check, string column1, string column2); + void wrapper_edit_user(bool check, string column1, string column2); + void wrapper_set_add_data_melody(bool flag, string &name, string &code); + void wrapper_set_add_data_user(bool flag, string &name, string &password); }; class SettingsPlug : public Gtk::Plug diff --git a/ubl-settings-bootloader.css b/ubl-settings-bootloader.css index 34c1572..dcc568a 100644 --- a/ubl-settings-bootloader.css +++ b/ubl-settings-bootloader.css @@ -144,3 +144,10 @@ opacity:0.99; } +.thin{ + margin:0px; + padding: 0px; +} +.nobg{ + background: none; +} \ No newline at end of file diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade index 796e699..1b94d7f 100644 --- a/ubl-settings-bootloader.glade +++ b/ubl-settings-bootloader.glade @@ -153,12 +153,19 @@ True True - + True - False - gtk-goto-last + True + False + True + right + + + @@ -529,7 +536,7 @@ True False - open-menu-symbolic + image-loading-symbolic @@ -639,6 +646,9 @@ True True + + + @@ -814,6 +824,9 @@ True True + + + @@ -1011,6 +1024,9 @@ True True + + + @@ -1136,6 +1152,9 @@ True True + + + @@ -1261,6 +1280,9 @@ True True + + + @@ -1630,12 +1652,20 @@ True True - + True - False - start - 0 - gtk-goto-first + True + False + True + left + + + + @@ -1789,10 +1819,17 @@ True False - + True False + 5 + 5 + 5 + 5 + 5 + 5 label + 0 False @@ -1801,10 +1838,20 @@ - + True - False - label + True + False + 5 + 5 + 5 + 5 + 7 + 5 + True + + + False @@ -1812,9 +1859,6 @@ 1 - - - False @@ -1826,63 +1870,11 @@ True False + vertical True False - vertical - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - label - - - False - True - 0 - - - - - True - True - False - 5 - 5 - 5 - 5 - 7 - 5 - True - - - - - - False - True - 1 - - - - - True - True - 0 - - - - - True - False - vertical True @@ -1894,6 +1886,7 @@ 5 5 label + 0 False @@ -1913,23 +1906,22 @@ 5 - False + True True 1 - True + False True - 1 + 0 True False - vertical True @@ -1941,6 +1933,7 @@ 5 5 label + 0 False @@ -1960,16 +1953,16 @@ 5 - False + True True 1 - True + False True - 2 + 1 @@ -1983,9 +1976,17 @@ True False - end - 5 - True + + + True + False + + + False + True + 0 + + gtk-cancel @@ -2003,11 +2004,12 @@ False True - 0 + end + 1 - + gtk-save True True @@ -2023,6 +2025,7 @@ False True + end 1 @@ -2030,7 +2033,7 @@ False True - 2 + 3 @@ -2040,7 +2043,7 @@ True False - + True False ubl-settings-bootloader @@ -2058,6 +2061,14 @@ + + + + + + + + False start diff --git a/ubl-settings-bootloader.pot b/ubl-settings-bootloader.pot index e0c0e5b..7b40070 100644 --- a/ubl-settings-bootloader.pot +++ b/ubl-settings-bootloader.pot @@ -17,6 +17,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +msgid "Edit" +msgstr "" + +msgid "Adding" +msgstr "" + msgid "Selecting the loading mode option" msgstr "" diff --git a/ubl-settings-bootloader_ru.po b/ubl-settings-bootloader_ru.po index 1ea37f9..952e3ff 100644 --- a/ubl-settings-bootloader_ru.po +++ b/ubl-settings-bootloader_ru.po @@ -17,6 +17,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +msgid "Edit" +msgstr "Редактирование" + +msgid "Adding" +msgstr "Добавление" + msgid "Selecting the loading mode option" msgstr "Выбор варианта режима загрузки" From 7684ea96ee99593120cbc6f877e542b82869d116 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Fri, 19 May 2023 14:08:16 +0600 Subject: [PATCH 15/20] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=BE=D0=BA=D0=BD=D0=B0=20=D1=81=20=D1=81=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D0=BA=D0=BE=D0=BC=20=D0=BE=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/CMakeLists.txt | 2 +- source/main.cc | 1 + source/menu_os.cc | 6 +- source/menu_os.h | 4 +- source/ubl-settings-bootloader.cc | 12 +- source/ubl-settings-bootloader.h | 3 +- ubl-settings-bootloader.glade | 184 +++++++++++++++++------------- 7 files changed, 125 insertions(+), 87 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 62bfb35..da9e11c 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -30,7 +30,7 @@ configure_file(ubl-settings-bootloader.h.in ubl-settings-bootloader-cm.h) 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 -g") set(SOURCE_FILES menu_os.h diff --git a/source/main.cc b/source/main.cc index d5802e3..c28e514 100644 --- a/source/main.cc +++ b/source/main.cc @@ -54,6 +54,7 @@ int main(int argc, char** argv) { builder->get_widget_derived("window", wnd); wnd->settings(); wnd->event(); + wnd->set_menu_os_to_button(); auto r = app->run(*wnd); delete wnd; return r; diff --git a/source/menu_os.cc b/source/menu_os.cc index 71910dd..e22e32a 100644 --- a/source/menu_os.cc +++ b/source/menu_os.cc @@ -22,10 +22,13 @@ void Menu_os::set_builder(Glib::RefPtr& builder, string path_glade builder->get_widget("boxALLL3", boxALLL3); builder->get_widget("boxLevel1", boxLevel1); builder->get_widget("btnToLev1", btnToLev1); - revealerL1->set_reveal_child(true); } +void Menu_os::set_btnOpenMenuOS(Gtk::Button *btnOpenMenuOS) { + this->btnOpenMenuOS = btnOpenMenuOS; +} + void Menu_os::set_map(vector>> &vec_list_os) { this->vec_list_os = vec_list_os; } @@ -138,6 +141,7 @@ void Menu_os::to_l1() { revealerL1->set_reveal_child(true); revealerL2->set_reveal_child(false); map_menu_level_1[key_global]->revealer->set_reveal_child(false); + btnOpenMenuOS->signal_clicked().connect([&]() {popoverMenuOS->show_all();}); key_global = ""; } diff --git a/source/menu_os.h b/source/menu_os.h index 0768c7b..231e4e4 100644 --- a/source/menu_os.h +++ b/source/menu_os.h @@ -13,7 +13,7 @@ private: Glib::RefPtr builder; vector>> vec_list_os; - Gtk::Popover *popoverMenuOS; + Gtk::Window *popoverMenuOS; Gtk::Revealer *revealerL1; Gtk::Revealer *revealerL2; Gtk::Button *btnToLev1; @@ -26,6 +26,7 @@ private: string path_glade = ""; Gtk::Box *boxALLL3; Gtk::Box *boxLevel1; + Gtk::Button *btnOpenMenuOS; struct struct_menu_level_3 { Gtk::Button *btnToL3; Gtk::Label *lblToL3; @@ -60,6 +61,7 @@ public: void set_entry(Gtk::Entry *entry); void event_template(Gtk::Label* label, string& name_level, string& key); void event(); + void set_btnOpenMenuOS(Gtk::Button *btnOpenMenuOS); void to_l1(); ~Menu_os(); }; diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index 9c8d6a2..e8e50b2 100644 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -51,6 +51,7 @@ SettingsPlug::SettingsPlug(::Window p_socketID, Glib::RefPtr build wnd->event(); plugBox->get_parent()->remove(*plugBox); add(*plugBox); + wnd->set_menu_os_to_button(); show_all_children(); } @@ -246,7 +247,6 @@ void MainWindow::settings() { overHead->add_overlay(*boxWidget); btnBoxAboutDialog->set_visible(false); ubl_make_plugs(boxSave,boxButton, socket_ext_id_I, socket_trd_id_I); - #ifdef WEBKIT_FOUND one = WEBKIT_WEB_VIEW(webkit_web_view_new()); three = Glib::wrap(GTK_WIDGET(one)); @@ -285,6 +285,10 @@ void MainWindow::settings() { } } +void MainWindow::set_menu_os_to_button() { + obj_menu_os.set_btnOpenMenuOS(btnOpenMenuOS1); +} + void MainWindow::set_plug(Gtk::Widget *plug) { this->plug = plug; } @@ -633,7 +637,7 @@ void MainWindow::get_builder() { builder->get_widget("btnReadHelp", btnReadHelp); builder->get_widget("btnCancelHelp", btnCancelHelp); builder->get_widget("wndShowWeb", wndShowWeb); - builder->get_widget("btnOpenMenuOS", btnOpenMenuOS); + builder->get_widget("btnOpenMenuOS1", btnOpenMenuOS1); builder->get_widget("entrListOS", entrListOS); builder->get_widget("treeViewUser", treeViewUser); builder->get_widget("treeViewMelody", treeViewMelody); @@ -700,7 +704,7 @@ void MainWindow::localization() { btnAddMusic->set_tooltip_text(str_tooltip_add_melody); btnRemoveUser->set_tooltip_text(str_tooltip_del_user); btnAddUser->set_tooltip_text(str_tooltip_add_user); - btnOpenMenuOS->set_tooltip_text(str_tooltip_boot_menu); + btnOpenMenuOS1->set_tooltip_text(str_tooltip_boot_menu); } vector MainWindow::get_setting_entry_all(string key, std::map * map_temp) { @@ -814,7 +818,7 @@ void MainWindow::event() { btnEditMusic->signal_clicked().connect([&]() {wrapper_edit_show_melody();}); btnAddUser->signal_clicked().connect([&]() {wrapper_add_data_user();}); btnAddMusic->signal_clicked().connect([&]() {wrapper_add_data_melody();}); - btnOpenMenuOS->signal_clicked().connect([&]() {obj_menu_os.show();}); + btnOpenMenuOS1->signal_clicked().connect([&]() {obj_menu_os.show();}); btnCancelHelp->signal_clicked().connect([&]() {wndShowWeb->hide();}); chkAlwaysOpenHelp->signal_toggled().connect([&]() {flag_open_browser = true;}); btnReadHelp->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::open_browser)); diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index 3254043..70c3090 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -324,7 +324,7 @@ public: Gtk::Button *btnReadHelp; Gtk::Button *btnCancelHelp; Gtk::Window *wndShowWeb; - Gtk::Button *btnOpenMenuOS; + Gtk::Button *btnOpenMenuOS1; Gtk::Entry *entrListOS; std::vector vec_Option_kernel; @@ -474,6 +474,7 @@ public: void wrapper_edit_user(bool check, string column1, string column2); void wrapper_set_add_data_melody(bool flag, string &name, string &code); void wrapper_set_add_data_user(bool flag, string &name, string &password); + void set_menu_os_to_button(); }; class SettingsPlug : public Gtk::Plug diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade index 1b94d7f..7147009 100644 --- a/ubl-settings-bootloader.glade +++ b/ubl-settings-bootloader.glade @@ -522,7 +522,7 @@ - + True True True @@ -1599,10 +1599,99 @@ - + False - btnOpenMenuOS - bottom + Внимание! + center + dialog + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + 50 + gtk-dialog-warning + + + True + True + 0 + + + + + 160 + True + False + start + center + 5 + 5 + 5 + 5 + 5 + 5 + Warning! + + + True + True + 1 + + + + + False + True + 1 + + + + + OK + True + True + True + 5 + 5 + 5 + 5 + 3 + 3 + + + False + True + 1 + + + + + + + False + True + True + False + com.ublinux.ubl-settings-datetime True @@ -1701,90 +1790,26 @@ - - - False - Внимание! - center - dialog - - + + True False - vertical - - + True + + True False - 5 - 5 - 5 - 5 - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 50 - gtk-dialog-warning - - - True - True - 0 - - - - - 160 - True - False - start - center - 5 - 5 - 5 - 5 - 5 - 5 - Warning! - - - True - True - 1 - - + ubl-settings-bootloader - - False - True - 1 - - - OK + True - True - True - 5 - 5 - 5 - 5 - 3 - 3 + False + 32 + com.ublinux.ubl-settings-bootloader + 5 - - False - True - 1 - @@ -2042,6 +2067,7 @@ True False + True True From cf6cf2a807dfc8c593d0ed13fa948445c20e48fc Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Fri, 19 May 2023 16:03:56 +0600 Subject: [PATCH 16/20] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=BE=20=D0=BE=D1=82=D0=BA=D1=80=D1=8B=D1=82?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B1=D1=80=D0=B0=D1=83=D0=B7=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-bootloader.cc | 18 +++++++++--------- source/ubl-settings-bootloader.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index e8e50b2..3eeda34 100644 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -247,11 +247,6 @@ void MainWindow::settings() { overHead->add_overlay(*boxWidget); btnBoxAboutDialog->set_visible(false); ubl_make_plugs(boxSave,boxButton, socket_ext_id_I, socket_trd_id_I); - #ifdef WEBKIT_FOUND - one = WEBKIT_WEB_VIEW(webkit_web_view_new()); - three = Glib::wrap(GTK_WIDGET(one)); - wndWeb->add(*three); - #endif this->flag_block_gui(); if (this->check_root() == 0) { spbSecond->set_range(1, 60); @@ -1444,7 +1439,15 @@ void MainWindow::open_help() { void MainWindow::open_browser() { #ifdef WEBKIT_FOUND - webkit_web_view_load_uri(one, _(global_lick_doc.c_str())); + if (my_web_kit) { + gtk_widget_destroy(GTK_WIDGET(my_web_kit)); + } + my_web_kit = WEBKIT_WEB_VIEW(webkit_web_view_new()); + three = Glib::wrap(GTK_WIDGET(my_web_kit)); + wndWeb->add(*three); + webkit_web_view_load_uri(my_web_kit, _(global_lick_doc.c_str())); + wndWeb->show_all(); + webkit_web_view_load_uri(my_web_kit, _(global_lick_doc.c_str())); wndWeb->show_all(); #else this->template_open_browser(global_lick_doc); @@ -1524,9 +1527,6 @@ void MainWindow::info_warning_error(int mess) { } } MainWindow::~MainWindow() { - #ifdef WEBKIT_FOUND - free(one); - #endif } void MainWindow::add_CSS() { diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index 70c3090..38f86e9 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -339,7 +339,7 @@ public: #ifdef WEBKIT_FOUND Gtk::Window *wndWeb; Gtk::Widget *three; - WebKitWebView *one; + WebKitWebView *my_web_kit = NULL; #endif Gtk::TreeModel::Row row_kernel; Gtk::TreeModel::Row row_IPT; From d8a7b177cd0701b3eff66db67d64e18142c6a61f Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Fri, 19 May 2023 16:24:38 +0600 Subject: [PATCH 17/20] fix --- source/menu_os.h | 2 +- ubl-settings-bootloader.glade | 181 +++++++++++++++------------------- 2 files changed, 79 insertions(+), 104 deletions(-) diff --git a/source/menu_os.h b/source/menu_os.h index 231e4e4..dfda82a 100644 --- a/source/menu_os.h +++ b/source/menu_os.h @@ -13,7 +13,7 @@ private: Glib::RefPtr builder; vector>> vec_list_os; - Gtk::Window *popoverMenuOS; + Gtk::Popover *popoverMenuOS; Gtk::Revealer *revealerL1; Gtk::Revealer *revealerL2; Gtk::Button *btnToLev1; diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade index 7147009..52146b6 100644 --- a/ubl-settings-bootloader.glade +++ b/ubl-settings-bootloader.glade @@ -1599,99 +1599,10 @@ - - False - Внимание! - center - dialog - - - True - False - vertical - - - True - False - 5 - 5 - 5 - 5 - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - 50 - gtk-dialog-warning - - - True - True - 0 - - - - - 160 - True - False - start - center - 5 - 5 - 5 - 5 - 5 - 5 - Warning! - - - True - True - 1 - - - - - False - True - 1 - - - - - OK - True - True - True - 5 - 5 - 5 - 5 - 3 - 3 - - - False - True - 1 - - - - - - + False - True - True - False - com.ublinux.ubl-settings-datetime + btnOpenMenuOS1 + bottom True @@ -1790,26 +1701,90 @@ - - + + + False + Внимание! + center + dialog + + True False - True - - + vertical + + True False - ubl-settings-bootloader + 5 + 5 + 5 + 5 + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + 50 + gtk-dialog-warning + + + True + True + 0 + + + + + 160 + True + False + start + center + 5 + 5 + 5 + 5 + 5 + 5 + Warning! + + + True + True + 1 + + + + False + True + 1 + - + + OK True - False - 32 - com.ublinux.ubl-settings-bootloader - 5 + True + True + 5 + 5 + 5 + 5 + 3 + 3 + + False + True + 1 + From 990e4f254d8959b26fe05e837223f56bf6bd4bc1 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Fri, 19 May 2023 16:55:57 +0600 Subject: [PATCH 18/20] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=BE=20=D0=BC=D0=B5=D0=BD=D1=8E=20=D1=81?= =?UTF-8?q?=D0=BE=20=D1=81=D0=BF=D0=B8=D1=81=D0=BA=D0=BE=D0=BC=20=D0=BE?= =?UTF-8?q?=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/menu_os.cc | 11 +- source/menu_os.h | 2 + source/ubl-settings-bootloader.cc | 4 + source/ubl-settings-bootloader.h | 2 + ubl-settings-bootloader.css | 3 + ubl-settings-bootloader.glade | 1038 +++++++++++++++-------------- 6 files changed, 543 insertions(+), 517 deletions(-) diff --git a/source/menu_os.cc b/source/menu_os.cc index e22e32a..365f232 100644 --- a/source/menu_os.cc +++ b/source/menu_os.cc @@ -99,11 +99,15 @@ void Menu_os::close_revealer() { } } +void Menu_os::set_main_revealer(Gtk::Revealer *revealer) { + this->main_revealer = revealer; +} + void Menu_os::show() { revealerL1->set_reveal_child(true); revealerL2->set_reveal_child(false); this->close_revealer(); - popoverMenuOS->show_all(); + main_revealer->set_reveal_child(true); } void Menu_os::event() { btnToLev1->signal_clicked().connect(sigc::mem_fun(*this, &Menu_os::to_l1)); @@ -130,10 +134,10 @@ void Menu_os::event_template(Gtk::Label* label, string& name_level, string& key) else if (map_menu_level_1[key]->vec_menu_level_3.size() == 0) { entry->set_text(name_level_1); name_level_3 = ""; - popoverMenuOS->hide(); + main_revealer->set_reveal_child(false); } else { - popoverMenuOS->hide(); + main_revealer->set_reveal_child(false); entry->set_text(name_level_1 + name_level_3); } } @@ -141,7 +145,6 @@ void Menu_os::to_l1() { revealerL1->set_reveal_child(true); revealerL2->set_reveal_child(false); map_menu_level_1[key_global]->revealer->set_reveal_child(false); - btnOpenMenuOS->signal_clicked().connect([&]() {popoverMenuOS->show_all();}); key_global = ""; } diff --git a/source/menu_os.h b/source/menu_os.h index dfda82a..b4e3801 100644 --- a/source/menu_os.h +++ b/source/menu_os.h @@ -17,6 +17,7 @@ private: Gtk::Revealer *revealerL1; Gtk::Revealer *revealerL2; Gtk::Button *btnToLev1; + Gtk::Revealer *main_revealer; string str_last_launched_os = ""; private: string name_level_1 = ""; @@ -61,6 +62,7 @@ public: void set_entry(Gtk::Entry *entry); void event_template(Gtk::Label* label, string& name_level, string& key); void event(); + void set_main_revealer(Gtk::Revealer *revealer); void set_btnOpenMenuOS(Gtk::Button *btnOpenMenuOS); void to_l1(); ~Menu_os(); diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index 3eeda34..5d6e6c8 100644 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -245,6 +245,7 @@ void MainWindow::settings() { Gtk::Widget *boxWidget; builder->get_widget("boxColor", boxWidget); overHead->add_overlay(*boxWidget); + overMenuOS->add_overlay(*revilerMenuOS); btnBoxAboutDialog->set_visible(false); ubl_make_plugs(boxSave,boxButton, socket_ext_id_I, socket_trd_id_I); this->flag_block_gui(); @@ -260,6 +261,7 @@ void MainWindow::settings() { this->download_local_cfg(); this->download_globl_cfg(); vector>> vec_list_os = format_os_list(os_control_list); + obj_menu_os.set_main_revealer(revilerMenuOS); obj_menu_os.set_builder(builder, path_glade); obj_menu_os.set_map(vec_list_os); obj_menu_os.set_entry(entrListOS); @@ -644,6 +646,8 @@ void MainWindow::get_builder() { builder->get_widget("btnRemoveMusic", btnRemoveMusic); builder->get_widget("btnEditMusic", btnEditMusic); builder->get_widget("btnEditUser", btnEditUser); + builder->get_widget("revilerMenuOS", revilerMenuOS); + builder->get_widget("overMenuOS", overMenuOS); } diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index 38f86e9..399a601 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -326,6 +326,8 @@ public: Gtk::Window *wndShowWeb; Gtk::Button *btnOpenMenuOS1; Gtk::Entry *entrListOS; + Gtk::Overlay *overMenuOS; + Gtk::Revealer* revilerMenuOS; std::vector vec_Option_kernel; std::vector vec_Option_IPT; diff --git a/ubl-settings-bootloader.css b/ubl-settings-bootloader.css index dcc568a..34e17f4 100644 --- a/ubl-settings-bootloader.css +++ b/ubl-settings-bootloader.css @@ -150,4 +150,7 @@ opacity:0.99; } .nobg{ background: none; +} +.addbg * { + background-color: @theme_bg_color; } \ No newline at end of file diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade index 52146b6..885006e 100644 --- a/ubl-settings-bootloader.glade +++ b/ubl-settings-bootloader.glade @@ -9,6 +9,15 @@ + + both + True + + + + + + False False @@ -409,94 +418,73 @@ False 5 - + True False - vertical - - - True - False - - - Boot selection menu timer - True - True - False - 3 - 5 - 3 - 5 - 5 - 5 - True - - - False - True - 0 - - - - - True - True - 5 - 5 - 5 - 5 - 5 - 5 - - - False - True - 1 - - - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - Seconds - - - False - True - 2 - - - - - False - True - 0 - - True False + vertical - + True False - start - 5 - 5 - 5 - 5 - 5 - 5 - Default load - start - 0 + + + Boot selection menu timer + True + True + False + 3 + 5 + 3 + 5 + 5 + 5 + True + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 5 + 5 + + + False + True + 1 + + + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + Seconds + + + False + True + 2 + + False @@ -505,81 +493,130 @@ - - True - True - 5 - 5 - 5 - 5 - 5 - 5 - - - True - True - 2 - - - - + True - True - True - 5 - 10 - 5 - 10 - 5 - 5 + False - + True False - image-loading-symbolic + start + 5 + 5 + 5 + 5 + 5 + 5 + Default load + start + 0 + + + False + True + 0 + + + + + True + True + 5 + 5 + 5 + 5 + 5 + 5 + + True + True + 2 + + + + + True + True + True + 5 + 10 + 5 + 10 + 5 + 5 + + + True + False + image-loading-symbolic + + + + + False + True + 3 + False True - 3 + 1 - - - False - True - 1 - - - - - True - False - + True False - start - 5 - 5 - 5 - 5 - 5 - 5 - Load screen display mode: - start - 0 + + + True + False + start + 5 + 5 + 5 + 5 + 5 + 5 + Load screen display mode: + start + 0 + + + False + True + 0 + + + + + True + False + 5 + 10 + 5 + 10 + 5 + 5 + + + True + True + 1 + + False True - 0 + 2 - + True False 5 @@ -588,58 +625,35 @@ 10 5 5 - - - True - True - 1 - - - - - False - True - 2 - - - - - True - False - 5 - 10 - 5 - 10 - 5 - 5 - 0.019999999552965164 - in - - - True - False + 0.019999999552965164 + in - + True False - 5 - + True False - vertical + 5 - - 100 + True - True - 3 - 5 - 3 - 5 - in + False + vertical - + + 100 + True + True + 5 + 3 + 5 + 3 + 5 + in + + True False @@ -651,173 +665,174 @@ + + + + False + True + 0 + - - False - True - 0 - - - - - - - True - True - 0 - - - - - True - False - vertical - - - True - True - True - 5 - 10 - 5 - 10 - 5 - 5 - - - True - False - list-add - - False + True True 0 - + True - True - True - 5 - 10 - 5 - 10 - 3 - 5 + False + vertical - + True - False - gtk-select-all + True + True + 5 + 10 + 5 + 10 + 5 + 5 + + + True + False + list-add + + + + False + True + 0 + - - - False - True - 1 - - - - - True - True - True - 5 - 10 - 5 - 10 - 3 - 10 - + True - False - gtk-remove + True + True + 5 + 10 + 5 + 10 + 3 + 5 + + + True + False + gtk-select-all + + + + False + True + 1 + + + + + True + True + True + 5 + 10 + 5 + 10 + 3 + 10 + + + True + False + gtk-remove + + + + + False + True + 2 + False True - 2 + 1 - - False - True - 1 - + + + + True + False + start + 5 + 5 + 5 + 5 + 5 + 5 + Boot Menu Users + start + + + False + True + 5 + - - + + True False - start 5 - 5 + 10 5 - 5 + 10 5 5 - Boot Menu Users - start - - - - - False - True - 5 - - - - - True - False - 5 - 10 - 5 - 10 - 5 - 5 - 0.019999999552965164 - in - - - True - False + 0.019999999552965164 + in - + True False - 5 - + True False - vertical + 5 - - 100 + True - True - 5 - 5 - 5 - 5 - in + False + vertical - + + 100 + True + True + 5 + 5 + 5 + 5 + 5 + in + + True False @@ -829,133 +844,138 @@ + + + + False + True + 0 + - - False - True - 0 - - - - - - - True - True - 0 - - - - - True - False - vertical - - - True - True - True - 5 - 10 - 5 - 10 - 5 - 5 - - - True - False - list-add - - False + True True 0 - + True - True - True - 5 - 10 - 5 - 10 - 3 - 5 + False + vertical - + True - False - gtk-select-all + True + True + 5 + 10 + 5 + 10 + 5 + 5 + + + True + False + list-add + + + + False + True + 0 + + + + + True + True + True + 5 + 10 + 5 + 10 + 3 + 5 + + + True + False + gtk-select-all + + + + + False + True + 1 + - - - False - True - 1 - - - - - True - True - True - 5 - 10 - 5 - 10 - 3 - 10 - + True - False - gtk-remove + True + True + 5 + 10 + 5 + 10 + 3 + 10 + + + True + False + gtk-remove + + + + False + True + 2 + False True - 2 + 1 - - False - True - 1 - + + + + True + False + start + 5 + 5 + 5 + 5 + 5 + 5 + Ringtone at startup + start + - - - - True - False - start - 5 - 5 - 5 - 5 - 5 - 5 - Ringtone at startup - start - + + False + True + 5 + - False - True - 5 + -1 @@ -1024,9 +1044,6 @@ True True - - - @@ -1152,9 +1169,6 @@ True True - - - @@ -1280,9 +1294,6 @@ True True - - - @@ -1583,15 +1594,6 @@ - - both - True - - - - - - @@ -1599,109 +1601,6 @@ - - False - btnOpenMenuOS1 - bottom - - - True - False - - - 0 - 0 - True - False - none - - - True - False - vertical - - - - - - - - True - True - 0 - - - - - 0 - 0 - True - False - none - True - - - True - False - vertical - - - 1 - 1 - True - True - True - - - True - True - False - True - left - - - - - - - - - False - True - 0 - - - - - True - False - vertical - - - - - - False - True - 1 - - - - - - - False - True - 1 - - - - - False Внимание! @@ -1804,6 +1703,119 @@ + + True + False + end + start + 5 + 5 + 10 + 10 + slide-right + + + True + False + + + 0 + 0 + True + False + none + + + True + False + vertical + + + + + + + + True + True + 0 + + + + + 0 + 0 + True + False + none + True + + + True + False + vertical + + + 1 + 1 + True + True + True + + + True + True + False + True + 0 + left + + + + + + + + + False + True + 0 + + + + + True + False + vertical + + + + + + False + True + 1 + + + + + + + False + True + 1 + + + + + + False True From 38077340888615b10544cede7f4c0a606c44fff0 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Fri, 19 May 2023 17:36:44 +0600 Subject: [PATCH 19/20] fix --- source/menu_os.cc | 1 - source/menu_os.h | 1 - source/ubl-settings-bootloader.cc | 4 ++++ ubl-settings-bootloader.glade | 27 ++++++++++++++++++--------- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/source/menu_os.cc b/source/menu_os.cc index 365f232..46378a9 100644 --- a/source/menu_os.cc +++ b/source/menu_os.cc @@ -16,7 +16,6 @@ void Menu_os::set_last_launched_os(string str_last_launched_os) { void Menu_os::set_builder(Glib::RefPtr& builder, string path_glade) { this->builder = builder; this->path_glade = path_glade; - builder->get_widget("popoverMenuOS", popoverMenuOS); builder->get_widget("revealerL1", revealerL1); builder->get_widget("revealerL2", revealerL2); builder->get_widget("boxALLL3", boxALLL3); diff --git a/source/menu_os.h b/source/menu_os.h index b4e3801..01e3051 100644 --- a/source/menu_os.h +++ b/source/menu_os.h @@ -13,7 +13,6 @@ private: Glib::RefPtr builder; vector>> vec_list_os; - Gtk::Popover *popoverMenuOS; Gtk::Revealer *revealerL1; Gtk::Revealer *revealerL2; Gtk::Button *btnToLev1; diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index 5d6e6c8..331071d 100644 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -167,6 +167,7 @@ void View_edit_add_table::set_data(bool check, string column1, string column2) { } void View_edit_add_table::show_melody_edit() { + gtk_entry_set_input_purpose(GTK_ENTRY(entryCol2->gobj()) ,GTK_INPUT_PURPOSE_FREE_FORM); lblAddEditCheckBox->set_text(string(str_active) + ":"); lblAddEditCol1->set_text(string(str_option) + ":"); lblAddEditCol2->set_text(string(str_melody_code) + ":"); @@ -177,6 +178,7 @@ void View_edit_add_table::show_melody_edit() { } void View_edit_add_table::show_melody_add() { + gtk_entry_set_input_purpose(GTK_ENTRY(entryCol2->gobj()),GTK_INPUT_PURPOSE_FREE_FORM); btnSaveEditSave->set_sensitive(false); chkAddEdit->set_active(false); entryCol1->set_text(""); @@ -191,6 +193,7 @@ void View_edit_add_table::show_melody_add() { this->show(); } void View_edit_add_table::show_user_edit() { + gtk_entry_set_input_purpose(GTK_ENTRY(entryCol2->gobj()),GTK_INPUT_PURPOSE_PASSWORD); lblAddEditCheckBox->set_text(string(str_administrator) + ":"); lblAddEditCol1->set_text(string(str_user) + ":"); lblAddEditCol2->set_text(string(str_password) + ":"); @@ -201,6 +204,7 @@ void View_edit_add_table::show_user_edit() { } void View_edit_add_table::show_user_add() { + gtk_entry_set_input_purpose(GTK_ENTRY(entryCol2->gobj()),GTK_INPUT_PURPOSE_PASSWORD); btnSaveEditSave->set_sensitive(false); chkAddEdit->set_active(false); entryCol1->set_text(""); diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade index 885006e..9ffb834 100644 --- a/ubl-settings-bootloader.glade +++ b/ubl-settings-bootloader.glade @@ -9,15 +9,6 @@ - - both - True - - - - - - False False @@ -1044,6 +1035,9 @@ True True + + + @@ -1169,6 +1163,9 @@ True True + + + @@ -1294,6 +1291,9 @@ True True + + + @@ -1585,6 +1585,15 @@ + + both + True + + + + + + both True From 645a5eca86d53e18f2dda9a29b555d533ab92ba4 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Fri, 19 May 2023 17:57:49 +0600 Subject: [PATCH 20/20] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D1=84?= =?UTF-8?q?=D0=BB=D0=B0=D0=B3=20=D0=BE=D1=82=D0=BB=D0=B0=D0=B4=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index da9e11c..62bfb35 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -30,7 +30,7 @@ configure_file(ubl-settings-bootloader.h.in ubl-settings-bootloader-cm.h) 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 -g") + -fstack-clash-protection -fcf-protection") set(SOURCE_FILES menu_os.h