|
|
|
|
@ -94,18 +94,19 @@ void MainWindow::settings(){
|
|
|
|
|
this->change_security_login();
|
|
|
|
|
this->set_active_boot_second();
|
|
|
|
|
this->download_local_cfg();
|
|
|
|
|
//this->download_globl_cfg();
|
|
|
|
|
this->download_globl_cfg();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
boxWidgetAll->set_sensitive(false);
|
|
|
|
|
btnLoad->set_sensitive(false);
|
|
|
|
|
boxSave->set_sensitive(false);
|
|
|
|
|
btnSave->set_sensitive(false);
|
|
|
|
|
imgInfo->set_from_icon_name("com.ublinux.ubl-settings-bootloader.warning", Gtk::ICON_SIZE_MENU);
|
|
|
|
|
info_status_app("boxInfoMessError");
|
|
|
|
|
lblWarning->set_text(_("The program must be run as root"));
|
|
|
|
|
this->set_active_boot_second();
|
|
|
|
|
this->fill_in_view();
|
|
|
|
|
}
|
|
|
|
|
this->event();
|
|
|
|
|
}
|
|
|
|
|
@ -159,8 +160,6 @@ void MainWindow::item_selected_OTT(const Gtk::TreeModel::Path&, const Gtk::TreeM
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void MainWindow::item_selected_IPT(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&) {
|
|
|
|
|
// TODO
|
|
|
|
|
// Баг
|
|
|
|
|
auto selection_kernel = treeViewKernel->get_selection();
|
|
|
|
|
auto selection_OTT = treeViewOTT->get_selection();
|
|
|
|
|
selection_kernel->unselect_all();
|
|
|
|
|
@ -687,7 +686,7 @@ void MainWindow::wrapper_save_global_cfg() {
|
|
|
|
|
|
|
|
|
|
bool MainWindow::save_global_cfg() {
|
|
|
|
|
bool flag_no_save = true;
|
|
|
|
|
obj_save.set_data_local(map_cmd_selection);
|
|
|
|
|
obj_save.set_data_local(map_local_cmd_selection);
|
|
|
|
|
obj_save.set_data_global(map_global_cmd_selection);
|
|
|
|
|
obj_save.set_data_gui(map_cmd_selection);
|
|
|
|
|
obj_save.set_vec_params(vec_param_names);
|
|
|
|
|
@ -710,8 +709,8 @@ void MainWindow::wrapper_save_local_cfg() {
|
|
|
|
|
|
|
|
|
|
bool MainWindow::save_local_cfg() {
|
|
|
|
|
bool flag_no_save = true;
|
|
|
|
|
obj_save.set_data_local(map_cmd_selection);
|
|
|
|
|
obj_save.set_data_global(map_local_cmd_selection);
|
|
|
|
|
obj_save.set_data_local(map_local_cmd_selection);
|
|
|
|
|
obj_save.set_data_global(map_global_cmd_selection);
|
|
|
|
|
obj_save.set_data_gui(map_cmd_selection);
|
|
|
|
|
obj_save.set_vec_params(vec_param_names);
|
|
|
|
|
obj_save.save("boot", "system");
|
|
|
|
|
@ -755,10 +754,12 @@ void MainWindow::set_data_cfg() {
|
|
|
|
|
|
|
|
|
|
void MainWindow::download_globl_cfg() {
|
|
|
|
|
this->load_template(&map_global_cmd_selection, "global");
|
|
|
|
|
info_warning_error(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::download_local_cfg() {
|
|
|
|
|
this->load_template(&map_local_cmd_selection, "system");
|
|
|
|
|
info_warning_error(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::load_template(std::map<string, string>* map_temp, string str_load) {
|
|
|
|
|
@ -784,7 +785,6 @@ void MainWindow::load_template(std::map<string, string>* map_temp, string str_lo
|
|
|
|
|
this->set_entry(entryKernel, *map_temp, "GRUB_CMDLINE_LINUX");
|
|
|
|
|
this->set_entry(entryIPT, *map_temp, "GRUB_TERMINAL_INPUT");
|
|
|
|
|
this->set_entry(entryOTT, *map_temp, "GRUB_TERMINAL_OUTPUT");
|
|
|
|
|
info_warning_error(1);
|
|
|
|
|
map_cmd_selection = *map_temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -820,8 +820,6 @@ void MainWindow::set_row_all(std::map <string, string> &map_cmd, Glib::RefPtr<Gt
|
|
|
|
|
for (auto &name: list_params) {
|
|
|
|
|
this->set_row(list_store, size, name, false);
|
|
|
|
|
}
|
|
|
|
|
// TODO:
|
|
|
|
|
// Баг
|
|
|
|
|
string value = map_cmd[key];
|
|
|
|
|
Utils::str_replace_all(value, "\"", "");
|
|
|
|
|
vector<string> vec_params = Utils::split(value, ' ');
|
|
|
|
|
@ -842,7 +840,7 @@ void MainWindow::set_row(Glib::RefPtr<Gtk::ListStore> &list_store, int size, std
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::synopsis_show() {
|
|
|
|
|
string cmd = "xdg-open " + string(_("https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/")) + app_name + " &";
|
|
|
|
|
string cmd = "xdg-open " + string(_("https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/")) + app_name;
|
|
|
|
|
if (geteuid() == 0) {
|
|
|
|
|
string response_user = getlogin();
|
|
|
|
|
cmd = "su -l " + response_user + " -c \" DISPLAY=$DISPLAY " + cmd + " \"";
|
|
|
|
|
|