Import config from filesystem on iOS
This commit is contained in:
parent
cacf74af3c
commit
1b3a32f83f
5 changed files with 7 additions and 11 deletions
|
@ -21,7 +21,6 @@
|
||||||
#include "protocols/qml_register_protocols.h"
|
#include "protocols/qml_register_protocols.h"
|
||||||
|
|
||||||
#if defined(Q_OS_IOS)
|
#if defined(Q_OS_IOS)
|
||||||
#include "platforms/ios/QtAppDelegate-C-Interface.h"
|
|
||||||
#include "platforms/ios/ios_controller.h"
|
#include "platforms/ios/ios_controller.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -112,7 +111,10 @@ void AmneziaApplication::init()
|
||||||
|
|
||||||
#ifdef Q_OS_IOS
|
#ifdef Q_OS_IOS
|
||||||
IosController::Instance()->initialize();
|
IosController::Instance()->initialize();
|
||||||
setImportController(m_importController.get());
|
connect(IosController::Instance(), &IosController::importConfigFromOutside, m_importController.get(),
|
||||||
|
&ImportController::extractConfigFromData);
|
||||||
|
connect(IosController::Instance(), &IosController::importConfigFromOutside, m_pageController.get(),
|
||||||
|
&PageController::goToPageViewConfig);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_notificationHandler.reset(NotificationHandler::create(nullptr));
|
m_notificationHandler.reset(NotificationHandler::create(nullptr));
|
||||||
|
|
|
@ -4,6 +4,5 @@
|
||||||
#include "ui/controllers/importController.h"
|
#include "ui/controllers/importController.h"
|
||||||
|
|
||||||
void QtAppDelegateInitialize();
|
void QtAppDelegateInitialize();
|
||||||
void setImportController(ImportController*);
|
|
||||||
|
|
||||||
#endif // QTAPPDELEGATECINTERFACE_H
|
#endif // QTAPPDELEGATECINTERFACE_H
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
#import "QtAppDelegate-C-Interface.h"
|
|
||||||
|
|
||||||
#include "ui/controllers/importController.h"
|
#include "ui/controllers/importController.h"
|
||||||
|
|
||||||
@interface QtAppDelegate : UIResponder <UIApplicationDelegate>
|
@interface QtAppDelegate : UIResponder <UIApplicationDelegate>
|
||||||
+(QtAppDelegate *)sharedQtAppDelegate;
|
|
||||||
@property (nonatomic) ImportController* ImportController;
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#import "QtAppDelegate.h"
|
#import "QtAppDelegate.h"
|
||||||
|
#import "ios_controller.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
|
@ -79,7 +80,7 @@
|
||||||
bool isOpenFile = file.open(QIODevice::ReadOnly);
|
bool isOpenFile = file.open(QIODevice::ReadOnly);
|
||||||
QByteArray data = file.readAll();
|
QByteArray data = file.readAll();
|
||||||
|
|
||||||
[QtAppDelegate sharedQtAppDelegate].ImportController->extractConfigFromData(QString(data));
|
IosController::Instance()->importConfigFromOutside(QString(data));
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -92,8 +93,4 @@ void QtAppDelegateInitialize()
|
||||||
NSLog(@"Created a new AppDelegate");
|
NSLog(@"Created a new AppDelegate");
|
||||||
}
|
}
|
||||||
|
|
||||||
void setImportController(ImportController* controller) {
|
|
||||||
[QtAppDelegate sharedQtAppDelegate].ImportController = controller;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -49,6 +49,7 @@ public:
|
||||||
signals:
|
signals:
|
||||||
void connectionStateChanged(Vpn::ConnectionState state);
|
void connectionStateChanged(Vpn::ConnectionState state);
|
||||||
void bytesChanged(quint64 receivedBytes, quint64 sentBytes);
|
void bytesChanged(quint64 receivedBytes, quint64 sentBytes);
|
||||||
|
void importConfigFromOutside(const QString);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue