ui fixes
This commit is contained in:
parent
d0c66a693b
commit
97e918ae72
2 changed files with 59 additions and 8 deletions
|
@ -1445,6 +1445,8 @@ void MainWindow::setupSharePageConnections()
|
|||
});
|
||||
|
||||
connect(ui->pushButton_share_amnezia_copy, &QPushButton::clicked, this, [this](){
|
||||
if (ui->textEdit_share_amnezia_code->toPlainText().isEmpty()) return;
|
||||
|
||||
QGuiApplication::clipboard()->setText(ui->textEdit_share_amnezia_code->toPlainText());
|
||||
ui->pushButton_share_amnezia_copy->setText(tr("Copied"));
|
||||
|
||||
|
@ -1453,6 +1455,17 @@ void MainWindow::setupSharePageConnections()
|
|||
});
|
||||
});
|
||||
|
||||
connect(ui->pushButton_share_amnezia_save, &QPushButton::clicked, this, [this](){
|
||||
if (ui->textEdit_share_amnezia_code->toPlainText().isEmpty()) return;
|
||||
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save AmneziaVPN config"),
|
||||
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.amnezia");
|
||||
QSaveFile save(fileName);
|
||||
save.open(QIODevice::WriteOnly);
|
||||
save.write(ui->textEdit_share_amnezia_code->toPlainText().toUtf8());
|
||||
save.commit();
|
||||
});
|
||||
|
||||
connect(ui->pushButton_share_openvpn_copy, &QPushButton::clicked, this, [this](){
|
||||
QGuiApplication::clipboard()->setText(ui->textEdit_share_openvpn_code->toPlainText());
|
||||
ui->pushButton_share_openvpn_copy->setText(tr("Copied"));
|
||||
|
@ -1548,7 +1561,9 @@ void MainWindow::setupSharePageConnections()
|
|||
});
|
||||
|
||||
connect(ui->pushButton_share_openvpn_save, &QPushButton::clicked, this, [this](){
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save OpenVPN config"), QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.ovpn");
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save OpenVPN config"),
|
||||
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.ovpn");
|
||||
|
||||
QSaveFile save(fileName);
|
||||
save.open(QIODevice::WriteOnly);
|
||||
save.write(ui->textEdit_share_openvpn_code->toPlainText().toUtf8());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue