diff --git a/#ubl-settings-bootloader.glade# b/#ubl-settings-bootloader.glade# deleted file mode 100644 index 84887a7..0000000 --- a/#ubl-settings-bootloader.glade# +++ /dev/null @@ -1,1265 +0,0 @@ - - - - - - False - О Программе - False - True - center - ubl-settings-datetime - dialog - True - ubl-settings-datetime - 1.2 - Copyright © 2023 - UBSoft Software LLC - ubl-settings-bootloader - https://ublinux.ru/ - Project Home Page - Это приложение распространяется без каких-либо гарантий. -Подробнее в <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, версии 2 или позднее</a>. - UBGroup - UBGroup - com.ublinux.ubl-settings-bootloader - True - gpl-2-0 - - - False - vertical - 2 - - - False - end - - - - - - False - False - 0 - - - - - - - - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - 69 - com.ublinux.ubl-settings-bootloader - - - False - True - 0 - - - - - True - False - start - 5 - 5 - 5 - 5 - 6 - 6 - Running applications as a user with a -specified priority - - - - - - - - True - True - 1 - - - - - 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 - - - - - - 750 - 550 - False - - - True - False - vertical - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - 25 - 1 - - - False - True - 0 - - - - - True - False - start - 5 - 5 - 5 - 5 - 6 - 6 - - - - - - - True - True - 1 - - - - - False - True - 0 - - - - - True - True - in - - - True - False - - - True - False - vertical - - - True - False - - - 81 - True - False - start - - - -1 - - - - - False - True - 0 - - - - - True - False - 0.019999999552965164 - in - - - True - False - 12 - - - True - False - vertical - - - True - False - - - Load variant selection timer - True - True - False - 5 - 5 - 5 - 5 - 6 - 6 - True - - - False - True - 0 - - - - - True - True - 5 - 5 - 5 - 5 - 6 - 6 - - - False - True - 1 - - - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Seconds - - - False - True - 2 - - - - - False - True - 0 - - - - - True - False - - - 0 - True - False - start - 5 - 5 - 5 - 5 - 6 - 6 - Default download - - - False - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - - - False - True - 1 - - - - - The last selection will become the default boot choice - True - True - False - start - 5 - 5 - 5 - 5 - 6 - 6 - True - - - False - True - 2 - - - - - False - True - 1 - - - - - True - False - - - 0 - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Download mode - - - False - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - - - True - True - 1 - - - - - False - True - 2 - - - - - True - False - - - 0 - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Security login: - - - False - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - - - True - True - 1 - - - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - - - True - True - 2 - - - - - False - True - 3 - - - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Password protection: - - - False - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - - - True - True - 1 - - - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - - - True - True - 2 - - - - - False - True - 4 - - - - - - - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Download menu - - - - - False - True - 1 - - - - - True - False - 0.019999999552965164 - in - - - True - False - 12 - - - True - False - vertical - - - 140 - True - True - in - - - True - False - - - -1 - True - True - - - - - - - - - - False - True - 0 - - - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Command line parameters: - - - False - True - 0 - - - - - True - True - 5 - 5 - 5 - 5 - 6 - 6 - - - True - True - 1 - - - - - False - True - 10 - - - - - - - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Parameters passed to the kernel - - - - - False - True - 2 - - - - - True - False - 0.019999999552965164 - in - - - True - False - 12 - - - True - False - vertical - - - 140 - True - True - in - - - True - False - - - True - True - - - - - - - - - - False - True - 1 - - - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Command line parameters: - - - False - True - 0 - - - - - True - True - 5 - 5 - 5 - 5 - 6 - 6 - - - True - True - 1 - - - - - False - True - 7 - - - - - - - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Terminal for input - - - - - False - True - 3 - - - - - True - False - 0.019999999552965164 - in - - - True - False - 12 - - - True - False - vertical - - - 140 - True - True - in - - - True - False - - - True - True - - - - - - - - - - False - True - 0 - - - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Command line parameters: - - - False - True - 0 - - - - - True - True - 5 - 5 - 5 - 5 - 6 - 6 - - - True - True - 1 - - - - - False - True - 7 - - - - - - - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Terminal for output - - - - - False - True - 4 - - - - - - - - - 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 - - - - - - - False - Внимание! - center - dialog - - - True - False - vertical - - - True - False - 5 - 5 - 5 - 5 - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - 50 - gtk-dialog-warning - - - True - True - 0 - - - - - 160 - True - False - start - center - 5 - 5 - 5 - 5 - 6 - 6 - Warning! - - - True - True - 1 - - - - - False - True - 1 - - - - - OK - True - True - True - 5 - 5 - 5 - 5 - 3 - 3 - - - False - True - 1 - - - - - - diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index 273edd8..c5e4f1e 100755 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -116,8 +116,6 @@ void MainWindow::fill_in_view() { this->view_add_colums(*treeViewIPT); this->view_add_colums(*treeViewOTT); std::vector treeViewKernalCol = treeViewKernel->get_columns(); - - //cout << treeViewKernalCol[2]->get_alignment() << endl; } void MainWindow::item_selected_kernel(const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator&) { @@ -167,6 +165,56 @@ void MainWindow::item_selected_IPT(const Gtk::TreeModel::Path& path, const Gtk:: } +void MainWindow::get_download_mode(string cmd) { + struct Result res_response = this->wrapper_call(cmd); + if (res_response.error == 0) { + str_replace_all(res_response.response, "\"",""); + if (res_response.response == "splash") { + cmbDownloadMode->set_active(0); + } + else if (res_response.response == "splash quiet ub.silent") { + cmbDownloadMode->set_active(1); + } + else if (res_response.response == "quiet ub.silent") { + cmbDownloadMode->set_active(2); + } + else if (res_response.response == "plymouth.enable=0") { + cmbDownloadMode->set_active(3); + } + else{ + cmbDownloadMode->set_active(-1); + } + } + else if (res_response.error == 3) { + cmbDownloadMode->set_active(-1); + } + else { + cmbDownloadMode->set_active(-1); + } +} +void MainWindow::set_download_mode(string cmd) { + int index = cmbDownloadMode->get_active_row_number(); + string key = ""; + if (index == 0) { + key = "splash"; + } + else if (index == 1) { + key = "splash quiet ub.silent"; + } + else if (index == 2) { + key = "quiet ub.silent"; + } + else if (index == 3) { + key = "plymouth.enable=0"; + } + else{ + return; + } + cmd +="\"" + key + "\""; + wrapper_system(cmd, ""); + +} + void MainWindow::template_item_selected(std::map &map_view, const Gtk::TreeModel::Path& path, Glib::RefPtr &list_store) { const auto iter = list_store->get_iter(path); if(iter) { @@ -272,6 +320,11 @@ void MainWindow::get_builder(){ builder->get_widget("lblDownloadMode", lblDownloadMode); builder->get_widget("lblSecurityLogin", lblSecurityLogin); builder->get_widget("lblPasswordProtec", lblPasswordProtec); + builder->get_widget("cmbDownloadMode", cmbDownloadMode); + builder->get_widget("chbSecurityLogin", chbSecurityLogin); + builder->get_widget("chbPasswordProtecc", chbPasswordProtecc); + builder->get_widget("entryPasswordProtecc", entryPasswordProtecc); + builder->get_widget("entrySecurityLogin", entrySecurityLogin); } void MainWindow::localization(){ @@ -313,6 +366,11 @@ void MainWindow::localization(){ lblDownloadMode->set_text(gettext("Download mode:")); lblSecurityLogin->set_text(gettext("Security login:")); lblPasswordProtec->set_text(gettext("Password protection:")); + + cmbDownloadMode->append(gettext("Plymouth graphics, full log")); + cmbDownloadMode->append(gettext("Plymouth graphics, no log")); + cmbDownloadMode->append(gettext("No plymouth, minimal log")); + cmbDownloadMode->append(gettext("Without plymouth, full log")); } vector MainWindow::get_setting_entry_all(string cmd, Gtk::Entry &entry_text, std::map &map_temp) { @@ -441,25 +499,27 @@ void MainWindow::event(){ void MainWindow::save_global_local_cfg() { if (flag_save_global) { - std::string cmd_boot_time = "sudo ubconfig --target global set boot GRUB_TIMEOUT="; + std::string cmd_boot_time = "ubconfig --target global set boot GRUB_TIMEOUT="; this->set_menu_boot(cmd_boot_time); - string cmd_settings_kernel = "sudo ubconfig --target global set boot GRUB_CMDLINE_LINUX="; - string cmd_settings_IPT = "sudo ubconfig --target global set boot GRUB_TERMINAL_OUTPUT="; - string cmd_settings_OTT = "sudo ubconfig --target global set boot GRUB_TERMINAL_INPUT="; + string cmd_settings_kernel = "ubconfig --target global set boot GRUB_CMDLINE_LINUX="; + string cmd_settings_IPT = "ubconfig --target global set boot GRUB_TERMINAL_OUTPUT="; + string cmd_settings_OTT = "ubconfig --target global set boot GRUB_TERMINAL_INPUT="; this->cmd_entry_all(cmd_settings_kernel,cmd_settings_IPT,cmd_settings_OTT); + this->set_download_mode("ubconfig --target global set boot GRUB_BOOT_SILENT="); flag_save_all = false; } - else if (flag_save_local) { + if (flag_save_local) { - std::string cmd_boot_time = "sudo ubconfig --target global set boot GRUB_TIMEOUT="; + std::string cmd_boot_time = "ubconfig --target system set boot GRUB_TIMEOUT="; this->set_menu_boot(cmd_boot_time); - string cmd_settings_kernel = "sudo ubconfig --target global set boot GRUB_CMDLINE_LINUX="; - string cmd_settings_IPT = "sudo ubconfig --target global set boot GRUB_TERMINAL_OUTPUT="; - string cmd_settings_OTT = "sudo ubconfig --target global set boot GRUB_TERMINAL_INPUT="; + string cmd_settings_kernel = "ubconfig --target system set boot GRUB_CMDLINE_LINUX="; + string cmd_settings_IPT = "ubconfig --target system set boot GRUB_TERMINAL_OUTPUT="; + string cmd_settings_OTT = "ubconfig --target system set boot GRUB_TERMINAL_INPUT="; this->cmd_entry_all(cmd_settings_kernel,cmd_settings_IPT,cmd_settings_OTT); + this->set_download_mode("ubconfig --target system set boot GRUB_BOOT_SILENT="); flag_save_all = false; } - else{ + else if (flag_save_local == false && flag_save_local == false) { info_status_app("boxInfoMessOK"); lblWarning->set_text(gettext("Nothing to save!")); } @@ -471,12 +531,13 @@ void MainWindow::save_global_local_cfg() { void MainWindow::save_global_cfg() { if (flag_save_global) { if (flag_save_all) { - std::string cmd_boot_time = "sudo ubconfig --target global set boot GRUB_TIMEOUT="; + std::string cmd_boot_time = "ubconfig --target global set boot GRUB_TIMEOUT="; this->set_menu_boot(cmd_boot_time); - string cmd_settings_kernel = "sudo ubconfig --target global set boot GRUB_CMDLINE_LINUX="; - string cmd_settings_IPT = "sudo ubconfig --target global set boot GRUB_TERMINAL_OUTPUT"; - string cmd_settings_OTT = "sudo ubconfig --target global set boot GRUB_TERMINAL_INPUT="; + string cmd_settings_kernel = "ubconfig --target global set boot GRUB_CMDLINE_LINUX="; + string cmd_settings_IPT = "ubconfig --target global set boot GRUB_TERMINAL_OUTPUT"; + string cmd_settings_OTT = "ubconfig --target global set boot GRUB_TERMINAL_INPUT="; this->cmd_entry_all(cmd_settings_kernel,cmd_settings_IPT,cmd_settings_OTT); + this->set_download_mode("ubconfig --target global set boot GRUB_BOOT_SILENT="); flag_save_global = false; } } @@ -490,12 +551,13 @@ void MainWindow::save_global_cfg() { void MainWindow::save_local_cfg() { if (flag_save_local) { if (flag_save_all) { - std::string cmd_boot_time = "sudo ubconfig --target system set boot GRUB_TIMEOUT="; + std::string cmd_boot_time = "ubconfig --target system set boot GRUB_TIMEOUT="; this->set_menu_boot(cmd_boot_time); - string cmd_settings_kernel = "sudo ubconfig --target system set boot GRUB_CMDLINE_LINUX="; - string cmd_settings_IPT = "sudo ubconfig --target system set boot GRUB_TERMINAL_OUTPUT"; - string cmd_settings_OTT = "sudo ubconfig --target system set boot GRUB_TERMINAL_INPUT="; + string cmd_settings_kernel = "ubconfig --target system set boot GRUB_CMDLINE_LINUX="; + string cmd_settings_IPT = "ubconfig --target system set boot GRUB_TERMINAL_OUTPUT"; + string cmd_settings_OTT = "ubconfig --target system set boot GRUB_TERMINAL_INPUT="; this->cmd_entry_all(cmd_settings_kernel,cmd_settings_IPT,cmd_settings_OTT); + this->set_download_mode("ubconfig --target system set boot GRUB_BOOT_SILENT="); flag_save_local = true; } } @@ -514,17 +576,18 @@ void MainWindow::download_globl_cfg() { flag_save_global = false; flag_save_all = false; flag_load = true; - std::string cmd_boot_time = "sudo ubconfig --default --source global get boot GRUB_TIMEOUT"; + std::string cmd_boot_time = "ubconfig --default --source global get boot GRUB_TIMEOUT"; this->get_menu_boot(cmd_boot_time); - string cmd_kernel_entry = "sudo ubconfig --default --source global get boot GRUB_CMDLINE_LINUX"; + string cmd_kernel_entry = "ubconfig --default --source global get boot GRUB_CMDLINE_LINUX"; this->get_setting_entry_all(cmd_kernel_entry, *entryKernel, map_global_cmd_selection); - string cmd_ipt_entry = "sudo ubconfig --default --source global get boot GRUB_TERMINAL_INPUT"; + string cmd_ipt_entry = "ubconfig --default --source global get boot GRUB_TERMINAL_INPUT"; this->get_setting_entry_all(cmd_ipt_entry, *entryIPT, map_global_cmd_selection); - string cmd_opt_entry = "sudo ubconfig --default --source global get boot GRUB_TERMINAL_OUTPUT"; + string cmd_opt_entry = "ubconfig --default --source global get boot GRUB_TERMINAL_OUTPUT"; this->get_setting_entry_all(cmd_opt_entry, *entryOTT, map_global_cmd_selection); this->set_row_all(map_global_cmd_selection, list_store_kernel, vec_Option_kernel, size_kernel); this->set_row_all(map_global_cmd_selection, list_store_IPT, vec_Option_IPT, size_IPT); this->set_row_all(map_global_cmd_selection, list_store_OTT, vec_Option_OTT, size_OTT); + this->get_download_mode("ubconfig --default --source global get boot GRUB_BOOT_SILENT"); info_warning_error(1); } @@ -536,17 +599,18 @@ void MainWindow::download_local_cfg() { flag_save_global = false; flag_save_all = false; flag_load = false; - std::string cmd_boot_time = "sudo ubconfig --default --source system get boot GRUB_TIMEOUT"; + std::string cmd_boot_time = "ubconfig --default --source system get boot GRUB_TIMEOUT"; this->get_menu_boot(cmd_boot_time); - string cmd_kernel_entry = "sudo ubconfig --default --source system get boot GRUB_CMDLINE_LINUX"; + string cmd_kernel_entry = "ubconfig --default --source system get boot GRUB_CMDLINE_LINUX"; this->get_setting_entry_all(cmd_kernel_entry, *entryKernel, map_local_cmd_selection); - string cmd_ipt_entry = "sudo ubconfig --default --source system get boot GRUB_TERMINAL_INPUT"; + string cmd_ipt_entry = "ubconfig --default --source system get boot GRUB_TERMINAL_INPUT"; this->get_setting_entry_all(cmd_ipt_entry, *entryIPT, map_local_cmd_selection); - string cmd_opt_entry = "sudo ubconfig --default --source system get boot GRUB_TERMINAL_OUTPUT"; + string cmd_opt_entry = "ubconfig --default --source system get boot GRUB_TERMINAL_OUTPUT"; this->get_setting_entry_all(cmd_opt_entry, *entryOTT, map_local_cmd_selection); this->set_row_all(map_local_cmd_selection, list_store_kernel, vec_Option_kernel, size_kernel); this->set_row_all(map_local_cmd_selection, list_store_IPT, vec_Option_IPT, size_IPT); this->set_row_all(map_local_cmd_selection, list_store_OTT, vec_Option_OTT, size_OTT); + this->get_download_mode("ubconfig --default --source system get boot GRUB_BOOT_SILENT"); info_warning_error(0); } @@ -685,7 +749,6 @@ struct MainWindow::Result MainWindow::wrapper_call(string cmd) { } void MainWindow::log_mess_error(string &cmd) { - cout << cmd << endl; string key = ""; if (map_cmd_error.find(cmd) != map_cmd_error.end()){ str_cmd_error = map_cmd_error[cmd]; diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index fe7b57b..99595ac 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -91,6 +91,11 @@ class MainWindow : public Gtk::ApplicationWindow { Gtk::TreeView *treeViewOTT; Gtk::Image *imgBG; Gtk::Overlay *overHead; + Gtk::ComboBoxText *cmbDownloadMode; + Gtk::ComboBoxText *chbSecurityLogin; + Gtk::ComboBoxText *chbPasswordProtecc; + Gtk::Entry *entrySecurityLogin; + Gtk::Entry *entryPasswordProtecc; std::vector vec_Option_kernel; std::vector vec_Option_IPT; @@ -142,6 +147,7 @@ class MainWindow : public Gtk::ApplicationWindow { void fn_event_intelMax1(); void fn_event_intelMax4(); void synopsis_show(); + void get_download_mode(string cmd); void view_add_cell(Gtk::TreeModel::Row &row, Glib::RefPtr list_store_m , std::array, 5> &arr_view, size_t index); void wrapper_system(string cmd, string thread_str); struct Result wrapper_call(string cmd); @@ -160,6 +166,7 @@ class MainWindow : public Gtk::ApplicationWindow { bool focus_out_txt_IPT(GdkEventFocus*); bool focus_out_txt_OTT(GdkEventFocus*); void fill_in_view(); + void set_download_mode(string cmd); vector get_setting_entry_all(string cmd, Gtk::Entry &entry_text, std::map &map_temp); void cmd_entry_all(string cmd_settings_kernel,string cmd_settings_IPT,string cmd_settings_OTT); string dynamic_update_entry(std::map &map_view, vector &vec_allowed); diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade index d294a9a..792091f 100644 --- a/ubl-settings-bootloader.glade +++ b/ubl-settings-bootloader.glade @@ -392,7 +392,7 @@ specified priority - + True False 5 @@ -403,7 +403,7 @@ specified priority 6 - False + True True 1 @@ -460,7 +460,7 @@ specified priority - + True False 5 @@ -480,7 +480,7 @@ specified priority False True - 2 + 3 @@ -507,7 +507,7 @@ specified priority - + True False 5 @@ -524,9 +524,9 @@ specified priority - + True - False + True 5 5 5 @@ -544,7 +544,7 @@ specified priority False True - 3 + 4 @@ -570,7 +570,7 @@ specified priority - + True False 5 @@ -587,9 +587,9 @@ specified priority - + True - False + True 5 5 5 @@ -607,7 +607,7 @@ specified priority False True - 4 + 5 diff --git a/ubl-settings-bootloader_ru.po b/ubl-settings-bootloader_ru.po index a82a2b3..7e8af3c 100644 --- a/ubl-settings-bootloader_ru.po +++ b/ubl-settings-bootloader_ru.po @@ -16,6 +16,18 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +msgid "Plymouth graphics, full log" +msgstr "Графика plymouth, полный лог" + +msgid "Plymouth graphics, no log" +msgstr "Графика plymouth, нет лога" + +msgid "No plymouth, minimal log" +msgstr "Без plymouth, минимальный лог" + +msgid "Without plymouth, full log" +msgstr "Без plymouth, полный лог" + msgid "Download mode:" msgstr "Режим загрузки:"