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".
This commit is contained in:
malte_langkabel
2016-02-17 12:20:36 +01:00
parent 42513fe102
commit 7f33ab37be
4 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -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();
@@ -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())
{
+7 -8
View File
@@ -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<FilePath> 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));
+3 -2
View File
@@ -4,6 +4,7 @@
#include <QPushButton>
#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;
};