logic: Added Non-Commercial Use option and removed trial mode
* Added non-commercial use option to enter license window * Show enter license window on first start and force license selection * Added ApplicationSettings migration that removed private/academic license and switches user to non-commercial mode * Added commandline option to choose non-commercial use and provide better hints to license selection * Removed trial mode fortune cookie message = A secret admirer will soon send you a sign of affection.
This commit is contained in:
@@ -213,8 +213,8 @@ add_files(
|
||||
qt/window/QtIndexingDialog.h
|
||||
qt/window/QtKeyboardShortcuts.cpp
|
||||
qt/window/QtKeyboardShortcuts.h
|
||||
qt/window/QtLicense.cpp
|
||||
qt/window/QtLicense.h
|
||||
qt/window/QtLicenseWindow.cpp
|
||||
qt/window/QtLicenseWindow.h
|
||||
qt/window/QtMainWindow.cpp
|
||||
qt/window/QtMainWindow.h
|
||||
qt/window/QtPreferencesWindow.cpp
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
#include "utility/messaging/type/MessageActivateFile.h"
|
||||
#include "utility/messaging/type/MessageProjectEdit.h"
|
||||
|
||||
#include "Application.h"
|
||||
#include "project/Project.h"
|
||||
#include "qt/utility/QtContextMenu.h"
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "settings/ColorScheme.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
#include "Application.h"
|
||||
|
||||
QtCodeFileTitleButton::QtCodeFileTitleButton(QWidget* parent)
|
||||
: QPushButton(parent)
|
||||
@@ -89,26 +89,18 @@ void QtCodeFileTitleButton::setProject(const std::string& name)
|
||||
setText(name.c_str());
|
||||
m_filePath = FilePath();
|
||||
|
||||
if (Application::getInstance()->isInTrial())
|
||||
{
|
||||
setIcon(QIcon());
|
||||
setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string text = ResourcePaths::getGuiPath().str() + "code_view/images/edit.png";
|
||||
setToolTip("edit project");
|
||||
std::string text = ResourcePaths::getGuiPath().str() + "code_view/images/edit.png";
|
||||
setToolTip("edit project");
|
||||
|
||||
setIcon(utility::colorizePixmap(
|
||||
QPixmap(text.c_str()),
|
||||
ColorScheme::getInstance()->getColor("code/file/title/icon").c_str()
|
||||
));
|
||||
}
|
||||
setIcon(utility::colorizePixmap(
|
||||
QPixmap(text.c_str()),
|
||||
ColorScheme::getInstance()->getColor("code/file/title/icon").c_str()
|
||||
));
|
||||
}
|
||||
|
||||
void QtCodeFileTitleButton::updateTexts()
|
||||
{
|
||||
if (Application::getInstance()->isInTrial() || m_filePath.empty())
|
||||
if (m_filePath.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <QPushButton>
|
||||
|
||||
#include "utility/messaging/type/MessageRefresh.h"
|
||||
|
||||
#include "utility/ResourcePaths.h"
|
||||
|
||||
#include "qt/utility/utilityQt.h"
|
||||
@@ -26,8 +25,6 @@ QtRefreshBar::QtRefreshBar()
|
||||
m_refreshButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
layout->addWidget(m_refreshButton);
|
||||
|
||||
m_refreshButton->setEnabled(false);
|
||||
|
||||
connect(m_refreshButton, &QPushButton::clicked, this, &QtRefreshBar::refreshClicked);
|
||||
|
||||
refreshStyle();
|
||||
@@ -53,13 +50,3 @@ void QtRefreshBar::refreshStyle()
|
||||
"search/button"
|
||||
));
|
||||
}
|
||||
|
||||
void QtRefreshBar::handleMessage(MessageEnteredLicense* message)
|
||||
{
|
||||
m_onQtThread(
|
||||
[=]()
|
||||
{
|
||||
m_refreshButton->setEnabled(true);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,14 +4,11 @@
|
||||
#include <QFrame>
|
||||
|
||||
#include "qt/utility/QtThreadedFunctor.h"
|
||||
#include "utility/messaging/type/MessageEnteredLicense.h"
|
||||
#include "utility/messaging/MessageListener.h"
|
||||
|
||||
class QPushButton;
|
||||
|
||||
class QtRefreshBar
|
||||
: public QFrame
|
||||
, public MessageListener<MessageEnteredLicense>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -25,8 +22,6 @@ private slots:
|
||||
void refreshClicked();
|
||||
|
||||
private:
|
||||
virtual void handleMessage(MessageEnteredLicense* message);
|
||||
|
||||
QtThreadedLambdaFunctor m_onQtThread;
|
||||
|
||||
QPushButton* m_refreshButton;
|
||||
|
||||
@@ -70,14 +70,12 @@ void QtUpdateChecker::check(bool force, std::function<void(Result)> callback)
|
||||
switch (LicenseChecker::getInstance()->getCurrentLicenseType())
|
||||
{
|
||||
case MessageEnteredLicense::LICENSE_NONE:
|
||||
licenseString = "trial";
|
||||
case MessageEnteredLicense::LICENSE_NON_COMMERCIAL:
|
||||
licenseString = "private";
|
||||
break;
|
||||
case MessageEnteredLicense::LICENSE_TEST:
|
||||
licenseString = "test";
|
||||
break;
|
||||
case MessageEnteredLicense::LICENSE_NON_COMMERCIAL:
|
||||
licenseString = "private";
|
||||
break;
|
||||
case MessageEnteredLicense::LICENSE_COMMERCIAL:
|
||||
licenseString = "commercial";
|
||||
break;
|
||||
|
||||
@@ -145,12 +145,12 @@ void QtMainView::updateBookmarksMenu(const std::vector<std::shared_ptr<Bookmark>
|
||||
|
||||
void QtMainView::handleMessage(MessageForceEnterLicense* message)
|
||||
{
|
||||
bool expired = message->licenseExpired;
|
||||
LicenseChecker::LicenseState state = message->state;
|
||||
|
||||
m_onQtThread(
|
||||
[=]()
|
||||
{
|
||||
m_window->forceEnterLicense(expired);
|
||||
m_window->forceEnterLicense(state);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,169 +0,0 @@
|
||||
#include "qt/window/QtLicense.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QLineEdit>
|
||||
#include <QLabel>
|
||||
#include <QTextEdit>
|
||||
|
||||
#include "LicenseChecker.h"
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
|
||||
QtLicense::QtLicense(QWidget *parent)
|
||||
: QtWindow(false, parent)
|
||||
{
|
||||
}
|
||||
|
||||
QSize QtLicense::sizeHint() const
|
||||
{
|
||||
return QSize(780, 520);
|
||||
}
|
||||
|
||||
void QtLicense::clear()
|
||||
{
|
||||
if (m_licenseText)
|
||||
{
|
||||
m_licenseText->setText("");
|
||||
}
|
||||
|
||||
if (m_errorLabel)
|
||||
{
|
||||
m_errorLabel->setText(" ");
|
||||
}
|
||||
}
|
||||
|
||||
void QtLicense::load()
|
||||
{
|
||||
clear();
|
||||
|
||||
std::string licenseString = LicenseChecker::getInstance()->getCurrentLicenseString();
|
||||
|
||||
if (licenseString.size() && m_licenseText)
|
||||
{
|
||||
m_licenseText->setText(licenseString.c_str());
|
||||
}
|
||||
|
||||
updateCloseButton("Cancel");
|
||||
}
|
||||
|
||||
void QtLicense::setErrorMessage(const QString& errorMessage)
|
||||
{
|
||||
if (m_errorLabel)
|
||||
{
|
||||
m_errorLabel->setText(errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
void QtLicense::populateWindow(QWidget* widget)
|
||||
{
|
||||
QVBoxLayout* subLayout = new QVBoxLayout();
|
||||
subLayout->setContentsMargins(270, 0, 0, 0);
|
||||
|
||||
QLabel* licenseName = new QLabel();
|
||||
licenseName->setText(QString::fromLatin1("Enter Licence"));
|
||||
licenseName->setObjectName("title");
|
||||
subLayout->addWidget(licenseName);
|
||||
|
||||
subLayout->addSpacing(10);
|
||||
|
||||
QLabel* licenseIntro = new QLabel();
|
||||
licenseIntro->setText(QString::fromLatin1("Please enter a licence key to activate Sourcetrail:"));
|
||||
licenseIntro->setObjectName("licenseIntro");
|
||||
subLayout->addWidget(licenseIntro);
|
||||
|
||||
m_licenseText = new QTextEdit();
|
||||
m_licenseText->setObjectName("licenseField");
|
||||
m_licenseText->setAcceptRichText(false);
|
||||
m_licenseText->setPlaceholderText(
|
||||
"-----BEGIN LICENSE-----\n"
|
||||
"Product: Sourcetrail\n"
|
||||
"Licensed to:\n"
|
||||
"License type:\n"
|
||||
"Valid up to version:\n"
|
||||
"-\n"
|
||||
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
|
||||
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
|
||||
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
|
||||
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
|
||||
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
|
||||
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
|
||||
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
|
||||
"xxxxxxxxxxxxxx\n"
|
||||
"-----END LICENSE-----\n"
|
||||
);
|
||||
subLayout->addWidget(m_licenseText);
|
||||
|
||||
m_errorLabel = new QLabel(this);
|
||||
m_errorLabel->setObjectName("licenseError");
|
||||
m_errorLabel->setText(" ");
|
||||
subLayout->addWidget(m_errorLabel);
|
||||
|
||||
subLayout->addSpacing(10);
|
||||
|
||||
QLabel* linkLabel = new QLabel(this);
|
||||
linkLabel->setObjectName("linkLabel");
|
||||
linkLabel->setText(
|
||||
"Don't have a license key yet? "
|
||||
"Please <a href=\"http://sourcetrail.com/buy-license\" style=\"color: #007AC2;\">purchase a license</a>, "
|
||||
"or get a temporary <a href=\"http://sourcetrail.com/test-license\" style=\"color: #007AC2;\">test license</a>.");
|
||||
linkLabel->setOpenExternalLinks(true);
|
||||
linkLabel->setWordWrap(true);
|
||||
linkLabel->setGeometry(275, 300, 300, 50);
|
||||
subLayout->addWidget(linkLabel);
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout();
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->addLayout(subLayout);
|
||||
layout->addSpacing(20);
|
||||
|
||||
widget->setLayout(layout);
|
||||
}
|
||||
|
||||
void QtLicense::windowReady()
|
||||
{
|
||||
m_content->setStyleSheet(m_content->styleSheet() + utility::getStyleSheet(ResourcePaths::getGuiPath().concat(FilePath("license/license.css"))).c_str());
|
||||
|
||||
addLogo();
|
||||
|
||||
updateNextButton("Activate");
|
||||
setPreviousVisible(false);
|
||||
|
||||
m_title->hide();
|
||||
}
|
||||
|
||||
void QtLicense::handleNext()
|
||||
{
|
||||
std::string licenseString = m_licenseText->toPlainText().toStdString();
|
||||
|
||||
LicenseChecker* checker = LicenseChecker::getInstance().get();
|
||||
LicenseChecker::LicenseState state = checker->checkLicenseString(licenseString);
|
||||
|
||||
std::string errorString;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case LicenseChecker::LICENSE_EMPTY:
|
||||
errorString = "No licence key was entered.";
|
||||
break;
|
||||
case LicenseChecker::LICENSE_MOVED:
|
||||
case LicenseChecker::LICENSE_MALFORMED:
|
||||
errorString = "The entered license key is malformed.";
|
||||
break;
|
||||
case LicenseChecker::LICENSE_INVALID:
|
||||
errorString = "The entered license key is invalid.";
|
||||
break;
|
||||
case LicenseChecker::LICENSE_EXPIRED:
|
||||
errorString = "The entered license key is expired.";
|
||||
break;
|
||||
case LicenseChecker::LICENSE_VALID:
|
||||
{
|
||||
checker->saveCurrentLicenseString(licenseString);
|
||||
m_errorLabel->setText(" ");
|
||||
|
||||
emit finished();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_errorLabel->setText(errorString.c_str());
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
#ifndef QT_LICENSE_H
|
||||
#define QT_LICENSE_H
|
||||
|
||||
#include "qt/window/QtWindow.h"
|
||||
|
||||
class QLabel;
|
||||
class QPushButton;
|
||||
class QTextEdit;
|
||||
|
||||
class QtLicense
|
||||
: public QtWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtLicense(QWidget* parent = 0);
|
||||
QSize sizeHint() const override;
|
||||
|
||||
void clear();
|
||||
void load();
|
||||
|
||||
void setErrorMessage(const QString& errorMessage);
|
||||
|
||||
protected:
|
||||
// QtWindow implementation
|
||||
virtual void populateWindow(QWidget* widget) override;
|
||||
virtual void windowReady() override;
|
||||
|
||||
virtual void handleNext() override;
|
||||
|
||||
private:
|
||||
QTextEdit* m_licenseText;
|
||||
QLabel* m_errorLabel;
|
||||
};
|
||||
|
||||
#endif // QT_LICENSE_H
|
||||
@@ -0,0 +1,326 @@
|
||||
#include "qt/window/QtLicenseWindow.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCheckBox>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QRadioButton>
|
||||
#include <QTextEdit>
|
||||
|
||||
#include "LicenseChecker.h"
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "settings/ApplicationSettings.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
|
||||
QtLicenseWindow::QtLicenseWindow(QWidget *parent)
|
||||
: QtWindow(false, parent)
|
||||
{
|
||||
}
|
||||
|
||||
QSize QtLicenseWindow::sizeHint() const
|
||||
{
|
||||
return QSize(700, 500);
|
||||
}
|
||||
|
||||
void QtLicenseWindow::clear()
|
||||
{
|
||||
if (m_licenseText)
|
||||
{
|
||||
m_commercialUse->setChecked(false);
|
||||
m_privateUse->setChecked(false);
|
||||
|
||||
m_licenseText->setText("");
|
||||
m_errorLabel->setText(" ");
|
||||
}
|
||||
}
|
||||
|
||||
void QtLicenseWindow::load()
|
||||
{
|
||||
clear();
|
||||
|
||||
std::string licenseString = LicenseChecker::getInstance()->getCurrentLicenseString();
|
||||
|
||||
if (licenseString.size() && m_licenseText)
|
||||
{
|
||||
m_commercialUse->setChecked(true);
|
||||
|
||||
m_licenseText->setEnabled(true);
|
||||
m_licenseText->setText(licenseString.c_str());
|
||||
}
|
||||
else if (ApplicationSettings::getInstance()->getNonCommercialUse())
|
||||
{
|
||||
m_privateUse->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
void QtLicenseWindow::setErrorMessage(const QString& errorMessage)
|
||||
{
|
||||
if (m_errorLabel)
|
||||
{
|
||||
m_errorLabel->setText(errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
void QtLicenseWindow::populateWindow(QWidget* widget)
|
||||
{
|
||||
QVBoxLayout* subLayout = new QVBoxLayout();
|
||||
subLayout->setContentsMargins(270, 0, 0, 0);
|
||||
|
||||
// commercial
|
||||
m_commercialUse = new QRadioButton("Commercial Use");
|
||||
m_commercialUse->setObjectName("licenseOption");
|
||||
subLayout->addWidget(m_commercialUse);
|
||||
|
||||
QLabel* linkLabel = new QLabel(this);
|
||||
linkLabel->setText(
|
||||
"For commercial use please <a href=\"http://sourcetrail.com/buy-license\" style=\"color: #007AC2;\">purchase a license</a>, "
|
||||
"or get a temporary <a href=\"http://sourcetrail.com/test-license\" style=\"color: #007AC2;\">test license</a>.");
|
||||
linkLabel->setOpenExternalLinks(true);
|
||||
linkLabel->setWordWrap(true);
|
||||
subLayout->addWidget(linkLabel);
|
||||
|
||||
m_licenseText = new QTextEdit();
|
||||
m_licenseText->setObjectName("licenseField");
|
||||
m_licenseText->setAcceptRichText(false);
|
||||
m_licenseText->setPlaceholderText(
|
||||
"-----BEGIN LICENSE-----\n"
|
||||
"Product: Sourcetrail\n"
|
||||
"Licensed to:\n"
|
||||
"License type:\n"
|
||||
"Valid up to version:\n"
|
||||
"-\n"
|
||||
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
|
||||
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
|
||||
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
|
||||
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
|
||||
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
|
||||
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
|
||||
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
|
||||
"xxxxxxxxxxxxxx\n"
|
||||
"-----END LICENSE-----\n"
|
||||
);
|
||||
m_licenseText->setEnabled(false);
|
||||
subLayout->addWidget(m_licenseText);
|
||||
|
||||
m_errorLabel = new QLabel(" ", this);
|
||||
m_errorLabel->setObjectName("licenseError");
|
||||
m_errorLabel->setWordWrap(true);
|
||||
subLayout->addWidget(m_errorLabel);
|
||||
|
||||
subLayout->addSpacing(10);
|
||||
|
||||
|
||||
// private
|
||||
m_privateUse = new QRadioButton("Non-Commercial Use");
|
||||
m_privateUse->setObjectName("licenseOption");
|
||||
subLayout->addWidget(m_privateUse);
|
||||
|
||||
QLabel* licenseIntro2 = new QLabel("You confirm that you will use Sourcetrail solely for non-commercial purposes.");
|
||||
licenseIntro2->setWordWrap(true);
|
||||
subLayout->addWidget(licenseIntro2);
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout();
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->addLayout(subLayout);
|
||||
layout->addSpacing(20);
|
||||
|
||||
widget->setLayout(layout);
|
||||
|
||||
|
||||
connect(m_commercialUse, &QRadioButton::toggled, this, &QtLicenseWindow::optionChanged);
|
||||
connect(m_privateUse, &QRadioButton::toggled, this, &QtLicenseWindow::optionChanged);
|
||||
}
|
||||
|
||||
void QtLicenseWindow::windowReady()
|
||||
{
|
||||
m_content->setStyleSheet(m_content->styleSheet() +
|
||||
utility::getStyleSheet(ResourcePaths::getGuiPath().concat(FilePath("license/license.css"))).c_str());
|
||||
|
||||
addLogo();
|
||||
|
||||
updateTitle("Select Licence Option");
|
||||
|
||||
updateNextButton("Activate");
|
||||
setNextEnabled(false);
|
||||
|
||||
setPreviousVisible(false);
|
||||
updateCloseButton("Cancel");
|
||||
}
|
||||
|
||||
void QtLicenseWindow::handleNext()
|
||||
{
|
||||
if (m_commercialUse->isChecked())
|
||||
{
|
||||
std::string licenseString = m_licenseText->toPlainText().toStdString();
|
||||
|
||||
LicenseChecker* checker = LicenseChecker::getInstance().get();
|
||||
LicenseChecker::LicenseState state = checker->checkLicenseString(licenseString);
|
||||
|
||||
std::string errorString;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case LicenseChecker::LICENSE_EMPTY:
|
||||
errorString = "No licence key was entered.";
|
||||
break;
|
||||
case LicenseChecker::LICENSE_MOVED:
|
||||
case LicenseChecker::LICENSE_MALFORMED:
|
||||
errorString = "The entered license key is malformed.";
|
||||
break;
|
||||
case LicenseChecker::LICENSE_INVALID:
|
||||
errorString = "The entered license key is invalid.";
|
||||
break;
|
||||
case LicenseChecker::LICENSE_EXPIRED:
|
||||
errorString = "The entered license key is expired.";
|
||||
break;
|
||||
case LicenseChecker::LICENSE_VALID:
|
||||
{
|
||||
if (checker->getLicenseType(licenseString) == MessageEnteredLicense::LICENSE_NON_COMMERCIAL)
|
||||
{
|
||||
errorString =
|
||||
"The entered license key does not permit commercial use. You no longer need a license "
|
||||
"key for non-commercial use. Please choose the non-commercial option below.";
|
||||
break;
|
||||
}
|
||||
|
||||
checker->saveCurrentLicenseString(licenseString);
|
||||
m_errorLabel->setText(" ");
|
||||
|
||||
ApplicationSettings::getInstance()->setNonCommercialUse(false);
|
||||
ApplicationSettings::getInstance()->save();
|
||||
|
||||
emit finished();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_errorLabel->setText(errorString.c_str());
|
||||
}
|
||||
else if (m_privateUse->isChecked())
|
||||
{
|
||||
if (!m_confirmWindow)
|
||||
{
|
||||
m_confirmWindow = new QtNonCommercialInfoWindow();
|
||||
m_confirmWindow->setup();
|
||||
|
||||
connect(m_confirmWindow, &QtWindow::canceled,
|
||||
[this]()
|
||||
{
|
||||
m_confirmWindow->hideWindow();
|
||||
raise();
|
||||
}
|
||||
);
|
||||
|
||||
connect(m_confirmWindow, &QtWindow::finished,
|
||||
[this]()
|
||||
{
|
||||
m_confirmWindow->hideWindow();
|
||||
raise();
|
||||
|
||||
ApplicationSettings::getInstance()->setNonCommercialUse(true);
|
||||
ApplicationSettings::getInstance()->save();
|
||||
|
||||
emit finished();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
m_confirmWindow->showWindow();
|
||||
}
|
||||
}
|
||||
|
||||
void QtLicenseWindow::optionChanged()
|
||||
{
|
||||
m_licenseText->setEnabled(m_commercialUse->isChecked());
|
||||
setNextEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
QtNonCommercialInfoWindow::QtNonCommercialInfoWindow(QWidget *parent)
|
||||
: QtWindow(false, parent)
|
||||
{
|
||||
}
|
||||
|
||||
QSize QtNonCommercialInfoWindow::sizeHint() const
|
||||
{
|
||||
return QSize(450, 500);
|
||||
}
|
||||
|
||||
void QtNonCommercialInfoWindow::populateWindow(QWidget* widget)
|
||||
{
|
||||
QVBoxLayout* layout = new QVBoxLayout(widget);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
QLabel* titleLabel;
|
||||
QLabel* textLabel;
|
||||
|
||||
|
||||
titleLabel = new QLabel("Is your use non-commercial?");
|
||||
textLabel = new QLabel(
|
||||
"A use is non-commercial only if it is in no manner primarily intended for or directed toward "
|
||||
"commercial advantage or private monetary compensation.");
|
||||
|
||||
QFont font = titleLabel->font();
|
||||
font.setBold(true);
|
||||
titleLabel->setFont(font);
|
||||
textLabel->setWordWrap(true);
|
||||
|
||||
layout->addWidget(titleLabel);
|
||||
layout->addWidget(textLabel);
|
||||
layout->addSpacing(10);
|
||||
|
||||
|
||||
titleLabel = new QLabel("When does non-commercial use NOT apply?");
|
||||
textLabel = new QLabel(
|
||||
"<p>Running Sourcetrail for 'Non-Commercial Use' is not permitted, if your use is in some sense commercial. "
|
||||
"Examples of commercial uses are:</p>"
|
||||
"<ul><li> you are using Sourcetrail to work on your company's projects (no matter whether you are working on "
|
||||
"open-source projects as well),</li>"
|
||||
"<li> you are a student and you use Sourcetrail for your work as a freelancer,</li>"
|
||||
"<li> you use Sourcetrail in your spare time to help on your friend's new game and you are getting paid for that.</li></ul>"
|
||||
"<p>In cases like these you will need a commercial license.</p>"
|
||||
);
|
||||
|
||||
titleLabel->setFont(font);
|
||||
textLabel->setWordWrap(true);
|
||||
|
||||
layout->addWidget(titleLabel);
|
||||
layout->addWidget(textLabel);
|
||||
layout->addSpacing(10);
|
||||
|
||||
|
||||
titleLabel = new QLabel("Not sure?");
|
||||
textLabel = new QLabel(
|
||||
"Contact mail@sourcetrail.com and explain your intended use in detail, then we may confirm whether a "
|
||||
"non-commercial license applies."
|
||||
);
|
||||
|
||||
titleLabel->setFont(font);
|
||||
textLabel->setWordWrap(true);
|
||||
|
||||
layout->addWidget(titleLabel);
|
||||
layout->addWidget(textLabel);
|
||||
layout->addStretch();
|
||||
|
||||
QCheckBox* checkbox = new QCheckBox("I confirm solely non-commercial use of Sourcetrail according to above conditions.");
|
||||
connect(checkbox, &QCheckBox::toggled,
|
||||
[checkbox, this]()
|
||||
{
|
||||
setNextEnabled(checkbox->isChecked());
|
||||
}
|
||||
);
|
||||
layout->addWidget(checkbox);
|
||||
layout->addStretch();
|
||||
|
||||
widget->setLayout(layout);
|
||||
}
|
||||
|
||||
void QtNonCommercialInfoWindow::windowReady()
|
||||
{
|
||||
updateTitle("Non-Commercial Use Confirmation");
|
||||
updateCloseButton("Cancel");
|
||||
updateNextButton("Confirm");
|
||||
|
||||
setNextEnabled(false);
|
||||
setPreviousVisible(false);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
#ifndef QT_LICENSE_WINDOW_H
|
||||
#define QT_LICENSE_WINDOW_H
|
||||
|
||||
#include "qt/window/QtWindow.h"
|
||||
|
||||
class QLabel;
|
||||
class QRadioButton;
|
||||
class QTextEdit;
|
||||
|
||||
class QtLicenseWindow
|
||||
: public QtWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtLicenseWindow(QWidget* parent = 0);
|
||||
QSize sizeHint() const override;
|
||||
|
||||
void clear();
|
||||
void load();
|
||||
|
||||
void setErrorMessage(const QString& errorMessage);
|
||||
|
||||
protected:
|
||||
// QtWindow implementation
|
||||
virtual void populateWindow(QWidget* widget) override;
|
||||
virtual void windowReady() override;
|
||||
|
||||
virtual void handleNext() override;
|
||||
|
||||
private slots:
|
||||
void optionChanged();
|
||||
|
||||
private:
|
||||
QRadioButton* m_commercialUse;
|
||||
QRadioButton* m_privateUse;
|
||||
|
||||
QTextEdit* m_licenseText;
|
||||
QLabel* m_errorLabel;
|
||||
|
||||
QtWindow* m_confirmWindow = nullptr;
|
||||
};
|
||||
|
||||
|
||||
class QtNonCommercialInfoWindow
|
||||
: public QtWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtNonCommercialInfoWindow(QWidget* parent = 0);
|
||||
QSize sizeHint() const override;
|
||||
|
||||
protected:
|
||||
// QtWindow implementation
|
||||
virtual void populateWindow(QWidget* widget) override;
|
||||
virtual void windowReady() override;
|
||||
};
|
||||
|
||||
#endif // QT_LICENSE_WINDOW_H
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "component/view/TabbedView.h"
|
||||
#include "component/view/View.h"
|
||||
#include "data/bookmark/Bookmark.h"
|
||||
#include "LicenseChecker.h"
|
||||
#include "qt/utility/QtContextMenu.h"
|
||||
#include "qt/utility/QtFileDialog.h"
|
||||
#include "qt/utility/utilityQt.h"
|
||||
@@ -24,7 +23,7 @@
|
||||
#include "qt/window/QtAboutLicense.h"
|
||||
#include "qt/window/QtEulaWindow.h"
|
||||
#include "qt/window/QtKeyboardShortcuts.h"
|
||||
#include "qt/window/QtLicense.h"
|
||||
#include "qt/window/QtLicenseWindow.h"
|
||||
#include "qt/window/QtPreferencesWindow.h"
|
||||
#include "qt/window/QtStartScreen.h"
|
||||
#include "settings/ApplicationSettings.h"
|
||||
@@ -263,11 +262,11 @@ void QtMainWindow::loadWindow(bool showStartWindow)
|
||||
MessageEnteredLicense(LicenseChecker::getInstance()->getCurrentLicenseType()).dispatch();
|
||||
}
|
||||
|
||||
setTrialActionsEnabled(licenseValid);
|
||||
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
|
||||
|
||||
if (state == LicenseChecker::LICENSE_MOVED)
|
||||
{
|
||||
ApplicationSettings::getInstance()->setLicenseString("");
|
||||
appSettings->setLicenseString("");
|
||||
}
|
||||
|
||||
if (showStartWindow)
|
||||
@@ -275,13 +274,13 @@ void QtMainWindow::loadWindow(bool showStartWindow)
|
||||
showStartScreen();
|
||||
}
|
||||
|
||||
if (state != LicenseChecker::LICENSE_VALID && state != LicenseChecker::LICENSE_EMPTY)
|
||||
if (state != LicenseChecker::LICENSE_VALID && !appSettings->getNonCommercialUse())
|
||||
{
|
||||
forceEnterLicense(state == LicenseChecker::LICENSE_EXPIRED);
|
||||
forceEnterLicense(state);
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WIN
|
||||
if (ApplicationSettings::getInstance()->getAcceptedEulaVersion() < QtEulaWindow::EULA_VERSION)
|
||||
if (appSettings->getAcceptedEulaVersion() < QtEulaWindow::EULA_VERSION)
|
||||
{
|
||||
showEula(true);
|
||||
}
|
||||
@@ -305,26 +304,40 @@ void QtMainWindow::saveLayout()
|
||||
settings.setValue("DOCK_LOCATIONS", this->saveState());
|
||||
}
|
||||
|
||||
void QtMainWindow::forceEnterLicense(bool expired)
|
||||
void QtMainWindow::forceEnterLicense(LicenseChecker::LicenseState state)
|
||||
{
|
||||
QtLicenseWindow* window = dynamic_cast<QtLicenseWindow*>(m_windowStack.getTopWindow());
|
||||
if (window)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
enterLicense();
|
||||
|
||||
QtLicense* enterLicenseWindow = dynamic_cast<QtLicense*>(m_windowStack.getTopWindow());
|
||||
if (!enterLicenseWindow)
|
||||
window = dynamic_cast<QtLicenseWindow*>(m_windowStack.getTopWindow());
|
||||
if (!window)
|
||||
{
|
||||
LOG_ERROR("No enter license window on top of stack");
|
||||
return;
|
||||
}
|
||||
|
||||
if (expired)
|
||||
if (state == LicenseChecker::LICENSE_EXPIRED)
|
||||
{
|
||||
enterLicenseWindow->setErrorMessage("The license key is expired.");
|
||||
window->setErrorMessage("The license key is expired.");
|
||||
}
|
||||
else
|
||||
else if (state != LicenseChecker::LICENSE_VALID && state != LicenseChecker::LICENSE_EMPTY)
|
||||
{
|
||||
enterLicenseWindow->clear();
|
||||
enterLicenseWindow->setErrorMessage("Please re-enter your license key.");
|
||||
window->clear();
|
||||
window->setErrorMessage("Please re-enter your license key.");
|
||||
}
|
||||
|
||||
window->updateCloseButton("Quit");
|
||||
|
||||
setEnabled(false);
|
||||
window->setEnabled(true);
|
||||
|
||||
disconnect(window, &QtWindow::canceled, &m_windowStack, &QtWindowStack::popWindow);
|
||||
connect(window, &QtWindow::canceled, dynamic_cast<QApplication*>(QCoreApplication::instance()), &QApplication::quit);
|
||||
}
|
||||
|
||||
void QtMainWindow::updateHistoryMenu(const std::vector<SearchMatch>& history)
|
||||
@@ -458,11 +471,11 @@ void QtMainWindow::showLicenses()
|
||||
|
||||
void QtMainWindow::enterLicense()
|
||||
{
|
||||
QtLicense* enterLicenseWindow = createWindow<QtLicense>();
|
||||
QtLicenseWindow* enterLicenseWindow = createWindow<QtLicenseWindow>();
|
||||
enterLicenseWindow->setup();
|
||||
|
||||
disconnect(enterLicenseWindow, &QtLicense::finished, &m_windowStack, &QtWindowStack::clearWindows);
|
||||
connect(enterLicenseWindow, &QtLicense::finished, this, &QtMainWindow::enteredLicense);
|
||||
disconnect(enterLicenseWindow, &QtLicenseWindow::finished, &m_windowStack, &QtWindowStack::clearWindows);
|
||||
connect(enterLicenseWindow, &QtLicenseWindow::finished, this, &QtMainWindow::enteredLicense);
|
||||
|
||||
enterLicenseWindow->load();
|
||||
}
|
||||
@@ -477,9 +490,10 @@ void QtMainWindow::enteredLicense()
|
||||
|
||||
m_windowStack.clearWindows();
|
||||
|
||||
setTrialActionsEnabled(true);
|
||||
MessageEnteredLicense(LicenseChecker::getInstance()->getCurrentLicenseType()).dispatch();
|
||||
|
||||
setEnabled(true);
|
||||
|
||||
if (showStartWindow)
|
||||
{
|
||||
showStartScreen();
|
||||
@@ -732,8 +746,7 @@ void QtMainWindow::setupProjectMenu()
|
||||
QMenu *menu = new QMenu(tr("&Project"), this);
|
||||
menuBar()->addMenu(menu);
|
||||
|
||||
m_trialDisabledActions.push_back(
|
||||
menu->addAction(tr("&New Project..."), this, &QtMainWindow::newProject, QKeySequence::New));
|
||||
menu->addAction(tr("&New Project..."), this, &QtMainWindow::newProject, QKeySequence::New);
|
||||
menu->addAction(tr("&Open Project..."), this, &QtMainWindow::openProject, QKeySequence::Open);
|
||||
|
||||
QMenu *recentProjectMenu = new QMenu(tr("Recent Projects"));
|
||||
@@ -753,8 +766,8 @@ void QtMainWindow::setupProjectMenu()
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
m_trialDisabledActions.push_back(menu->addAction(tr("&Edit Project..."), this, &QtMainWindow::editProject));
|
||||
m_trialDisabledActions.push_back(menu->addSeparator());
|
||||
menu->addAction(tr("&Edit Project..."), this, &QtMainWindow::editProject);
|
||||
menu->addSeparator();
|
||||
|
||||
menu->addAction(tr("E&xit"), QCoreApplication::instance(), &QCoreApplication::quit, QKeySequence::Quit);
|
||||
}
|
||||
@@ -764,21 +777,14 @@ void QtMainWindow::setupEditMenu()
|
||||
QMenu *menu = new QMenu(tr("&Edit"), this);
|
||||
menuBar()->addMenu(menu);
|
||||
|
||||
m_trialDisabledActions.push_back(menu->addAction(tr("&Refresh"), this, &QtMainWindow::refresh, QKeySequence::Refresh));
|
||||
menu->addAction(tr("&Refresh"), this, &QtMainWindow::refresh, QKeySequence::Refresh);
|
||||
if (utility::getOsType() == OS_WINDOWS)
|
||||
{
|
||||
m_trialDisabledActions.push_back(
|
||||
menu->addAction(tr("&Full Refresh"), this, &QtMainWindow::forceRefresh, QKeySequence(Qt::SHIFT + Qt::Key_F5))
|
||||
);
|
||||
menu->addAction(tr("&Full Refresh"), this, &QtMainWindow::forceRefresh, QKeySequence(Qt::SHIFT + Qt::Key_F5));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_trialDisabledActions.push_back(menu->addAction(
|
||||
tr("&Full Refresh"),
|
||||
this,
|
||||
&QtMainWindow::forceRefresh,
|
||||
QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_R)
|
||||
));
|
||||
menu->addAction(tr("&Full Refresh"), this, &QtMainWindow::forceRefresh, QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_R));
|
||||
}
|
||||
|
||||
menu->addSeparator();
|
||||
@@ -906,10 +912,10 @@ void QtMainWindow::setupHelpMenu()
|
||||
menu->addAction(tr("Keyboard Shortcuts"), this, &QtMainWindow::showKeyboardShortcuts);
|
||||
menu->addAction(tr("Documentation"), this, &QtMainWindow::showDocumentation);
|
||||
menu->addAction(tr("Bug Tracker"), this, &QtMainWindow::showBugtracker);
|
||||
menu->addAction(tr("Enter License..."), this, &QtMainWindow::enterLicense);
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
menu->addAction(tr("Select License..."), this, &QtMainWindow::enterLicense);
|
||||
menu->addAction(tr("End User License Agreement"), this, &QtMainWindow::showEula);
|
||||
menu->addAction(tr("3rd Party Licences"), this, &QtMainWindow::showLicenses);
|
||||
menu->addAction(tr("&About Sourcetrail"), this, &QtMainWindow::about);
|
||||
@@ -920,14 +926,6 @@ void QtMainWindow::setupHelpMenu()
|
||||
menu->addAction(tr("Show Log Folder"), this, &QtMainWindow::showLogFolder);
|
||||
}
|
||||
|
||||
void QtMainWindow::setTrialActionsEnabled(bool enabled)
|
||||
{
|
||||
for (QAction* action : m_trialDisabledActions)
|
||||
{
|
||||
action->setEnabled(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
QtMainWindow::DockWidget* QtMainWindow::getDockWidgetForView(View* view)
|
||||
{
|
||||
for (DockWidget& dock : m_dockWidgets)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <QMainWindow>
|
||||
|
||||
#include "data/search/SearchMatch.h"
|
||||
#include "LicenseChecker.h"
|
||||
#include "qt/window/QtWindowStack.h"
|
||||
|
||||
class Bookmark;
|
||||
@@ -71,7 +72,7 @@ public:
|
||||
void loadDockWidgetLayout();
|
||||
void loadWindow(bool showStartWindow);
|
||||
|
||||
void forceEnterLicense(bool expired);
|
||||
void forceEnterLicense(LicenseChecker::LicenseState state);
|
||||
|
||||
void updateHistoryMenu(const std::vector<SearchMatch>& history);
|
||||
void updateBookmarksMenu(const std::vector<std::shared_ptr<Bookmark>>& bookmarks);
|
||||
@@ -160,8 +161,6 @@ private:
|
||||
void setupBookmarksMenu();
|
||||
void setupHelpMenu();
|
||||
|
||||
void setTrialActionsEnabled(bool enabled);
|
||||
|
||||
DockWidget* getDockWidgetForView(View* view);
|
||||
|
||||
void setShowDockWidgetTitleBars(bool showTitleBars);
|
||||
@@ -187,8 +186,6 @@ private:
|
||||
|
||||
bool m_showDockWidgetTitleBars;
|
||||
|
||||
std::vector<QAction*> m_trialDisabledActions;
|
||||
|
||||
QtWindowStack m_windowStack;
|
||||
};
|
||||
|
||||
|
||||
@@ -145,7 +145,6 @@ void QtStartScreen::setupStartScreen()
|
||||
{
|
||||
License license;
|
||||
license.loadFromEncodedString(ApplicationSettings::getInstance()->getLicenseString(), AppPath::getAppPath());
|
||||
bool licenseValid = license.isValid();
|
||||
|
||||
setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concat(FilePath("startscreen/startscreen.css"))).c_str());
|
||||
addLogo();
|
||||
@@ -166,52 +165,10 @@ void QtStartScreen::setupStartScreen()
|
||||
QtUpdateCheckerWidget* checker = new QtUpdateCheckerWidget(this);
|
||||
col->addWidget(checker);
|
||||
|
||||
if (!licenseValid)
|
||||
col->addSpacing(30);
|
||||
|
||||
if (license.isValid())
|
||||
{
|
||||
col->addSpacing(20);
|
||||
|
||||
QLabel* welcomeLabel = new QLabel(
|
||||
"<b>Welcome to the trial version of Sourcetrail!</b><br />"
|
||||
"Explore our preindexed projects to experience Sourcetrail's unique user interface. "
|
||||
"More projects are available for download <a href=\"http://sourcetrail.com/downloads#extra\" style=\"color: #007AC2;\">here</a>.<br /><br />"
|
||||
"If you want to use Sourcetrail on your own source code please "
|
||||
"<a href=\"http://sourcetrail.com/buy-license\" style=\"color: #007AC2;\">purchase a license</a>, "
|
||||
"or get a temporary <a href=\"http://sourcetrail.com/test-license\" style=\"color: #007AC2;\">test license</a>.", this);
|
||||
welcomeLabel->setOpenExternalLinks(true);
|
||||
welcomeLabel->setObjectName("welcomeLabel");
|
||||
welcomeLabel->setWordWrap(true);
|
||||
welcomeLabel->setAlignment(Qt::AlignTop);
|
||||
|
||||
col->addWidget(welcomeLabel, 0, Qt::AlignHCenter | Qt::AlignTop);
|
||||
col->addStrut(260);
|
||||
col->addStretch();
|
||||
|
||||
QPushButton* openProjectButton = new QPushButton("Open Project", this);
|
||||
openProjectButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
openProjectButton->setObjectName("projectButton");
|
||||
openProjectButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
connect(openProjectButton, &QPushButton::clicked, this, &QtStartScreen::handleOpenProjectButton);
|
||||
col->addWidget(openProjectButton);
|
||||
|
||||
col->addSpacing(8);
|
||||
|
||||
QPushButton* unlockButton = new QPushButton("Unlock", this);
|
||||
unlockButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
unlockButton->setObjectName("projectButton");
|
||||
unlockButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
connect(unlockButton, &QPushButton::clicked, this, &QtStartScreen::handleUnlockButton);
|
||||
|
||||
QHBoxLayout* row = new QHBoxLayout();
|
||||
row->addWidget(unlockButton);
|
||||
row->addStretch();
|
||||
col->addLayout(row);
|
||||
|
||||
layout->addStretch(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
col->addSpacing(30);
|
||||
|
||||
std::string licenseString = license.getLicenseInfo();
|
||||
|
||||
QLabel* licenseHeader = new QLabel("Licensed to:");
|
||||
@@ -221,27 +178,39 @@ void QtStartScreen::setupStartScreen()
|
||||
QLabel* licenseLabel = new QLabel(licenseString.c_str());
|
||||
licenseLabel->setObjectName("licenseLabel");
|
||||
col->addWidget(licenseLabel);
|
||||
|
||||
col->addStretch();
|
||||
|
||||
QPushButton* newProjectButton = new QPushButton("New Project", this);
|
||||
newProjectButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
newProjectButton->setObjectName("projectButton");
|
||||
newProjectButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
connect(newProjectButton, &QPushButton::clicked, this, &QtStartScreen::handleNewProjectButton);
|
||||
col->addWidget(newProjectButton);
|
||||
|
||||
col->addSpacing(8);
|
||||
|
||||
QPushButton* openProjectButton = new QPushButton("Open Project", this);
|
||||
openProjectButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
openProjectButton->setObjectName("projectButton");
|
||||
openProjectButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
connect(openProjectButton, &QPushButton::clicked, this, &QtStartScreen::handleOpenProjectButton);
|
||||
col->addWidget(openProjectButton);
|
||||
|
||||
layout->addStretch(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
QLabel* licenseHeader = new QLabel("Not licensed for<br />commercial use.");
|
||||
licenseHeader->setObjectName("licenseHeaderLabel");
|
||||
col->addWidget(licenseHeader);
|
||||
|
||||
QPushButton* upgradeButton = new QPushButton("upgrade");
|
||||
upgradeButton->setObjectName("upgradeButton");
|
||||
upgradeButton->setCursor(Qt::PointingHandCursor);
|
||||
col->addWidget(upgradeButton);
|
||||
connect(upgradeButton, &QPushButton::clicked, [this](){ emit openEnterLicenseDialog(); });
|
||||
}
|
||||
|
||||
col->addStretch();
|
||||
|
||||
QPushButton* newProjectButton = new QPushButton("New Project", this);
|
||||
newProjectButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
newProjectButton->setObjectName("projectButton");
|
||||
newProjectButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
connect(newProjectButton, &QPushButton::clicked, this, &QtStartScreen::handleNewProjectButton);
|
||||
col->addWidget(newProjectButton);
|
||||
|
||||
col->addSpacing(8);
|
||||
|
||||
QPushButton* openProjectButton = new QPushButton("Open Project", this);
|
||||
openProjectButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
openProjectButton->setObjectName("projectButton");
|
||||
openProjectButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
connect(openProjectButton, &QPushButton::clicked, this, &QtStartScreen::handleOpenProjectButton);
|
||||
col->addWidget(openProjectButton);
|
||||
|
||||
layout->addStretch(2);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -249,10 +218,6 @@ void QtStartScreen::setupStartScreen()
|
||||
layout->addLayout(col, 1);
|
||||
|
||||
QLabel* recentProjectsLabel = new QLabel("Recent Projects: ", this);
|
||||
if (!licenseValid)
|
||||
{
|
||||
recentProjectsLabel->setText("Projects:");
|
||||
}
|
||||
recentProjectsLabel->setObjectName("recentLabel");
|
||||
col->addWidget(recentProjectsLabel);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user