removed Widgets from service part
This commit is contained in:
parent
f7926847ac
commit
23ad006187
11 changed files with 178 additions and 162 deletions
|
|
@ -4,7 +4,6 @@
|
|||
#include <QDataStream>
|
||||
#include <QDesktopServices>
|
||||
#include <QFile>
|
||||
#include <QFileDialog>
|
||||
#include <QFileInfo>
|
||||
#include <QImage>
|
||||
#include <QStandardPaths>
|
||||
|
|
@ -12,7 +11,7 @@
|
|||
#include "configurators/openvpn_configurator.h"
|
||||
#include "configurators/wireguard_configurator.h"
|
||||
#include "core/errorstrings.h"
|
||||
#include "utilities.h"
|
||||
#include "fileUtilites.h"
|
||||
#ifdef Q_OS_ANDROID
|
||||
#include "platforms/android/android_controller.h"
|
||||
#include "platforms/android/androidutils.h"
|
||||
|
|
@ -230,7 +229,7 @@ void ExportController::saveFile(const QString &fileExtension, const QString &cap
|
|||
return;
|
||||
#endif
|
||||
|
||||
Utils::saveFile(fileExtension, caption, fileName, m_config);
|
||||
FileUtilites::saveFile(fileExtension, caption, fileName, m_config);
|
||||
}
|
||||
|
||||
QList<QString> ExportController::generateQrCodeImageSeries(const QByteArray &data)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include "../../platforms/android/androidutils.h"
|
||||
#include <QJniObject>
|
||||
#endif
|
||||
#include "utilities.h"
|
||||
#include "fileUtilites.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
|
@ -84,9 +84,9 @@ ImportController::ImportController(const QSharedPointer<ServersModel> &serversMo
|
|||
|
||||
void ImportController::extractConfigFromFile()
|
||||
{
|
||||
QString fileName = Utils::getFileName(Q_NULLPTR, tr("Open config file"),
|
||||
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation),
|
||||
"*.vpn *.ovpn *.conf");
|
||||
QString fileName = FileUtilites::getFileName(Q_NULLPTR, tr("Open config file"),
|
||||
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation),
|
||||
"*.vpn *.ovpn *.conf");
|
||||
QFile file(fileName);
|
||||
if (file.open(QIODevice::ReadOnly)) {
|
||||
QString data = file.readAll();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "core/errorstrings.h"
|
||||
#include "core/servercontroller.h"
|
||||
#include "fileUtilites.h"
|
||||
#include "utilities.h"
|
||||
|
||||
namespace
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
#include <QStandardPaths>
|
||||
|
||||
#include "fileUtilites.h"
|
||||
#include "logger.h"
|
||||
#include "utilities.h"
|
||||
#include "version.h"
|
||||
|
||||
SettingsController::SettingsController(const QSharedPointer<ServersModel> &serversModel,
|
||||
|
|
@ -69,7 +69,7 @@ void SettingsController::openLogsFolder()
|
|||
|
||||
void SettingsController::exportLogsFile()
|
||||
{
|
||||
Utils::saveFile(".log", tr("Save log"), "AmneziaVPN", Logger::getLogFile());
|
||||
FileUtilites::saveFile(".log", tr("Save log"), "AmneziaVPN", Logger::getLogFile());
|
||||
}
|
||||
|
||||
void SettingsController::clearLogs()
|
||||
|
|
@ -80,14 +80,14 @@ void SettingsController::clearLogs()
|
|||
|
||||
void SettingsController::backupAppConfig()
|
||||
{
|
||||
Utils::saveFile(".backup", tr("Backup application config"), "AmneziaVPN", m_settings->backupAppConfig());
|
||||
FileUtilites::saveFile(".backup", tr("Backup application config"), "AmneziaVPN", m_settings->backupAppConfig());
|
||||
}
|
||||
|
||||
void SettingsController::restoreAppConfig()
|
||||
{
|
||||
QString fileName =
|
||||
Utils::getFileName(Q_NULLPTR, tr("Open backup"),
|
||||
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.backup");
|
||||
FileUtilites::getFileName(Q_NULLPTR, tr("Open backup"),
|
||||
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.backup");
|
||||
|
||||
if (fileName.isEmpty()) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include <QHostInfo>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#include "utilities.h"
|
||||
#include "fileUtilites.h"
|
||||
|
||||
SitesController::SitesController(const std::shared_ptr<Settings> &settings,
|
||||
const QSharedPointer<VpnConnection> &vpnConnection,
|
||||
|
|
@ -80,8 +80,9 @@ void SitesController::removeSite(int index)
|
|||
|
||||
void SitesController::importSites(bool replaceExisting)
|
||||
{
|
||||
QString fileName = Utils::getFileName(Q_NULLPTR, tr("Open sites file"),
|
||||
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.json");
|
||||
QString fileName =
|
||||
FileUtilites::getFileName(Q_NULLPTR, tr("Open sites file"),
|
||||
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.json");
|
||||
|
||||
if (fileName.isEmpty()) {
|
||||
return;
|
||||
|
|
@ -149,7 +150,7 @@ void SitesController::exportSites()
|
|||
QJsonDocument jsonDocument(jsonArray);
|
||||
QByteArray jsonData = jsonDocument.toJson();
|
||||
|
||||
Utils::saveFile(".json", tr("Export sites file"), "sites", jsonData);
|
||||
FileUtilites::saveFile(".json", tr("Export sites file"), "sites", jsonData);
|
||||
|
||||
emit finished(tr("Export completed"));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue