Code refactor, support multiple gateways and non-SAML authentication (#9)

* Code refactor

* Update README.md
This commit is contained in:
Kevin Yue
2020-05-23 15:51:10 +08:00
committed by GitHub
parent 76a4977e92
commit 7f5bf0ce52
30 changed files with 1665 additions and 192 deletions

View File

@@ -2,17 +2,32 @@
#include "gpclient.h"
#include "enhancedwebview.h"
#include <QStandardPaths>
#include <plog/Log.h>
#include <plog/Appenders/ColorConsoleAppender.h>
int main(int argc, char *argv[])
{
const QDir path = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + "/GlobalProtect-openconnect";
const QString logFile = path.path() + "/gpclient.log";
if (!path.exists()) {
path.mkpath(".");
}
static plog::ColorConsoleAppender<plog::TxtFormatter> consoleAppender;
plog::init(plog::debug, logFile.toUtf8()).addAppender(&consoleAppender);
QString port = QString::fromLocal8Bit(qgetenv(ENV_CDP_PORT));
if (port == "") {
qputenv(ENV_CDP_PORT, "12315");
}
SingleApplication app(argc, argv);
GPClient w;
w.show();
QObject::connect(&app, &SingleApplication::instanceStarted, &w, &GPClient::raise);
QObject::connect(&app, &SingleApplication::instanceStarted, &w, &GPClient::activiate);
return app.exec();
}