added output of notifications/errors after installation/import
This commit is contained in:
parent
0411792ca5
commit
1092abe776
39 changed files with 488 additions and 303 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue