ui: Fixed start screen not disappearing when opening project with double click on macOS

This commit is contained in:
Eberhard Graether
2018-07-13 14:36:13 +02:00
parent 7884f82432
commit 37aa46d77b
5 changed files with 21 additions and 15 deletions
+6
View File
@@ -227,6 +227,12 @@ void Application::handleMessage(MessageLoadProject* message)
TRACE("app load project");
FilePath projectSettingsFilePath(message->projectSettingsFilePath);
if (m_hasGUI)
{
bool showStartWindow = projectSettingsFilePath.empty();
m_mainView->loadWindow(showStartWindow);
}
if (projectSettingsFilePath.empty())
{
return;
+2
View File
@@ -23,6 +23,8 @@ public:
virtual void refreshView() = 0;
virtual void loadWindow(bool showStartWindow) = 0;
virtual void hideStartScreen() = 0;
virtual void setTitle(const std::wstring& title) = 0;
virtual void activateWindow() = 0;
@@ -1,6 +1,7 @@
#ifndef MESSAGE_PROJECT_NEW_H
#define MESSAGE_PROJECT_NEW_H
#include "utility/file/FilePath.h"
#include "utility/messaging/Message.h"
class MessageProjectNew
+10 -12
View File
@@ -82,6 +82,16 @@ void QtMainView::saveLayout()
m_window->saveLayout();
}
void QtMainView::loadWindow(bool showStartWindow)
{
m_onQtThread(
[=]()
{
m_window->loadWindow(showStartWindow);
}
);
}
void QtMainView::refreshView()
{
m_onQtThread(
@@ -177,18 +187,6 @@ void QtMainView::handleMessage(MessageForceEnterLicense* message)
);
}
void QtMainView::handleMessage(MessageLoadProject* message)
{
bool showStartWindow = message->projectSettingsFilePath.empty();
m_onQtThread(
[=]()
{
m_window->loadWindow(showStartWindow);
}
);
}
void QtMainView::handleMessage(MessageProjectEdit* message)
{
m_onQtThread(
+2 -3
View File
@@ -11,7 +11,6 @@
#include "utility/messaging/MessageListener.h"
#include "utility/messaging/type/MessageForceEnterLicense.h"
#include "utility/messaging/type/MessageLoadProject.h"
#include "utility/messaging/type/MessageProjectEdit.h"
#include "utility/messaging/type/MessageProjectNew.h"
@@ -21,7 +20,6 @@ class View;
class QtMainView
: public MainView
, public MessageListener<MessageForceEnterLicense>
, public MessageListener<MessageLoadProject>
, public MessageListener<MessageProjectEdit>
, public MessageListener<MessageProjectNew>
{
@@ -49,6 +47,8 @@ public:
virtual void loadLayout();
virtual void saveLayout();
virtual void loadWindow(bool showStartWindow);
virtual void refreshView();
virtual void hideStartScreen();
@@ -61,7 +61,6 @@ public:
private:
void handleMessage(MessageForceEnterLicense* message);
void handleMessage(MessageLoadProject* message);
void handleMessage(MessageProjectEdit* message);
void handleMessage(MessageProjectNew* message);