mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-24 02:00:24 +07:00
Save files for iOS
This commit is contained in:
@@ -24,7 +24,8 @@ void FileUtilites::saveFile(QString fileName, const QString &data)
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_IOS
|
||||
QFile file(fileName);
|
||||
QUrl fileUrl = QDir::tempPath() + "/" + fileName;
|
||||
QFile file(fileUrl.toString());
|
||||
#else
|
||||
QUrl fileUrl = QUrl(fileName);
|
||||
QFile file(fileUrl.toLocalFile());
|
||||
@@ -37,7 +38,7 @@ void FileUtilites::saveFile(QString fileName, const QString &data)
|
||||
|
||||
#ifdef Q_OS_IOS
|
||||
QStringList filesToSend;
|
||||
filesToSend.append(fileName);
|
||||
filesToSend.append(fileUrl.toString());
|
||||
MobileUtils::shareText(filesToSend);
|
||||
return;
|
||||
#else
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef QTAPPDELEGATECINTERFACE_H
|
||||
#define QTAPPDELEGATECINTERFACE_H
|
||||
|
||||
#include "ui/controllers/importController.h"
|
||||
|
||||
void QtAppDelegateInitialize();
|
||||
|
||||
#endif // QTAPPDELEGATECINTERFACE_H
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#include "ui/controllers/importController.h"
|
||||
|
||||
@interface QtAppDelegate : UIResponder <UIApplicationDelegate>
|
||||
@end
|
||||
|
||||
@@ -69,7 +69,13 @@ DrawerType {
|
||||
text: qsTr("Share")
|
||||
imageSource: "qrc:/images/controls/share-2.svg"
|
||||
|
||||
onClicked: fileDialog.open()
|
||||
onClicked: {
|
||||
if (Qt.platform.os === "ios") {
|
||||
ExportController.saveFile("amnezia_config.vpn")
|
||||
} else {
|
||||
fileDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
FileDialog {
|
||||
id: fileDialog
|
||||
|
||||
@@ -100,7 +100,13 @@ PageType {
|
||||
|
||||
image: "qrc:/images/controls/save.svg"
|
||||
|
||||
onClicked: fileDialog.open()
|
||||
onClicked: {
|
||||
if (Qt.platform.os === "ios") {
|
||||
SettingsController.exportLogsFile("AmneziaVPN.log")
|
||||
} else {
|
||||
fileDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
FileDialog {
|
||||
id: fileDialog
|
||||
|
||||
@@ -302,7 +302,11 @@ PageType {
|
||||
text: qsTr("Save site list")
|
||||
|
||||
clickedFunction: function() {
|
||||
saveFileDialog.open()
|
||||
if (Qt.platform.os === "ios") {
|
||||
ExportController.saveFile("amezia_tunnel.json")
|
||||
} else {
|
||||
saveFileDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
FileDialog {
|
||||
|
||||
Reference in New Issue
Block a user