You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ublexec/source/ublexec.h

202 lines
4.9 KiB

#include <cstddef>
#include <cstdlib>
#include <iostream>
#include <memory>
#include <gtkmm.h>
#include <ostream>
#include <string>
#include <ctime>
#include <vector>
#include <map>
#include <fstream>
#include <filesystem>
#include <libintl.h>
#include <locale.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdio.h>
#include <gtkmm/plug.h>
#include <gtkmm/stock.h>
#include <gtkmm/window.h>
#include <string>
#include <gtkmm.h>
#include <gtkmm/plug.h>
#include <string>
#include <iostream>
#include <filesystem>
#include <iostream>
#include <sys/types.h>
#include <pwd.h>
#include <set>
using namespace std;
extern string path_app;
extern string app_name;
extern string path_glade;
extern string path_css;
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;
};
// This is what is going to be plugged into xfce4-settings-manager:
//
// Documented here:
//
// https://developer.gnome.org/gtkmm-tutorial/3.22/sec-plugs-sockets-example.html.en
//
class MainWindow : public Gtk::ApplicationWindow {
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 close_start_menu();
void start_menu_entry_app();
void message_gui_close();
void activ_or_block_execute_epriority();
void open_filemaneg();
void close_filemaneg();
void get_path_filemaneg();
void open_list_app();
void start_cmd();
void changed_user();
void execute_terminal(){}
void execute_another_User(){}
void activ_or_block_other_user();
void change_scale_priority();
void change_spin_priority();
void pars_dir_bin();
void pars_users();
void pars_apps();
void tmp_desktop(string cmd_name);
vector<std::string> split(const std::string &s, char delim);
public:
class ModelColumns : public Gtk::TreeModel::ColumnRecord
{
public:
ModelColumns()
{
add(m_col_filename);
add(m_col_description);
add(m_col_pixbuf);
}
Gtk::TreeModelColumn<std::string> m_col_filename;
Gtk::TreeModelColumn<Glib::ustring> m_col_description;
Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > m_col_pixbuf;
};
ModelColumns m_Columns;
public:
Glib::RefPtr<Gtk::Builder> builder;
Gtk::Button *btnFilemaneg;
Gtk::Button *btnListApp;
Gtk::Button *btnStart;
Gtk::CheckButton *chbTerminal;
Gtk::CheckButton *chbAnotherUser;
Gtk::CheckButton *cbxExecuteEpriority;
Gtk::ComboBoxText *cmbUser;
Gtk::SpinButton *spinPriority;
Gtk::Scale *scalePriority;
Gtk::RadioButton *rbPkexec;
Gtk::RadioButton *rbSu;
Gtk::RadioButton *rbSudo;
Gtk::Entry *txtCmd;
Gtk::FileChooserDialog *wndChooseFileWallpaper;
Gtk::Button *btnFilemangerExit;
Gtk::Button *btnFilemangerOk;
Gtk::Label *lblTimeEpriority;
Gtk::Label *lblTimeEpriorityLow;
Gtk::Label *lblTime4EpriorityHigh;
Gtk::Label *lblUserName;
Gtk::MessageDialog *messageError;
Gtk::Button *btnMessageErrorOk;
Gtk::Label *lblMessageError;
Gtk::Button *btnStartMenuOK;
Gtk::Button *btnStartMenuExit;
Gtk::Box *boxlistProgramm;
Gtk::Dialog *dialogStartMenu;
Gtk::Box *boxColor;
Gtk::Label *lblInfoHead;
Gtk::Label *lblinfoCmd;
Gtk::Label *lblInfoTime;
Gtk::Label *labInfoExecutTerm;
Gtk::Label *lblInfoUser;
Gtk::Label *lblInfoUserOther;
Gtk::Label *lblInfoUserName;
Gtk::Label *lblInfoNooPriority;
Gtk::Label *lblInfoExec;
Gtk::Label *lblInfoPriority;
Gtk::Label *lblInfoEnterProg;
Gtk::Label *lblGraphics;
Gtk::Label *lblTools;
Gtk::Label *lblInternet;
Gtk::Label *lblMultimedia;
Gtk::Label *lblSettings;
Gtk::Label *lblEducation;
Gtk::Label *lblOffice;
Gtk::Label *lblOther;
Gtk::Label *lblDevelopment;
Gtk::Label *lblSystem;
Gtk::IconView *iconGraphics;
Glib::RefPtr<Gtk::ListStore> list_Graphics;
public:
string execute_cmd = "";
string path_file = "";
bool flag_pkexec = false;
bool flag_su = false;
bool flag_sudo = false;
string path_file_name;
struct struct_App{
string Name_desktop;
string Name;
string Exec;
string Icon;
string MimeType;
string Type;
vector<std::string> Categories;
};
list <struct_App> list_app;
set <string> set_categories;
};
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;
};