mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:15:10 +00:00
UI: Options: Confirm "Import Backup" to restart
This commit is contained in:
parent
263755f4bb
commit
960b9d07c9
@ -177,11 +177,20 @@ void OptionsController::importBackup()
|
||||
|
||||
if (confManager()->importBackup(path)) {
|
||||
windowManager()->showInfoDialog(tr("Backup Imported Successfully"));
|
||||
windowManager()->restart();
|
||||
} else {
|
||||
windowManager()->showErrorBox(tr("Cannot Import Backup"));
|
||||
}
|
||||
}
|
||||
|
||||
void OptionsController::confirmImportBackup()
|
||||
{
|
||||
windowManager()->showConfirmBox([&] { importBackup(); },
|
||||
tr("Program will be restarted after successful import. Continue?\n\n"
|
||||
"Make sure that you have a fresh backup."),
|
||||
tr("Import Backup"));
|
||||
}
|
||||
|
||||
void OptionsController::closeWindow()
|
||||
{
|
||||
windowManager()->closeOptionsWindow();
|
||||
|
@ -48,6 +48,7 @@ public slots:
|
||||
|
||||
void exportBackup();
|
||||
void importBackup();
|
||||
void confirmImportBackup();
|
||||
|
||||
void closeWindow();
|
||||
|
||||
|
@ -130,7 +130,7 @@ void OptMainPage::setupBackup()
|
||||
m_actImport = backupMenu->addAction(IconCache::icon(":/icons/folder.png"), QString());
|
||||
|
||||
connect(m_actExport, &QAction::triggered, ctrl(), &OptionsController::exportBackup);
|
||||
connect(m_actImport, &QAction::triggered, ctrl(), &OptionsController::importBackup);
|
||||
connect(m_actImport, &QAction::triggered, ctrl(), &OptionsController::confirmImportBackup);
|
||||
|
||||
m_btBackup = new QPushButton();
|
||||
m_btBackup->setMenu(backupMenu);
|
||||
|
Loading…
Reference in New Issue
Block a user