|
|
|
|
@ -205,7 +205,7 @@ void MainWindow::get_download_mode(std::map <string, string> &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 <string, string> &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 <string, string> &map_temp) {
|
|
|
|
|
@ -519,8 +485,8 @@ vector<string> 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 <string, string> &map_temp) {
|
|
|
|
|
std::map <string, string>:: 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 <string, string> &map_cmd, Glib::RefPtr<Gtk::ListStore> &list_store, vector<string> &list_params, size_t size) {
|
|
|
|
|
void MainWindow::set_row_all(std::map <string, string> &map_cmd, Glib::RefPtr<Gtk::ListStore> &list_store, vector<string> &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 {
|
|
|
|
|
|