ui: Added option to show file directory in code view title (issue #556)

* relative to project file if shorter
* checkbox in preferences
* not enabled by default
This commit is contained in:
Eberhard Graether
2019-07-22 14:25:46 +02:00
parent 293ddffb46
commit cd144a979f
12 changed files with 114 additions and 13 deletions
+11 -1
View File
@@ -146,11 +146,21 @@ Application::~Application()
}
}
const std::shared_ptr<Project> Application::getCurrentProject()
const std::shared_ptr<Project> Application::getCurrentProject() const
{
return m_project;
}
FilePath Application::getCurrentProjectPath() const
{
if (m_project)
{
return m_project->getProjectSettingsFilePath();
}
return FilePath();
}
bool Application::isProjectLoaded() const
{
if (m_project)
+2 -1
View File
@@ -48,7 +48,8 @@ public:
~Application();
const std::shared_ptr<Project> getCurrentProject();
const std::shared_ptr<Project> getCurrentProject() const;
FilePath getCurrentProjectPath() const;
bool isProjectLoaded() const;
bool hasGUI();
@@ -62,7 +62,7 @@ bool CodeSnippetParams::sort(const CodeSnippetParams& a, const CodeSnippetParams
// alphabetical filepath without extension
else
{
return aFilePath.withoutExtension().fileName() < bFilePath.withoutExtension().fileName();
return aFilePath.withoutExtension() < bFilePath.withoutExtension();
}
}
+10
View File
@@ -182,6 +182,16 @@ void ApplicationSettings::setShowBuiltinTypesInGraph(bool showBuiltinTypes)
setValue<bool>("application/builtin_types_in_graph", showBuiltinTypes);
}
bool ApplicationSettings::getShowDirectoryInCodeFileTitle() const
{
return getValue<bool>("application/directory_in_code_title", false);
}
void ApplicationSettings::setShowDirectoryInCodeFileTitle(bool showDirectory)
{
setValue<bool>("application/directory_in_code_title", showDirectory);
}
std::wstring ApplicationSettings::getColorSchemeName() const
{
return getValue<std::wstring>("application/color_scheme", L"bright");
+3
View File
@@ -54,6 +54,9 @@ public:
bool getShowBuiltinTypesInGraph() const;
void setShowBuiltinTypesInGraph(bool showBuiltinTypes);
bool getShowDirectoryInCodeFileTitle() const;
void setShowDirectoryInCodeFileTitle(bool showDirectory);
int getWindowBaseWidth() const;
int getWindowBaseHeight() const;