logic: visual studio solution parsing

Can now parse visual studio solutions. VS Plugin can send a command, parsing is implemented in Coati.
Some minor changes: added project file icon, added language check to vs plugin
This commit is contained in:
Manuel Dobusch
2016-02-08 15:58:25 +01:00
parent 29149f313a
commit e13eaa85da
46 changed files with 5139 additions and 253 deletions
+13
View File
@@ -106,6 +106,7 @@ bool MouseWheelFilter::eventFilter(QObject* obj, QEvent* event)
QtMainWindow::QtMainWindow()
: m_showDockWidgetTitleBars(true)
, m_createNewProjectFunctor(std::bind(&QtMainWindow::doCreateNewProject, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4))
{
setObjectName("QtMainWindow");
setCentralWidget(nullptr);
@@ -252,6 +253,11 @@ void QtMainWindow::forceEnterLicense()
m_enterLicenseWindow->setEnabled(true);
}
void QtMainWindow::handleMessage(MessageNewProject* message)
{
m_createNewProjectFunctor(message->projectName, message->projectLocation, message->projectSourceFiles, message->projectIncludePaths);
}
bool QtMainWindow::event(QEvent* event)
{
if (event->type() == QEvent::WindowActivate)
@@ -599,6 +605,13 @@ void QtMainWindow::toggleShowDockWidgetTitleBars()
setShowDockWidgetTitleBars(!m_showDockWidgetTitleBars);
}
void QtMainWindow::doCreateNewProject(const std::string& name, const std::string& location,
const std::vector<std::string>& sourceFiles, const std::vector<std::string>& includePaths)
{
newProject();
m_newProjectDialog->setPresets(name, location, sourceFiles, includePaths);
}
void QtMainWindow::setupEditMenu()
{
QMenu *menu = new QMenu(tr("&Edit"), this);
+11
View File
@@ -8,6 +8,10 @@
#include <QMainWindow>
#include <QShortcut>
#include "utility/messaging/MessageListener.h"
#include "utility/messaging/type/MessageNewProject.h"
#include "qt/utility/QtThreadedFunctor.h"
#include "qt/window/QtApplicationSettingsScreen.h"
#include "qt/window/QtStartScreen.h"
#include "qt/window/QtProjectSetupScreen.h"
@@ -66,6 +70,7 @@ protected:
class QtMainWindow
: public QMainWindow
, public MessageListener<MessageNewProject>
{
Q_OBJECT
@@ -86,6 +91,8 @@ public:
void forceEnterLicense();
void handleMessage(MessageNewProject* message);
protected:
bool event(QEvent* event);
void keyPressEvent(QKeyEvent* event);
@@ -143,6 +150,8 @@ private:
QtViewToggle* toggle;
};
void doCreateNewProject(const std::string& name, const std::string& location,
const std::vector<std::string>& sourceFiles, const std::vector<std::string>& includePaths);
void setupEditMenu();
void setupProjectMenu();
@@ -174,6 +183,8 @@ private:
QShortcut* m_escapeShortcut;
static std::string m_windowSettingsPath;
QtThreadedFunctor<std::string, std::string, std::vector<std::string>, std::vector<std::string>> m_createNewProjectFunctor;
};
#endif // QT_MAIN_WINDOW_H
@@ -142,6 +142,28 @@ void QtProjectSetupScreen::loadProjectSettings()
}
}
void QtProjectSetupScreen::setPresets(const std::string& name, const std::string& location,
const std::vector<std::string>& sourceFiles, const std::vector<std::string>& includePaths)
{
m_projectName->setText(QString::fromStdString(name));
m_projectFileLocation->setText(QString::fromStdString(location));
std::vector<FilePath> sourceFilePaths;
for (unsigned int i = 0; i < sourceFiles.size(); i++)
{
sourceFilePaths.push_back(FilePath(sourceFiles[i]));
}
std::vector<FilePath> includePathsPaths;
for (unsigned int i = 0; i < includePaths.size(); i++)
{
includePathsPaths.push_back(FilePath(sourceFiles[i]));
}
m_sourcePaths->setList(sourceFilePaths);
m_includePaths->setList(includePathsPaths);
}
void QtProjectSetupScreen::populateForm(QFormLayout* layout)
{
int minimumWidthForSecondCol = 360;
@@ -49,6 +49,10 @@ public:
void projectSetupScreen();
// fill screen without having to set project setting beforehand (e.g. when creating a new project)
void setPresets(const std::string& name, const std::string& location,
const std::vector<std::string>& sourceFiles, const std::vector<std::string>& includePaths);
signals:
void showPreferences();