logic: iterated on license checking
- moved LicenseChecker from App to Lib project - added MessageDispatchWhenLicenseValid. This message takes another message as an argument which is dispatched once the LicenseChecher confirms the current license key or (if the key is invalid) once the user entered a valid key. This message is used when messages are sent that should not be working when no license key has been entered (LoadProject or ActivateTokenLocation via the IDE communication). - added MessageShowStartScreen which makes the MainView display this screen. This message is also sent via the MessageDispatchWhenLicenseValid. - removed startup project from appsettings.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "settings/ProjectSettings.h"
|
||||
#include "utility/file/FileSystem.h"
|
||||
#include "utility/logging/logging.h"
|
||||
#include "utility/messaging/type/MessageDispatchWhenLicenseValid.h"
|
||||
#include "utility/messaging/type/MessageFind.h"
|
||||
#include "utility/messaging/type/MessageInterruptTasks.h"
|
||||
#include "utility/messaging/type/MessageLoadProject.h"
|
||||
@@ -130,7 +131,6 @@ void MouseWheelFilter::stopWaiting()
|
||||
QtMainWindow::QtMainWindow()
|
||||
: m_showDockWidgetTitleBars(true)
|
||||
, m_windowStack(this)
|
||||
, m_createNewProjectFunctor(std::bind(&QtMainWindow::doCreateNewProject, this, std::placeholders::_1))
|
||||
{
|
||||
setObjectName("QtMainWindow");
|
||||
setCentralWidget(nullptr);
|
||||
@@ -161,11 +161,6 @@ QtMainWindow::QtMainWindow()
|
||||
loadLayout();
|
||||
}
|
||||
|
||||
void QtMainWindow::init()
|
||||
{
|
||||
showStartScreen();
|
||||
}
|
||||
|
||||
QtMainWindow::~QtMainWindow()
|
||||
{
|
||||
if (m_recentProjectAction)
|
||||
@@ -285,12 +280,6 @@ void QtMainWindow::forceEnterLicense()
|
||||
enterLicenseWindow->setEnabled(true);
|
||||
}
|
||||
|
||||
void QtMainWindow::handleMessage(MessageProjectNew* message)
|
||||
{
|
||||
MessageProjectNew msg(*message);
|
||||
m_createNewProjectFunctor(msg);
|
||||
}
|
||||
|
||||
bool QtMainWindow::event(QEvent* event)
|
||||
{
|
||||
if (event->type() == QEvent::WindowActivate)
|
||||
@@ -374,6 +363,12 @@ void QtMainWindow::newProject()
|
||||
wizzard->newProject();
|
||||
}
|
||||
|
||||
void QtMainWindow::newProjectFromSolution(const std::string& ideId, const std::string& solutionPath)
|
||||
{
|
||||
QtProjectWizzard* wizzard = createWindow<QtProjectWizzard>();
|
||||
wizzard->newProjectFromSolution(ideId, solutionPath);
|
||||
}
|
||||
|
||||
void QtMainWindow::openProject(const QString &path)
|
||||
{
|
||||
QString fileName = path;
|
||||
@@ -385,7 +380,9 @@ void QtMainWindow::openProject(const QString &path)
|
||||
|
||||
if (!fileName.isEmpty())
|
||||
{
|
||||
MessageLoadProject(fileName.toStdString(), false).dispatch();
|
||||
MessageDispatchWhenLicenseValid(
|
||||
std::make_shared<MessageLoadProject>(fileName.toStdString(), false)
|
||||
).dispatch();
|
||||
m_windowStack.clearWindows();
|
||||
}
|
||||
}
|
||||
@@ -573,20 +570,6 @@ void QtMainWindow::toggleShowDockWidgetTitleBars()
|
||||
setShowDockWidgetTitleBars(!m_showDockWidgetTitleBars);
|
||||
}
|
||||
|
||||
void QtMainWindow::doCreateNewProject(MessageProjectNew message)
|
||||
{
|
||||
QtProjectWizzard* wizzard = createWindow<QtProjectWizzard>();
|
||||
|
||||
if (message.fromSolution())
|
||||
{
|
||||
wizzard->newProjectFromSolution(message.ideId ,message.solutionPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
wizzard->newProject();
|
||||
}
|
||||
}
|
||||
|
||||
void QtMainWindow::setupEditMenu()
|
||||
{
|
||||
QMenu *menu = new QMenu(tr("&Edit"), this);
|
||||
|
||||
Reference in New Issue
Block a user