ui: Extended wizzard with simple setup and vs solution parsing

* removed blurry coati background
* added language selection to project type window
* search for headers in project paths option as part of simple setup
* show popup containing list of all analyzed symbols
* show build file path in summary and allow refreshing
* only force refresh after editing project and something changed
This commit is contained in:
Eberhard Graether
2016-02-17 13:32:21 +01:00
parent b7bb1349f2
commit a4c6cebce6
40 changed files with 1019 additions and 573 deletions
+2 -2
View File
@@ -237,7 +237,7 @@ add_files(
utility/messaging/type/MessageInterruptTasks.h
utility/messaging/type/MessageLoadProject.h
utility/messaging/type/MessageMoveIDECursor.h
utility/messaging/type/MessageNewProject.h
utility/messaging/type/MessageProjectNew.h
utility/messaging/type/MessageRedo.h
utility/messaging/type/MessageRefresh.h
utility/messaging/type/MessageResetZoom.h
@@ -278,7 +278,7 @@ add_files(
utility/solution/ISolutionParser.h
utility/solution/SolutionParserVisualStudio.cpp
utility/solution/SolutionParserVisualStudio.h
utility/text/Dictionary.cpp
utility/text/Dictionary.h
utility/text/TextAccess.cpp
+14 -10
View File
@@ -189,20 +189,24 @@ Parser::Arguments Project::getParserArguments() const
// Add the source paths as HeaderSearchPaths as well, so clang will also look here when searching include files.
utility::append(args.systemHeaderSearchPaths, m_fileManager.getSourcePaths());
// std::vector<FilePath> headerSearchSubPaths;
// for(FilePath p : projSettings->getHeaderSearchPaths())
// {
// std::vector<FilePath> tempPaths = FileSystem::getSubDirectories(p);
// headerSearchSubPaths.insert( headerSearchSubPaths.end(), tempPaths.begin(), tempPaths.end() );
// }
// std::unique(headerSearchSubPaths.begin(),headerSearchSubPaths.end());
// utility::append(args.systemHeaderSearchPaths, headerSearchSubPaths);
utility::append(args.systemHeaderSearchPaths, projSettings->getHeaderSearchPaths());
utility::append(args.systemHeaderSearchPaths, appSettings->getHeaderSearchPaths());
// Add all subdirectories of the header search paths
if (projSettings->getUseSourcePathsForHeaderSearch())
{
std::vector<FilePath> headerSearchSubPaths;
for (FilePath p : projSettings->getHeaderSearchPaths())
{
std::vector<FilePath> tempPaths = FileSystem::getSubDirectories(p);
headerSearchSubPaths.insert( headerSearchSubPaths.end(), tempPaths.begin(), tempPaths.end() );
}
std::unique(headerSearchSubPaths.begin(),headerSearchSubPaths.end());
utility::append(args.systemHeaderSearchPaths, headerSearchSubPaths);
}
utility::append(args.frameworkSearchPaths, projSettings->getFrameworkSearchPaths());
utility::append(args.frameworkSearchPaths, appSettings->getFrameworkSearchPaths());
@@ -7,10 +7,9 @@
#include "utility/messaging/type/MessageActivateTokenLocations.h"
#include "utility/messaging/type/MessageActivateWindow.h"
#include "utility/messaging/type/MessageLoadProject.h"
#include "utility/messaging/type/MessageProjectNew.h"
#include "utility/messaging/type/MessageStatus.h"
#include "utility/messaging/type/MessageNewProject.h"
#include "utility/logging/logging.h"
#include "utility/solution/SolutionParserVisualStudio.h"
#include "settings/ProjectSettings.h"
@@ -86,38 +85,9 @@ void IDECommunicationController::handleCreateProjectMessage(const NetworkProtoco
{
if (message.ideId == NetworkProtocolHelper::CreateProjectMessage::IDE_ID::VS)
{
SolutionParserVisualStudio parser;
parser.openSolutionFile(message.solutionFileLocation);
std::vector<std::string> includePaths = parser.getIncludePaths();
std::vector<std::string> projectItems = parser.getProjectItems();
/*std::vector<FilePath> projectFPs;
std::vector<FilePath> includeFPs;
for (unsigned int i = 0; i < projectItems.size(); i++)
{
projectFPs.push_back(FilePath(projectItems[i]));
}
for (unsigned int i = 0; i < includePaths.size(); i++)
{
includeFPs.push_back(FilePath(includePaths[i]));
}*/
/*ProjectSettings* projSettings = ProjectSettings::getInstance().get();
projSettings->clear();
projSettings->setLanguage("c++");
projSettings->setStandard("11");
projSettings->setSourcePaths(projectFPs);
projSettings->setHeaderSearchPaths(includeFPs);
std::string filePath = parser.getSolutionPath() + parser.getSolutionName() + ".coatiproject";
projSettings->save(filePath);*/
MessageNewProject(parser.getSolutionName(), parser.getSolutionPath(), projectItems, includePaths).dispatch();
MessageProjectNew msg;
msg.setVisualStudioSolutionPath(message.solutionFileLocation);
msg.dispatch();
}
else
{
+51
View File
@@ -1,5 +1,7 @@
#include "settings/ProjectSettings.h"
#include "utility/utility.h"
std::vector<std::string> ProjectSettings::getDefaultHeaderExtensions()
{
std::vector<std::string> defaultValues;
@@ -38,6 +40,20 @@ ProjectSettings::~ProjectSettings()
{
}
bool ProjectSettings::operator==(const ProjectSettings& other) const
{
return
getFilePath() == other.getFilePath() &&
getLanguage() == other.getLanguage() &&
getStandard() == other.getStandard() &&
getVisualStudioSolutionPath() == other.getVisualStudioSolutionPath() &&
getCompilationDatabasePath() == other.getCompilationDatabasePath() &&
getUseSourcePathsForHeaderSearch() == other.getUseSourcePathsForHeaderSearch() &&
utility::isPermutation<FilePath>(getSourcePaths(), other.getSourcePaths()) &&
utility::isPermutation<FilePath>(getHeaderSearchPaths(), other.getHeaderSearchPaths()) &&
utility::isPermutation<FilePath>(getFrameworkSearchPaths(), other.getFrameworkSearchPaths());
}
void ProjectSettings::save(const FilePath& filePath)
{
m_projectName = "";
@@ -126,6 +142,41 @@ bool ProjectSettings::setSourceExtensions(const std::vector<std::string> &source
return setValues("source/extensions/source_extensions", sourceExtensions);
}
bool ProjectSettings::isUseSourcePathsForHeaderSearchDefined() const
{
return isValueDefined("source/use_source_paths_for_header_search");
}
bool ProjectSettings::getUseSourcePathsForHeaderSearch() const
{
return getValue<bool>("source/use_source_paths_for_header_search", false);
}
bool ProjectSettings::setUseSourcePathsForHeaderSearch(bool useSourcePathsForHeaderSearch)
{
return setValue<bool>("source/use_source_paths_for_header_search", useSourcePathsForHeaderSearch);
}
FilePath ProjectSettings::getVisualStudioSolutionPath() const
{
return FilePath(getValue<std::string>("source/build_file_path/vs_solution_path", ""));
}
bool ProjectSettings::setVisualStudioSolutionPath(const FilePath& visualStudioSolutionPath)
{
return setValue<std::string>("source/build_file_path/vs_solution_path", visualStudioSolutionPath.str());
}
FilePath ProjectSettings::getCompilationDatabasePath() const
{
return FilePath(getValue<std::string>("source/build_file_path/compilation_db_path", ""));
}
bool ProjectSettings::setCompilationDatabasePath(const FilePath& compilationDatabasePath)
{
return setValue<std::string>("source/build_file_path/compilation_db_path", compilationDatabasePath.str());
}
std::string ProjectSettings::getDescription() const
{
return getValue<std::string>("info/description", "");
+15 -4
View File
@@ -17,10 +17,9 @@ public:
ProjectSettings();
~ProjectSettings();
virtual void save(const FilePath& filePath);
bool operator==(const ProjectSettings& other) const;
// info
std::string getDescription() const;
virtual void save(const FilePath& filePath);
// language settings
std::string getLanguage() const;
@@ -41,13 +40,25 @@ public:
std::vector<std::string> getCompilerFlags() const;
// extensions
std::vector<std::string> getHeaderExtensions() const;
std::vector<std::string> getSourceExtensions() const;
bool setHeaderExtensions(const std::vector<std::string>& headerExtensions);
bool setSourceExtensions(const std::vector<std::string>& sourceExtensions);
bool isUseSourcePathsForHeaderSearchDefined() const;
bool getUseSourcePathsForHeaderSearch() const;
bool setUseSourcePathsForHeaderSearch(bool useSourcePathsForHeaderSearch);
FilePath getVisualStudioSolutionPath() const;
bool setVisualStudioSolutionPath(const FilePath& visualStudioSolutionPath);
FilePath getCompilationDatabasePath() const;
bool setCompilationDatabasePath(const FilePath& compilationDatabasePath);
// info
std::string getDescription() const;
// used in project wizzard
std::string getProjectName() const;
void setProjectName(const std::string& name);
+22
View File
@@ -5,6 +5,23 @@
#include "utility/text/TextAccess.h"
#include "utility/utilityString.h"
Settings::Settings(const Settings& other)
: m_filePath(other.m_filePath)
, m_config(other.m_config->createCopy())
{
}
Settings& Settings::operator=(const Settings& other)
{
if (&other != this)
{
m_filePath = other.m_filePath;
m_config = other.m_config->createCopy();
}
return *this;
}
Settings::~Settings()
{
}
@@ -137,6 +154,11 @@ bool Settings::moveRelativePathValues(const std::string& key, const FilePath& fi
return setValues(key, values);
}
bool Settings::isValueDefined(const std::string& key) const
{
return m_config->isValueDefined(key);
}
void Settings::enableWarnings() const
{
m_config->setWarnOnEmptyKey(true);
+4
View File
@@ -11,6 +11,8 @@
class Settings
{
public:
Settings(const Settings& other);
Settings& operator=(const Settings& other);
virtual ~Settings();
bool load(const FilePath& filePath);
@@ -43,6 +45,8 @@ protected:
bool setPathValues(const std::string& key, const std::vector<FilePath>& paths);
bool moveRelativePathValues(const std::string& key, const FilePath& filePath);
bool isValueDefined(const std::string& key) const;
void enableWarnings() const;
void disableWarnings() const;
+18
View File
@@ -18,6 +18,11 @@ std::shared_ptr<ConfigManager> ConfigManager::createAndLoad(const std::shared_pt
return configManager;
}
std::shared_ptr<ConfigManager> ConfigManager::createCopy()
{
return std::shared_ptr<ConfigManager>(new ConfigManager(*this));
}
void ConfigManager::clear()
{
m_values.clear();
@@ -215,6 +220,13 @@ void ConfigManager::setValues(const std::string& key, const std::vector<bool>& v
setValues(key, stringValues);
}
bool ConfigManager::isValueDefined(const std::string& key) const
{
std::multimap<std::string, std::string>::const_iterator it = m_values.find(key);
return (it != m_values.end());
}
bool ConfigManager::load(const std::shared_ptr<TextAccess> textAccess)
{
std::string text = textAccess->getText();
@@ -258,6 +270,12 @@ ConfigManager::ConfigManager()
{
}
ConfigManager::ConfigManager(const ConfigManager& other)
: m_values(other.m_values)
, m_warnOnEmptyKey(other.m_warnOnEmptyKey)
{
}
bool ConfigManager::createXmlDocument(bool saveAsFile, const std::string filepath, std::string& output)
{
bool success = true;
+3
View File
@@ -14,6 +14,7 @@ class ConfigManager
public:
static std::shared_ptr<ConfigManager> createEmpty();
static std::shared_ptr<ConfigManager> createAndLoad(const std::shared_ptr<TextAccess> textAccess);
std::shared_ptr<ConfigManager> createCopy();
void clear();
@@ -37,6 +38,8 @@ public:
void setValues(const std::string& key, const std::vector<float>& values);
void setValues(const std::string& key, const std::vector<bool>& values);
bool isValueDefined(const std::string& key) const;
bool load(const std::shared_ptr<TextAccess> textAccess);
void save(const std::string filepath);
std::string toString();
@@ -1,33 +0,0 @@
#ifndef MESSAGE_NEW_PROJECT_H
#define MESSAGE_NEW_PROJECT_H
#include "utility/messaging/Message.h"
class MessageNewProject : public Message<MessageNewProject>
{
public:
MessageNewProject(const std::string& projectName, const std::string projectLocation,
const std::vector<std::string>& sourceFiles, const std::vector<std::string>& includePaths)
: projectName(projectName)
, projectLocation(projectLocation)
, projectSourceFiles(sourceFiles)
, projectIncludePaths(includePaths)
{
}
static const std::string getStaticType()
{
return "MessageNewProject";
}
virtual void print(std::ostream& os) const
{
}
const std::string projectName;
const std::string projectLocation;
const std::vector<std::string> projectSourceFiles;
const std::vector<std::string> projectIncludePaths;
};
#endif // MESSAGE_NEW_PROJECT_H
@@ -0,0 +1,32 @@
#ifndef MESSAGE_PROJECT_NEW_H
#define MESSAGE_PROJECT_NEW_H
#include "utility/messaging/Message.h"
class MessageProjectNew
: public Message<MessageProjectNew>
{
public:
MessageProjectNew()
{
}
static const std::string getStaticType()
{
return "MessageProjectNew";
}
bool fromVisualStudioSolution() const
{
return visualStudioSolutionPath.size() > 0;
}
void setVisualStudioSolutionPath(const std::string& path)
{
visualStudioSolutionPath = path;
}
std::string visualStudioSolutionPath;
};
#endif // MESSAGE_PROJECT_NEW_H