Сделал редактирование "Параметры командной строки:"

pull/11/head
Igor Belitskiy 3 years ago
parent 80956fb202
commit 633dead36d

@ -125,9 +125,11 @@ void MainWindow::item_selected_kernel(const Gtk::TreeModel::Path& path, const Gt
auto selection_OTT = treeViewOTT->get_selection();
selection_IPT->unselect_all();
selection_OTT->unselect_all();
template_item_selected(map_cmd_selection, path, list_store_kernel);
string str_flags = this->dynamic_update_entry(map_cmd_selection, vec_Option_kernel);
entryKernel->set_text(str_flags);
if (flag_blocked_tree_view == false) {
template_item_selected(map_cmd_selection, path, list_store_kernel);
string str_flags = this->dynamic_update_entry(map_cmd_selection, vec_Option_kernel);
entryKernel->set_text(str_flags);
}
}
void MainWindow::item_selected_OTT(const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator&) {
@ -135,9 +137,11 @@ void MainWindow::item_selected_OTT(const Gtk::TreeModel::Path& path, const Gtk::
auto selection_IPT = treeViewIPT->get_selection();
selection_kernel->unselect_all();
selection_IPT->unselect_all();
template_item_selected(map_cmd_selection , path, list_store_OTT);
string str_flags = this->dynamic_update_entry(map_cmd_selection, vec_Option_OTT);
entryOTT->set_text(str_flags);
if (flag_blocked_tree_view == false) {
template_item_selected(map_cmd_selection , path, list_store_OTT);
string str_flags = this->dynamic_update_entry(map_cmd_selection, vec_Option_OTT);
entryOTT->set_text(str_flags);
}
}
@ -146,9 +150,11 @@ void MainWindow::item_selected_IPT(const Gtk::TreeModel::Path& path, const Gtk::
auto selection_OTT = treeViewOTT->get_selection();
selection_kernel->unselect_all();
selection_OTT->unselect_all();
template_item_selected(map_cmd_selection , path, list_store_IPT);
string str_flags = this->dynamic_update_entry(map_cmd_selection, vec_Option_IPT);
entryIPT->set_text(str_flags);
if (flag_blocked_tree_view == false) {
template_item_selected(map_cmd_selection , path, list_store_IPT);
string str_flags = this->dynamic_update_entry(map_cmd_selection, vec_Option_IPT);
entryIPT->set_text(str_flags);
}
}
@ -204,13 +210,6 @@ void MainWindow::view_add_cell(Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListS
row = *(list_store_m->append());
bool flag_chb = false;
string name = arr_view[0][index];
/*
if (map_cmd_selection.find(name) != map_cmd_selection.end()) {
if (map_cmd_selection[name] == "1") {
flag_chb = true;
}
}
*/
row[m_columns.check_button] = flag_chb;
row[m_columns.name] = gettext(name.c_str());
row[m_columns.description] = gettext(arr_view[1][index].c_str());
@ -330,15 +329,33 @@ vector<string> MainWindow::get_setting_entry_all(string cmd, Gtk::Entry &entry_t
}
bool MainWindow::focus_out_txt_kernel(GdkEventFocus*) {
this->set_entry_to_tree_view(list_store_kernel, *entryKernel, vec_Option_kernel, size_kernel);
return true;
}
bool MainWindow::focus_out_txt_IPT(GdkEventFocus*) {
this->set_entry_to_tree_view(list_store_IPT, *entryIPT, vec_Option_IPT, size_IPT);
return true;
}
bool MainWindow::focus_out_txt_OTT(GdkEventFocus*) {
this->set_entry_to_tree_view(list_store_OTT, *entryOTT, vec_Option_OTT, size_OTT);
return true;
}
void MainWindow::set_entry_to_tree_view(Glib::RefPtr<Gtk::ListStore> &list_store, Gtk::Entry &entry, std::vector<std::string> &vec_Option, int size) {
flag_blocked_tree_view = true;
vector<string> vec_params;
std::string text = entry.get_text();
str_replace_all(text, " ", "");
vec_params = split(text, ',');
for (auto &name: vec_Option) {
this->set_row(list_store, size, name, false);
}
for (auto &name: vec_params) {
this->set_row(list_store, size, name, true);
}
flag_blocked_tree_view = false;
}
void MainWindow::get_menu_boot(string cmd) {
struct Result<string> res_response = this->wrapper_call(cmd);
@ -401,6 +418,9 @@ void MainWindow::event(){
treeViewIPTModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::item_selected_IPT));
Glib::RefPtr<Gtk::TreeModel> treeViewOTTModel = treeViewOTT->get_model();
treeViewOTTModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::item_selected_OTT));
entryKernel->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_kernel));
entryIPT->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_IPT));
entryOTT->signal_focus_out_event().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_OTT));
}
}
@ -514,7 +534,6 @@ void MainWindow::download_local_cfg() {
this->set_row_all(map_local_cmd_selection,list_store_kernel , vec_Option_kernel, size_kernel);
this->set_row_all(map_local_cmd_selection,list_store_IPT , vec_Option_IPT, size_IPT);
this->set_row_all(map_local_cmd_selection,list_store_OTT , vec_Option_OTT, size_OTT);
info_warning_error(0);
}

@ -99,6 +99,7 @@ class MainWindow : public Gtk::ApplicationWindow {
Glib::RefPtr<Gtk::ListStore> list_store_kernel;
Glib::RefPtr<Gtk::ListStore> list_store_IPT;
Glib::RefPtr<Gtk::ListStore> list_store_OTT;
void set_entry_to_tree_view(Glib::RefPtr<Gtk::ListStore> &list_store, Gtk::Entry &entry, std::vector<std::string> &vec_Option, int size);
Gtk::TreeModel::Row row_kernel;
Gtk::TreeModel::Row row_IPT;
Gtk::TreeModel::Row row_OTT;
@ -114,6 +115,7 @@ class MainWindow : public Gtk::ApplicationWindow {
bool flag_save_all = false;
bool flag_save_global = false;
bool flag_save_local = false;
bool flag_blocked_tree_view = false;
size_t size_kernel = 0;
size_t size_IPT = 0;
size_t size_OTT = 0;

Loading…
Cancel
Save