ui: reworked StartScreen and ProjectSettupScreen UI flow

* realigned buttons and elements
* fixed retina styles for mac
* removed MessageLoadSource and subsequent functionality
* edit existing project through menu
* browsing paths from the line item in QtDirectoryListBox
* grow QtDirectoryListBox instead of scroll
* take any file or directory as valid path
* fixed new project setup screen background
* fixed screen handling on cancelation
This commit is contained in:
Eberhard Graether
2015-09-04 10:54:37 +02:00
parent 1b445d4c3a
commit 5ab627b735
30 changed files with 688 additions and 338 deletions
-20
View File
@@ -67,20 +67,6 @@ void Application::loadProject(const std::string& projectSettingsFilePath)
updateRecentProjects(projectSettingsFilePath);
}
void Application::loadSource(const std::string& sourceDirectoryPath)
{
MessageStatus("Loading Source: " + sourceDirectoryPath).dispatch();
m_storageCache->clear();
m_componentManager->refreshViews();
m_project = Project::create(m_storageCache.get());
m_project->clearProjectSettings();
m_project->setSourceDirectoryPath(sourceDirectoryPath);
m_project->parseCode();
}
void Application::reloadProject()
{
MessageStatus("Refreshing Project").dispatch();
@@ -136,12 +122,6 @@ void Application::handleMessage(MessageLoadProject* message)
loadProject(message->projectSettingsFilePath);
}
void Application::handleMessage(MessageLoadSource* message)
{
m_isInitialParse = true;
loadSource(message->sourceDirectoryPath);
}
void Application::handleMessage(MessageRefresh* message)
{
loadSettings();
-3
View File
@@ -8,7 +8,6 @@
#include "utility/messaging/MessageListener.h"
#include "utility/messaging/type/MessageFinishedParsing.h"
#include "utility/messaging/type/MessageLoadProject.h"
#include "utility/messaging/type/MessageLoadSource.h"
#include "utility/messaging/type/MessageRefresh.h"
#include "utility/messaging/type/MessageSaveProject.h"
@@ -19,7 +18,6 @@ class StorageCache;
class Application
: public MessageListener<MessageFinishedParsing>
, public MessageListener<MessageLoadProject>
, public MessageListener<MessageLoadSource>
, public MessageListener<MessageRefresh>
, public MessageListener<MessageSaveProject>
{
@@ -39,7 +37,6 @@ private:
virtual void handleMessage(MessageFinishedParsing* message);
virtual void handleMessage(MessageLoadProject* message);
virtual void handleMessage(MessageLoadSource* message);
virtual void handleMessage(MessageRefresh* message);
virtual void handleMessage(MessageSaveProject* message);
-1
View File
@@ -247,7 +247,6 @@ add_files(
utility/messaging/type/MessageGraphNodeMove.h
utility/messaging/type/MessageInterruptTasks.h
utility/messaging/type/MessageLoadProject.h
utility/messaging/type/MessageLoadSource.h
utility/messaging/type/MessageRedo.h
utility/messaging/type/MessageRefresh.h
utility/messaging/type/MessageSaveProject.h
-14
View File
@@ -70,20 +70,6 @@ void Project::reloadProjectSettings()
}
}
bool Project::setSourceDirectoryPath(const std::string& sourceDirectoryPath)
{
m_projectSettingsFilepath = sourceDirectoryPath + "/ProjectSettings.xml";
bool success = ProjectSettings::getInstance()->setSourcePaths(std::vector<FilePath>(1, sourceDirectoryPath));
if (success)
{
m_fileManager.reset();
updateFileManager();
}
return success;
}
void Project::clearStorage()
{
m_storage = std::make_shared<Storage>();
-2
View File
@@ -22,8 +22,6 @@ public:
void clearProjectSettings();
void reloadProjectSettings();
bool setSourceDirectoryPath(const std::string& sourceDirectoryPath);
void clearStorage();
void parseCode();
@@ -84,11 +84,6 @@ void UndoRedoController::handleMessage(MessageLoadProject* message)
clear();
}
void UndoRedoController::handleMessage(MessageLoadSource* message)
{
clear();
}
void UndoRedoController::handleMessage(MessageRedo* message)
{
if (!m_redo.empty())
@@ -12,7 +12,6 @@
#include "utility/messaging/type/MessageGraphNodeExpand.h"
#include "utility/messaging/type/MessageGraphNodeMove.h"
#include "utility/messaging/type/MessageLoadProject.h"
#include "utility/messaging/type/MessageLoadSource.h"
#include "utility/messaging/type/MessageRedo.h"
#include "utility/messaging/type/MessageRefresh.h"
#include "utility/messaging/type/MessageSearch.h"
@@ -33,7 +32,6 @@ class UndoRedoController
, public MessageListener<MessageGraphNodeExpand>
, public MessageListener<MessageGraphNodeMove>
, public MessageListener<MessageLoadProject>
, public MessageListener<MessageLoadSource>
, public MessageListener<MessageRedo>
, public MessageListener<MessageRefresh>
, public MessageListener<MessageSearch>
@@ -63,7 +61,6 @@ private:
virtual void handleMessage(MessageGraphNodeExpand* message);
virtual void handleMessage(MessageGraphNodeMove* message);
virtual void handleMessage(MessageLoadProject* message);
virtual void handleMessage(MessageLoadSource* message);
virtual void handleMessage(MessageRedo* message);
virtual void handleMessage(MessageRefresh* message);
virtual void handleMessage(MessageSearch* message);
+5
View File
@@ -809,6 +809,11 @@ std::shared_ptr<TokenLocationFile> Storage::getTokenLocationsForLinesInFile(
std::shared_ptr<TokenLocationFile> ret = std::make_shared<TokenLocationFile>(filePath);
std::shared_ptr<TokenLocationFile> locationFile = m_sqliteStorage.getTokenLocationsForFile(filePath);
if (!locationFile->getTokenLocationLines().size())
{
return ret;
}
uint endLineNumber = locationFile->getTokenLocationLines().rbegin()->first;
std::set<int> addedLocationIds;
for (uint i = firstLineNumber; i <= endLineNumber; i++)
+19 -6
View File
@@ -1,5 +1,22 @@
#include "settings/ProjectSettings.h"
std::vector<std::string> ProjectSettings::getDefaultHeaderExtensions()
{
std::vector<std::string> defaultValues;
defaultValues.push_back(".h");
defaultValues.push_back(".hpp");
return defaultValues;
}
std::vector<std::string> ProjectSettings::getDefaultSourceExtensions()
{
std::vector<std::string> defaultValues;
defaultValues.push_back(".cpp");
defaultValues.push_back(".cxx");
defaultValues.push_back(".cc");
return defaultValues;
}
std::shared_ptr<ProjectSettings> ProjectSettings::s_instance;
std::shared_ptr<ProjectSettings> ProjectSettings::getInstance()
@@ -67,16 +84,12 @@ std::vector<std::string> ProjectSettings::getCompilerFlags() const
std::vector<std::string> ProjectSettings::getHeaderExtensions() const
{
std::vector<std::string> defaultValues;
defaultValues.push_back(".h");
return getValues("source/Extensions/HeaderExtensions", defaultValues);
return getValues("source/Extensions/HeaderExtensions", getDefaultHeaderExtensions());
}
std::vector<std::string> ProjectSettings::getSourceExtensions() const
{
std::vector<std::string> defaultValues;
defaultValues.push_back(".cpp");
return getValues("source/Extensions/SourceExtensions", defaultValues);
return getValues("source/Extensions/SourceExtensions", getDefaultSourceExtensions());
}
bool ProjectSettings::setHeaderExtensions(const std::vector<std::string> &headerExtensions)
+3
View File
@@ -10,6 +10,9 @@ class ProjectSettings
: public Settings
{
public:
static std::vector<std::string> getDefaultHeaderExtensions();
static std::vector<std::string> getDefaultSourceExtensions();
static std::shared_ptr<ProjectSettings> getInstance();
~ProjectSettings();
+5 -5
View File
@@ -57,16 +57,16 @@ void Settings::clear()
m_filePath = FilePath();
}
Settings::Settings()
{
clear();
}
const FilePath& Settings::getFilePath() const
{
return m_filePath;
}
Settings::Settings()
{
clear();
}
void Settings::setFilePath(const FilePath& filePath)
{
m_filePath = filePath;
+2 -1
View File
@@ -18,10 +18,11 @@ public:
virtual void save(const FilePath& filePath);
void clear();
const FilePath& getFilePath() const;
protected:
Settings();
const FilePath& getFilePath() const;
void setFilePath(const FilePath& filePath);
template<typename T>
@@ -1,22 +0,0 @@
#ifndef MESSAGE_LOAD_SOURCE_H
#define MESSAGE_LOAD_SOURCE_H
#include "utility/messaging/Message.h"
class MessageLoadSource: public Message<MessageLoadSource>
{
public:
MessageLoadSource(const std::string& sourceDir)
: sourceDirectoryPath(sourceDir)
{
}
static const std::string getStaticType()
{
return "MessageLoadSource";
}
const std::string sourceDirectoryPath;
};
#endif // MESSAGE_LOAD_SOURCE_H