From 7f33ab37be57c2752555bdbc9f7fac39ad0d7f9d Mon Sep 17 00:00:00 2001 From: malte_langkabel Date: Wed, 17 Feb 2016 12:20:36 +0100 Subject: [PATCH] ui: display of project name * Window title now reads "Coati - Project name". * Removed file endings in the recent projects list. * Changed the first line of the project summary to be "Project: Project name" instead of just "Project name". --- src/lib/Application.cpp | 4 ++-- src/lib/component/controller/CodeController.cpp | 2 +- src/lib_gui/qt/window/QtStartScreen.cpp | 15 +++++++-------- src/lib_gui/qt/window/QtStartScreen.h | 5 +++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/lib/Application.cpp b/src/lib/Application.cpp index 4c69afd2..3940ba19 100644 --- a/src/lib/Application.cpp +++ b/src/lib/Application.cpp @@ -77,8 +77,8 @@ void Application::loadProject(const FilePath& projectSettingsFilePath, bool forc updateRecentProjects(projectSettingsFilePath); m_mainView->setTitle( - projectSettingsFilePath.withoutExtension().fileName() - + "[" + projectSettingsFilePath.fileName() + "]" + " - Coati"); + "Coati - " + + projectSettingsFilePath.fileName()); m_storageCache->clear(); m_componentManager->refreshViews(); diff --git a/src/lib/component/controller/CodeController.cpp b/src/lib/component/controller/CodeController.cpp index ad3abf0d..63b6077f 100644 --- a/src/lib/component/controller/CodeController.cpp +++ b/src/lib/component/controller/CodeController.cpp @@ -47,7 +47,7 @@ void CodeController::handleMessage(MessageActivateAll* message) std::stringstream ss; ss << "\n"; - ss << "\t" + ProjectSettings::getInstance()->getFilePath().withoutExtension().fileName() + "\n"; + ss << "\tProject: " + ProjectSettings::getInstance()->getFilePath().withoutExtension().fileName() + "\n"; if (description.size()) { diff --git a/src/lib_gui/qt/window/QtStartScreen.cpp b/src/lib_gui/qt/window/QtStartScreen.cpp index c9d235f7..7303e74b 100644 --- a/src/lib_gui/qt/window/QtStartScreen.cpp +++ b/src/lib_gui/qt/window/QtStartScreen.cpp @@ -13,17 +13,17 @@ #include "qt/utility/utilityQt.h" #include "isTrial.h" -QtRecentProjectButton::QtRecentProjectButton(const QString &text, QWidget *parent) - : QPushButton(text, parent) +QtRecentProjectButton::QtRecentProjectButton(const FilePath& projectFilePath, QWidget* parent) + : QPushButton(parent) + , m_projectFilePath(projectFilePath) { - m_projectFile = text.toStdString(); - this->setText(FileSystem::fileName(text.toStdString()).c_str()); - this->setToolTip(m_projectFile.c_str()); + this->setText(m_projectFilePath.withoutExtension().fileName().c_str()); + this->setToolTip(m_projectFilePath.str().c_str()); } void QtRecentProjectButton::handleButtonClick() { - MessageLoadProject(m_projectFile, false).dispatch(); + MessageLoadProject(m_projectFilePath.str(), false).dispatch(); }; QtStartScreen::QtStartScreen(QWidget *parent) @@ -62,8 +62,7 @@ void QtStartScreen::setup() std::vector recentProjects = ApplicationSettings::getInstance()->getRecentProjects(); for (size_t i = 0; i < recentProjects.size() && i < ApplicationSettings::MaximalAmountOfRecentProjects; i++) { - FilePath project = recentProjects[i]; - QtRecentProjectButton* button = new QtRecentProjectButton(project.str().c_str(), this); + QtRecentProjectButton* button = new QtRecentProjectButton(recentProjects[i], this); button->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac button->setIcon(cpp_icon); button->setIconSize(QSize(25, 25)); diff --git a/src/lib_gui/qt/window/QtStartScreen.h b/src/lib_gui/qt/window/QtStartScreen.h index 273fc783..512dccd9 100644 --- a/src/lib_gui/qt/window/QtStartScreen.h +++ b/src/lib_gui/qt/window/QtStartScreen.h @@ -4,6 +4,7 @@ #include #include "qt/window/QtSettingsWindow.h" +#include "utility/file/FilePath.h" class QtRecentProjectButton : public QPushButton @@ -11,13 +12,13 @@ class QtRecentProjectButton Q_OBJECT public: - QtRecentProjectButton(const QString& text, QWidget* parent); + QtRecentProjectButton(const FilePath& projectFilePath, QWidget* parent); public slots: void handleButtonClick(); private: - std::string m_projectFile; + FilePath m_projectFilePath; };