diff --git a/boot-options.csv b/boot-options.csv index c76e0a9..d755699 100644 --- a/boot-options.csv +++ b/boot-options.csv @@ -1,14 +1,14 @@ Get,Set=1,Set=0,Option,Description -get boot GRUB_BOOT_SILENT,quiet,cmd_false,quiet,Downloading without text messages -get boot GRUB_BOOT_SILENT,splash,cmd_false,splash,Show welcome window -get boot GRUB_BOOT_SILENT,noplymouth,cmd_false,noplymouth,Disable Plymouth -get boot GRUB_BOOT_SILENT,acpi=off,cmd_false,acpi=off,Disable ACPI -get boot GRUB_BOOT_SILENT,noapic,cmd_false,noapic,Disable APIC -get boot GRUB_BOOT_SILENT,nolapic,cmd_false,nolapic,Disable local APIC -get boot GRUB_BOOT_SILENT,single,cmd_false,single,Single User Mode -get boot GRUB_BOOT_SILENT,nomodeset,cmd_false,nomodeset,Disable kernel selection and loading of video drivers -get boot GRUB_BOOT_SILENT,915.enable_dc=0,cmd_false,915.enable_dc=0,Disable GPU power management -get boot GRUB_BOOT_SILENT,ahci.mobile_lpm_policy=1,cmd_false,ahci.mobile_lpm_policy=1,"Maximum performance, power management" -get boot GRUB_BOOT_SILENT,snd-intel-dspcfg.dsp_driver=1,cmd_false,snd-intel-dspcfg.dsp_driver=1,Forced selection of an Intel sound device driver -get boot GRUB_BOOT_SILENT,intel_idle.max_cstate=1,cmd_false,intel_idle.max_cstate=1,Prevents the processor from going into a deep sleep state -get boot GRUB_BOOT_SILENT,intel_idle.max_cstate=4,cmd_false,intel_idle.max_cstate=4,Eliminates flickering laptop display on Ultra Voltage processors +quiet,Downloading without text messages +splash,Show welcome window +noplymouth,Disable Plymouth +acpi=off,Disable ACPI +noapic,Disable APIC +nolapic,Disable local APIC +single,Single User Mode +nomodeset,Disable kernel selection and loading of video drivers +915.enable_dc=0,Disable GPU power management +ahci.mobile_lpm_policy=1,"Maximum performance, power management" +snd-intel-dspcfg.dsp_driver=1,Forced selection of an Intel sound device driver +intel_idle.max_cstate=1,Prevents the processor from going into a deep sleep state +intel_idle.max_cstate=4,Eliminates flickering laptop display on Ultra Voltage processors diff --git a/input-options.csv b/input-options.csv index 2f0acd3..f90c724 100644 --- a/input-options.csv +++ b/input-options.csv @@ -1,6 +1,6 @@ Get,Set=1,Set=0,Option,Description -ubconfig get boot GRUB_TERMINAL_INPUT,cmd_true,cmd_false,console,PC BIOS & EFI console -ubconfig get boot GRUB_TERMINAL_INPUT,cmd_true,cmd_false,serial,Serial terminal -ubconfig get boot GRUB_TERMINAL_INPUT,cmd_true,cmd_false,ofconsole,Open Firmware Console -ubconfig get boot GRUB_TERMINAL_INPUT,cmd_true,cmd_false,at_keyboard,PC AT Keyboard (Coreboot) -ubconfig get boot GRUB_TERMINAL_INPUT,cmd_true,cmd_false,usb_keyboard,USB Keyboard (HID Boot protocol) +console,PC BIOS & EFI console +serial,Serial terminal +ofconsole,Open Firmware Console +at_keyboard,PC AT Keyboard (Coreboot) +usb_keyboard,USB Keyboard (HID Boot protocol) diff --git a/output-options.csv b/output-options.csv index 3fb8237..3af14be 100644 --- a/output-options.csv +++ b/output-options.csv @@ -1,6 +1,6 @@ Get,Set=1,Set=0,Option,Description -ubconfig get boot GRUB_TERMINAL_OUTPUT,console,cmd_false,console,PC BIOS & EFI console -ubconfig get boot GRUB_TERMINAL_OUTPUT,serial,cmd_false,serial,Serial terminal -ubconfig get boot GRUB_TERMINAL_OUTPUT,ofconsole,cmd_false,ofconsole,Open Firmware Console -ubconfig get boot GRUB_TERMINAL_OUTPUT,gfxterm,cmd_false,gfxterm,Output in graphical mode -ubconfig get boot GRUB_TERMINAL_OUTPUT,vga_text,cmd_false,vga_text,VGA text output (Coreboot) +console,PC BIOS & EFI console +serial,Serial terminal +ofconsole,Open Firmware Console +gfxterm,Output in graphical mode +vga_text,VGA text output (Coreboot) diff --git a/source/ubl-settings-bootloader.cc b/source/ubl-settings-bootloader.cc index 3aa3c3f..5c34eb3 100755 --- a/source/ubl-settings-bootloader.cc +++ b/source/ubl-settings-bootloader.cc @@ -80,12 +80,12 @@ void MainWindow::settings(){ if (this->check_root() == 0) { spbSecond->set_range(0, 100000000000); spbSecond->set_increments(1.0, 1.0); - + this->fill_in_view(); this->download_local_cfg(); this->download_globl_cfg(); - this->fill_in_view(); this->event(); + } else{ boxWidgetAll->set_sensitive(false); @@ -109,6 +109,9 @@ void MainWindow::fill_in_view() { vec_Option_kernel = this->read_file_and_view("boot-options.csv", row_kernel, list_store_kernel); vec_Option_IPT = this->read_file_and_view("input-options.csv", row_IPT, list_store_IPT); vec_Option_OTT = this->read_file_and_view("output-options.csv", row_OTT, list_store_OTT); + size_kernel = vec_Option_kernel.size(); + size_IPT = vec_Option_IPT.size(); + size_OTT = vec_Option_OTT.size(); this->view_add_colums(*treeViewKernel); this->view_add_colums(*treeViewIPT); this->view_add_colums(*treeViewOTT); @@ -164,8 +167,6 @@ void MainWindow::template_item_selected(std::map &map_view, con } Glib::ustring name = row[m_columns.name]; - cout << cmd << " " << name << endl; - map_view[name] = cmd; } } @@ -203,11 +204,13 @@ void MainWindow::view_add_cell(Gtk::TreeModel::Row &row, Glib::RefPtrappend()); bool flag_chb = false; string name = arr_view[0][index]; + /* if (map_cmd_selection.find(name) != map_cmd_selection.end()) { - if (map_cmd_selection[name] == "1"){ + if (map_cmd_selection[name] == "1") { flag_chb = true; } } + */ row[m_columns.check_button] = flag_chb; row[m_columns.name] = gettext(name.c_str()); row[m_columns.description] = gettext(arr_view[1][index].c_str()); @@ -326,6 +329,16 @@ vector MainWindow::get_setting_entry_all(string cmd, Gtk::Entry &entry_t return vec_params; } +bool MainWindow::focus_out_txt_kernel(GdkEventFocus*) { + return true; +} +bool MainWindow::focus_out_txt_IPT(GdkEventFocus*) { + return true; +} +bool MainWindow::focus_out_txt_OTT(GdkEventFocus*) { + return true; +} + void MainWindow::get_menu_boot(string cmd) { struct Result res_response = this->wrapper_call(cmd); @@ -378,6 +391,9 @@ void MainWindow::event(){ btnSaveLocalGlob->signal_activate().connect([&]() {save_global_local_cfg();}); btnSaveLocal->signal_activate().connect([&]() {save_local_cfg();}); btnSaveGlob->signal_activate().connect([&]() {save_global_cfg();}); + entryKernel->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_kernel)); + entryIPT->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_IPT)); + entryOTT->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_OTT)); if (this->check_root() == 0) { Glib::RefPtr treeViewKernelModel = treeViewKernel->get_model(); treeViewKernelModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::item_selected_kernel)); @@ -473,6 +489,9 @@ void MainWindow::download_globl_cfg() { 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"; 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); info_warning_error(1); } @@ -492,10 +511,35 @@ void MainWindow::download_local_cfg() { 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"; 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); + info_warning_error(0); } +void MainWindow::set_row_all(std::map &map_cmd, Glib::RefPtr &list_store, vector &list_params, size_t size) { + for (auto &name: list_params) { + if (map_cmd.find(name) != map_cmd.end()){ + this->set_row(list_store, size, name, true); + } + else { + this->set_row(list_store, size, name, false); + } + } +} + +void MainWindow::set_row(Glib::RefPtr &list_store, int size, std::string name, bool flag_chbox) { + for (int index = 0; index < size; index++) { + Gtk::TreeModel::Row row = list_store->children()[index]; + if(row) { + if (row[m_columns.name] == name) { + row[m_columns.check_button] = flag_chbox; + } + } + } +} void MainWindow::synopsis_show() { string cmd = "xdg-open " + string(gettext("https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/")) + app_name + " &"; diff --git a/source/ubl-settings-bootloader.h b/source/ubl-settings-bootloader.h index 888a542..23f4090 100644 --- a/source/ubl-settings-bootloader.h +++ b/source/ubl-settings-bootloader.h @@ -1,4 +1,5 @@ +#include #include #include #include @@ -39,11 +40,8 @@ class MainWindow : public Gtk::ApplicationWindow { public: class ModelColumns : public Gtk::TreeModel::ColumnRecord { public: - ModelColumns() {add(cmd_get),add(cmd_set_true),add(cmd_set_false),add(check_button), add(name); add(description); } + ModelColumns() {add(check_button), add(name); add(description); } //Gtk::TreeModelColumn check_button; - Gtk::TreeModelColumn cmd_get; - Gtk::TreeModelColumn cmd_set_true; - Gtk::TreeModelColumn cmd_set_false; Gtk::TreeModelColumn check_button; Gtk::TreeModelColumn name; Gtk::TreeModelColumn description; @@ -116,6 +114,9 @@ class MainWindow : public Gtk::ApplicationWindow { bool flag_save_all = false; bool flag_save_global = false; bool flag_save_local = false; + size_t size_kernel = 0; + size_t size_IPT = 0; + size_t size_OTT = 0; int index_error = 0; string str_cmd_error = ""; template @@ -129,6 +130,8 @@ class MainWindow : public Gtk::ApplicationWindow { MainWindow(Glib::RefPtr const& builder); void get_menu_boot(string cmd); void set_menu_boot(string cmd); + void set_row_all(std::map &map_cmd, Glib::RefPtr &list_store, vector &list_params, size_t size); + void set_row(Glib::RefPtr &list_store, int size, std::string name, bool flag_chbox); void get_builder(); void add_CSS(); void localization(); @@ -151,6 +154,9 @@ class MainWindow : public Gtk::ApplicationWindow { void info_status_app(string stule); void info_warning_error(int mess); int check_root(); + bool focus_out_txt_kernel(GdkEventFocus*); + bool focus_out_txt_IPT(GdkEventFocus*); + bool focus_out_txt_OTT(GdkEventFocus*); void fill_in_view(); 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); diff --git a/ubl-settings-bootloader.glade b/ubl-settings-bootloader.glade index e2cd7e3..d294a9a 100644 --- a/ubl-settings-bootloader.glade +++ b/ubl-settings-bootloader.glade @@ -373,9 +373,11 @@ specified priority False + 0 True False - 8 + start + 5 5 5 5 @@ -406,6 +408,27 @@ specified priority 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 @@ -414,19 +437,45 @@ specified priority - - The last selection will become the default boot choice + True - True - False - start - 5 - 5 - 5 - 5 - 6 - 6 - 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 @@ -434,6 +483,133 @@ specified priority 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 + + @@ -677,7 +853,7 @@ specified priority 5 6 6 - Input terminal + Terminal for input @@ -791,7 +967,7 @@ specified priority 5 6 6 - Output terminal + Terminal for output diff --git a/ubl-settings-bootloader_ru.po b/ubl-settings-bootloader_ru.po index 9cc5300..a82a2b3 100644 --- a/ubl-settings-bootloader_ru.po +++ b/ubl-settings-bootloader_ru.po @@ -16,6 +16,15 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +msgid "Download mode:" +msgstr "Режим загрузки:" + +msgid "Security login:" +msgstr "Логин защиты:" + +msgid "Password protection:" +msgstr "Пароль защиты:" + #: source/ubl-settings-bootloader.cc:301 msgid "About" msgstr "О программе" @@ -121,8 +130,8 @@ msgstr "Справка" #: source/ubl-settings-bootloader.cc:295 #, fuzzy -msgid "Input terminal" -msgstr "Выходной терминал" +msgid "Terminal for input" +msgstr "Терминал для ввода" #: source/ubl-settings-bootloader.cc:308 msgid "Load" @@ -176,7 +185,7 @@ msgstr "Вывод в графическом режиме" #: source/ubl-settings-bootloader.cc:296 msgid "Output terminal" -msgstr "Выходной терминал" +msgstr "Терминал для вывода" msgid "PC AT Keyboard (Coreboot)" msgstr "Клавиатура PC AT (Coreboot)"