Исправлена команда сохранения

pull/20/head
Igor Belitskiy 3 years ago
parent a51dd7b9de
commit 0112ec6a1f

@ -28,7 +28,7 @@ configure_file(ubl-settings-bootloader.h.in ubl-settings-bootloader-cm.h)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \
-O2 -pipe -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection")
-fstack-clash-protection -fcf-protection -g")
set(SOURCE_FILES
menu_os.h

@ -57,6 +57,20 @@ bool Save::check_save(string flag_save, string key_name) {
return true;
}
bool Save::wrapper_check_save(string flag_save, string key_name) {
if (flag_save == "all") {
bool bool_flag_save = this->check_save("system", key_name);
if (bool_flag_save) {
return true;
}
return this->check_save("global", key_name);
}
else {
return this->check_save(flag_save, key_name);
}
}
int Save::get_count_error() {
return process.get_count_error();
}
@ -82,7 +96,7 @@ void Save::save(string sections, string str_flag_save) {
for (const auto &key: *vec_param_names) {
if (map_gui->find(key) != map_gui->end()) {
value = (*map_gui)[key];
if (this->check_save(str_flag_save, key)) {
if (this->wrapper_check_save(str_flag_save, key)) {
if (value.length() != 0) {
cmd = "ubconfig --target " + str_flag_save + " set " + sections + " " +
key + "=\"" + value + "\"";
@ -117,7 +131,7 @@ void Save::save_one_cmd(string cmd1, string cmd_remove, string str_flag_save) {
for (const auto &key: *vec_param_names) {
if (map_gui->find(key) != map_gui->end()) {
value = (*map_gui)[key];
if (this->check_save(str_flag_save, key)) {
if (this->wrapper_check_save(str_flag_save, key)) {
if (value.length() != 0) {
cmd = cmd + key + "=\"" + value + "\" ";
}

@ -20,7 +20,7 @@ public:
void set_data_gui(std::map <string, string> &map_gui);
bool check_save(string flag_save, string key_name);
bool get_state_save();
bool wrapper_check_save(string flag_save, string key_name);
void save_one_cmd(string cmd1, string cmd_remove, string str_flag_save);
int get_count_error();
string get_cmd_error();

@ -951,15 +951,11 @@ void MainWindow::set_active_boot_second() {
void MainWindow::wrapper_save_all_cfg() {
this->set_data_cfg();
bool _flag_save_global1 = true;
bool _flag_save_local1 = true;
if (flag_save_global == false) {
_flag_save_global1 = this->save_template(global_save, global_remove , "global");
bool _flag_save_all = true;
if (flag_save_global == false || flag_save_local == false) {
_flag_save_all = this->save_template(all_save, all_remove, "all");
}
if (flag_save_local == false) {
_flag_save_local1 = this->save_template(system_save, system_remove , "system");
}
if (_flag_save_global1 && _flag_save_local1) {
if (_flag_save_all) {
this->info_warning_error(5);
}
else {

@ -120,8 +120,10 @@ void me_thread(string cmd);
#define global_load "ubconfig --default --source global get boot"
#define system_load "ubconfig --default --source system get boot"
#define global_save "ubconfig --target global set boot "
#define system_save "ubconfig --target system set boot "
#define all_save "ubconfig --noexecute set boot "
#define all_remove "ubconfig --noexecute set/remove boot "
#define global_save "ubconfig --target global --noexecute set boot "
#define system_save "ubconfig --target system --noexecute set boot "
#define global_remove "ubconfig --target global --noexecute set/remove boot "
#define system_remove "ubconfig --target system --noexecute set/remove boot "
#define link_doc "https://wiki.ublinux.com/ru/Программное_обеспечениерограммы_и_утилиты/Все/ubl-settings-bootloader"

Loading…
Cancel
Save