#include #include #include #include #include #include #include #include #include #include #include #include #include "ubl-util-standard.c" #include "util.h" using namespace std; extern string path_app; extern string app_name; extern string path_glade; extern string path_css; extern int socket_ext_id_I; extern int socket_trd_id_I; extern const string path_img_head_background; 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); ::Window GetSocketID() const; private: int m_socketID = 0; }; class MainWindow : public Gtk::ApplicationWindow { public: class ModelColumns : public Gtk::TreeModel::ColumnRecord { public: ModelColumns() {add(cmd_get),add(cmd_set_true),add(cmd_set_false),add(check_button), add(name); add(description); } //Gtk::TreeModelColumn check_button; Gtk::TreeModelColumn cmd_get; Gtk::TreeModelColumn cmd_set_true; Gtk::TreeModelColumn cmd_set_false; Gtk::TreeModelColumn check_button; Gtk::TreeModelColumn name; Gtk::TreeModelColumn description; }; ModelColumns m_columns; Glib::RefPtr builder; Gtk::SpinButton *spbSecond; Gtk::Label *lblInfoSeconds; Gtk::Label *lblInfoDefaultDonw; Gtk::Label *lblInfoCommand; Gtk::Label *lblInfoCommand1; Gtk::Label *lblInfoCommand2; Gtk::Label *lblLoadMenu; Gtk::Label *lblInfoInputTerminal; Gtk::Label *lblInfoOutputTerminal; Gtk::Label *lblHeaderName; Gtk::Label *lblInfoHead; Gtk::CheckButton *chbVgaText; Gtk::CheckButton *chbintelMax4; Gtk::CheckButton *chbintelMax1; Gtk::CheckButton *chbLoadVariantSelectionTimer; Gtk::CheckButton *chbLastSelectionWillBecome; Gtk::Entry *entryKernel; Gtk::Entry *entryIT; Gtk::Entry *entryOT; 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; Glib::RefPtr list_store_kernel; Glib::RefPtr list_store_IPT; Glib::RefPtr list_store_OTT; Gtk::TreeModel::Row row_kernel; Gtk::TreeModel::Row row_IPT; Gtk::TreeModel::Row row_OTT; std::map cmd_selection_global; int width; int heigh; int screen_width; int screen_hight; string version_application = "1.0"; int index_error = 0; string str_cmd_error = ""; template struct Result{ Type response; int error; }; std::map map_cmd_error; MainWindow(BaseObjectType* obj, Glib::RefPtr const& builder); MainWindow(Glib::RefPtr const& builder); void get_builder(); void add_CSS(); void localization(); void event(); void settings(); void fn_event_intelMax1(); void fn_event_intelMax4(); void get_monitor_size(); void synopsis_show(); void view_add_cell(Gtk::TreeModel::Row &row, Glib::RefPtr list_store_m , std::array, 5> &arr_view, size_t index); void wrapper_system(string cmd, string thread_str); struct Result wrapper_call(string cmd); void log_mess_error(string &cmd); void save_global_local_cfg(); void save_local_cfg(); void view_add_colums(Gtk::TreeView &treeView); void save_global_cfg(); void read_file_and_view(string file_name ,Gtk::TreeModel::Row &row, Glib::RefPtr list_store_m); void download_local_cfg(); void download_globl_cfg(); void info_status_app(string stule); void info_warning_error(int mess); int check_root(); void fill_in_view(); void item_selected(const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator&); void item_selected_row_changed(const Gtk::TreeModel::Path &, const Gtk::TreeModel::iterator &); }; class SettingsPlug : public Gtk::Plug{ public: Gtk::Window *window; SettingsPlug(::Window p_socketID, Glib::RefPtr builder); private: Gtk::Widget *plugBox; Gtk::Widget *parent; };