Some code clean-up.

This commit is contained in:
LoRd_MuldeR 2017-12-06 02:13:00 +01:00
parent 25debe1d8e
commit 0012af66a7
2 changed files with 46 additions and 31 deletions

View File

@ -35,7 +35,7 @@
#define VER_LAMEXP_MINOR_LO 6 #define VER_LAMEXP_MINOR_LO 6
#define VER_LAMEXP_TYPE Beta #define VER_LAMEXP_TYPE Beta
#define VER_LAMEXP_PATCH 1 #define VER_LAMEXP_PATCH 1
#define VER_LAMEXP_BUILD 2060 #define VER_LAMEXP_BUILD 2061
#define VER_LAMEXP_CONFG 2002 #define VER_LAMEXP_CONFG 2002
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -1452,24 +1452,45 @@ void MainWindow::windowShown(void)
//First run? //First run?
const bool firstRun = arguments.contains("first-run"); const bool firstRun = arguments.contains("first-run");
if (firstRun)
//Check license
if((m_settings->licenseAccepted() <= 0) || firstRun)
{ {
int iAccepted = m_settings->licenseAccepted(); m_settings->licenseAccepted(0);
m_settings->autoUpdateCheckBeta(false);
if((iAccepted == 0) || firstRun) m_settings->syncNow();
{
AboutDialog *about = new AboutDialog(m_settings, this, true);
iAccepted = about->exec();
if(iAccepted <= 0) iAccepted = -2;
MUTILS_DELETE(about);
} }
if(iAccepted <= 0) //Check license
if (m_settings->licenseAccepted() <= 0)
{ {
m_settings->licenseAccepted(++iAccepted); if (m_settings->licenseAccepted() == 0)
{
QScopedPointer<AboutDialog> about(new AboutDialog(m_settings, this, true));
if (about->exec() > 0)
{
m_settings->licenseAccepted(1);
m_settings->syncNow(); m_settings->syncNow();
MUtils::Sound::play_sound("woohoo", false);
if (lamexp_version_demo())
{
showAnnounceBox();
}
}
else
{
m_settings->licenseAccepted(-1);
m_settings->syncNow();
}
}
else
{
m_settings->licenseAccepted(0);
m_settings->syncNow();
}
}
//License declined?
if(m_settings->licenseAccepted() <= 0)
{
QApplication::processEvents(); QApplication::processEvents();
MUtils::Sound::play_sound("whammy", false); MUtils::Sound::play_sound("whammy", false);
QMessageBox::critical(this, tr("License Declined"), tr("You have declined the license. Consequently the application will exit now!"), tr("Goodbye!")); QMessageBox::critical(this, tr("License Declined"), tr("You have declined the license. Consequently the application will exit now!"), tr("Goodbye!"));
@ -1487,12 +1508,6 @@ void MainWindow::windowShown(void)
return; return;
} }
MUtils::Sound::play_sound("woohoo", false);
m_settings->licenseAccepted(1);
m_settings->syncNow();
if(lamexp_version_demo()) showAnnounceBox();
}
//Check for expiration //Check for expiration
if(lamexp_version_demo()) if(lamexp_version_demo())
{ {