A rewrite in C++ and wxWidgets of a minimalistic pEp Linux Setup for Thuderbird.
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.
 
 
 
 
 

73 lines
2.2 KiB

#ifndef TB_SETUP_H_INCLUDED
#define TB_SETUP_H_INCLUDED
#include <thread>
#include "pstream.h"
#include "tb_setup_events.h"
#include "wx_setup.h"
#define PEP_SUDO_PASSWORD_PROMPT "PEP_SUDO_PASSWORD_PROMPT"
#define PEP_SU_PASSWORD_PROMPT "Password:"
using namespace std;
class TbSetupApp : public wxApp
{
protected:
wxLocale *m_locale = NULL;
std::thread *th_interact = NULL;;
WelcomeWindow *m_windowFrame = NULL;
redi::pstream *m_script = NULL;
string m_opt_language = "";
bool m_opt_with_uninstall = true;
string m_opt_xdg = "";
bool m_opt_prefer_user_install = false;
string m_opt_script = "";
string m_opt_import_script = "";
string m_opt_script_base = "";
string m_opt_tb_profile_dir = "";
bool m_opt_do_not_import = false;
bool m_import_script_pending = false;
bool m_script_user_phase_pending = false;
bool m_opt_unattended_start = false;
string m_opt_adapter_package_ver = "2.0.0";
string m_opt_adapter_package_archive = "";
string m_opt_adapter_package_plat = "x86_64";
string m_opt_adapter_package_variant = "";
#if __linux__
string m_opt_adapter_package_os = "lnx";
#elif __APPLE__
string m_opt_adapter_package_os = "darwin";
#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__
string m_opt_adapter_package_os = "bsd";
#elif _WIN32
string m_opt_adapter_package_os = "win32";
#else
string m_opt_adapter_package_os = "unknown";
#endif
public:
virtual bool OnInit();
virtual void OnInitCmdLine(wxCmdLineParser&);
virtual bool OnCmdLineParsed(wxCmdLineParser&);
void LogText(const char*);
void OnStartSetup(wxCommandEvent&);
void OnStartUninstall(wxCommandEvent&);
void OnAdminPasswordRequired(wxCommandEvent&);
void OnAdminPasswordProvided(wxCommandEvent&);
void OnInteractionComplete(wxCommandEvent&);
void OnInteractionCheckPending(wxCommandEvent&);
void OnClose(wxCommandEvent&);
vector<string>* GetScriptOptions();
vector<string>* GetImportScriptOptions();
int InteractElevated(std::vector<std::string> *);
int Interact(std::vector<std::string> *);
string Abspath(const char *);
string Dirname(const char *);
string PathExpand(const char*);
string ShellQuote(string);
};
#endif