mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 88e3e2bcb4 |
@@ -178,12 +178,11 @@ void SettingsController::backupAppConfig(const QString &fileName)
|
|||||||
|
|
||||||
void SettingsController::restoreAppConfig(const QString &fileName)
|
void SettingsController::restoreAppConfig(const QString &fileName)
|
||||||
{
|
{
|
||||||
QFile file(fileName);
|
QByteArray data;
|
||||||
|
if (!SystemController::readFile(fileName, data)) {
|
||||||
file.open(QIODevice::ReadOnly);
|
emit changeSettingsErrorOccurred(tr("Can't open file: %1").arg(fileName));
|
||||||
|
return;
|
||||||
QByteArray data = file.readAll();
|
}
|
||||||
|
|
||||||
restoreAppConfigFromData(data);
|
restoreAppConfigFromData(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -169,6 +169,27 @@ PageType {
|
|||||||
var noButtonFunction = function() {
|
var noButtonFunction = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var showDialog = function() {
|
||||||
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
|
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GC.isMobile() && Qt.platform.os === "android") {
|
||||||
|
restoreBackupDelayTimer.dialogCallback = showDialog
|
||||||
|
restoreBackupDelayTimer.restart()
|
||||||
|
} else {
|
||||||
|
showDialog()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: restoreBackupDelayTimer
|
||||||
|
interval: 500
|
||||||
|
repeat: false
|
||||||
|
property var dialogCallback
|
||||||
|
onTriggered: {
|
||||||
|
if (dialogCallback && typeof dialogCallback === "function") {
|
||||||
|
dialogCallback()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user