|
|
|
@ -9,9 +9,11 @@ int socket_ext_id_I = 0;
|
|
|
|
int socket_trd_id_I = 0;
|
|
|
|
int socket_trd_id_I = 0;
|
|
|
|
|
|
|
|
|
|
|
|
MainWindow* obj_main;
|
|
|
|
MainWindow* obj_main;
|
|
|
|
void wrapper_help_show() {
|
|
|
|
void wrapper_help_show(GtkWidget *self, char* link, gpointer user_data) {
|
|
|
|
|
|
|
|
if (self && user_data) {}
|
|
|
|
|
|
|
|
obj_main->global_lick_doc = link;
|
|
|
|
obj_main->aboutWindows->hide();
|
|
|
|
obj_main->aboutWindows->hide();
|
|
|
|
obj_main->help_show();
|
|
|
|
obj_main->temp_help_show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CmdArgParser::CmdArgParser(const std::string& p_name, const std::string& p_description, const std::string& p_help)
|
|
|
|
CmdArgParser::CmdArgParser(const std::string& p_name, const std::string& p_description, const std::string& p_help)
|
|
|
|
@ -227,7 +229,7 @@ void MainWindow::event() {
|
|
|
|
btnCancelHelp->signal_clicked().connect([&]() {wndShowWeb->hide();});
|
|
|
|
btnCancelHelp->signal_clicked().connect([&]() {wndShowWeb->hide();});
|
|
|
|
chkAlwaysOpenHelp->signal_toggled().connect([&]() {flag_open_browser = true;});
|
|
|
|
chkAlwaysOpenHelp->signal_toggled().connect([&]() {flag_open_browser = true;});
|
|
|
|
btnReadHelp->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::open_browser));
|
|
|
|
btnReadHelp->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::open_browser));
|
|
|
|
btnhelp->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::help_show));
|
|
|
|
btnhelp->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::open_help));
|
|
|
|
btnFilemaneg->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::open_filemaneg));
|
|
|
|
btnFilemaneg->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::open_filemaneg));
|
|
|
|
btnListApp->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::open_list_app));
|
|
|
|
btnListApp->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::open_list_app));
|
|
|
|
btnStart->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::entry_app));
|
|
|
|
btnStart->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::entry_app));
|
|
|
|
@ -252,7 +254,6 @@ void MainWindow::event() {
|
|
|
|
iconOther->signal_selection_changed().connect(sigc::mem_fun(*this,&MainWindow::select_Other));
|
|
|
|
iconOther->signal_selection_changed().connect(sigc::mem_fun(*this,&MainWindow::select_Other));
|
|
|
|
iconDevelopment->signal_selection_changed().connect(sigc::mem_fun(*this,&MainWindow::select_Development));
|
|
|
|
iconDevelopment->signal_selection_changed().connect(sigc::mem_fun(*this,&MainWindow::select_Development));
|
|
|
|
iconSystem->signal_selection_changed().connect(sigc::mem_fun(*this,&MainWindow::select_System));
|
|
|
|
iconSystem->signal_selection_changed().connect(sigc::mem_fun(*this,&MainWindow::select_System));
|
|
|
|
btnhelp->signal_activate().connect(sigc::mem_fun(*this, &MainWindow::help_show));
|
|
|
|
|
|
|
|
btnAbout->signal_activate().connect([&]() {aboutWindows->show();});
|
|
|
|
btnAbout->signal_activate().connect([&]() {aboutWindows->show();});
|
|
|
|
cmbUser->signal_changed().connect([&]() {changed_user();this->denamic_cmd();});
|
|
|
|
cmbUser->signal_changed().connect([&]() {changed_user();this->denamic_cmd();});
|
|
|
|
rbSudo->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::sudo_nice));
|
|
|
|
rbSudo->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::sudo_nice));
|
|
|
|
@ -353,7 +354,7 @@ bool MainWindow::focus_in_txt_cmd(GdkEventFocus* event) {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::help_show() {
|
|
|
|
void MainWindow::temp_help_show() {
|
|
|
|
if (flag_open_browser == true) {
|
|
|
|
if (flag_open_browser == true) {
|
|
|
|
this->open_browser();
|
|
|
|
this->open_browser();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -363,26 +364,31 @@ void MainWindow::help_show() {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::open_help() {
|
|
|
|
|
|
|
|
global_lick_doc = const_link_doc;
|
|
|
|
|
|
|
|
temp_help_show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::open_browser() {
|
|
|
|
void MainWindow::open_browser() {
|
|
|
|
#ifdef WEBKIT_FOUND
|
|
|
|
#ifdef WEBKIT_FOUND
|
|
|
|
webkit_web_view_load_uri(one, link_doc);
|
|
|
|
webkit_web_view_load_uri(one, _(global_lick_doc.c_str()));
|
|
|
|
wndWeb->show_all();
|
|
|
|
wndWeb->show_all();
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
this->template_open_browser();
|
|
|
|
this->template_open_browser(global_lick_doc);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
wndShowWeb->hide();
|
|
|
|
wndShowWeb->hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::template_open_browser() {
|
|
|
|
void MainWindow::template_open_browser(string link_doc) {
|
|
|
|
string cmd = cmd_xdg + string(_(link_doc)) + " &";
|
|
|
|
string cmd = cmd_xdg + string(_(link_doc.c_str())) + " &";
|
|
|
|
string buf = "";
|
|
|
|
string buf = "";
|
|
|
|
if (geteuid() == 0) {
|
|
|
|
if (geteuid() == 0) {
|
|
|
|
string response_user = getlogin();
|
|
|
|
string response_user = getlogin();
|
|
|
|
int size_s = std::snprintf(nullptr, 0, cmd_execute, response_user.c_str(), cmd.c_str()) + 1;
|
|
|
|
int size_s = std::snprintf(nullptr, 0, cmd_execute, response_user.c_str(), cmd.c_str()) + 1;
|
|
|
|
auto size = static_cast<size_t>(size_s);
|
|
|
|
auto size = static_cast<size_t>(size_s);
|
|
|
|
std::unique_ptr<char[]> buf(new char[ size ]);
|
|
|
|
std::unique_ptr<char[]> buf(new char[ size ]);
|
|
|
|
std::snprintf( buf.get(), size, cmd_execute, response_user.c_str(), cmd.c_str() );
|
|
|
|
std::snprintf(buf.get(), size, cmd_execute, response_user.c_str(), cmd.c_str());
|
|
|
|
cmd = std::string( buf.get(), buf.get() + size - 1 );
|
|
|
|
cmd = string(buf.get(), buf.get() + size - 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
index_error = system(cmd.c_str());
|
|
|
|
index_error = system(cmd.c_str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|