|
|
|
@ -717,10 +717,10 @@ void MainWindow::set_init_data_superuser(std::map<string, string> &map_temp) {
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::set_data_csv_melody() {
|
|
|
|
void MainWindow::set_data_csv_melody() {
|
|
|
|
string path_name = "";
|
|
|
|
string path_name = "";
|
|
|
|
path_name = path_name + path_resources + "/" + "grub-melodylist.csv";
|
|
|
|
path_name = path_name + path_resources + "/" + melody_csv;
|
|
|
|
string line;
|
|
|
|
string line;
|
|
|
|
string all_melody = "";
|
|
|
|
string all_melody = "Option;Tone code\n";
|
|
|
|
string all_melody_old = "";
|
|
|
|
string all_melody_old = "Option;Tone code\n";
|
|
|
|
string code_melodyes = "";
|
|
|
|
string code_melodyes = "";
|
|
|
|
ifstream in(path_name);
|
|
|
|
ifstream in(path_name);
|
|
|
|
if (in.is_open()) {
|
|
|
|
if (in.is_open()) {
|
|
|
|
@ -734,7 +734,7 @@ void MainWindow::set_data_csv_melody() {
|
|
|
|
Gtk::TreeModel::Row row = *iter;
|
|
|
|
Gtk::TreeModel::Row row = *iter;
|
|
|
|
code_melodyes = row[m_columns_melody.melody_code] + "";
|
|
|
|
code_melodyes = row[m_columns_melody.melody_code] + "";
|
|
|
|
if (code_melodyes.length() != 0 && (row[m_columns_melody.title] + "").length() != 0) {
|
|
|
|
if (code_melodyes.length() != 0 && (row[m_columns_melody.title] + "").length() != 0) {
|
|
|
|
all_melody += row[m_columns_melody.title] + "," + code_melodyes + "\n";
|
|
|
|
all_melody += row[m_columns_melody.title] + ";" + code_melodyes + "\n";
|
|
|
|
if (row[m_columns_melody.check_button]) {
|
|
|
|
if (row[m_columns_melody.check_button]) {
|
|
|
|
map_cmd_selection["GRUB_PLAY"] = code_melodyes + "";
|
|
|
|
map_cmd_selection["GRUB_PLAY"] = code_melodyes + "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -749,11 +749,7 @@ void MainWindow::set_data_csv_melody() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (all_melody_old != all_melody) {
|
|
|
|
if (all_melody_old != all_melody) {
|
|
|
|
ofstream fout(path_name, ios_base::out | ios_base::trunc);
|
|
|
|
Utils::write_file(path_name, all_melody);
|
|
|
|
if (fout.is_open()) {
|
|
|
|
|
|
|
|
fout << all_melody;
|
|
|
|
|
|
|
|
fout.close();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -769,7 +765,7 @@ void MainWindow::set_init_data_melody(std::map<string, string> &map_temp) {
|
|
|
|
list_store_melody = Gtk::ListStore::create(m_columns_melody);
|
|
|
|
list_store_melody = Gtk::ListStore::create(m_columns_melody);
|
|
|
|
treeViewMelody->set_model(list_store_melody);
|
|
|
|
treeViewMelody->set_model(list_store_melody);
|
|
|
|
string path_name = "";
|
|
|
|
string path_name = "";
|
|
|
|
path_name = path_name + path_resources + "/" + "grub-melodylist.csv";
|
|
|
|
path_name = path_name + path_resources + "/" + melody_csv;
|
|
|
|
vector<tuple<string, string>> vec_melody = Utils::read_csv_melody(path_name);
|
|
|
|
vector<tuple<string, string>> vec_melody = Utils::read_csv_melody(path_name);
|
|
|
|
bool flag = false;
|
|
|
|
bool flag = false;
|
|
|
|
string cgf_code_melody = map_temp["GRUB_PLAY"];
|
|
|
|
string cgf_code_melody = map_temp["GRUB_PLAY"];
|
|
|
|
@ -955,15 +951,11 @@ void MainWindow::set_active_boot_second() {
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::wrapper_save_all_cfg() {
|
|
|
|
void MainWindow::wrapper_save_all_cfg() {
|
|
|
|
this->set_data_cfg();
|
|
|
|
this->set_data_cfg();
|
|
|
|
bool _flag_save_global1 = true;
|
|
|
|
bool _flag_save_all = true;
|
|
|
|
bool _flag_save_local1 = true;
|
|
|
|
if (flag_save_global == false || flag_save_local == false) {
|
|
|
|
if (flag_save_global == false) {
|
|
|
|
_flag_save_all = this->save_template(all_save, all_remove, "all");
|
|
|
|
_flag_save_global1 = this->save_template(global_save, global_remove , "global");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
this->info_warning_error(5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
|