diff --git a/src/lib/component/controller/IDECommunicationController.cpp b/src/lib/component/controller/IDECommunicationController.cpp index 2d9f75e8..ef86435d 100644 --- a/src/lib/component/controller/IDECommunicationController.cpp +++ b/src/lib/component/controller/IDECommunicationController.cpp @@ -105,9 +105,7 @@ void IDECommunicationController::handleSetActiveTokenMessage( MessageStatus("Activating source location from plug-in succeeded: " + message.fileLocation + ", row: " + std::to_string(message.row) + ", col: " + std::to_string(message.column)).dispatch(); - MessageDispatchWhenLicenseValid( - std::make_shared(selectedLocationIds) - ).dispatch(); + MessageActivateTokenLocations(selectedLocationIds).dispatch(); MessageActivateWindow().dispatch(); return; } @@ -116,9 +114,7 @@ void IDECommunicationController::handleSetActiveTokenMessage( Id fileId = m_storageAccess->getTokenIdForFileNode(message.fileLocation); if (fileId > 0) { - MessageDispatchWhenLicenseValid( - std::make_shared(message.fileLocation, message.row) - ).dispatchImmediately(); + MessageActivateFile(message.fileLocation, message.row).dispatchImmediately(); MessageActivateWindow().dispatch(); } else @@ -171,21 +167,21 @@ void IDECommunicationController::handlePing(const NetworkProtocolHelper::PingMes { if (message.valid) { - std::shared_ptr msg = std::make_shared(); - msg->ideId = message.ideId; + MessagePingReceived msg; + msg.ideId = message.ideId; std::string ideName = "unknown"; - if (msg->ideId == "vs") + if (msg.ideId == "vs") { ideName = "Visual Studio"; } // TODO: add the other ides - std::string message = ideName + " instance detected via plugin port"; + std::string statusMessage = ideName + " instance detected via plugin port"; - MessageStatus(message, false, false).dispatch(); - MessageDispatchWhenLicenseValid(msg).dispatch(); + MessageStatus(statusMessage, false, false).dispatch(); + msg.dispatch(); } else { diff --git a/src/lib/utility/commandline/CommandLineParser.cpp b/src/lib/utility/commandline/CommandLineParser.cpp index b73481ac..87f0903a 100644 --- a/src/lib/utility/commandline/CommandLineParser.cpp +++ b/src/lib/utility/commandline/CommandLineParser.cpp @@ -4,7 +4,6 @@ #include "utility/ConfigManager.h" #include "utility/file/FileSystem.h" -#include "utility/messaging/type/MessageDispatchWhenLicenseValid.h" #include "utility/messaging/type/MessageLoadProject.h" #include "utility/messaging/type/MessageStatus.h" #include "utility/text/TextAccess.h" @@ -180,9 +179,7 @@ void CommandLineParser::projectLoad() { if (m_projectFile.exists() && m_projectFile.extension() == ".coatiproject") { - MessageDispatchWhenLicenseValid( - std::make_shared(m_projectFile.str(), m_force) - ).dispatch(); + MessageLoadProject(m_projectFile.str(), m_force).dispatch(); } } diff --git a/src/lib_gui/qt/QtApplication.cpp b/src/lib_gui/qt/QtApplication.cpp index 6522fec2..dfdc298c 100644 --- a/src/lib_gui/qt/QtApplication.cpp +++ b/src/lib_gui/qt/QtApplication.cpp @@ -3,7 +3,6 @@ #include #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(path.str(), false) - ).dispatch(); + MessageLoadProject(path.str(), false).dispatch(); return true; } } diff --git a/src/lib_gui/qt/window/QtMainWindow.cpp b/src/lib_gui/qt/window/QtMainWindow.cpp index 7e6e8189..d1a8b2ed 100644 --- a/src/lib_gui/qt/window/QtMainWindow.cpp +++ b/src/lib_gui/qt/window/QtMainWindow.cpp @@ -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(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); diff --git a/src/lib_gui/qt/window/QtStartScreen.cpp b/src/lib_gui/qt/window/QtStartScreen.cpp index ad3150b7..e8a6f1bf 100644 --- a/src/lib_gui/qt/window/QtStartScreen.cpp +++ b/src/lib_gui/qt/window/QtStartScreen.cpp @@ -150,7 +150,7 @@ void QtStartScreen::setupStartScreen(bool unlocked) if (!unlocked) { - col->addSpacing(50); + col->addSpacing(4); QLabel* welcomeLabel = new QLabel( "Welcome to the Coati trial!

" @@ -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); diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp index ab8cd5b8..0dae83e5 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp @@ -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(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( - currentProject->getProjectSettingsFilePath(), true - ) - ).dispatch(); + MessageLoadProject(currentProject->getProjectSettingsFilePath(), true).dispatch(); } } else