logic: Allow project opening in trial mode
* added open project button to start screen in trial mode * allow ide communication in trial
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
#include <QFileOpenEvent>
|
||||
|
||||
#include "utility/file/FilePath.h"
|
||||
#include "utility/messaging/type/MessageDispatchWhenLicenseValid.h"
|
||||
#include "utility/messaging/type/MessageLoadProject.h"
|
||||
#include "utility/logging/LogManager.h"
|
||||
#include "component/controller/LogController.h"
|
||||
@@ -36,9 +35,7 @@ bool QtApplication::event(QEvent *event)
|
||||
|
||||
if (path.exists() && path.extension() == ".coatiproject")
|
||||
{
|
||||
MessageDispatchWhenLicenseValid(
|
||||
std::make_shared<MessageLoadProject>(path.str(), false)
|
||||
).dispatch();
|
||||
MessageLoadProject(path.str(), false).dispatch();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "utility/file/FileSystem.h"
|
||||
#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"
|
||||
@@ -420,9 +419,7 @@ void QtMainWindow::openProject()
|
||||
|
||||
if (!fileName.isEmpty())
|
||||
{
|
||||
MessageDispatchWhenLicenseValid(
|
||||
std::make_shared<MessageLoadProject>(fileName.toStdString(), false)
|
||||
).dispatch();
|
||||
MessageLoadProject(fileName.toStdString(), false).dispatch();
|
||||
m_windowStack.clearWindows();
|
||||
}
|
||||
}
|
||||
@@ -563,7 +560,7 @@ void QtMainWindow::setupProjectMenu()
|
||||
menuBar()->addMenu(menu);
|
||||
|
||||
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));
|
||||
menu->addAction(tr("&Open Project..."), this, SLOT(openProject()), QKeySequence::Open);
|
||||
|
||||
QMenu *recentProjectMenu = new QMenu(tr("Recent Projects"));
|
||||
menu->addMenu(recentProjectMenu);
|
||||
|
||||
@@ -150,7 +150,7 @@ void QtStartScreen::setupStartScreen(bool unlocked)
|
||||
|
||||
if (!unlocked)
|
||||
{
|
||||
col->addSpacing(50);
|
||||
col->addSpacing(4);
|
||||
|
||||
QLabel* welcomeLabel = new QLabel(
|
||||
"Welcome to the <b>Coati trial</b>!<br /><br />"
|
||||
@@ -166,12 +166,20 @@ void QtStartScreen::setupStartScreen(bool unlocked)
|
||||
col->addWidget(welcomeLabel, 0, Qt::AlignHCenter | Qt::AlignTop);
|
||||
col->addStretch();
|
||||
|
||||
QPushButton* openProjectButton = new QPushButton("Open Project", this);
|
||||
openProjectButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
openProjectButton->setObjectName("projectButton");
|
||||
openProjectButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
connect(openProjectButton, SIGNAL(clicked()), this, SLOT(handleOpenProjectButton()));
|
||||
col->addWidget(openProjectButton);
|
||||
|
||||
col->addSpacing(8);
|
||||
|
||||
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);
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "settings/JavaProjectSettings.h"
|
||||
#include "utility/file/FileSystem.h"
|
||||
#include "utility/logging/logging.h"
|
||||
#include "utility/messaging/type/MessageDispatchWhenLicenseValid.h"
|
||||
#include "utility/messaging/type/MessageLoadProject.h"
|
||||
#include "utility/messaging/type/MessagePluginPortChange.h"
|
||||
#include "utility/messaging/type/MessageRefresh.h"
|
||||
@@ -681,9 +680,7 @@ void QtProjectWizzard::createProject()
|
||||
MessageStatus("Created project: " + path.str()).dispatch();
|
||||
}
|
||||
|
||||
MessageDispatchWhenLicenseValid(
|
||||
std::make_shared<MessageLoadProject>(path, forceRefreshProject)
|
||||
).dispatch();
|
||||
MessageLoadProject(path, forceRefreshProject).dispatch();
|
||||
|
||||
finishWizzard();
|
||||
}
|
||||
@@ -710,11 +707,7 @@ void QtProjectWizzard::savePreferences()
|
||||
Project* currentProject = Application::getInstance()->getCurrentProject().get();
|
||||
if (currentProject)
|
||||
{
|
||||
MessageDispatchWhenLicenseValid(
|
||||
std::make_shared<MessageLoadProject>(
|
||||
currentProject->getProjectSettingsFilePath(), true
|
||||
)
|
||||
).dispatch();
|
||||
MessageLoadProject(currentProject->getProjectSettingsFilePath(), true).dispatch();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user