logic: Rewrote license checking logic for trial and app merge
This commit is contained in:
@@ -11,9 +11,9 @@
|
||||
#include "utility/messaging/type/MessageChangeFileView.h"
|
||||
#include "utility/messaging/type/MessageProjectEdit.h"
|
||||
|
||||
#include "Application.h"
|
||||
#include "data/location/TokenLocation.h"
|
||||
#include "data/location/TokenLocationFile.h"
|
||||
#include "isTrial.h"
|
||||
#include "qt/element/QtCodeNavigator.h"
|
||||
#include "qt/element/QtCodeSnippet.h"
|
||||
#include "qt/utility/utilityQt.h"
|
||||
@@ -144,7 +144,7 @@ QtCodeSnippet* QtCodeFile::addCodeSnippet(const CodeSnippetParams& params)
|
||||
title->setFixedHeight(std::max(title->fontMetrics().height() * 1.2, 28.0));
|
||||
title->setSizePolicy(title->sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
|
||||
|
||||
if (isTrial())
|
||||
if (Application::getInstance()->isInTrial())
|
||||
{
|
||||
title->setEnabled(false);
|
||||
}
|
||||
@@ -404,7 +404,7 @@ void QtCodeFile::updateSnippets()
|
||||
|
||||
void QtCodeFile::updateTitleBar()
|
||||
{
|
||||
if (isTrial())
|
||||
if (Application::getInstance()->isInTrial())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "settings/ApplicationSettings.h"
|
||||
#include "settings/ColorScheme.h"
|
||||
#include "isTrial.h"
|
||||
|
||||
QtRefreshBar::QtRefreshBar()
|
||||
{
|
||||
@@ -28,10 +27,7 @@ QtRefreshBar::QtRefreshBar()
|
||||
m_refreshButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
layout->addWidget(m_refreshButton);
|
||||
|
||||
if (isTrial())
|
||||
{
|
||||
m_refreshButton->setEnabled(false);
|
||||
}
|
||||
m_refreshButton->setEnabled(false);
|
||||
|
||||
connect(m_refreshButton, SIGNAL(clicked()), this, SLOT(refreshClicked()));
|
||||
|
||||
@@ -59,3 +55,13 @@ void QtRefreshBar::refreshStyle()
|
||||
ColorScheme::getInstance()->getColor("search/button/icon").c_str()
|
||||
));
|
||||
}
|
||||
|
||||
void QtRefreshBar::handleMessage(MessageEnteredLicense* message)
|
||||
{
|
||||
m_onQtThread(
|
||||
[=]()
|
||||
{
|
||||
m_refreshButton->setEnabled(true);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,10 +3,15 @@
|
||||
|
||||
#include <QFrame>
|
||||
|
||||
#include "qt/utility/QtThreadedFunctor.h"
|
||||
#include "utility/messaging/type/MessageEnteredLicense.h"
|
||||
#include "utility/messaging/MessageListener.h"
|
||||
|
||||
class QPushButton;
|
||||
|
||||
class QtRefreshBar
|
||||
: public QFrame
|
||||
, public MessageListener<MessageEnteredLicense>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -20,6 +25,10 @@ private slots:
|
||||
void refreshClicked();
|
||||
|
||||
private:
|
||||
virtual void handleMessage(MessageEnteredLicense* message);
|
||||
|
||||
QtThreadedLambdaFunctor m_onQtThread;
|
||||
|
||||
QPushButton* m_refreshButton;
|
||||
};
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ void QtMainView::doSetTitle(const std::string& title)
|
||||
void QtMainView::doActivateWindow()
|
||||
{
|
||||
// It's platform dependent which of these commands does the right thing, for now we just use them all at once.
|
||||
m_window->activateWindow();
|
||||
m_window->setEnabled(true);
|
||||
m_window->raise();
|
||||
m_window->setFocus(Qt::ActiveWindowFocusReason);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <QTextEdit>
|
||||
|
||||
#include "licenses.h"
|
||||
#include "isTrial.h"
|
||||
|
||||
QtAboutLicense::QtAboutLicense(QWidget *parent)
|
||||
: QtWindow(parent)
|
||||
@@ -30,30 +29,27 @@ void QtAboutLicense::populateWindow(QWidget* widget)
|
||||
|
||||
for (ThirdPartyLicense license : licenses3rdParties)
|
||||
{
|
||||
if( !(isTrial() && license.isNotInTrial) )
|
||||
{
|
||||
QLabel* licenseName = new QLabel();
|
||||
licenseName->setText( QString::fromLatin1(license.name));
|
||||
QFont _font = licenseName->font();
|
||||
_font.setPixelSize(36);
|
||||
_font.setBold(true);
|
||||
licenseName->setFont(_font);
|
||||
layout->addWidget(licenseName);
|
||||
QLabel* licenseName = new QLabel();
|
||||
licenseName->setText( QString::fromLatin1(license.name));
|
||||
QFont _font = licenseName->font();
|
||||
_font.setPixelSize(36);
|
||||
_font.setBold(true);
|
||||
licenseName->setFont(_font);
|
||||
layout->addWidget(licenseName);
|
||||
|
||||
QLabel* licenseURL = new QLabel();
|
||||
licenseURL->setText(QString::fromLatin1("(<a href=\"%1\">Website</a>)")
|
||||
.arg(QString::fromLatin1(license.url)));
|
||||
licenseURL->setOpenExternalLinks(true);
|
||||
layout->addWidget(licenseURL);
|
||||
QLabel* licenseURL = new QLabel();
|
||||
licenseURL->setText(QString::fromLatin1("(<a href=\"%1\">Website</a>)")
|
||||
.arg(QString::fromLatin1(license.url)));
|
||||
licenseURL->setOpenExternalLinks(true);
|
||||
layout->addWidget(licenseURL);
|
||||
|
||||
QLabel* licenseText = new QLabel();
|
||||
licenseText->setFixedWidth(450);
|
||||
licenseText->setWordWrap(true);
|
||||
licenseText->setText(QString::fromLatin1(license.license));
|
||||
layout->addWidget(licenseText);
|
||||
QLabel* licenseText = new QLabel();
|
||||
licenseText->setFixedWidth(450);
|
||||
licenseText->setWordWrap(true);
|
||||
licenseText->setText(QString::fromLatin1(license.license));
|
||||
layout->addWidget(licenseText);
|
||||
|
||||
layout->addSpacing(50);
|
||||
}
|
||||
layout->addSpacing(50);
|
||||
}
|
||||
|
||||
widget->setLayout(layout);
|
||||
|
||||
@@ -8,12 +8,10 @@
|
||||
#include "LicenseChecker.h"
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "utility/file/FilePath.h"
|
||||
#include "utility/messaging/type/MessageEnteredLicense.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
|
||||
QtLicense::QtLicense(QWidget *parent)
|
||||
: QtWindow(parent)
|
||||
, m_forced(false)
|
||||
{
|
||||
raise();
|
||||
}
|
||||
@@ -47,16 +45,9 @@ void QtLicense::load()
|
||||
m_licenseText->setText(licenseString.c_str());
|
||||
}
|
||||
|
||||
m_forced = false;
|
||||
updateCloseButton("Cancel");
|
||||
}
|
||||
|
||||
void QtLicense::loadForced()
|
||||
{
|
||||
m_forced = true;
|
||||
updateCloseButton("Quit Coati");
|
||||
}
|
||||
|
||||
void QtLicense::setErrorMessage(const QString& errorMessage)
|
||||
{
|
||||
if (m_errorLabel)
|
||||
@@ -135,18 +126,6 @@ void QtLicense::windowReady()
|
||||
m_title->hide();
|
||||
}
|
||||
|
||||
void QtLicense::handleClose()
|
||||
{
|
||||
if (m_forced)
|
||||
{
|
||||
QApplication::quit();
|
||||
}
|
||||
else
|
||||
{
|
||||
emit canceled();
|
||||
}
|
||||
}
|
||||
|
||||
void QtLicense::handleNext()
|
||||
{
|
||||
std::string licenseString = m_licenseText->toPlainText().toStdString();
|
||||
@@ -174,9 +153,6 @@ void QtLicense::handleNext()
|
||||
case LicenseChecker::LICENSE_VALID:
|
||||
{
|
||||
checker->saveCurrentLicenseString(licenseString);
|
||||
MessageEnteredLicense().dispatch();
|
||||
|
||||
setCancelAble(true);
|
||||
m_errorLabel->setText(" ");
|
||||
|
||||
emit finished();
|
||||
|
||||
@@ -18,7 +18,6 @@ public:
|
||||
|
||||
void clear();
|
||||
void load();
|
||||
void loadForced();
|
||||
|
||||
void setErrorMessage(const QString& errorMessage);
|
||||
|
||||
@@ -28,13 +27,10 @@ protected:
|
||||
virtual void windowReady() override;
|
||||
|
||||
virtual void handleNext() override;
|
||||
virtual void handleClose() override;
|
||||
|
||||
private:
|
||||
QTextEdit* m_licenseText;
|
||||
QLabel* m_errorLabel;
|
||||
|
||||
bool m_forced;
|
||||
};
|
||||
|
||||
#endif // QT_LICENSE_H
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "Application.h"
|
||||
#include "component/view/View.h"
|
||||
#include "component/view/CompositeView.h"
|
||||
#include "LicenseChecker.h"
|
||||
#include "qt/utility/QtContextMenu.h"
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "qt/view/QtViewWidgetWrapper.h"
|
||||
@@ -26,6 +27,7 @@
|
||||
#include "utility/logging/logging.h"
|
||||
#include "utility/messaging/type/MessageCodeReference.h"
|
||||
#include "utility/messaging/type/MessageDispatchWhenLicenseValid.h"
|
||||
#include "utility/messaging/type/MessageEnteredLicense.h"
|
||||
#include "utility/messaging/type/MessageFind.h"
|
||||
#include "utility/messaging/type/MessageInterruptTasks.h"
|
||||
#include "utility/messaging/type/MessageLoadProject.h"
|
||||
@@ -40,7 +42,6 @@
|
||||
#include "utility/tracing.h"
|
||||
#include "utility/UserPaths.h"
|
||||
#include "version.h"
|
||||
#include "isTrial.h"
|
||||
|
||||
QtViewToggle::QtViewToggle(View* view, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
@@ -278,16 +279,11 @@ void QtMainWindow::forceEnterLicense(bool expired)
|
||||
{
|
||||
enterLicenseWindow->clear();
|
||||
}
|
||||
|
||||
enterLicenseWindow->loadForced();
|
||||
|
||||
this->setEnabled(false);
|
||||
enterLicenseWindow->setEnabled(true);
|
||||
}
|
||||
|
||||
bool QtMainWindow::event(QEvent* event)
|
||||
{
|
||||
if (isEnabled() && event->type() == QEvent::WindowActivate)
|
||||
if (event->type() == QEvent::WindowActivate)
|
||||
{
|
||||
MessageWindowFocus().dispatch();
|
||||
}
|
||||
@@ -318,12 +314,6 @@ void QtMainWindow::contextMenuEvent(QContextMenuEvent* event)
|
||||
QtContextMenu::getInstance()->showDefault(event, this);
|
||||
}
|
||||
|
||||
void QtMainWindow::activateWindow()
|
||||
{
|
||||
this->setEnabled(true);
|
||||
m_windowStack.popWindow();
|
||||
}
|
||||
|
||||
void QtMainWindow::about()
|
||||
{
|
||||
QtAbout* aboutWindow = createWindow<QtAbout>();
|
||||
@@ -358,11 +348,30 @@ void QtMainWindow::enterLicense()
|
||||
enterLicenseWindow->setup();
|
||||
|
||||
disconnect(enterLicenseWindow, SIGNAL(finished()), &m_windowStack, SLOT(clearWindows()));
|
||||
connect(enterLicenseWindow, SIGNAL(finished()), this, SLOT(activateWindow()));
|
||||
connect(enterLicenseWindow, SIGNAL(finished()), this, SLOT(enteredLicense()));
|
||||
|
||||
enterLicenseWindow->load();
|
||||
}
|
||||
|
||||
void QtMainWindow::enteredLicense()
|
||||
{
|
||||
bool showStartWindow = false;
|
||||
if (m_windowStack.getWindowCount() > 0 && dynamic_cast<QtStartScreen*>(m_windowStack.getBottomWindow()))
|
||||
{
|
||||
showStartWindow = true;
|
||||
}
|
||||
|
||||
m_windowStack.clearWindows();
|
||||
|
||||
setTrialActionsEnabled(true);
|
||||
MessageEnteredLicense().dispatch();
|
||||
|
||||
if (showStartWindow)
|
||||
{
|
||||
showStartScreen();
|
||||
}
|
||||
}
|
||||
|
||||
void QtMainWindow::showDataFolder()
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl(("file:///" + UserPaths::getUserDataPath()).c_str(), QUrl::TolerantMode));
|
||||
@@ -376,10 +385,31 @@ void QtMainWindow::showLogFolder()
|
||||
void QtMainWindow::showStartScreen()
|
||||
{
|
||||
QtStartScreen* startScreen = createWindow<QtStartScreen>();
|
||||
startScreen->setupStartScreen();
|
||||
|
||||
LicenseChecker::LicenseState state = LicenseChecker::getInstance()->checkCurrentLicense();
|
||||
bool licenseValid = (state == LicenseChecker::LICENSE_VALID);
|
||||
|
||||
startScreen->setupStartScreen(licenseValid);
|
||||
setTrialActionsEnabled(licenseValid);
|
||||
|
||||
if (licenseValid)
|
||||
{
|
||||
MessageEnteredLicense().dispatch();
|
||||
}
|
||||
|
||||
connect(startScreen, SIGNAL(openOpenProjectDialog()), this, SLOT(openProject()));
|
||||
connect(startScreen, SIGNAL(openNewProjectDialog()), this, SLOT(newProject()));
|
||||
connect(startScreen, SIGNAL(openEnterLicenseDialog()), this, SLOT(enterLicense()));
|
||||
|
||||
if (state == LicenseChecker::LICENSE_MOVED)
|
||||
{
|
||||
ApplicationSettings::getInstance()->setLicenseString("");
|
||||
}
|
||||
|
||||
if (state != LicenseChecker::LICENSE_VALID && state != LicenseChecker::LICENSE_EMPTY)
|
||||
{
|
||||
forceEnterLicense(state == LicenseChecker::LICENSE_EXPIRED);
|
||||
}
|
||||
}
|
||||
|
||||
void QtMainWindow::hideStartScreen()
|
||||
@@ -411,7 +441,8 @@ void QtMainWindow::openProject(const QString &path)
|
||||
if (!fileName.isEmpty())
|
||||
{
|
||||
MessageDispatchWhenLicenseValid(
|
||||
std::make_shared<MessageLoadProject>(fileName.toStdString(), false)
|
||||
std::make_shared<MessageLoadProject>(fileName.toStdString(), false),
|
||||
true
|
||||
).dispatch();
|
||||
m_windowStack.clearWindows();
|
||||
}
|
||||
@@ -551,11 +582,8 @@ void QtMainWindow::setupProjectMenu()
|
||||
QMenu *menu = new QMenu(tr("&Project"), this);
|
||||
menuBar()->addMenu(menu);
|
||||
|
||||
if(!isTrial())
|
||||
{
|
||||
menu->addAction(tr("&New Project..."), this, SLOT(newProject()), QKeySequence::New);
|
||||
menu->addAction(tr("&Open Project..."), this, SLOT(openProject()), QKeySequence::Open);
|
||||
}
|
||||
m_trialDisabledActions.push_back(menu->addAction(tr("&New Project..."), this, SLOT(newProject()), QKeySequence::New));
|
||||
m_trialDisabledActions.push_back(menu->addAction(tr("&Open Project..."), this, SLOT(openProject()), QKeySequence::Open));
|
||||
|
||||
QMenu *recentProjectMenu = new QMenu(tr("Recent Projects"));
|
||||
menu->addMenu(recentProjectMenu);
|
||||
@@ -574,12 +602,8 @@ void QtMainWindow::setupProjectMenu()
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
if(!isTrial())
|
||||
{
|
||||
menu->addAction(tr("&Edit Project..."), this, SLOT(editProject()));
|
||||
|
||||
menu->addSeparator();
|
||||
}
|
||||
m_trialDisabledActions.push_back(menu->addAction(tr("&Edit Project..."), this, SLOT(editProject())));
|
||||
m_trialDisabledActions.push_back(menu->addSeparator());
|
||||
|
||||
menu->addAction(tr("E&xit"), QCoreApplication::instance(), SLOT(quit()), QKeySequence::Quit);
|
||||
}
|
||||
@@ -593,22 +617,21 @@ void QtMainWindow::setupEditMenu()
|
||||
menu->addAction(tr("Forward"), this, SLOT(redo()), QKeySequence::Redo);
|
||||
|
||||
menu->addSeparator();
|
||||
if(!isTrial())
|
||||
m_trialDisabledActions.push_back(menu->addAction(tr("&Refresh"), this, SLOT(refresh()), QKeySequence::Refresh));
|
||||
if (QSysInfo::windowsVersion() != QSysInfo::WV_None)
|
||||
{
|
||||
menu->addAction(tr("&Refresh"), this, SLOT(refresh()), QKeySequence::Refresh);
|
||||
if (QSysInfo::windowsVersion() != QSysInfo::WV_None)
|
||||
{
|
||||
menu->addAction(tr("&Force Refresh"), this, SLOT(forceRefresh()), QKeySequence(Qt::SHIFT + Qt::Key_F5));
|
||||
}
|
||||
else
|
||||
{
|
||||
menu->addAction(
|
||||
tr("&Force Refresh"),
|
||||
this,
|
||||
SLOT(forceRefresh()),
|
||||
QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_R)
|
||||
);
|
||||
}
|
||||
m_trialDisabledActions.push_back(
|
||||
menu->addAction(tr("&Force Refresh"), this, SLOT(forceRefresh()), QKeySequence(Qt::SHIFT + Qt::Key_F5))
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_trialDisabledActions.push_back(menu->addAction(
|
||||
tr("&Force Refresh"),
|
||||
this,
|
||||
SLOT(forceRefresh()),
|
||||
QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_R)
|
||||
));
|
||||
}
|
||||
|
||||
menu->addSeparator();
|
||||
@@ -661,11 +684,7 @@ void QtMainWindow::setupHelpMenu()
|
||||
menu->addAction(tr("Documentation"), this, SLOT(showDocumentation()));
|
||||
menu->addAction(tr("Bug Tracker"), this, SLOT(showBugtracker()));
|
||||
menu->addAction(tr("Licences"), this, SLOT(showLicenses()));
|
||||
|
||||
if(!isTrial())
|
||||
{
|
||||
menu->addAction(tr("Enter License..."), this, SLOT(enterLicense()));
|
||||
}
|
||||
menu->addAction(tr("Enter License..."), this, SLOT(enterLicense()));
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
@@ -673,6 +692,14 @@ void QtMainWindow::setupHelpMenu()
|
||||
menu->addAction(tr("Show Log Folder"), this, SLOT(showLogFolder()));
|
||||
}
|
||||
|
||||
void QtMainWindow::setTrialActionsEnabled(bool enabled)
|
||||
{
|
||||
for (QAction* action : m_trialDisabledActions)
|
||||
{
|
||||
action->setEnabled(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
QtMainWindow::DockWidget* QtMainWindow::getDockWidgetForView(View* view)
|
||||
{
|
||||
for (DockWidget& dock : m_dockWidgets)
|
||||
|
||||
@@ -93,14 +93,13 @@ protected:
|
||||
void contextMenuEvent(QContextMenuEvent* event);
|
||||
|
||||
public slots:
|
||||
void activateWindow();
|
||||
|
||||
void about();
|
||||
void openSettings();
|
||||
void showBugtracker();
|
||||
void showDocumentation();
|
||||
void showLicenses();
|
||||
void enterLicense();
|
||||
void enteredLicense();
|
||||
|
||||
void showDataFolder();
|
||||
void showLogFolder();
|
||||
@@ -151,6 +150,8 @@ private:
|
||||
void setupViewMenu();
|
||||
void setupHelpMenu();
|
||||
|
||||
void setTrialActionsEnabled(bool enabled);
|
||||
|
||||
DockWidget* getDockWidgetForView(View* view);
|
||||
|
||||
void setShowDockWidgetTitleBars(bool showTitleBars);
|
||||
@@ -166,6 +167,8 @@ private:
|
||||
|
||||
bool m_showDockWidgetTitleBars;
|
||||
|
||||
std::vector<QAction*> m_trialDisabledActions;
|
||||
|
||||
QtWindowStack m_windowStack;
|
||||
};
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "utility/logging/logging.h"
|
||||
#include "utility/Version.h"
|
||||
#include "isTrial.h"
|
||||
|
||||
QtRecentProjectButton::QtRecentProjectButton(QWidget* parent)
|
||||
: QPushButton(parent)
|
||||
@@ -49,7 +48,8 @@ void QtRecentProjectButton::handleButtonClick()
|
||||
if (m_projectExists)
|
||||
{
|
||||
MessageDispatchWhenLicenseValid(
|
||||
std::make_shared<MessageLoadProject>(m_projectFilePath.str(), false)
|
||||
std::make_shared<MessageLoadProject>(m_projectFilePath.str(), false),
|
||||
true
|
||||
).dispatch();
|
||||
}
|
||||
else
|
||||
@@ -121,7 +121,7 @@ void QtStartScreen::updateButtons()
|
||||
setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath() + "startscreen/startscreen.css").c_str());
|
||||
}
|
||||
|
||||
void QtStartScreen::setupStartScreen()
|
||||
void QtStartScreen::setupStartScreen(bool unlocked)
|
||||
{
|
||||
setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath() + "startscreen/startscreen.css").c_str());
|
||||
addLogo();
|
||||
@@ -135,7 +135,7 @@ void QtStartScreen::setupStartScreen()
|
||||
QVBoxLayout* col = new QVBoxLayout();
|
||||
layout->addLayout(col, 2);
|
||||
|
||||
if (isTrial())
|
||||
if (!unlocked)
|
||||
{
|
||||
col->addSpacing(50);
|
||||
|
||||
@@ -153,6 +153,18 @@ void QtStartScreen::setupStartScreen()
|
||||
col->addWidget(welcomeLabel, 0, Qt::AlignHCenter | Qt::AlignTop);
|
||||
col->addStretch();
|
||||
|
||||
QPushButton* unlockButton = new QPushButton("Unlock", this);
|
||||
unlockButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
unlockButton->setObjectName("projectButton");
|
||||
unlockButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
connect(unlockButton, SIGNAL(clicked()), this, SLOT(handleUnlockButton()));
|
||||
col->addWidget(unlockButton);
|
||||
|
||||
QHBoxLayout* row = new QHBoxLayout();
|
||||
row->addWidget(unlockButton);
|
||||
row->addStretch();
|
||||
col->addLayout(row);
|
||||
|
||||
layout->addStretch(1);
|
||||
}
|
||||
else
|
||||
@@ -194,7 +206,7 @@ void QtStartScreen::setupStartScreen()
|
||||
layout->addLayout(col, 1);
|
||||
|
||||
QLabel* recentProjectsLabel = new QLabel("Recent Projects: ", this);
|
||||
if (isTrial())
|
||||
if (!unlocked)
|
||||
{
|
||||
recentProjectsLabel->setText("Projects:");
|
||||
}
|
||||
@@ -243,6 +255,11 @@ void QtStartScreen::handleOpenProjectButton()
|
||||
emit openOpenProjectDialog();
|
||||
}
|
||||
|
||||
void QtStartScreen::handleUnlockButton()
|
||||
{
|
||||
emit openEnterLicenseDialog();
|
||||
}
|
||||
|
||||
void QtStartScreen::handleRecentButton()
|
||||
{
|
||||
emit finished();
|
||||
|
||||
@@ -34,15 +34,17 @@ public:
|
||||
QtStartScreen(QWidget* parent = 0);
|
||||
QSize sizeHint() const override;
|
||||
|
||||
void setupStartScreen();
|
||||
void setupStartScreen(bool unlocked);
|
||||
|
||||
signals:
|
||||
void openOpenProjectDialog();
|
||||
void openNewProjectDialog();
|
||||
void openEnterLicenseDialog();
|
||||
|
||||
private slots:
|
||||
void handleNewProjectButton();
|
||||
void handleOpenProjectButton();
|
||||
void handleUnlockButton();
|
||||
void handleRecentButton();
|
||||
void updateButtons();
|
||||
|
||||
|
||||
@@ -21,6 +21,16 @@ QtWindowStackElement* QtWindowStack::getTopWindow()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QtWindowStackElement* QtWindowStack::getBottomWindow()
|
||||
{
|
||||
if (m_stack.size())
|
||||
{
|
||||
return m_stack.front();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
size_t QtWindowStack::getWindowCount()
|
||||
{
|
||||
return m_stack.size();
|
||||
|
||||
@@ -30,6 +30,7 @@ public:
|
||||
QtWindowStack(QObject* parent = nullptr);
|
||||
|
||||
QtWindowStackElement* getTopWindow();
|
||||
QtWindowStackElement* getBottomWindow();
|
||||
size_t getWindowCount();
|
||||
|
||||
public slots:
|
||||
|
||||
Reference in New Issue
Block a user