minor ui fixes
This commit is contained in:
parent
420c616e9d
commit
f7926847ac
11 changed files with 50 additions and 34 deletions
|
|
@ -12,6 +12,7 @@
|
|||
#include "configurators/openvpn_configurator.h"
|
||||
#include "configurators/wireguard_configurator.h"
|
||||
#include "core/errorstrings.h"
|
||||
#include "utilities.h"
|
||||
#ifdef Q_OS_ANDROID
|
||||
#include "platforms/android/android_controller.h"
|
||||
#include "platforms/android/androidutils.h"
|
||||
|
|
@ -201,7 +202,7 @@ QList<QString> ExportController::getQrCodes()
|
|||
return m_qrCodes;
|
||||
}
|
||||
|
||||
void ExportController::saveFile()
|
||||
void ExportController::saveFile(const QString &fileExtension, const QString &caption, const QString &fileName)
|
||||
{
|
||||
#if defined Q_OS_IOS
|
||||
// ext.replace("*", "");
|
||||
|
|
@ -229,27 +230,7 @@ void ExportController::saveFile()
|
|||
return;
|
||||
#endif
|
||||
|
||||
QString fileExtension = ".vpn";
|
||||
QString docDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
|
||||
QUrl fileName;
|
||||
fileName = QFileDialog::getSaveFileUrl(nullptr, tr("Save AmneziaVPN config"),
|
||||
QUrl::fromLocalFile(docDir + "/" + "amnezia_config"), "*" + fileExtension);
|
||||
if (fileName.isEmpty())
|
||||
return;
|
||||
if (!fileName.toString().endsWith(fileExtension)) {
|
||||
fileName = QUrl(fileName.toString() + fileExtension);
|
||||
}
|
||||
if (fileName.isEmpty())
|
||||
return;
|
||||
|
||||
QFile save(fileName.toLocalFile());
|
||||
|
||||
save.open(QIODevice::WriteOnly);
|
||||
save.write(m_config.toUtf8());
|
||||
save.close();
|
||||
|
||||
QFileInfo fi(fileName.toLocalFile());
|
||||
QDesktopServices::openUrl(fi.absoluteDir().absolutePath());
|
||||
Utils::saveFile(fileExtension, caption, fileName, m_config);
|
||||
}
|
||||
|
||||
QList<QString> ExportController::generateQrCodeImageSeries(const QByteArray &data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue