Сделан первый уровень меню со списком ос

pull/18/head
Igor Belitskiy 3 years ago
parent 6a9b72896c
commit 7b908e0614

@ -28,7 +28,7 @@ configure_file(ubl-settings-bootloader.h.in ubl-settings-bootloader-cm.h)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \
-O2 -pipe -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection")
-fstack-clash-protection -fcf-protection -g")
set(SOURCE_FILES
menu_os.h

@ -9,12 +9,16 @@ Menu_os::~Menu_os()
{
}
void Menu_os::set_builder(Glib::RefPtr<Gtk::Builder> const& builder) {
void Menu_os::set_builder(Glib::RefPtr<Gtk::Builder>& builder, string path_glade) {
this->builder = builder;
this->path_glade = path_glade;
builder->get_widget("popoverMenuOS", popoverMenuOS);
builder->get_widget("revealerL1", revealerL1);
builder->get_widget("revealerL2", revealerL2);
builder->get_widget("boxALLL3", boxALLL3);
builder->get_widget("boxLevel1", boxLevel1);
revealerL1->set_reveal_child(true);
}
void Menu_os::set_map(std::map <string, vector<string>> &map_list_os) {
@ -22,63 +26,72 @@ void Menu_os::set_map(std::map <string, vector<string>> &map_list_os) {
}
void Menu_os::init() {
Gtk::Box *box_L1 = new Gtk::Box();
vector<stuct_all_reviler> vec_stuct_all_reviler;
for (auto& [key, value]: map_list_os) {
size_t len_data = value.size();
struct map_reviler_L1 obj_map_reviler_L1;
struct map_reviler_L3 obj_map_reviler_L3;
vector<Gtk::Button*> vec_buttons;
vector<Gtk::Label*> vec_labels;
vector<string> vec_names;
Gtk::Revealer* revealerL3;
Gtk::Box *box_L3 = new Gtk::Box();
builder->get_widget("boxL1", obj_map_reviler_L1.boxL1);
builder->get_widget("lblRevL1", obj_map_reviler_L1.lblRevL1);
builder->get_widget("btnToL2AndLv3", obj_map_reviler_L1.btnToL2AndLv3);
builder->get_widget("revealerL3", revealerL3);
box_L1->pack_start(*obj_map_reviler_L1.btnToL2AndLv3, Gtk::PACK_SHRINK);
obj_map_reviler_L1.lblRevL1->set_text(key);
this->event_template(obj_map_reviler_L1.btnToL2AndLv3, obj_map_reviler_L1.lblRevL1, name_level_1);
// Todo : open level 3
for (string& str_level_2: value) {
Gtk::Button* btn1;
Gtk::Label* lbl1;
builder->get_widget("btnToL3", btn1);
builder->get_widget("lblToL3", lbl1);
this->event_template(btn1, lbl1, name_level_3);
box_L3->pack_start(*btn1, Gtk::PACK_SHRINK);
lbl1->set_text(str_level_2);
vec_buttons.push_back(btn1);
vec_labels.push_back(lbl1);
vec_names.push_back(str_level_2);
}
boxALLL3->pack_start(*box_L3, Gtk::PACK_SHRINK);
revealerL3->set_reveal_child(true);
obj_map_reviler_L3.revealerL3 = revealerL3;
obj_map_reviler_L3.vec_buttons = vec_buttons;
obj_map_reviler_L3.vec_labels = vec_labels;
obj_map_reviler_L3.len_data = len_data;
obj_map_reviler_L3.box_L3 = box_L3;
obj_stuct_all_reviler.obj_map_reviler_L1 = obj_map_reviler_L1;
obj_stuct_all_reviler.obj_map_reviler_L3 = obj_map_reviler_L3;
vec_stuct_all_reviler.push_back(obj_stuct_all_reviler);
GtkWidget* rev_widget = GTK_WIDGET(revealerL1->gobj());
gtk_container_add(GTK_CONTAINER(rev_widget), GTK_WIDGET(box_L1->gobj()));
revealerL1->set_reveal_child(true);
revealerL2->set_reveal_child(true);
size_t index_l1 = 0;
for (auto& [key, vec_value]: map_list_os) {
map_menu_level_1[key] = new struct_menu_level1;
Glib::RefPtr<Gtk::Builder> builder_level_1 = Gtk::Builder::create_from_file(path_glade);
builder_level_1->get_widget("lblRevL1", map_menu_level_1[key]->lblRevL1);
builder_level_1->get_widget("btnToL2AndLv3", map_menu_level_1[key]->btnToL2AndLv3);
builder_level_1->get_widget("boxMenuLevel1", map_menu_level_1[key]->boxMenuLevel1);
map_menu_level_1[key]->builder = builder_level_1;
map_menu_level_1[key]->lblRevL1->set_text(key);
boxLevel1->pack_end(*(map_menu_level_1[key]->boxMenuLevel1));
map_menu_level_1[key]->btnToL2AndLv3->signal_clicked().connect(
sigc::bind<Gtk::Label*, string&> (sigc::mem_fun( *this,
&Menu_os::event_template), map_menu_level_1[key]->lblRevL1,
name_level_1));
map_menu_level_1[key]->name = key;
}
if (vec_value.size()!= 0) {
builder_level_1->get_widget("revealerL3", map_menu_level_1[key]->revealer);
builder_level_1->get_widget("boxLevel3", map_menu_level_1[key]->boxLevel3);
}
else {
map_menu_level_1[key]->revealer = NULL;
map_menu_level_1[key]->boxLevel3 = NULL;
}
size_t index_l3 = 0;
for (string& str_level_2: vec_value) {
auto builder_level_3 = Gtk::Builder::create_from_file(path_glade);
map_menu_level_1[key]->vec_menu_level_3.push_back(new struct_menu_level_3);
builder_level_3->get_widget("btnToL3",
map_menu_level_1[key]->vec_menu_level_3[index_l3]->btnToL3);
builder_level_3->get_widget("lblToL3",
map_menu_level_1[key]->vec_menu_level_3[index_l3]->lblToL3);
map_menu_level_1[key]->vec_menu_level_3[index_l3]->lblToL3->set_text(str_level_2);
map_menu_level_1[key]->boxLevel3->pack_start(
*(map_menu_level_1[key]->vec_menu_level_3[index_l3]->btnToL3));
map_menu_level_1[key]->vec_menu_level_3[index_l3]->btnToL3->signal_clicked().connect(
sigc::bind<Gtk::Label*, string&> (sigc::mem_fun(*this,
&Menu_os::event_template), map_menu_level_1[key]->vec_menu_level_3[index_l3]->lblToL3,
name_level_3));
map_menu_level_1[key]->vec_menu_level_3[index_l3]->builder = builder_level_3;
boxALLL3->pack_start(
*(map_menu_level_1[key]->revealer));
index_l3 += 1;
}
index_l1 += 1;
}
}
void Menu_os::show() {
revealerL1->set_reveal_child(true);
revealerL2->set_reveal_child(false);
popoverMenuOS->show_all();
}
void Menu_os::event() {
btnToLev1->signal_clicked().connect(sigc::mem_fun(*this, &Menu_os::to_l1));
}
void Menu_os::event_template(Gtk::Button* button, Gtk::Label* label, string& name_level) {
button->signal_clicked().connect([&]() {name_level = label->get_label();});
void Menu_os::set_entry(Gtk::Entry *entry) {
this->entry = entry;
}
void Menu_os::event_template(Gtk::Label* label, string& name_level) {
name_level = label->get_label();
entry->set_text(name_level_1 + name_level_3);
}
void Menu_os::to_l1() {
revealerL1->set_reveal_child(true);

@ -2,47 +2,58 @@
#define Menu_os_H
#include <gtkmm.h>
#include <map>
#include <iostream>
#include <vector>
using namespace std;
class Menu_os
{
private:
struct map_reviler_L1 {
Gtk::Box *boxL1;
Gtk::Label *lblRevL1;
Gtk::Button *btnToL2AndLv3;
};
struct map_reviler_L3 {
Gtk::Revealer *revealerL3;
Gtk::Box *box_L3;
vector<Gtk::Button*> vec_buttons;
vector<Gtk::Label*> vec_labels;
vector<string> vec_names;
size_t len_data;
};
struct stuct_all_reviler {
struct map_reviler_L1 obj_map_reviler_L1;
struct map_reviler_L3 obj_map_reviler_L3;
};
struct stuct_all_reviler obj_stuct_all_reviler;
vector<map_reviler_L1> vec_map_reviler_L1;
Glib::RefPtr<Gtk::Builder> builder;
std::map <string, vector<string>> map_list_os;
Gtk::Box *boxALLL3;
Gtk::Popover *popoverMenuOS;
Gtk::Revealer *revealerL1;
Gtk::Revealer *revealerL2;
Gtk::Button *btnToLev1;
string name_level_1 = "";
string name_level_3 = "";
private:
string name_level_1 = "";
string name_level_3 = "";
Gtk::Entry *entry;
string path_glade = "";
Gtk::Box *boxALLL3;
Gtk::Box *boxLevel1;
struct struct_menu_level_3 {
Gtk::Button *btnToL3;
Gtk::Label *lblToL3;
Glib::RefPtr<Gtk::Builder> builder;
};
struct struct_menu_level1 {
Gtk::Label *lblRevL1;
Gtk::Button *btnToL2AndLv3;
Gtk::Revealer *revealer;
Gtk::Box *boxLevel3;
Gtk::Box *boxMenuLevel1;
string name;
Glib::RefPtr<Gtk::Builder> builder;
vector<struct struct_menu_level_3*> vec_menu_level_3;
};
struct struct_menu_level1 *obj_struct_menu_level1;
std::map<string, struct struct_menu_level1*> map_menu_level_1;
public:
Menu_os(/* args */);
void set_builder(Glib::RefPtr<Gtk::Builder> const& builder);
void set_builder(Glib::RefPtr<Gtk::Builder>& builder, string path_glade);
void set_map(std::map <string, vector<string>> &map_list_os);
void init();
void show();
void event_template(Gtk::Button* button, Gtk::Label* label, string& name_level);
void settings();
void set_entry(Gtk::Entry *entry);
void event_template(Gtk::Label* label, string& name_level);
void event();
void to_l1();
~Menu_os();

@ -100,9 +100,10 @@ void MainWindow::settings(){
vector<string> os_control_list;
this->pars_os(os_control_list);
std::map<string, vector<string>> map_list_os = format_os_list(os_control_list);
obj_menu_os.set_builder(builder);
obj_menu_os.set_builder(builder, path_glade);
obj_menu_os.set_map(map_list_os);
obj_menu_os.show();
obj_menu_os.set_entry(entrListOS);
obj_menu_os.init();
this->write_list_entry_os(os_control_list);
this->download_local_cfg();
this->download_globl_cfg();
@ -124,12 +125,13 @@ map<string, vector<string>> MainWindow::format_os_list(vector<string> &os_contro
std::map<string, vector<string>> map_list_os;
set<string> set_key;
for (string& name_os : os_control_list) {
if (name_os.find(">") != string::npos) {
set_key.insert(name_os.substr(0,name_os.find(">")+1));
}
else {
vector<string> vec_os;
vec_os.push_back(" ");
//vec_os.push_back(" ");
map_list_os[name_os] = vec_os;
}
}
@ -142,7 +144,7 @@ map<string, vector<string>> MainWindow::format_os_list(vector<string> &os_contro
if (name_os.find(*it) != string::npos) {
flag = true;
vec_os_values.push_back(name_os.substr(name_os.find(">")+1, name_os.length() - 1));
name_os_buff = name_os;
name_os_buff = *it;
}
}
if (flag) {
@ -498,7 +500,8 @@ void MainWindow::get_builder() {
builder->get_widget("btnReadHelp", btnReadHelp);
builder->get_widget("btnCancelHelp", btnCancelHelp);
builder->get_widget("wndShowWeb", wndShowWeb);
builder->get_widget("btnOpenMenuOS", btnOpenMenuOS);
builder->get_widget("entrListOS", entrListOS);
}
void MainWindow::localization(){
@ -695,6 +698,7 @@ void MainWindow::cmd_entry_all(Gtk::Entry &entry, string cmd_settings, string cm
}
void MainWindow::event(){
btnOpenMenuOS->signal_clicked().connect([&]() {obj_menu_os.show();});
btnCancelHelp->signal_clicked().connect([&]() {wndShowWeb->hide();});
chkAlwaysOpenHelp->signal_toggled().connect([&]() {flag_open_browser = true;});
btnReadHelp->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::open_browser));

@ -68,7 +68,8 @@ void me_thread(string cmd);
#define boot_menu_user_password _("Boot menu user password:")
#define last_successful_upload _("Last successful upload")
#define read_documentation_web _("Would you like to read documentation in the Web?")
#define redirected_documentation _("You will be redirected to documentation site, where user help pages are ""translated and supported by community.")
#define redirected_documentation _("You will be redirected to documentation site, where user help pages are " \
"translated and supported by community.")
#define user_name_configuration_editing_code _("User name to enter boot configuration editing mode")
#define user_password_configuration_edit_mode _("User password to enter boot configuration edit mode")
#define loading_animation_with _("Loading animation with the magazine")
@ -93,10 +94,19 @@ void me_thread(string cmd);
#define str_active _("Active")
#define str_option _("Option")
#define str_description _("Description")
#define str_help_h _("GTK settings bootloader for UBLinux\n""\n""Usage: ubl-settings-bootloader [OPTIONS...]\n""Options:\n"" -h, --help\t Show this help\n"" -V, --version\t Show package version\n"" --lock-help Lock utility help\n"" --lock-save Lock saving local and global configuration\n"" --lock-save-local Lock save global configuration\n"" --lock-save-global Lock load global configuration\n"" --lock-load-global Lock load global configuration\n")
#define str_help_h _("GTK settings bootloader for UBLinux\n" \
"\n" \
"Usage: ubl-settings-bootloader [OPTIONS...]\n" \
"Options:\n" \
" -h, --help\t Show this help\n" \
" -V, --version\t Show package version\n" \
" --lock-help Lock utility help\n" \
" --lock-save Lock saving local and global configuration\n" \
" --lock-save-local Lock save global configuration\n" \
" --lock-save-global Lock load global configuration\n" \
" --lock-load-global Lock load global configuration\n")
#define no_recognized _("Argument not recognized\n")
#define global_load "ubconfig --default --source global get boot"
#define system_load "ubconfig --default --source system get boot"
#define global_save "ubconfig --target global set boot "
@ -125,201 +135,210 @@ void me_thread(string cmd);
class CmdArgParser : public Glib::OptionGroup
{
public:
CmdArgParser(const std::string& p_name, const std::string& p_description, const std::string& p_help);
CmdArgParser(const std::string &p_name, const std::string &p_description, const std::string &p_help);
::Window GetSocketID() const;
private:
int m_socketID = 0;
};
class MainWindow : public Gtk::ApplicationWindow {
class MainWindow : public Gtk::ApplicationWindow
{
public:
class ModelColumns : public Gtk::TreeModel::ColumnRecord
{
public:
class ModelColumns : public Gtk::TreeModel::ColumnRecord {
public:
ModelColumns() {add(check_button), add(name); add(description); }
//Gtk::TreeModelColumn<Gtk::CheckButton> check_button;
Gtk::TreeModelColumn<bool> check_button;
Gtk::TreeModelColumn<Glib::ustring> name;
Gtk::TreeModelColumn<Glib::ustring> description;
};
ModelColumns m_columns;
Glib::RefPtr<Gtk::Builder> builder;
Gtk::SpinButton *spbSecond;
Gtk::Label *lblInfoSeconds;
Gtk::Label *lblInfoDefaultDonw;
Gtk::Label *lblInfoCommand;
Gtk::Label *lblInfoCommand1;
Gtk::Label *lblHeaderAboutTopic;
Gtk::Label *lblInfoCommand2;
Gtk::Label *lblLoadMenu;
Gtk::Label *lblInfoInputTerminal;
Gtk::Label *lblInfoOutputTerminal;
Gtk::Label *lblHeaderName;
Gtk::Label *lblInfoHead;
Gtk::CheckButton *chbVgaText;
Gtk::CheckButton *chbLoadVariantSelectionTimer;
Gtk::Entry *entryKernel;
Gtk::Entry *entryIPT;
Gtk::Entry *entryOTT;
Gtk::Box *boxColor;
Gtk::AboutDialog *aboutWindows;
Gtk::MenuItem *btnAbout;
Gtk::MenuItem *btnSynopsis;
Gtk::MenuItem *btnSaveLocalGlob;
Gtk::MenuItem *btnSaveLocal;
Gtk::MenuItem *btnSaveGlob;
Gtk::MenuItem *btnLoadGlob;
Gtk::MenuItem *btnLoadLocal;
Gtk::Button *btnLoad;
Gtk::Button *btnSave;
Gtk::Button *btnSettings;
Gtk::Widget *boxButton;
Gtk::Widget *boxSave;
Gtk::Box *boxInfoError;
Gtk::Box *boxWidgetAll;
Gtk::Label *lblWarning;
Gtk::Image *imgInfo;
Gtk::ButtonBox *btnBoxAboutDialog;
Gtk::TreeView *treeViewKernel;
Gtk::TreeView *treeViewIPT;
Gtk::TreeView *treeViewOTT;
Gtk::Image *imgBG;
Gtk::Overlay *overHead;
Gtk::ComboBoxText *cmbDefaultDonw;
Gtk::ComboBoxText *cmbDownloadMode;
Gtk::CheckButton *chbSecurityLogin;
Gtk::CheckButton *chbPasswordProtecc;
Gtk::Entry *entrySecurityLogin;
Gtk::Entry *entryPasswordProtecc;
Gtk::Label *lblHeadeWndWeb;
ModelColumns()
{
add(check_button), add(name);
add(description);
}
// Gtk::TreeModelColumn<Gtk::CheckButton> check_button;
Gtk::TreeModelColumn<bool> check_button;
Gtk::TreeModelColumn<Glib::ustring> name;
Gtk::TreeModelColumn<Glib::ustring> description;
};
ModelColumns m_columns;
Glib::RefPtr<Gtk::Builder> builder;
Gtk::SpinButton *spbSecond;
Gtk::Label *lblInfoSeconds;
Gtk::Label *lblInfoDefaultDonw;
Gtk::Label *lblInfoCommand;
Gtk::Label *lblInfoCommand1;
Gtk::Label *lblHeaderAboutTopic;
Gtk::Label *lblInfoCommand2;
Gtk::Label *lblLoadMenu;
Gtk::Label *lblInfoInputTerminal;
Gtk::Label *lblInfoOutputTerminal;
Gtk::Label *lblHeaderName;
Gtk::Label *lblInfoHead;
Gtk::CheckButton *chbVgaText;
Gtk::CheckButton *chbLoadVariantSelectionTimer;
Gtk::Entry *entryKernel;
Gtk::Entry *entryIPT;
Gtk::Entry *entryOTT;
Gtk::Box *boxColor;
Gtk::AboutDialog *aboutWindows;
Gtk::MenuItem *btnAbout;
Gtk::MenuItem *btnSynopsis;
Gtk::MenuItem *btnSaveLocalGlob;
Gtk::MenuItem *btnSaveLocal;
Gtk::MenuItem *btnSaveGlob;
Gtk::MenuItem *btnLoadGlob;
Gtk::MenuItem *btnLoadLocal;
Gtk::Button *btnLoad;
Gtk::Button *btnSave;
Gtk::Button *btnSettings;
Gtk::Widget *boxButton;
Gtk::Widget *boxSave;
Gtk::Box *boxInfoError;
Gtk::Box *boxWidgetAll;
Gtk::Label *lblWarning;
Gtk::Image *imgInfo;
Gtk::ButtonBox *btnBoxAboutDialog;
Gtk::TreeView *treeViewKernel;
Gtk::TreeView *treeViewIPT;
Gtk::TreeView *treeViewOTT;
Gtk::Image *imgBG;
Gtk::Overlay *overHead;
Gtk::ComboBoxText *cmbDefaultDonw;
Gtk::ComboBoxText *cmbDownloadMode;
Gtk::CheckButton *chbSecurityLogin;
Gtk::CheckButton *chbPasswordProtecc;
Gtk::Entry *entrySecurityLogin;
Gtk::Entry *entryPasswordProtecc;
Gtk::Label *lblHeadeWndWeb;
Gtk::Label *lblwebHeaderName;
Gtk::Label *lblhelpText;
Gtk::Label *lblhelpHeader;
Gtk::CheckButton *chkAlwaysOpenHelp;
Gtk::Button *btnReadHelp;
Gtk::Button *btnCancelHelp;
Gtk::Window *wndShowWeb;
Gtk::Label *lblwebHeaderName;
Gtk::Label *lblhelpText;
Gtk::Label *lblhelpHeader;
Gtk::CheckButton *chkAlwaysOpenHelp;
Gtk::Button *btnReadHelp;
Gtk::Button *btnCancelHelp;
Gtk::Window *wndShowWeb;
Gtk::Button *btnOpenMenuOS;
Gtk::Entry *entrListOS;
std::vector<std::string> vec_Option_kernel;
std::vector<std::string> vec_Option_IPT;
std::vector<std::string> vec_Option_OTT;
std::vector<std::string> vec_Option_kernel;
std::vector<std::string> vec_Option_IPT;
std::vector<std::string> vec_Option_OTT;
Glib::RefPtr<Gtk::ListStore> list_store_kernel;
Glib::RefPtr<Gtk::ListStore> list_store_IPT;
Glib::RefPtr<Gtk::ListStore> list_store_OTT;
#ifdef WEBKIT_FOUND
Gtk::Window *wndWeb;
Gtk::Widget *three;
WebKitWebView *one;
#endif
Glib::RefPtr<Gtk::ListStore> list_store_kernel;
Glib::RefPtr<Gtk::ListStore> list_store_IPT;
Glib::RefPtr<Gtk::ListStore> list_store_OTT;
#ifdef WEBKIT_FOUND
Gtk::Window *wndWeb;
Gtk::Widget *three;
WebKitWebView *one;
#endif
void set_entry_to_tree_view(Glib::RefPtr<Gtk::ListStore> &list_store, Gtk::Entry &entry, std::vector<std::string> &vec_Option, int size, string key);
Gtk::TreeModel::Row row_kernel;
Gtk::TreeModel::Row row_IPT;
Gtk::TreeModel::Row row_OTT;
std::map <string, string> map_cmd_selection;
std::map <string, string> map_global_cmd_selection;
std::map <string, string> map_local_cmd_selection;
void set_entry_to_tree_view(Glib::RefPtr<Gtk::ListStore> &list_store, Gtk::Entry &entry, std::vector<std::string> &vec_Option, int size, string key);
Gtk::TreeModel::Row row_kernel;
Gtk::TreeModel::Row row_IPT;
Gtk::TreeModel::Row row_OTT;
std::map<string, string> map_cmd_selection;
std::map<string, string> map_global_cmd_selection;
std::map<string, string> map_local_cmd_selection;
Gtk::Label *lblDownloadMode;
Lib_save::Save obj_save = Lib_save::Save();
Lib_Load::Load obj_load = Lib_Load::Load();
Menu_os obj_menu_os = Menu_os();
vector<string> vec_param_names;
My_Process::My_Process_system obj_process_system = My_Process::My_Process_system();
My_Process::My_Process_call obj_process_call = My_Process::My_Process_call();
bool flag_load = false;
bool flag_save_all = false;
bool flag_blocked_tree_view = false;
bool flag_save_block = false;
bool flag_open_browser = false;
string str_last_launched_os = "";
int index_error = 0;
string str_flag_load = "";
size_t size_kernel = 0;
size_t size_IPT = 0;
size_t size_OTT = 0;
Glib::RefPtr<Gtk::StyleContext> boxInfo;
string str_cmd_error = "";
template<typename Type>
struct Result{
Type response;
int error;
};
std::map <string, string> map_cmd_error;
Gtk::Label *lblDownloadMode;
Lib_save::Save obj_save = Lib_save::Save();
Lib_Load::Load obj_load = Lib_Load::Load();
Menu_os obj_menu_os = Menu_os();
vector<string> vec_param_names;
My_Process::My_Process_system obj_process_system = My_Process::My_Process_system();
My_Process::My_Process_call obj_process_call = My_Process::My_Process_call();
bool flag_load = false;
bool flag_save_all = false;
bool flag_blocked_tree_view = false;
bool flag_save_block = false;
bool flag_open_browser = false;
string str_last_launched_os = "";
int index_error = 0;
string str_flag_load = "";
size_t size_kernel = 0;
size_t size_IPT = 0;
size_t size_OTT = 0;
Glib::RefPtr<Gtk::StyleContext> boxInfo;
string str_cmd_error = "";
template <typename Type>
struct Result
{
Type response;
int error;
};
std::map<string, string> map_cmd_error;
MainWindow(BaseObjectType* obj, Glib::RefPtr<Gtk::Builder> const& builder);
MainWindow(Glib::RefPtr<Gtk::Builder> const& builder);
~MainWindow();
void open_browser();
void get_menu_boot(std::map <string, string> &map_temp);
void 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 set_row(Glib::RefPtr<Gtk::ListStore> &list_store, int size, std::string name, bool flag_chbox);
void get_builder();
bool gui_exit(GdkEventAny*);
void init_dict(string flag_load);
void add_CSS();
void show_pass();
void localization();
void event();
void settings();
string pars_last_launched_os();
vector<string> pars_os(vector<string> &os_control_list);
void fn_event_intelMax1();
void write_list_entry_os(vector<string> &os_control_list);
void fn_event_intelMax4();
void synopsis_show();
void set_data_cfg();
std::map<string, vector<string>> format_os_list(vector<string> &os_control_list);
void set_active_boot_second();
void get_download_mode(std::map <string, string> &map_temp);
void view_add_cell(Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListStore> list_store_m , std::array<std::vector<std::string>, 5> &arr_view, size_t index);
void wrapper_system(string cmd, string thread_str);
struct Result<string> wrapper_call(string cmd);
void log_mess_error(string &cmd);
void wrapper_save_all_cfg();
void wrapper_save_local_cfg();
void wrapper_save_global_cfg();
bool save_template(string cmd, string cmd_remove, string flag_save);
void view_add_colums(Gtk::TreeView &treeView);
vector<string> read_file_and_view(string file_name ,Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListStore> list_store_m);
void download_local_cfg();
void template_open_browser();
void download_globl_cfg();
void flag_block_gui();
void info_status_app(string stule);
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*);
void fill_in_view();
bool focus_tree_view(GdkEventFocus*);
void set_security_login();
void get_security_login(std::map <string, string> &map_temp);
bool check_flag_save(string flag_save);
void set_download_mode();
void change_password_protecc();
bool focus_out_txt_login(GdkEventFocus*);
void change_security_login();
void get_default_load(std::map <string, string> &map_temp);
bool focus_out_txt_password(GdkEventFocus*);
void get_password_protec(std::map <string, string> &map_temp);
void set_password_protec();
void set_entry(Gtk::Entry* entry , std::map<string, string> &map_temp, string key);
void load_template(std::map<string, string>* map_temp, string cmd);
vector<string> get_setting_entry_all(string key, std::map <string, string>* map_temp);
void cmd_entry_all(Gtk::Entry &entry, string cmd_settings, string cmd_remove);
void item_selected_kernel(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&);
void item_selected_OTT(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&);
void item_selected_IPT(const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&);
string template_item_selected(int size, Glib::RefPtr<Gtk::ListStore> &list_store, string key);
MainWindow(BaseObjectType *obj, Glib::RefPtr<Gtk::Builder> const &builder);
MainWindow(Glib::RefPtr<Gtk::Builder> const &builder);
~MainWindow();
void open_browser();
void get_menu_boot(std::map<string, string> &map_temp);
void 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 set_row(Glib::RefPtr<Gtk::ListStore> &list_store, int size, std::string name, bool flag_chbox);
void get_builder();
bool gui_exit(GdkEventAny *);
void init_dict(string flag_load);
void add_CSS();
void show_pass();
void localization();
void event();
void settings();
string pars_last_launched_os();
vector<string> pars_os(vector<string> &os_control_list);
void fn_event_intelMax1();
void write_list_entry_os(vector<string> &os_control_list);
void fn_event_intelMax4();
void synopsis_show();
void set_data_cfg();
std::map<string, vector<string>> format_os_list(vector<string> &os_control_list);
void set_active_boot_second();
void get_download_mode(std::map<string, string> &map_temp);
void view_add_cell(Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListStore> list_store_m, std::array<std::vector<std::string>, 5> &arr_view, size_t index);
void wrapper_system(string cmd, string thread_str);
struct Result<string> wrapper_call(string cmd);
void log_mess_error(string &cmd);
void wrapper_save_all_cfg();
void wrapper_save_local_cfg();
void wrapper_save_global_cfg();
bool save_template(string cmd, string cmd_remove, string flag_save);
void view_add_colums(Gtk::TreeView &treeView);
vector<string> read_file_and_view(string file_name, Gtk::TreeModel::Row &row, Glib::RefPtr<Gtk::ListStore> list_store_m);
void download_local_cfg();
void template_open_browser();
void download_globl_cfg();
void flag_block_gui();
void info_status_app(string stule);
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 *);
void fill_in_view();
bool focus_tree_view(GdkEventFocus *);
void set_security_login();
void get_security_login(std::map<string, string> &map_temp);
bool check_flag_save(string flag_save);
void set_download_mode();
void change_password_protecc();
bool focus_out_txt_login(GdkEventFocus *);
void change_security_login();
void get_default_load(std::map<string, string> &map_temp);
bool focus_out_txt_password(GdkEventFocus *);
void get_password_protec(std::map<string, string> &map_temp);
void set_password_protec();
void set_entry(Gtk::Entry *entry, std::map<string, string> &map_temp, string key);
void load_template(std::map<string, string> *map_temp, string cmd);
vector<string> get_setting_entry_all(string key, std::map<string, string> *map_temp);
void cmd_entry_all(Gtk::Entry &entry, string cmd_settings, string cmd_remove);
void item_selected_kernel(const Gtk::TreeModel::Path &, const Gtk::TreeModel::iterator &);
void item_selected_OTT(const Gtk::TreeModel::Path &, const Gtk::TreeModel::iterator &);
void item_selected_IPT(const Gtk::TreeModel::Path &, const Gtk::TreeModel::iterator &);
string template_item_selected(int size, Glib::RefPtr<Gtk::ListStore> &list_store, string key);
};
class SettingsPlug : public Gtk::Plug{
class SettingsPlug : public Gtk::Plug
{
public:
Gtk::Window *window;
SettingsPlug(::Window p_socketID, Glib::RefPtr<Gtk::Builder> builder);
@ -330,5 +349,3 @@ private:
};
void help();

@ -125,7 +125,7 @@ specified priority</property>
</packing>
</child>
</object>
<object class="GtkBox" id="boxL1">
<object class="GtkBox" id="boxMenuLevel1">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
@ -133,6 +133,7 @@ specified priority</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">****</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">True</property>
@ -164,6 +165,12 @@ specified priority</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="margin-left">4</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>
<child>
<object class="GtkLabel" id="lblToL3">
<property name="visible">True</property>
@ -266,159 +273,6 @@ specified priority</property>
</object>
</child>
</object>
<object class="GtkWindow" id="mess_sudo">
<property name="can-focus">False</property>
<property name="title" translatable="yes">Внимание!</property>
<property name="window-position">center</property>
<property name="type-hint">dialog</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</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>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</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="pixel-size">50</property>
<property name="icon-name">gtk-dialog-warning</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lblMessageSudo">
<property name="width-request">160</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="valign">center</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="label" translatable="yes">Warning!</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btnMessCloseSudo">
<property name="label" translatable="yes">OK</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">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">3</property>
<property name="margin-bottom">3</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkPopover" id="popoverMenuOS">
<property name="can-focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkRevealer" id="revealerL1">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="transition-type">none</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkRevealer" id="revealerL2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="transition-type">none</property>
<property name="reveal-child">True</property>
<child>
<object class="GtkBox" id="boxALLL3">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkButton" id="btnToLev1">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="stock">gtk-missing-image</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkWindow" id="window">
<property name="width-request">750</property>
<property name="height-request">550</property>
@ -647,10 +501,26 @@ specified priority</property>
</packing>
</child>
<child>
<object class="GtkMenuButton">
<object class="GtkEntry" id="entrListOS">
<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>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btnOpenMenuOS">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property>
@ -658,7 +528,6 @@ specified priority</property>
<property name="margin-end">5</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="align-widget">popoverMenuOS</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
@ -670,7 +539,7 @@ specified priority</property>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
</object>
@ -1432,12 +1301,193 @@ specified priority</property>
<widget name="chbPasswordProtecc"/>
</widgets>
</object>
<object class="GtkPopover" id="popoverMenuOS">
<property name="can-focus">False</property>
<property name="relative-to">btnOpenMenuOS</property>
<property name="position">bottom</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkRevealer" id="revealerL1">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="transition-type">none</property>
<child>
<object class="GtkBox" id="boxLevel1">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkRevealer" id="revealerL2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="transition-type">none</property>
<property name="reveal-child">True</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkButton" id="btnToLev1">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="stock">gtk-missing-image</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="boxALLL3">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkWindow" id="mess_sudo">
<property name="can-focus">False</property>
<property name="title" translatable="yes">Внимание!</property>
<property name="window-position">center</property>
<property name="type-hint">dialog</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</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>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</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="pixel-size">50</property>
<property name="icon-name">gtk-dialog-warning</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lblMessageSudo">
<property name="width-request">160</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="valign">center</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="label" translatable="yes">Warning!</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btnMessCloseSudo">
<property name="label" translatable="yes">OK</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">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">3</property>
<property name="margin-bottom">3</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkRevealer" id="revealerL3">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="transition-type">none</property>
<child>
<placeholder/>
<object class="GtkBox" id="boxLevel3">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
<object class="GtkApplicationWindow" id="wndShowWeb">

Loading…
Cancel
Save