diff --git a/source/save.cc b/source/save.cc index 55343ae..4b0b888 100644 --- a/source/save.cc +++ b/source/save.cc @@ -34,7 +34,6 @@ bool Save::check_save(string flag_save, string key_name) { } iter_map_data = (*map_gui).find(key_name); iter_map_data_old = (*map_data_old).find(key_name); - cout << iter_map_data->second << " ||| " << iter_map_data_old->second << endl; if (iter_map_data_old == (*map_data_old).end() && iter_map_data != (*map_gui).end()) { return true; } @@ -77,7 +76,6 @@ void Save::save(string sections, string str_flag_save) { else { cmd = ""; } - cout << cmd << endl; if (cmd.length() != 0) { process.call(cmd, ""); this->flag_no_save = false; diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index 7000711..77745e1 100755 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -205,7 +205,7 @@ void MainWindow::get_download_mode(std::map &map_temp) { } } -void MainWindow::set_download_mode(string cmd="") { +void MainWindow::set_download_mode() { int index = cmbDownloadMode->get_active_row_number(); string key = ""; if (index == 0) { @@ -223,42 +223,20 @@ void MainWindow::set_download_mode(string cmd="") { else{ return; } - if (cmd.length() !=0 ) { - } - else { - flag_save_local = true; - flag_save_global = true; - flag_save_all = true; - } map_cmd_selection["GRUB_BOOT_SILENT"] = key; } -void MainWindow::set_security_login(string cmd = "", string cmd_remove = "") { +void MainWindow::set_security_login() { int index = chbSecurityLogin->get_active_row_number(); string key = ""; if (index == 0) { key = ""; - if (cmd_remove.length() != 0) { - } - else { - flag_save_local = true; - flag_save_global = true; - flag_save_all = true; - } } else if (index == 1) { key = entrySecurityLogin->get_text(); - if (cmd.length() != 0) { - entrySecurityLogin->set_text(key); - } - else { - flag_save_local = true; - flag_save_global = true; - flag_save_all = true; - } } else if (index == -1) { - return; + key = ""; } map_cmd_selection["GRUB_USER"] = key; } @@ -288,36 +266,24 @@ void MainWindow::get_security_login(std::map &map_temp) { } } -void MainWindow::set_password_protec(string cmd = "", string cmd_remove = "") { +void MainWindow::set_password_protec() { int index = chbPasswordProtecc->get_active_row_number(); string key = ""; if (index == 0){ key = ""; - if (cmd_remove.length() != 0) { - } - else { - flag_save_local = true; - flag_save_global = true; - flag_save_all = true; - } } else if (index == 1) { key = entryPasswordProtecc->get_text(); - if (cmd.length() != 0 and key != "************") { - entryPasswordProtecc->set_text(key); - } - else { - flag_save_local = true; - flag_save_global = true; - flag_save_all = true; - } } else if (index == -1) { - return; + key = ""; } if (key!= "************") { map_cmd_selection["GRUB_PASSWORD"] = key; } + else { + key = ""; + } } void MainWindow::get_password_protec(std::map &map_temp) { @@ -519,8 +485,8 @@ vector MainWindow::get_setting_entry_all(string key, Gtk::Entry &entry_t Utils::str_replace_all(value, " ", ", "); entry_text.set_text(value); for (auto ¶m: vec_params) { - map_cmd_selection[param] = "1"; - map_temp[param] = "1"; + map_cmd_selection[key+"_" + param] = "1"; + map_temp[key + "_" + param] = "1"; } Utils::str_remove(value, ","); map_temp[key] = value; @@ -681,33 +647,6 @@ void MainWindow::change_security_login() { boxSave->set_sensitive(true); } } -void MainWindow::set_default_load(string cmd = "", string cmd_remove = "") { - int index = cmbDefaultDonw->get_active_row_number(); - if (index == 0) { - if (cmd.length() != 0) { - } - else { - flag_save_local = true; - flag_save_global = true; - flag_save_all = true; - } - } - else if (index > 0) { - if (cmd_remove.length() != 0) { - } - else { - flag_save_local = true; - flag_save_global = true; - flag_save_all = true; - } - } - if (index != 0 && index != -1) { - map_cmd_selection["GRUB_DEFAULT"] = cmbDefaultDonw->get_active_text(); - } - else { - map_cmd_selection["GRUB_DEFAULT"] = ""; - } -} void MainWindow::get_default_load(std::map &map_temp) { std::map :: iterator iter_map_data; @@ -845,8 +784,13 @@ void MainWindow::set_data_cfg() { else { map_cmd_selection["GRUB_TIMEOUT"] = ""; } - - this->set_default_load(); + int index = cmbDefaultDonw->get_active_row_number(); + if (index != 0 && index != -1) { + map_cmd_selection["GRUB_DEFAULT"] = cmbDefaultDonw->get_active_text(); + } + else { + map_cmd_selection["GRUB_DEFAULT"] = ""; + } this->set_download_mode(); this->set_security_login(); this->set_password_protec(); @@ -867,12 +811,12 @@ void MainWindow::download_globl_cfg() { map_local_cmd_selection = obj_load.get_load_data(map_global_cmd_selection, "global"); this->get_menu_boot(map_global_cmd_selection); - this->get_setting_entry_all("GRUB_CMDLINE_LINUX",*entryKernel, map_global_cmd_selection); - this->get_setting_entry_all("GRUB_TERMINAL_INPUT",*entryIPT, map_global_cmd_selection); + this->get_setting_entry_all("GRUB_CMDLINE_LINUX", *entryKernel, map_global_cmd_selection); + this->get_setting_entry_all("GRUB_TERMINAL_INPUT", *entryIPT, map_global_cmd_selection); this->get_setting_entry_all("GRUB_TERMINAL_OUTPUT", *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->set_row_all(map_global_cmd_selection, list_store_kernel, vec_Option_kernel, size_kernel, "GRUB_CMDLINE_LINUX"); + this->set_row_all(map_global_cmd_selection, list_store_IPT, vec_Option_IPT, size_IPT, "GRUB_TERMINAL_INPUT"); + this->set_row_all(map_global_cmd_selection, list_store_OTT, vec_Option_OTT, size_OTT, "GRUB_TERMINAL_OUTPUT"); this->get_download_mode(map_global_cmd_selection); this->get_security_login(map_global_cmd_selection); this->get_password_protec(map_global_cmd_selection); @@ -914,9 +858,9 @@ void MainWindow::download_local_cfg() { this->get_setting_entry_all("GRUB_CMDLINE_LINUX", *entryKernel, map_local_cmd_selection); this->get_setting_entry_all("GRUB_TERMINAL_INPUT", *entryIPT, map_local_cmd_selection); this->get_setting_entry_all("GRUB_TERMINAL_OUTPUT", *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->set_row_all(map_local_cmd_selection, list_store_kernel, vec_Option_kernel, size_kernel, "GRUB_CMDLINE_LINUX"); + this->set_row_all(map_local_cmd_selection, list_store_IPT, vec_Option_IPT, size_IPT, "GRUB_TERMINAL_INPUT"); + this->set_row_all(map_local_cmd_selection, list_store_OTT, vec_Option_OTT, size_OTT, "GRUB_TERMINAL_OUTPUT"); this->get_download_mode(map_local_cmd_selection); this->get_security_login(map_local_cmd_selection); this->get_password_protec(map_local_cmd_selection); @@ -926,9 +870,9 @@ void MainWindow::download_local_cfg() { } -void MainWindow::set_row_all(std::map &map_cmd, Glib::RefPtr &list_store, vector &list_params, size_t size) { +void MainWindow::set_row_all(std::map &map_cmd, Glib::RefPtr &list_store, vector &list_params, size_t size,string key="") { for (auto &name: list_params) { - if (map_cmd.find(name) != map_cmd.end()){ + if (map_cmd.find(key + "_" + name) != map_cmd.end()){ this->set_row(list_store, size, name, true); } else { diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index 13e2ec7..532818e 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -144,8 +144,7 @@ class MainWindow : public Gtk::ApplicationWindow { MainWindow(BaseObjectType* obj, Glib::RefPtr const& builder); MainWindow(Glib::RefPtr const& builder); void get_menu_boot(std::map &map_temp); - void set_default_load(string cmd, string cmd_remove); - void set_row_all(std::map &map_cmd, Glib::RefPtr &list_store, vector &list_params, size_t size); + void set_row_all(std::map &map_cmd, Glib::RefPtr &list_store, vector &list_params, size_t size,string key); void set_row(Glib::RefPtr &list_store, int size, std::string name, bool flag_chbox); void get_builder(); void init_dict(); @@ -181,17 +180,17 @@ class MainWindow : public Gtk::ApplicationWindow { bool focus_out_txt_IPT(GdkEventFocus*); bool focus_out_txt_OTT(GdkEventFocus*); void fill_in_view(); - void set_security_login(string cmd, string cmd_remove); + void set_security_login(); void get_security_login(std::map &map_temp); bool check_flag_save(string flag_save); - void set_download_mode(string cmd); + void set_download_mode(); void change_password_protecc(); bool focus_out_txt_login(GdkEventFocus*); void change_security_login(); void get_default_load(std::map &map_temp); bool focus_out_txt_password(GdkEventFocus*); void get_password_protec(std::map &map_temp); - void set_password_protec(string cmd, string cmd_remove); + void set_password_protec(); vector get_setting_entry_all(string key, Gtk::Entry &entry_text, std::map &map_temp); void cmd_entry_all(Gtk::Entry &entry, string cmd_settings, string cmd_remove); string dynamic_update_entry(std::map &map_view, vector &vec_allowed); diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade index 2066813..8d7cbd6 100644 --- a/ubl-settings-bootloader.glade +++ b/ubl-settings-bootloader.glade @@ -254,28 +254,6 @@ specified priority 0 - - - True - False - - - 81 - True - False - start - - - -1 - - - - - False - True - 1 - - True @@ -286,110 +264,112 @@ specified priority True False - + True False vertical - + + True + False + + + 81 + True + False + start + + + -1 + + + + + False + True + 0 + + + + True False - 0.019999999552965164 - in + vertical - + True False - 12 + 0.019999999552965164 + in - + True False - vertical + 12 True False + vertical - - 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 - - + True False - start - 5 - 5 - 5 - 5 - 6 - 6 - Default load - start - 0 + + + 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 @@ -398,296 +378,296 @@ specified priority - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - - - True - True - 1 - - - - - False - True - 1 - - - - - True - False - - + True False - start - 5 - 5 - 5 - 5 - 6 - 6 - Load screen display mode: - start - 0 + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Default load + start + 0 + + + False + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 1 + + False True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - - - True - True 1 - - - False - True - 3 - - - - - True - False - + True False - User name to enter boot configuration editing mode - start - 5 - 5 - 5 - 5 - 6 - 6 - Load menu user name: - start - 0 + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Load screen display mode: + start + 0 + + + False + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 1 + + False True - 0 + 3 - + True False - 5 - 5 - 5 - 5 - 6 - 6 - - - True - True - 1 - - - - - True - True - 5 - 5 - 5 - 5 - 6 - 6 - - - True - True - 2 - - - - - False - True - 4 - - - - - True - False - - - True - False - start - 5 - 5 - 5 - 5 - 6 - 6 - Load menu user password: - start - 0 + + + True + False + User name to enter boot configuration editing mode + start + 5 + 5 + 5 + 5 + 6 + 6 + Load menu user name: + start + 0 + + + False + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 1 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 2 + + False True - 0 + 4 - + True False - 5 - 5 - 5 - 5 - 6 - 6 - - - True - True - 1 - - - - - True - True - 5 - 5 - 5 - 5 - 6 - 6 + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Load menu user password: + start + 0 + + + False + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 1 + + + + + True + True + 5 + 5 + 5 + 5 + 6 + 6 + + + True + True + 2 + + - True + False True - 2 + 5 - - False - True - 5 - + + + True + False + 5 + 5 + 5 + 5 + 6 + 6 + Download menu + + + + False + True + 0 + - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Download menu - - - - - False - True - 1 - - - - - True - False - 0.019999999552965164 - in - + True False - 12 + 0.019999999552965164 + in - + True False - vertical + 12 - - 140 + True - True - in + False + vertical - + + 140 True - False + True + in - - -1 + True - True - - + False + + + -1 + True + True + - - - - False - True - 0 - - - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Command line parameters: - False True @@ -695,231 +675,225 @@ specified priority - + True - True - 5 - 5 - 5 - 5 - 6 - 6 + 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 + + - True + False True - 1 + 10 - - False - True - 10 - + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Parameters passed to the kernel + start + + + + False + True + 1 + - - - True - False - start - 5 - 5 - 5 - 5 - 6 - 6 - Parameters passed to the kernel - start - - - - - False - True - 2 - - - - - True - False - 0.019999999552965164 - in - + True False - 12 + 0.019999999552965164 + in - + True False - vertical + 12 - - 140 + True - True - in + False + vertical - + + 140 True - False + True + in - + True - True - - + False + + + True + True + - - - - False - True - 1 - - - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Command line parameters: - False True - 0 + 1 - + True - True - 5 - 5 - 5 - 5 - 6 - 6 + 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 + + - True + False True - 1 + 7 - - False - True - 7 - + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Terminal for input + start + + + + False + True + 2 + - - - True - False - start - 5 - 5 - 5 - 5 - 6 - 6 - Terminal for input - start - - - - - False - True - 3 - - - - - True - False - 0.019999999552965164 - in - + True False - 12 + 0.019999999552965164 + in - + True False - vertical + 12 - - 140 + True - True - in + False + vertical - + + 140 True - False + True + in - + True - True - - + False + + + True + True + - - - - False - True - 0 - - - - - True - False - - - True - False - 5 - 5 - 5 - 5 - 6 - 6 - Command line parameters: - False True @@ -927,53 +901,82 @@ specified priority - + True - True - 5 - 5 - 5 - 5 - 6 - 6 + 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 + + - True + False True - 1 + 7 - - False - True - 7 - + + + True + False + start + 5 + 5 + 5 + 5 + 6 + 6 + Terminal for output + start + + - - - - True - False - start - 5 - 5 - 5 - 5 - 6 - 6 - Terminal for output - start - + + False + True + 3 + False True - 4 + 5 diff --git a/ubl-settings-bootloader_ru.po b/ubl-settings-bootloader_ru.po index f97b883..9f561ea 100644 --- a/ubl-settings-bootloader_ru.po +++ b/ubl-settings-bootloader_ru.po @@ -169,6 +169,11 @@ msgstr "Справка" msgid "Terminal for input" msgstr "Терминал для ввода" +#: source/ubl-settings-bootloader.cc:295 +#, fuzzy +msgid "Terminal for output" +msgstr "Терминал для вывода" + #: source/ubl-settings-bootloader.cc:308 msgid "Load" msgstr "Загрузить"