Add what's new dialog

This commit is contained in:
Luis Ángel San Martín
2021-01-21 21:39:22 +01:00
parent 3f6c44ce7a
commit 58fdf0af23
16 changed files with 313 additions and 18 deletions

View File

@ -0,0 +1,29 @@
#include "whats_new_controller.h"
#include "whats_new_dialog.h"
#include "yacreader_global.h"
#include <QtCore>
YACReader::WhatsNewController::WhatsNewController() { }
void YACReader::WhatsNewController::showWhatsNewIfNeeded(QWidget *fromParent)
{
QSettings commonSettings(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) +
"/YACReader/YACReaderCommon.ini",
QSettings::IniFormat);
if (commonSettings.value("LAST_VERSION_INSTALLED").toString() != VERSION) {
showWhatsNew(fromParent);
commonSettings.setValue("LAST_VERSION_INSTALLED", VERSION);
}
}
void YACReader::WhatsNewController::showWhatsNew(QWidget *fromParent)
{
auto whatsNewDialog = new WhatsNewDialog(fromParent);
whatsNewDialog->show();
QObject::connect(whatsNewDialog, &QDialog::finished, whatsNewDialog, &QDialog::deleteLater);
}