Setup wizard
| 1339 | |
| 1340 | // Setup wizard |
| 1341 | void MainWindow::launchFirstRunSetup() |
| 1342 | { |
| 1343 | QHBoxLayout *lbLayout = new QHBoxLayout; |
| 1344 | QMessageOverlay *lightBox = new QMessageOverlay(this); |
| 1345 | FirstLaunchWizard *wiz = new FirstLaunchWizard(_autostart, lightBox); |
| 1346 | QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(lightBox); |
| 1347 | QPropertyAnimation *a = new QPropertyAnimation(eff, "opacity"); |
| 1348 | |
| 1349 | lightBox->setGraphicsEffect(eff); |
| 1350 | lightBox->setLayout(lbLayout); |
| 1351 | lightBox->layout()->addWidget(wiz); |
| 1352 | lightBox->show(); |
| 1353 | |
| 1354 | a->setDuration(500); |
| 1355 | a->setStartValue(0); |
| 1356 | a->setEndValue(1); |
| 1357 | a->setEasingCurve(QEasingCurve::InBack); |
| 1358 | a->start(QPropertyAnimation::DeleteWhenStopped); |
| 1359 | |
| 1360 | connect(wiz, &FirstLaunchWizard::wizardFinished, [lightBox, eff, this] |
| 1361 | { |
| 1362 | QPropertyAnimation *b = new QPropertyAnimation(eff, "opacity"); |
| 1363 | b->setDuration(500); |
| 1364 | b->setStartValue(1); |
| 1365 | b->setEndValue(0); |
| 1366 | b->setEasingCurve(QEasingCurve::OutCirc); |
| 1367 | b->start(QPropertyAnimation::DeleteWhenStopped); |
| 1368 | |
| 1369 | connect(b, &QAbstractAnimation::finished, [lightBox, this]() |
| 1370 | { |
| 1371 | AppConfig::instance().set(AppConfig::SetupDone, true); |
| 1372 | lightBox->hide(); |
| 1373 | _settingsFragment->fragment()->refreshAll(); |
| 1374 | lightBox->deleteLater(); |
| 1375 | }); |
| 1376 | }); |
| 1377 | } |
| 1378 |
nothing calls this directly
no test coverage detected