|
|
|
|
|
#include <iostream>
|
|
|
#include <gtkmm.h>
|
|
|
#include <string>
|
|
|
#include <vector>
|
|
|
#include <stdio.h>
|
|
|
#include <gtkmm/stock.h>
|
|
|
#include <gtkmm/window.h>
|
|
|
#include <gtkmm/plug.h>
|
|
|
#include <locale.h>
|
|
|
#include <libintl.h>
|
|
|
#include <glibmm/i18n.h>
|
|
|
#include "ubl-util-standard.c"
|
|
|
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;
|
|
|
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:
|
|
|
Glib::RefPtr<Gtk::Builder> builder;
|
|
|
Gtk::SpinButton *spbSecond;
|
|
|
Gtk::Label *lblInfoSeconds;
|
|
|
Gtk::Label *lblInfoDefaultDonw;
|
|
|
Gtk::Label *lblInfoCommand;
|
|
|
Gtk::Label *lblInfoCommand1;
|
|
|
Gtk::Label *lblInfoCommand2;
|
|
|
Gtk::Label *lblDownloadMenu;
|
|
|
Gtk::Label *lblInfoInputTerminal;
|
|
|
Gtk::Label *lblInfoOutputTerminal;
|
|
|
Gtk::Label *lblHeaderName;
|
|
|
Gtk::Label *lblInfoHead;
|
|
|
Gtk::CheckButton *chbLoadVariantSelectionTimer;
|
|
|
Gtk::CheckButton *chbofConsoleOT;
|
|
|
Gtk::CheckButton *chbSerialOT;
|
|
|
Gtk::CheckButton *chbconsoleOT;
|
|
|
Gtk::CheckButton *chbGfxterm;
|
|
|
Gtk::CheckButton *chbVgaText;
|
|
|
Gtk::CheckButton *chbconsoleIT;
|
|
|
Gtk::CheckButton *chbSerialIT;
|
|
|
Gtk::CheckButton *chbofConsoleIT;
|
|
|
Gtk::CheckButton *chbAtKeyboard;
|
|
|
Gtk::CheckButton *chbUsbKeyboard;
|
|
|
Gtk::CheckButton *chbintelMax4;
|
|
|
Gtk::CheckButton *chbintelMax1;
|
|
|
Gtk::CheckButton *chbSndIntel;
|
|
|
Gtk::CheckButton *chbAhci;
|
|
|
Gtk::CheckButton *chbI915Enable;
|
|
|
Gtk::CheckButton *chbAcpi;
|
|
|
Gtk::CheckButton *chbPlymouth;
|
|
|
Gtk::CheckButton *chbSplash;
|
|
|
Gtk::CheckButton *chbQuiet;
|
|
|
Gtk::CheckButton *chbNоapic;
|
|
|
Gtk::CheckButton *chbNolapic;
|
|
|
Gtk::CheckButton *chbSingle;
|
|
|
Gtk::CheckButton *chbHomodeset;
|
|
|
Gtk::CheckButton *chbLastSelectionWillBecome;
|
|
|
Gtk::Entry *entryKernel;
|
|
|
Gtk::Entry *entryIT;
|
|
|
Gtk::Entry *entryOT;
|
|
|
Gtk::Box *boxOtput1;
|
|
|
Gtk::Box *boxOtput2;
|
|
|
Gtk::Box *boxInput1;
|
|
|
Gtk::Box *boxInput2;
|
|
|
Gtk::Box *boxKernel;
|
|
|
Gtk::Box *boxKernel1;
|
|
|
Gtk::Box *boxKernel2;
|
|
|
Gtk::Box *boxColor;
|
|
|
Gtk::AboutDialog *aboutWindows;
|
|
|
Gtk::MenuItem *btnAbout;
|
|
|
Gtk::MenuItem *btnSynopsis;
|
|
|
Gtk::MenuItem *btnSaveLocalGlob;
|
|
|
Gtk::MenuItem *btnSaveLocal;
|
|
|
Gtk::MenuItem *btnSaveGlob;
|
|
|
Gtk::MenuItem *btnDonwlolGlob;
|
|
|
Gtk::MenuItem *btnDonwlodLocal;
|
|
|
Gtk::Button *btnDownload;
|
|
|
Gtk::Button *btnSave;
|
|
|
Gtk::Button *btnSettings;
|
|
|
Gtk::Widget *boxButton;
|
|
|
Gtk::Widget *boxSave;
|
|
|
Gtk::Box *boxInfoError;
|
|
|
Gtk::Label *lblWarning;
|
|
|
Gtk::Image *imgInfo;
|
|
|
|
|
|
private:
|
|
|
int width;
|
|
|
int heigh;
|
|
|
int screen_width;
|
|
|
int screen_hight;
|
|
|
string version_application = "1.0";
|
|
|
int index_error = 0;
|
|
|
string str_cmd_error = "";
|
|
|
template<typename Type>
|
|
|
struct Result{
|
|
|
Type response;
|
|
|
int error;
|
|
|
};
|
|
|
std::map <string, string> map_cmd_error;
|
|
|
|
|
|
public:
|
|
|
MainWindow(BaseObjectType* obj, Glib::RefPtr<Gtk::Builder> const& builder);
|
|
|
MainWindow(Glib::RefPtr<Gtk::Builder> 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();
|
|
|
bool gui_set_orientation(GdkEventConfigure* configure_event);
|
|
|
void synopsis_show();
|
|
|
string call(string cmd);
|
|
|
void wrapper_system(string cmd, string thread_str);
|
|
|
struct Result<string> wrapper_call(string cmd);
|
|
|
void log_mess_error(string &cmd);
|
|
|
void save_global_local_cfg();
|
|
|
void save_local_cfg();
|
|
|
void save_global_cfg();
|
|
|
void download_local_cfg();
|
|
|
void download_globl_cfg();
|
|
|
void info_status_app(string stule);
|
|
|
void info_warning_error(int mess);
|
|
|
int check_root();
|
|
|
};
|
|
|
|
|
|
class SettingsPlug : public Gtk::Plug{
|
|
|
public:
|
|
|
Gtk::Window *window;
|
|
|
SettingsPlug(::Window p_socketID, Glib::RefPtr<Gtk::Builder> builder);
|
|
|
|
|
|
private:
|
|
|
Gtk::Widget *plugBox;
|
|
|
Gtk::Widget *parent;
|
|
|
};
|
|
|
|
|
|
|