ui: Extended project setup to support creation and editing of Source Groups (issue #230)

* Turned QtProjectWizzard into window for Source Group ui
* Clicking into FilePicker when empty will open dialog right away
* Fixed environment variable use throughout all Source Group path values
* Moved Preferences to QtPreferencesWindow

bug id = 230

fortune cookie message = Zwischen dir und deinen Freunden besteht echte Freundschaft.
This commit is contained in:
Eberhard Graether
2017-05-29 17:08:28 +02:00
parent 13f7acbb70
commit 9256618f7c
53 changed files with 1666 additions and 1220 deletions
+54 -73
View File
@@ -3,15 +3,6 @@
#include "qt/window/QtMainWindow.h"
QtMainView::QtMainView()
: m_editProjectFunctor(std::bind(&QtMainView::doEditProject, this))
, m_createNewProjectFromSolutionFunctor(std::bind(&QtMainView::doCreateNewProjectFromSolution, this, std::placeholders::_1, std::placeholders::_2))
, m_createNewProjectFromCDBFunctor(std::bind(&QtMainView::doCreateNewProjectFromCDB, this, std::placeholders::_1, std::placeholders::_2))
, m_showStartScreenFunctor(std::bind(&QtMainView::doShowStartScreen, this))
, 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_forceLicenseScreenFunctor(std::bind(&QtMainView::doForceLicenseScreen, this, std::placeholders::_1))
{
m_window = std::make_shared<QtMainWindow>();
m_window->show();
@@ -86,22 +77,45 @@ void QtMainView::setStatusBar(QStatusBar* statusbar)
void QtMainView::hideStartScreen()
{
m_hideStartScreenFunctor();
m_onQtThread(
[=]()
{
m_window->hideStartScreen();
}
);
}
void QtMainView::setTitle(const std::string& title)
{
m_setTitleFunctor(title);
m_onQtThread(
[=]()
{
m_window->setWindowTitle(QString::fromStdString(title));
}
);
}
void QtMainView::activateWindow()
{
m_activateWindowFunctor();
m_onQtThread(
[=]()
{
// It's platform dependent which of these commands does the right thing, for now we just use them all at once.
m_window->setEnabled(true);
m_window->raise();
m_window->setFocus(Qt::ActiveWindowFocusReason);
}
);
}
void QtMainView::updateRecentProjectMenu()
{
m_updateRecentProjectMenuFunctor();
m_onQtThread(
[=]()
{
m_window->updateRecentProjectMenu();
}
);
}
void QtMainView::updateHistoryMenu(const std::vector<SearchMatch>& history)
@@ -116,78 +130,45 @@ void QtMainView::updateHistoryMenu(const std::vector<SearchMatch>& history)
void QtMainView::handleMessage(MessageForceEnterLicense* message)
{
m_forceLicenseScreenFunctor(message->licenseExpired);
bool expired = message->licenseExpired;
m_onQtThread(
[=]()
{
m_window->forceEnterLicense(expired);
}
);
}
void QtMainView::handleMessage(MessageProjectEdit* message)
{
m_editProjectFunctor();
m_onQtThread(
[=]()
{
m_window->editProject();
}
);
}
void QtMainView::handleMessage(MessageProjectNew* message)
{
if (message->ideId.size() != 0 && message->solutionPath.size() != 0)
{
if (message->fromCDB() == false)
std::string cdbPath = message->cdbPath;
std::vector<std::string> headerPaths = message->headerPaths;
m_onQtThread(
[=]()
{
m_createNewProjectFromSolutionFunctor(message->ideId, message->solutionPath);
m_window->newProjectFromCDB(cdbPath, headerPaths);
}
else
{
m_createNewProjectFromCDBFunctor(message->solutionPath, message->headerPaths);
}
}
);
}
void QtMainView::handleMessage(MessageShowStartScreen* message)
{
m_showStartScreenFunctor();
}
void QtMainView::doEditProject()
{
m_window->editProject();
}
void QtMainView::doCreateNewProjectFromSolution(const std::string& ideId, const std::string& solutionPath)
{
m_window->newProjectFromSolution(ideId, solutionPath);
}
void QtMainView::doCreateNewProjectFromCDB(const std::string& filePath, const std::vector<std::string>& headerPaths)
{
m_window->newProjectFromCDB(filePath, headerPaths);
}
void QtMainView::doShowStartScreen()
{
m_window->showStartScreen();
}
void QtMainView::doHideStartScreen()
{
m_window->hideStartScreen();
}
void QtMainView::doSetTitle(const std::string& title)
{
m_window->setWindowTitle(QString::fromStdString(title));
}
void QtMainView::doActivateWindow()
{
// It's platform dependent which of these commands does the right thing, for now we just use them all at once.
m_window->setEnabled(true);
m_window->raise();
m_window->setFocus(Qt::ActiveWindowFocusReason);
}
void QtMainView::doUpdateRecentProjectMenu()
{
m_window->updateRecentProjectMenu();
}
void QtMainView::doForceLicenseScreen(bool expired)
{
m_window->forceEnterLicense(expired);
m_onQtThread(
[=]()
{
m_window->showStartScreen();
}
);
}