mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-04-02 18:31:50 -04:00
Save portal to settings
This commit is contained in:
parent
71d5e96f65
commit
c63c494ea4
@ -13,6 +13,9 @@ GPClient::GPClient(QWidget *parent)
|
||||
setFixedSize(width(), height());
|
||||
moveCenter();
|
||||
|
||||
settings = new QSettings("com.yuezk.qt", "GPClient");
|
||||
ui->portalInput->setText(settings->value("portal", "").toString());
|
||||
|
||||
QObject::connect(this, &GPClient::connectFailed, [this]() {
|
||||
ui->connectButton->setDisabled(false);
|
||||
ui->connectButton->setText("Connect");
|
||||
@ -47,6 +50,7 @@ GPClient::~GPClient()
|
||||
delete reply;
|
||||
delete loginWindow;
|
||||
delete vpn;
|
||||
delete settings;
|
||||
}
|
||||
|
||||
void GPClient::on_connectButton_clicked()
|
||||
@ -55,6 +59,7 @@ void GPClient::on_connectButton_clicked()
|
||||
|
||||
if (btnText == "Connect") {
|
||||
QString portal = ui->portalInput->text();
|
||||
settings->setValue("portal", portal);
|
||||
ui->statusLabel->setText("Authenticating...");
|
||||
ui->connectButton->setDisabled(true);
|
||||
samlLogin(portal);
|
||||
|
@ -38,6 +38,7 @@ private:
|
||||
QNetworkAccessManager *networkManager;
|
||||
QNetworkReply *reply;
|
||||
com::yuezk::qt::GPService *vpn;
|
||||
QSettings *settings;
|
||||
|
||||
void moveCenter();
|
||||
void samlLogin(const QString portal);
|
||||
|
@ -66,7 +66,7 @@
|
||||
<item>
|
||||
<widget class="QLineEdit" name="portalInput">
|
||||
<property name="text">
|
||||
<string>vpn.microstrategy.com</string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Please enter your portal address</string>
|
||||
|
Loading…
Reference in New Issue
Block a user