logic: refactored license checking
This commit is contained in:
@@ -429,20 +429,14 @@ void QtMainWindow::newProjectFromSolution(const std::string& ideId, const std::s
|
||||
wizzard->newProjectFromSolution(ideId, solutionPath);
|
||||
}
|
||||
|
||||
void QtMainWindow::openProject(const QString &path)
|
||||
void QtMainWindow::openProject()
|
||||
{
|
||||
QString fileName = path;
|
||||
|
||||
if (fileName.isNull())
|
||||
{
|
||||
fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "", "Coati Project Files (*.coatiproject)");
|
||||
}
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "", "Coati Project Files (*.coatiproject)");
|
||||
|
||||
if (!fileName.isEmpty())
|
||||
{
|
||||
MessageDispatchWhenLicenseValid(
|
||||
std::make_shared<MessageLoadProject>(fileName.toStdString(), false),
|
||||
true
|
||||
std::make_shared<MessageLoadProject>(fileName.toStdString(), false)
|
||||
).dispatch();
|
||||
m_windowStack.clearWindows();
|
||||
}
|
||||
@@ -535,7 +529,8 @@ void QtMainWindow::openRecentProject()
|
||||
QAction *action = qobject_cast<QAction *>(sender());
|
||||
if (action)
|
||||
{
|
||||
openProject(action->data().toString());
|
||||
MessageLoadProject(action->data().toString().toStdString(), false).dispatch();
|
||||
m_windowStack.clearWindows();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ public slots:
|
||||
|
||||
void newProject();
|
||||
void newProjectFromSolution(const std::string& ideId, const std::string& solutionPath);
|
||||
void openProject(const QString &path = QString());
|
||||
void openProject();
|
||||
void editProject();
|
||||
|
||||
void find();
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#include "settings/ApplicationSettings.h"
|
||||
#include "utility/file/FileSystem.h"
|
||||
#include "utility/messaging/type/MessageDispatchWhenLicenseValid.h"
|
||||
#include "utility/messaging/type/MessageLoadProject.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
|
||||
@@ -47,10 +46,7 @@ void QtRecentProjectButton::handleButtonClick()
|
||||
{
|
||||
if (m_projectExists)
|
||||
{
|
||||
MessageDispatchWhenLicenseValid(
|
||||
std::make_shared<MessageLoadProject>(m_projectFilePath.str(), false),
|
||||
true
|
||||
).dispatch();
|
||||
MessageLoadProject(m_projectFilePath.str(), false).dispatch();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user