|
|
|
|
@ -116,8 +116,6 @@ void MainWindow::fill_in_view() {
|
|
|
|
|
this->view_add_colums(*treeViewIPT);
|
|
|
|
|
this->view_add_colums(*treeViewOTT);
|
|
|
|
|
std::vector<Gtk::TreeViewColumn*> 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<string> 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<string, string> &map_view, const Gtk::TreeModel::Path& path, Glib::RefPtr<Gtk::ListStore> &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<string> MainWindow::get_setting_entry_all(string cmd, Gtk::Entry &entry_text, std::map <string, string> &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<string> 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];
|
|
|
|
|
|