added importController
This commit is contained in:
parent
0479113949
commit
ca6b7fbeb2
6 changed files with 258 additions and 1 deletions
37
client/ui/controllers/importController.h
Normal file
37
client/ui/controllers/importController.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
#ifndef IMPORTCONTROLLER_H
|
||||
#define IMPORTCONTROLLER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "core/defs.h"
|
||||
#include "containers/containers_defs.h"
|
||||
#include "ui/models/servers_model.h"
|
||||
#include "ui/models/containers_model.h"
|
||||
|
||||
class ImportController : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ImportController(const QSharedPointer<ServersModel> &serversModel,
|
||||
const QSharedPointer<ContainersModel> &containersModel,
|
||||
const std::shared_ptr<Settings> &settings,
|
||||
QObject *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
bool importFromFile(const QUrl &fileUrl);
|
||||
|
||||
signals:
|
||||
void importFinished();
|
||||
private:
|
||||
bool import(const QJsonObject &config);
|
||||
bool importAmneziaConfig(QString data);
|
||||
bool importOpenVpnConfig(const QString &data);
|
||||
bool importWireGuardConfig(const QString &data);
|
||||
|
||||
QSharedPointer<ServersModel> m_serversModel;
|
||||
QSharedPointer<ContainersModel> m_containersModel;
|
||||
std::shared_ptr<Settings> m_settings;
|
||||
|
||||
};
|
||||
|
||||
#endif // IMPORTCONTROLLER_H
|
Loading…
Add table
Add a link
Reference in a new issue