Исправлен баг с загрузкой 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, "\"", "");
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);
}
}
@ -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, "\"", "");
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);
}
}
@ -793,7 +793,6 @@ void MainWindow::set_entry(Gtk::Entry* entry , std::map<string, string> &map_tem
string value = map_temp[key];
Utils::str_replace_all(value, "\"", "");
Utils::str_replace_all(value, " ", ", ");
cout << value << endl;
entry->set_text(value);
}
else {
@ -817,25 +816,17 @@ void MainWindow::init_dict() {
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) {
this->set_row(list_store, size, name, false);
}
cout << key << endl;
for (auto &name: list_params) {
if (map_cmd.find(name) != map_cmd.end()) {
if (map_cmd[name] == "1") {
cout << name << "|||" << endl;
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);
}
// TODO:
// Баг
string value = map_cmd[key];
Utils::str_replace_all(value, "\"", "");
vector<string> vec_params = Utils::split(value, ' ');
for (auto &name: vec_params) {
this->set_row(list_store, size, name, true);
}
}

Loading…
Cancel
Save