logic: file associations for Mac and opening project files via Mac OS
* hide start screen when opening with project file * added project icon file to bundle and file type association to plist * listen for file open events from double click or drag and drop * fixed crashes in window handling
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
#include "qt/window/QtMainWindow.h"
|
||||
|
||||
QtMainView::QtMainView()
|
||||
: m_setTitleFunctor(std::bind(&QtMainView::doSetTitle, this, std::placeholders::_1))
|
||||
: m_hideStartScreenFunctor(std::bind(&QtMainView::doHideStartScreen, this))
|
||||
, m_setTitleFunctor(std::bind(&QtMainView::doSetTitle, this, std::placeholders::_1))
|
||||
, m_activateWindowFunctor(std::bind(&QtMainView::doActivateWindow, this))
|
||||
, m_updateRecentProjectMenuFunctor(std::bind(&QtMainView::doUpdateRecentProjectMenu, this))
|
||||
, m_showLicenseScreenFunctor(std::bind(&QtMainView::doShowLicenseScreen, this))
|
||||
@@ -69,7 +70,7 @@ void QtMainView::setStatusBar(QStatusBar* statusbar)
|
||||
|
||||
void QtMainView::hideStartScreen()
|
||||
{
|
||||
m_window->clearWindows();
|
||||
m_hideStartScreenFunctor();
|
||||
}
|
||||
|
||||
void QtMainView::setTitle(const std::string& title)
|
||||
@@ -97,6 +98,11 @@ void QtMainView::doUpdateRecentProjectMenu()
|
||||
m_window->updateRecentProjectMenu();
|
||||
}
|
||||
|
||||
void QtMainView::doHideStartScreen()
|
||||
{
|
||||
m_window->clearWindows();
|
||||
}
|
||||
|
||||
void QtMainView::doSetTitle(const std::string& title)
|
||||
{
|
||||
m_window->setWindowTitle(QString::fromStdString(title));
|
||||
|
||||
@@ -40,6 +40,7 @@ public:
|
||||
virtual void showLicenseScreen();
|
||||
|
||||
private:
|
||||
void doHideStartScreen();
|
||||
void doSetTitle(const std::string& title);
|
||||
void doActivateWindow();
|
||||
void doUpdateRecentProjectMenu();
|
||||
@@ -48,6 +49,7 @@ private:
|
||||
std::shared_ptr<QtMainWindow> m_window;
|
||||
std::vector<View*> m_views;
|
||||
|
||||
QtThreadedFunctor<> m_hideStartScreenFunctor;
|
||||
QtThreadedFunctor<const std::string&> m_setTitleFunctor;
|
||||
QtThreadedFunctor<> m_activateWindowFunctor;
|
||||
QtThreadedFunctor<> m_updateRecentProjectMenuFunctor;
|
||||
|
||||
Reference in New Issue
Block a user