Исправлен баг с загрузкой TreeView

pull/11/head
Igor Belitskiy 3 years ago
parent fbac0ac4d3
commit bec1f559e7

@ -154,7 +154,7 @@ void MainWindow::item_selected_OTT(const Gtk::TreeModel::Path&, const Gtk::TreeM
Utils::str_replace_all(str_flags, " \"", "\""); Utils::str_replace_all(str_flags, " \"", "\"");
Utils::str_replace_all(str_flags, "\"", ""); Utils::str_replace_all(str_flags, "\"", "");
map_cmd_selection["GRUB_TERMINAL_OUTPUT"] = str_flags; map_cmd_selection["GRUB_TERMINAL_OUTPUT"] = str_flags;
Utils::str_replace_all(str_flags, " ", ","); Utils::str_replace_all(str_flags, " ", ", ");
entryOTT->set_text(str_flags); entryOTT->set_text(str_flags);
} }
} }
@ -170,7 +170,7 @@ void MainWindow::item_selected_IPT(const Gtk::TreeModel::Path&, const Gtk::TreeM
Utils::str_replace_all(str_flags, " \"", "\""); Utils::str_replace_all(str_flags, " \"", "\"");
Utils::str_replace_all(str_flags, "\"", ""); Utils::str_replace_all(str_flags, "\"", "");
map_cmd_selection["GRUB_TERMINAL_INPUT"] = str_flags; map_cmd_selection["GRUB_TERMINAL_INPUT"] = str_flags;
Utils::str_replace_all(str_flags, " ", ","); Utils::str_replace_all(str_flags, " ", ", ");
entryIPT->set_text(str_flags); entryIPT->set_text(str_flags);
} }
} }
@ -793,7 +793,6 @@ void MainWindow::set_entry(Gtk::Entry* entry , std::map<string, string> &map_tem
string value = map_temp[key]; string value = map_temp[key];
Utils::str_replace_all(value, "\"", ""); Utils::str_replace_all(value, "\"", "");
Utils::str_replace_all(value, " ", ", "); Utils::str_replace_all(value, " ", ", ");
cout << value << endl;
entry->set_text(value); entry->set_text(value);
} }
else { else {
@ -817,26 +816,18 @@ void MainWindow::init_dict() {
map_local_cmd_selection = map_cmd_selection_n; map_local_cmd_selection = map_cmd_selection_n;
} }
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="") { 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) { for (auto &name: list_params) {
this->set_row(list_store, size, name, false); this->set_row(list_store, size, name, false);
} }
cout << key << endl; // TODO:
for (auto &name: list_params) { // Баг
if (map_cmd.find(name) != map_cmd.end()) { string value = map_cmd[key];
if (map_cmd[name] == "1") { Utils::str_replace_all(value, "\"", "");
cout << name << "|||" << endl; vector<string> vec_params = Utils::split(value, ' ');
for (auto &name: vec_params) {
this->set_row(list_store, size, name, true); this->set_row(list_store, size, name, true);
} }
else {
this->set_row(list_store, size, name, false);
}
}
else {
this->set_row(list_store, size, name, false);
}
}
} }
void MainWindow::set_row(Glib::RefPtr<Gtk::ListStore> &list_store, int size, std::string name, bool flag_chbox) { void MainWindow::set_row(Glib::RefPtr<Gtk::ListStore> &list_store, int size, std::string name, bool flag_chbox) {

Loading…
Cancel
Save