mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 04:54:29 -04:00
Add what's new dialog
This commit is contained in:
29
custom_widgets/whats_new_controller.cpp
Normal file
29
custom_widgets/whats_new_controller.cpp
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user