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.
158 lines
3.9 KiB
158 lines
3.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;
|
|
|
|
|
|
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 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();
|
|
|
|
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 *wndChooseDirWallpaper;
|
|
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::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;
|
|
|
|
|
|
|
|
public:
|
|
string execute_cmd = "";
|
|
bool flag_pkexec = false;
|
|
bool flag_su = false;
|
|
bool flag_sudo = false;
|
|
string path_file_name;
|
|
struct struct_App{
|
|
string Name;
|
|
string Exec;
|
|
string Icon;
|
|
string MimeType;
|
|
string Type;
|
|
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;
|
|
};
|