ui: startscreen display not existing project
* displays moved or deleted recent projects as disabled button
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "qt/window/QtLicense.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QLineEdit>
|
||||
#include <QLabel>
|
||||
#include <QTextEdit>
|
||||
@@ -105,7 +106,6 @@ void QtLicense::populateWindow(QWidget* widget)
|
||||
linkLabel->setGeometry(275, 300, 300, 50);
|
||||
subLayout->addWidget(linkLabel);
|
||||
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout();
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->addLayout(subLayout);
|
||||
@@ -123,12 +123,14 @@ void QtLicense::windowReady()
|
||||
updateNextButton("Activate");
|
||||
setPreviousVisible(false);
|
||||
|
||||
updateCloseButton("Quit Coati");
|
||||
|
||||
m_title->hide();
|
||||
}
|
||||
|
||||
void QtLicense::handleClose()
|
||||
{
|
||||
emit canceled();
|
||||
QApplication::quit();
|
||||
}
|
||||
|
||||
void QtLicense::handleNext()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "qt/window/QtStartScreen.h"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QString>
|
||||
#include <QHBoxLayout>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
@@ -18,7 +19,16 @@ QtRecentProjectButton::QtRecentProjectButton(const FilePath& projectFilePath, QW
|
||||
, m_projectFilePath(projectFilePath)
|
||||
{
|
||||
this->setText(m_projectFilePath.withoutExtension().fileName().c_str());
|
||||
this->setToolTip(m_projectFilePath.str().c_str());
|
||||
if ( projectFilePath.exists() )
|
||||
{
|
||||
this->setToolTip(m_projectFilePath.str().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string missingFileText = "Couldn't find " + m_projectFilePath.str() + " in your filesystem";
|
||||
this->setToolTip(missingFileText.c_str());
|
||||
this->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void QtRecentProjectButton::handleButtonClick()
|
||||
@@ -69,7 +79,7 @@ void QtStartScreen::setupStartScreen()
|
||||
int position = 290;
|
||||
QIcon cpp_icon((ResourcePaths::getGuiPath() + "icon/project_256_256.png").c_str());
|
||||
std::vector<FilePath> recentProjects = ApplicationSettings::getInstance()->getRecentProjects();
|
||||
for (size_t i = 0; i < recentProjects.size() && i < ApplicationSettings::getInstance()->getMaxRecentProjectsCount(); i++)
|
||||
for (size_t i = 0; i < recentProjects.size() && (int)i < ApplicationSettings::getInstance()->getMaxRecentProjectsCount(); i++)
|
||||
{
|
||||
QtRecentProjectButton* button = new QtRecentProjectButton(recentProjects[i], this);
|
||||
button->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
|
||||
Reference in New Issue
Block a user