Исправлены баги с entry и treeView для "kernel, IPT, OTT"

pull/18/head
Igor Belitskiy 3 years ago
parent 48c6283efa
commit cb9aad7acf

@ -97,7 +97,6 @@ void MainWindow::settings() {
this->pars_os(os_control_list);
this->download_local_cfg();
this->download_globl_cfg();
//this->view_add_colums_melody(*treeViewMelody);
vector<tuple<string, vector<string>>> vec_list_os = format_os_list(os_control_list);
obj_menu_os.set_builder(builder, path_glade);
obj_menu_os.set_map(vec_list_os);
@ -129,7 +128,6 @@ vector<tuple<string, vector<string>>> MainWindow::format_os_list(vector<string>
}
else {
vector<string> vec_os;
//vec_os.push_back(" ");
tuple<string, vector<string>> t1(name_os, vec_os);
vec_list_os.push_back(t1);
}
@ -249,7 +247,6 @@ void MainWindow::item_selected_OTT(const Gtk::TreeModel::Path&, const Gtk::TreeM
}
void MainWindow::item_selected_IPT(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&) {
auto selection_kernel = treeViewKernel->get_selection();
treeViewKernel->get_selection()->unselect_all();
treeViewOTT->get_selection()->unselect_all();
treeViewUser->get_selection()->unselect_all();
@ -505,47 +502,30 @@ vector<string> MainWindow::get_setting_entry_all(string key, std::map <string, s
return vec_params;
}
bool MainWindow::focus_out_txt_kernel(GdkEventFocus*) {
treeViewKernel->get_selection()->unselect_all();
treeViewUser->get_selection()->unselect_all();
void MainWindow::focus_out_txt_kernel() {
this->set_entry_to_tree_view(list_store_kernel, *entryKernel, vec_Option_kernel, size_kernel, "GRUB_CMDLINE_LINUX");
this->set_row_all(map_cmd_selection, list_store_kernel, vec_Option_kernel, size_kernel, "GRUB_CMDLINE_LINUX");
flag_blocked_tree_view = false;
return true;
}
bool MainWindow::focus_out_txt_IPT(GdkEventFocus*) {
treeViewIPT->get_selection()->unselect_all();
treeViewUser->get_selection()->unselect_all();
void MainWindow::focus_out_txt_IPT() {
this->set_entry_to_tree_view(list_store_IPT, *entryIPT, vec_Option_IPT, size_IPT, "GRUB_TERMINAL_INPUT");
this->set_row_all(map_cmd_selection, list_store_IPT, vec_Option_IPT, size_IPT, "GRUB_TERMINAL_INPUT");
flag_blocked_tree_view = false;
return true;
}
bool MainWindow::focus_out_txt_OTT(GdkEventFocus*) {
treeViewIPT->get_selection()->unselect_all();
treeViewUser->get_selection()->unselect_all();
void MainWindow::focus_out_txt_OTT() {
this->set_entry_to_tree_view(list_store_OTT, *entryOTT, vec_Option_OTT, size_OTT, "GRUB_TERMINAL_OUTPUT");
this->set_row_all(map_cmd_selection, list_store_OTT, vec_Option_OTT, size_OTT, "GRUB_TERMINAL_OUTPUT");
flag_blocked_tree_view = false;
return true;
}
bool MainWindow::focus_in_txt_kernel(GdkEventFocus*) {
auto selection_kernel = treeViewKernel->get_selection();
selection_kernel->unselect_all();
return true;
}
bool MainWindow::focus_in_txt_IPT(GdkEventFocus*) {
auto selection_IPT = treeViewIPT->get_selection();
selection_IPT->unselect_all();
return true;
}
bool MainWindow::focus_in_txt_OTT(GdkEventFocus*) {
auto selection_OTT = treeViewIPT->get_selection();
selection_OTT->unselect_all();
bool MainWindow::focus_in_txt_entry(GdkEventFocus*) {
treeViewKernel->get_selection()->unselect_all();
treeViewIPT->get_selection()->unselect_all();
treeViewOTT->get_selection()->unselect_all();
treeViewUser->get_selection()->unselect_all();
treeViewMelody->get_selection()->unselect_all();
return true;
}
@ -629,9 +609,9 @@ void MainWindow::event() {
btnSaveLocalGlob->signal_activate().connect([&]() {wrapper_save_all_cfg();});
btnSaveLocal->signal_activate().connect([&]() {wrapper_save_local_cfg();});
btnSaveGlob->signal_activate().connect([&]() {wrapper_save_global_cfg();});
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));
entryKernel->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_kernel));
entryIPT->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_IPT));
entryOTT->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::focus_out_txt_OTT));
if (this->check_root() == 0) {
Glib::RefPtr<Gtk::TreeModel> treeViewKernelModel = treeViewKernel->get_model();
treeViewKernelModel->signal_row_changed().connect(sigc::mem_fun(*this, &MainWindow::item_selected_kernel));
@ -639,12 +619,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));
entryKernel->signal_focus_in_event().connect(sigc::mem_fun(*this, &MainWindow::focus_in_txt_kernel));
entryIPT->signal_focus_in_event().connect(sigc::mem_fun(*this, &MainWindow::focus_in_txt_IPT));
entryOTT->signal_focus_in_event().connect(sigc::mem_fun(*this, &MainWindow::focus_in_txt_OTT));
entryKernel->signal_focus_in_event().connect(sigc::mem_fun(*this, &MainWindow::focus_in_txt_entry));
entryIPT->signal_focus_in_event().connect(sigc::mem_fun(*this, &MainWindow::focus_in_txt_entry));
entryOTT->signal_focus_in_event().connect(sigc::mem_fun(*this, &MainWindow::focus_in_txt_entry));
}
this->signal_delete_event().connect(sigc::mem_fun(*this, &MainWindow::gui_exit));
chbLoadVariantSelectionTimer->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::set_active_boot_second));

@ -369,12 +369,10 @@ public:
bool check_save(string flag_save, string key_name);
void info_warning_error(int mess);
int check_root();
bool focus_out_txt_kernel(GdkEventFocus *);
bool focus_out_txt_IPT(GdkEventFocus *);
bool focus_out_txt_OTT(GdkEventFocus *);
bool focus_in_txt_kernel(GdkEventFocus *);
bool focus_in_txt_IPT(GdkEventFocus *);
bool focus_in_txt_OTT(GdkEventFocus *);
void focus_out_txt_kernel();
void focus_out_txt_IPT();
void focus_out_txt_OTT();
bool focus_in_txt_entry(GdkEventFocus*);
void fill_in_view();
bool focus_tree_view(GdkEventFocus *);
bool check_flag_save(string flag_save);

@ -950,7 +950,7 @@ specified priority</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-top">1</property>
<property name="margin-bottom">6</property>
<property name="label" translatable="yes">Command line parameters:</property>
</object>
@ -1031,8 +1031,12 @@ specified priority</property>
<property name="height-request">140</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkViewport">
@ -1068,7 +1072,7 @@ specified priority</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-top">1</property>
<property name="margin-bottom">6</property>
<property name="label" translatable="yes">Command line parameters:</property>
</object>
@ -1149,8 +1153,12 @@ specified priority</property>
<property name="height-request">140</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkViewport">
@ -1186,7 +1194,7 @@ specified priority</property>
<property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-top">1</property>
<property name="margin-bottom">6</property>
<property name="label" translatable="yes">Command line parameters:</property>
</object>

Loading…
Cancel
Save