added output of notifications/errors after installation/import

This commit is contained in:
vladimir.kuznetsov 2023-07-31 00:13:08 +09:00
parent 0411792ca5
commit 1092abe776
39 changed files with 488 additions and 303 deletions

View file

@ -84,9 +84,10 @@ void SettingsController::restoreAppConfig()
Utils::getFileName(Q_NULLPTR, tr("Open backup"),
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.backup");
// todo error processing
if (fileName.isEmpty())
if (fileName.isEmpty()) {
emit changeSettingsErrorOccurred(tr("Backup file is empty"));
return;
}
QFile file(fileName);
file.open(QIODevice::ReadOnly);
@ -94,7 +95,10 @@ void SettingsController::restoreAppConfig()
bool ok = m_settings->restoreAppConfig(data);
if (ok) {
// emit uiLogic()->showWarningMessage(tr("Can't import config, file is corrupted."));
m_serversModel->resetModel();
emit restoreBackupFinished();
} else {
emit changeSettingsErrorOccurred(tr("Backup file is corrupted"));
}
}
@ -106,4 +110,5 @@ QString SettingsController::getAppVersion()
void SettingsController::clearSettings()
{
m_settings->clearSettings();
m_serversModel->resetModel();
}