mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
Add a scripting mode to GPClient (#110)
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
#include <QtWidgets/QMenu>
|
||||
#include <QtWidgets/QPushButton>
|
||||
|
||||
#include "gpserviceinterface.h"
|
||||
#include "portalconfigresponse.h"
|
||||
#include "settingsdialog.h"
|
||||
#include "vpn.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class GPClient; }
|
||||
@@ -19,12 +19,20 @@ class GPClient : public QMainWindow
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GPClient(QWidget *parent = nullptr);
|
||||
GPClient(QWidget *parent, IVpn *vpn);
|
||||
~GPClient();
|
||||
|
||||
void activate();
|
||||
void quit();
|
||||
|
||||
QString portal() const;
|
||||
void portal(QString);
|
||||
|
||||
GPGateway currentGateway() const;
|
||||
void setCurrentGateway(const GPGateway gateway);
|
||||
|
||||
void doConnect();
|
||||
|
||||
private slots:
|
||||
void onSettingsButtonClicked();
|
||||
void onSettingsAccepted();
|
||||
@@ -58,7 +66,7 @@ private:
|
||||
};
|
||||
|
||||
Ui::GPClient *ui;
|
||||
com::yuezk::qt::GPService *vpn;
|
||||
IVpn *vpn;
|
||||
|
||||
QSystemTrayIcon *systemTrayIcon;
|
||||
QMenu *contextMenu;
|
||||
@@ -83,20 +91,15 @@ private:
|
||||
void populateGatewayMenu();
|
||||
void updateConnectionStatus(const VpnStatus &status);
|
||||
|
||||
void doConnect();
|
||||
void portalLogin();
|
||||
void tryGatewayLogin();
|
||||
void gatewayLogin();
|
||||
|
||||
QString portal() const;
|
||||
bool connected() const;
|
||||
|
||||
QList<GPGateway> allGateways() const;
|
||||
void setAllGateways(QList<GPGateway> gateways);
|
||||
|
||||
GPGateway currentGateway() const;
|
||||
void setCurrentGateway(const GPGateway gateway);
|
||||
|
||||
void clearSettings();
|
||||
};
|
||||
#endif // GPCLIENT_H
|
||||
|
Reference in New Issue
Block a user