|
|
|
@ -69,6 +69,14 @@ MainWindow::MainWindow(Glib::RefPtr<Gtk::Builder> const& builder) {
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::settings(){
|
|
|
|
void MainWindow::settings(){
|
|
|
|
map_cmd_error[""] = "";
|
|
|
|
map_cmd_error[""] = "";
|
|
|
|
|
|
|
|
vec_param_names.push_back("GRUB_TIMEOUT");
|
|
|
|
|
|
|
|
vec_param_names.push_back("GRUB_CMDLINE_LINUX");
|
|
|
|
|
|
|
|
vec_param_names.push_back("GRUB_TERMINAL_INPUT");
|
|
|
|
|
|
|
|
vec_param_names.push_back("GRUB_TERMINAL_OUTPUT");
|
|
|
|
|
|
|
|
vec_param_names.push_back("GRUB_BOOT_SILENT");
|
|
|
|
|
|
|
|
vec_param_names.push_back("GRUB_USER");
|
|
|
|
|
|
|
|
vec_param_names.push_back("GRUB_PASSWORD");
|
|
|
|
|
|
|
|
vec_param_names.push_back("GRUB_DEFAULT");
|
|
|
|
this->get_builder();
|
|
|
|
this->get_builder();
|
|
|
|
this->localization();
|
|
|
|
this->localization();
|
|
|
|
this->add_CSS();
|
|
|
|
this->add_CSS();
|
|
|
|
@ -216,8 +224,6 @@ void MainWindow::set_download_mode(string cmd="") {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (cmd.length() !=0 ) {
|
|
|
|
if (cmd.length() !=0 ) {
|
|
|
|
cmd += "\"" + key + "\"";
|
|
|
|
|
|
|
|
obj_process_system.call(cmd, "");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
flag_save_local = true;
|
|
|
|
flag_save_local = true;
|
|
|
|
@ -233,7 +239,6 @@ void MainWindow::set_security_login(string cmd = "", string cmd_remove = "") {
|
|
|
|
if (index == 0) {
|
|
|
|
if (index == 0) {
|
|
|
|
key = "";
|
|
|
|
key = "";
|
|
|
|
if (cmd_remove.length() != 0) {
|
|
|
|
if (cmd_remove.length() != 0) {
|
|
|
|
obj_process_system.call(cmd_remove, "");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
flag_save_local = true;
|
|
|
|
flag_save_local = true;
|
|
|
|
@ -245,8 +250,6 @@ void MainWindow::set_security_login(string cmd = "", string cmd_remove = "") {
|
|
|
|
key = entrySecurityLogin->get_text();
|
|
|
|
key = entrySecurityLogin->get_text();
|
|
|
|
if (cmd.length() != 0) {
|
|
|
|
if (cmd.length() != 0) {
|
|
|
|
entrySecurityLogin->set_text(key);
|
|
|
|
entrySecurityLogin->set_text(key);
|
|
|
|
cmd = cmd + "\"" + key + "\"";
|
|
|
|
|
|
|
|
obj_process_system.call(cmd, "");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
flag_save_local = true;
|
|
|
|
flag_save_local = true;
|
|
|
|
@ -291,7 +294,6 @@ void MainWindow::set_password_protec(string cmd = "", string cmd_remove = "") {
|
|
|
|
if (index == 0){
|
|
|
|
if (index == 0){
|
|
|
|
key = "";
|
|
|
|
key = "";
|
|
|
|
if (cmd_remove.length() != 0) {
|
|
|
|
if (cmd_remove.length() != 0) {
|
|
|
|
obj_process_system.call(cmd_remove, "");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
flag_save_local = true;
|
|
|
|
flag_save_local = true;
|
|
|
|
@ -303,8 +305,6 @@ void MainWindow::set_password_protec(string cmd = "", string cmd_remove = "") {
|
|
|
|
key = entryPasswordProtecc->get_text();
|
|
|
|
key = entryPasswordProtecc->get_text();
|
|
|
|
if (cmd.length() != 0 and key != "************") {
|
|
|
|
if (cmd.length() != 0 and key != "************") {
|
|
|
|
entryPasswordProtecc->set_text(key);
|
|
|
|
entryPasswordProtecc->set_text(key);
|
|
|
|
cmd = cmd + "\"" + key + "\"";
|
|
|
|
|
|
|
|
obj_process_system.call(cmd, "");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
flag_save_local = true;
|
|
|
|
flag_save_local = true;
|
|
|
|
@ -318,7 +318,6 @@ void MainWindow::set_password_protec(string cmd = "", string cmd_remove = "") {
|
|
|
|
if (key!= "************") {
|
|
|
|
if (key!= "************") {
|
|
|
|
map_cmd_selection["GRUB_PASSWORD"] = key;
|
|
|
|
map_cmd_selection["GRUB_PASSWORD"] = key;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::get_password_protec(std::map <string, string> &map_temp) {
|
|
|
|
void MainWindow::get_password_protec(std::map <string, string> &map_temp) {
|
|
|
|
@ -607,51 +606,20 @@ void MainWindow::get_menu_boot(std::map <string, string> &map_temp) {
|
|
|
|
lblInfoSeconds->set_sensitive(true);
|
|
|
|
lblInfoSeconds->set_sensitive(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
spbSecond->set_value(1);
|
|
|
|
chbLoadVariantSelectionTimer->set_active(false);
|
|
|
|
chbLoadVariantSelectionTimer->set_active(false);
|
|
|
|
spbSecond->set_sensitive(false);
|
|
|
|
spbSecond->set_sensitive(false);
|
|
|
|
lblInfoSeconds->set_sensitive(true);
|
|
|
|
lblInfoSeconds->set_sensitive(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
spbSecond->set_value(1);
|
|
|
|
chbLoadVariantSelectionTimer->set_active(false);
|
|
|
|
chbLoadVariantSelectionTimer->set_active(false);
|
|
|
|
spbSecond->set_sensitive(false);
|
|
|
|
spbSecond->set_sensitive(false);
|
|
|
|
lblInfoSeconds->set_sensitive(true);
|
|
|
|
lblInfoSeconds->set_sensitive(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::set_menu_boot(string cmd = "", string cmd_remove = "") {
|
|
|
|
|
|
|
|
if (chbLoadVariantSelectionTimer->get_active()) {
|
|
|
|
|
|
|
|
int value = spbSecond->get_value();
|
|
|
|
|
|
|
|
if (cmd.length() != 0) {
|
|
|
|
|
|
|
|
cmd += to_string(value);
|
|
|
|
|
|
|
|
obj_process_system.call(cmd, "");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
flag_save_local = true;
|
|
|
|
|
|
|
|
flag_save_global = true;
|
|
|
|
|
|
|
|
flag_save_all = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
map_cmd_selection["GRUB_TIMEOUT"] = to_string(value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (chbLoadVariantSelectionTimer->get_active() == false) {
|
|
|
|
|
|
|
|
if (cmd_remove.length() != 0) {
|
|
|
|
|
|
|
|
obj_process_system.call(cmd_remove, "");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
flag_save_local = true;
|
|
|
|
|
|
|
|
flag_save_global = true;
|
|
|
|
|
|
|
|
flag_save_all = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
map_cmd_selection["GRUB_TIMEOUT"] = "";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
flag_save_local = true;
|
|
|
|
|
|
|
|
flag_save_global = true;
|
|
|
|
|
|
|
|
flag_save_all = true;
|
|
|
|
|
|
|
|
map_cmd_selection["GRUB_TIMEOUT"] = "";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::cmd_entry_all(Gtk::Entry &entry, string cmd_settings, string cmd_remove) {
|
|
|
|
void MainWindow::cmd_entry_all(Gtk::Entry &entry, string cmd_settings, string cmd_remove) {
|
|
|
|
string cmds = entry.get_text();
|
|
|
|
string cmds = entry.get_text();
|
|
|
|
Utils::str_remove(cmds, ",");
|
|
|
|
Utils::str_remove(cmds, ",");
|
|
|
|
@ -679,12 +647,8 @@ void MainWindow::event(){
|
|
|
|
entryOTT->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_OTT));
|
|
|
|
entryOTT->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_OTT));
|
|
|
|
entrySecurityLogin->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_login));
|
|
|
|
entrySecurityLogin->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_login));
|
|
|
|
entryPasswordProtecc->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_password));
|
|
|
|
entryPasswordProtecc->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_password));
|
|
|
|
chbPasswordProtecc->signal_changed().connect([&]() {change_password_protecc();set_password_protec();});
|
|
|
|
chbPasswordProtecc->signal_changed().connect([&]() {change_password_protecc();});
|
|
|
|
chbSecurityLogin->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::change_security_login));
|
|
|
|
chbSecurityLogin->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::change_security_login));
|
|
|
|
cmbDownloadMode->signal_changed().connect([&]() {set_download_mode();});
|
|
|
|
|
|
|
|
chbSecurityLogin->signal_changed().connect([&]() {set_security_login();});
|
|
|
|
|
|
|
|
cmbDefaultDonw->signal_changed().connect([&]() {set_default_load("","");});
|
|
|
|
|
|
|
|
spbSecond->signal_changed().connect([&]() {set_menu_boot();});
|
|
|
|
|
|
|
|
if (this->check_root() == 0) {
|
|
|
|
if (this->check_root() == 0) {
|
|
|
|
Glib::RefPtr<Gtk::TreeModel> treeViewKernelModel = treeViewKernel->get_model();
|
|
|
|
Glib::RefPtr<Gtk::TreeModel> treeViewKernelModel = treeViewKernel->get_model();
|
|
|
|
treeViewKernelModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::item_selected_kernel));
|
|
|
|
treeViewKernelModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::item_selected_kernel));
|
|
|
|
@ -721,7 +685,6 @@ void MainWindow::set_default_load(string cmd = "", string cmd_remove = "") {
|
|
|
|
int index = cmbDefaultDonw->get_active_row_number();
|
|
|
|
int index = cmbDefaultDonw->get_active_row_number();
|
|
|
|
if (index == 0) {
|
|
|
|
if (index == 0) {
|
|
|
|
if (cmd.length() != 0) {
|
|
|
|
if (cmd.length() != 0) {
|
|
|
|
obj_process_system.call(cmd, "");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
flag_save_local = true;
|
|
|
|
flag_save_local = true;
|
|
|
|
@ -731,7 +694,6 @@ void MainWindow::set_default_load(string cmd = "", string cmd_remove = "") {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (index > 0) {
|
|
|
|
else if (index > 0) {
|
|
|
|
if (cmd_remove.length() != 0) {
|
|
|
|
if (cmd_remove.length() != 0) {
|
|
|
|
obj_process_system.call(cmd_remove, "");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
flag_save_local = true;
|
|
|
|
flag_save_local = true;
|
|
|
|
@ -784,7 +746,14 @@ void MainWindow::change_password_protecc() {
|
|
|
|
void MainWindow::set_active_boot_second() {
|
|
|
|
void MainWindow::set_active_boot_second() {
|
|
|
|
spbSecond->set_sensitive(chbLoadVariantSelectionTimer->get_active());
|
|
|
|
spbSecond->set_sensitive(chbLoadVariantSelectionTimer->get_active());
|
|
|
|
lblInfoSeconds->set_sensitive(chbLoadVariantSelectionTimer->get_active());
|
|
|
|
lblInfoSeconds->set_sensitive(chbLoadVariantSelectionTimer->get_active());
|
|
|
|
this->set_menu_boot();
|
|
|
|
if (chbLoadVariantSelectionTimer->get_active()) {
|
|
|
|
|
|
|
|
int second = spbSecond->get_value();
|
|
|
|
|
|
|
|
map_cmd_selection["GRUB_TIMEOUT"] = to_string(second);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
spbSecond->set_value(1);
|
|
|
|
|
|
|
|
map_cmd_selection["GRUB_TIMEOUT"] = "";
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::wrapper_save_all_cfg() {
|
|
|
|
void MainWindow::wrapper_save_all_cfg() {
|
|
|
|
@ -801,6 +770,7 @@ void MainWindow::wrapper_save_all_cfg() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::wrapper_save_global_cfg() {
|
|
|
|
void MainWindow::wrapper_save_global_cfg() {
|
|
|
|
|
|
|
|
this->set_data_cfg();
|
|
|
|
if (this->save_global_cfg()) {
|
|
|
|
if (this->save_global_cfg()) {
|
|
|
|
this->info_warning_error(5);
|
|
|
|
this->info_warning_error(5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -810,104 +780,25 @@ void MainWindow::wrapper_save_global_cfg() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool MainWindow::save_global_cfg() {
|
|
|
|
bool MainWindow::save_global_cfg() {
|
|
|
|
string flag_save = "global";
|
|
|
|
|
|
|
|
bool flag_no_save = true;
|
|
|
|
bool flag_no_save = true;
|
|
|
|
if (flag_save_global) {
|
|
|
|
if (flag_save_global) {
|
|
|
|
if (flag_save_all) {
|
|
|
|
if (flag_save_all) {
|
|
|
|
flag_save_global = false;
|
|
|
|
flag_save_global = false;
|
|
|
|
this->set_data_cfg();
|
|
|
|
obj_save.set_data_local(map_cmd_selection);
|
|
|
|
if (this->check_save(flag_save, "GRUB_TIMEOUT")) {
|
|
|
|
obj_save.set_data_global(map_local_cmd_selection);
|
|
|
|
std::string cmd_boot_time = "ubconfig --target global set boot GRUB_TIMEOUT=";
|
|
|
|
obj_save.set_data_gui(map_cmd_selection);
|
|
|
|
string cmd_remove = "ubconfig --target global remove boot GRUB_TIMEOUT";
|
|
|
|
obj_save.set_vec_params(vec_param_names);
|
|
|
|
this->set_menu_boot(cmd_boot_time, cmd_remove);
|
|
|
|
obj_save.save("boot", "global");
|
|
|
|
flag_no_save = false;
|
|
|
|
vector<string> obj_vec_error = obj_save.get_error();
|
|
|
|
}
|
|
|
|
flag_no_save = obj_save.get_state_save();
|
|
|
|
if (this->check_save(flag_save, "GRUB_CMDLINE_LINUX")) {
|
|
|
|
|
|
|
|
string cmd_settings_kernel = "ubconfig --target global set boot GRUB_CMDLINE_LINUX=";
|
|
|
|
|
|
|
|
string cmd_remove = "ubconfig --target global remove boot GRUB_CMDLINE_LINUX";
|
|
|
|
|
|
|
|
this->cmd_entry_all(*entryKernel, cmd_settings_kernel, cmd_remove);
|
|
|
|
|
|
|
|
flag_no_save = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->check_save(flag_save, "GRUB_TERMINAL_OUTPUT")) {
|
|
|
|
|
|
|
|
string cmd_settings_IPT = "ubconfig --target global set boot GRUB_TERMINAL_OUTPUT=";
|
|
|
|
|
|
|
|
string cmd_remove = "ubconfig --target global remove boot GRUB_TERMINAL_OUTPUT";
|
|
|
|
|
|
|
|
this->cmd_entry_all(*entryIPT, cmd_settings_IPT,cmd_remove);
|
|
|
|
|
|
|
|
flag_no_save = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->check_save(flag_save, "GRUB_TERMINAL_INPUT")) {
|
|
|
|
|
|
|
|
string cmd_settings_OTT = "ubconfig --target global set boot GRUB_TERMINAL_INPUT=";
|
|
|
|
|
|
|
|
string cmd_remove = "ubconfig --target global remove boot GRUB_TERMINAL_INPUT";
|
|
|
|
|
|
|
|
this->cmd_entry_all(*entryOTT, cmd_settings_OTT, cmd_remove);
|
|
|
|
|
|
|
|
flag_no_save = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->check_save(flag_save, "GRUB_BOOT_SILENT")) {
|
|
|
|
|
|
|
|
this->set_download_mode("ubconfig --target global set boot GRUB_BOOT_SILENT=");
|
|
|
|
|
|
|
|
flag_no_save = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->check_save(flag_save, "GRUB_USER")) {
|
|
|
|
|
|
|
|
string cmd_login = "ubconfig --target global set boot GRUB_USER=";
|
|
|
|
|
|
|
|
string cmd_remove_login = "ubconfig --target system remove boot GRUB_USER";
|
|
|
|
|
|
|
|
this->set_security_login(cmd_login, cmd_remove_login);
|
|
|
|
|
|
|
|
flag_no_save = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->check_save(flag_save, "GRUB_PASSWORD")) {
|
|
|
|
|
|
|
|
string cmd_password = "ubconfig --target global set boot GRUB_PASSWORD=";
|
|
|
|
|
|
|
|
string cmd_password_remove = "ubconfig --target global remove boot GRUB_PASSWORD";
|
|
|
|
|
|
|
|
this->set_password_protec(cmd_password, cmd_password_remove);
|
|
|
|
|
|
|
|
flag_no_save = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->check_save(flag_save, "GRUB_DEFAULT")) {
|
|
|
|
|
|
|
|
string cmd_load = "ubconfig --target global set boot GRUB_DEFAULT=";
|
|
|
|
|
|
|
|
string cmd_load_remove = "ubconfig --target global remove boot GRUB_DEFAULT";
|
|
|
|
|
|
|
|
this->set_default_load(cmd_load, cmd_load_remove);
|
|
|
|
|
|
|
|
flag_no_save = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
map_local_cmd_selection = map_cmd_selection;
|
|
|
|
map_global_cmd_selection = map_cmd_selection;
|
|
|
|
|
|
|
|
return flag_no_save;
|
|
|
|
return flag_no_save;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool MainWindow::check_save(string flag_save, string key_name="") {
|
|
|
|
|
|
|
|
std::map <string, string>:: iterator iter_map_data;
|
|
|
|
|
|
|
|
std::map <string, string>:: iterator iter_map_data_old;
|
|
|
|
|
|
|
|
std::map <string, string> map_config_data_old;
|
|
|
|
|
|
|
|
if (flag_save == "local") {
|
|
|
|
|
|
|
|
map_config_data_old = map_local_cmd_selection;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (flag_save == "global") {
|
|
|
|
|
|
|
|
map_config_data_old = map_global_cmd_selection;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
iter_map_data = map_cmd_selection.find(key_name);
|
|
|
|
|
|
|
|
iter_map_data_old = map_config_data_old.find(key_name);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (iter_map_data_old == map_config_data_old.end() && iter_map_data != map_cmd_selection.end()) {
|
|
|
|
|
|
|
|
cout << 2 << endl;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (iter_map_data->second != iter_map_data_old->second) {
|
|
|
|
|
|
|
|
cout << iter_map_data->second << " ||| " << iter_map_data_old->second << endl;
|
|
|
|
|
|
|
|
cout << 3 << endl;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (iter_map_data->second.length() == 0 && iter_map_data_old->second.length() == 0) {
|
|
|
|
|
|
|
|
cout << 4 << " " << key_name << endl;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (iter_map_data->second == iter_map_data_old->second) {
|
|
|
|
|
|
|
|
cout << 5 << " " << key_name << endl;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
cout << 6 << endl;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
cout << 7 << endl;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::wrapper_save_local_cfg() {
|
|
|
|
void MainWindow::wrapper_save_local_cfg() {
|
|
|
|
|
|
|
|
this->set_data_cfg();
|
|
|
|
if (this->save_local_cfg()){
|
|
|
|
if (this->save_local_cfg()){
|
|
|
|
this->info_warning_error(5);
|
|
|
|
this->info_warning_error(5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -917,59 +808,17 @@ void MainWindow::wrapper_save_local_cfg() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool MainWindow::save_local_cfg() {
|
|
|
|
bool MainWindow::save_local_cfg() {
|
|
|
|
string flag_save = "local";
|
|
|
|
|
|
|
|
bool flag_no_save = true;
|
|
|
|
bool flag_no_save = true;
|
|
|
|
if (flag_save_local) {
|
|
|
|
if (flag_save_local) {
|
|
|
|
if (flag_save_all) {
|
|
|
|
if (flag_save_all) {
|
|
|
|
flag_save_local = false;
|
|
|
|
flag_save_local = false;
|
|
|
|
this->set_data_cfg();
|
|
|
|
obj_save.set_data_local(map_cmd_selection);
|
|
|
|
if (this->check_save(flag_save, "GRUB_TIMEOUT")) {
|
|
|
|
obj_save.set_data_global(map_global_cmd_selection);
|
|
|
|
std::string cmd_boot_time = "ubconfig --target system set boot GRUB_TIMEOUT=";
|
|
|
|
obj_save.set_data_gui(map_cmd_selection);
|
|
|
|
string cmd_remove = "ubconfig --target system remove boot GRUB_TIMEOUT";
|
|
|
|
obj_save.set_vec_params(vec_param_names);
|
|
|
|
this->set_menu_boot(cmd_boot_time, cmd_remove);
|
|
|
|
obj_save.save("boot", "system");
|
|
|
|
flag_no_save = false;
|
|
|
|
vector<string> obj_vec_error = obj_save.get_error();
|
|
|
|
}
|
|
|
|
flag_no_save = obj_save.get_state_save();
|
|
|
|
if (this->check_save(flag_save, "GRUB_CMDLINE_LINUX")) {
|
|
|
|
|
|
|
|
string cmd_settings_kernel = "ubconfig --target system set boot GRUB_CMDLINE_LINUX=";
|
|
|
|
|
|
|
|
string cmd_remove = "ubconfig --target system remove boot GRUB_CMDLINE_LINUX";
|
|
|
|
|
|
|
|
this->cmd_entry_all(*entryKernel, cmd_settings_kernel, cmd_remove);
|
|
|
|
|
|
|
|
flag_no_save = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->check_save(flag_save, "GRUB_TERMINAL_OUTPUT")) {
|
|
|
|
|
|
|
|
string cmd_settings_IPT = "ubconfig --target system set boot GRUB_TERMINAL_OUTPUT=";
|
|
|
|
|
|
|
|
string cmd_remove = "ubconfig --target system remove boot GRUB_TERMINAL_OUTPUT";
|
|
|
|
|
|
|
|
this->cmd_entry_all(*entryIPT, cmd_settings_IPT, cmd_remove);
|
|
|
|
|
|
|
|
flag_no_save = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->check_save(flag_save, "GRUB_TERMINAL_INPUT")) {
|
|
|
|
|
|
|
|
string cmd_settings_OTT = "ubconfig --target system set boot GRUB_TERMINAL_INPUT=";
|
|
|
|
|
|
|
|
string cmd_remove = "ubconfig --target system remove boot GRUB_TERMINAL_INPUT";
|
|
|
|
|
|
|
|
this->cmd_entry_all(*entryOTT, cmd_settings_OTT, cmd_remove);
|
|
|
|
|
|
|
|
flag_no_save = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->check_save(flag_save, "GRUB_BOOT_SILENT")) {
|
|
|
|
|
|
|
|
this->set_download_mode("ubconfig --target system set boot GRUB_BOOT_SILENT=");
|
|
|
|
|
|
|
|
flag_no_save = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->check_save(flag_save, "GRUB_USER")) {
|
|
|
|
|
|
|
|
string cmd_login = "ubconfig --target system set boot GRUB_USER=";
|
|
|
|
|
|
|
|
string cmd_remove_login = "ubconfig --target system remove boot GRUB_USER";
|
|
|
|
|
|
|
|
this->set_security_login(cmd_login, cmd_remove_login);
|
|
|
|
|
|
|
|
flag_no_save = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->check_save(flag_save, "GRUB_PASSWORD")) {
|
|
|
|
|
|
|
|
string cmd_password = "ubconfig --target system set boot GRUB_PASSWORD=";
|
|
|
|
|
|
|
|
string cmd_password_remove = "ubconfig --target system remove boot GRUB_PASSWORD";
|
|
|
|
|
|
|
|
this->set_password_protec(cmd_password, cmd_password_remove);
|
|
|
|
|
|
|
|
flag_no_save = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this->check_save(flag_save, "GRUB_DEFAULT")) {
|
|
|
|
|
|
|
|
string cmd_load = "ubconfig --target system set boot GRUB_DEFAULT=";
|
|
|
|
|
|
|
|
string cmd_load_remove = "ubconfig --target system remove boot GRUB_DEFAULT";
|
|
|
|
|
|
|
|
this->set_default_load(cmd_load, cmd_load_remove);
|
|
|
|
|
|
|
|
flag_no_save = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
map_local_cmd_selection = map_cmd_selection;
|
|
|
|
map_local_cmd_selection = map_cmd_selection;
|
|
|
|
@ -989,6 +838,18 @@ void MainWindow::set_data_cfg() {
|
|
|
|
Utils::str_remove(str_flags, ",");
|
|
|
|
Utils::str_remove(str_flags, ",");
|
|
|
|
Utils::str_replace_all(str_flags, " \"", "\"");
|
|
|
|
Utils::str_replace_all(str_flags, " \"", "\"");
|
|
|
|
map_cmd_selection["GRUB_TERMINAL_OUTPUT"] = str_flags;
|
|
|
|
map_cmd_selection["GRUB_TERMINAL_OUTPUT"] = str_flags;
|
|
|
|
|
|
|
|
if (chbLoadVariantSelectionTimer->get_active()) {
|
|
|
|
|
|
|
|
int second = spbSecond->get_value();
|
|
|
|
|
|
|
|
map_cmd_selection["GRUB_TIMEOUT"] = to_string(second);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
map_cmd_selection["GRUB_TIMEOUT"] = "";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this->set_default_load();
|
|
|
|
|
|
|
|
this->set_download_mode();
|
|
|
|
|
|
|
|
this->set_security_login();
|
|
|
|
|
|
|
|
this->set_password_protec();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::download_globl_cfg() {
|
|
|
|
void MainWindow::download_globl_cfg() {
|
|
|
|
@ -999,7 +860,6 @@ void MainWindow::download_globl_cfg() {
|
|
|
|
flag_save_local = true;
|
|
|
|
flag_save_local = true;
|
|
|
|
flag_save_global = true;
|
|
|
|
flag_save_global = true;
|
|
|
|
flag_save_all = true;
|
|
|
|
flag_save_all = true;
|
|
|
|
flag_load = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vector<string> vec_sections;
|
|
|
|
vector<string> vec_sections;
|
|
|
|
vec_sections.push_back("boot");
|
|
|
|
vec_sections.push_back("boot");
|
|
|
|
@ -1043,7 +903,6 @@ void MainWindow::download_local_cfg() {
|
|
|
|
flag_save_local = true;
|
|
|
|
flag_save_local = true;
|
|
|
|
flag_save_global = true;
|
|
|
|
flag_save_global = true;
|
|
|
|
flag_save_all = true;
|
|
|
|
flag_save_all = true;
|
|
|
|
flag_load = false;
|
|
|
|
|
|
|
|
this->init_dict();
|
|
|
|
this->init_dict();
|
|
|
|
|
|
|
|
|
|
|
|
vector<string> vec_sections;
|
|
|
|
vector<string> vec_sections;
|
|
|
|
|