ui: Added GitHub and Patreon buttons to start window

This commit is contained in:
Eberhard Graether
2019-11-17 16:14:24 +01:00
parent 9b86f0e824
commit b5e0387f1e
6 changed files with 44 additions and 10 deletions
+2 -2
View File
@@ -514,12 +514,12 @@ void QtMainWindow::showErrorHelpMessage()
void QtMainWindow::showChangelog()
{
QDesktopServices::openUrl(QUrl("https://github.com/CoatiSoftware/SourcetrailBugTracker/#changelog"));
QDesktopServices::openUrl(QUrl("https://github.com/CoatiSoftware/Sourcetrail/blob/master/CHANGELOG.md"));
}
void QtMainWindow::showBugtracker()
{
QDesktopServices::openUrl(QUrl("https://github.com/CoatiSoftware/SourcetrailBugTracker/issues"));
QDesktopServices::openUrl(QUrl("https://github.com/CoatiSoftware/Sourcetrail/issues"));
}
void QtMainWindow::showLicenses()
+28
View File
@@ -1,6 +1,7 @@
#include "QtStartScreen.h"
#include <QCheckBox>
#include <QDesktopServices>
#include <QLabel>
#include <QString>
#include <QHBoxLayout>
@@ -86,6 +87,8 @@ QtStartScreen::QtStartScreen(QWidget *parent)
, m_pythonIcon(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"icon/python_icon.png").wstr()))
, m_javaIcon(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"icon/java_icon.png").wstr()))
, m_projectIcon(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"icon/empty_icon.png").wstr()))
, m_githubIcon(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"startscreen/github_icon.png").wstr()))
, m_patreonIcon(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"startscreen/patreon_icon.png").wstr()))
{
}
@@ -174,6 +177,31 @@ void QtStartScreen::setupStartScreen()
col->addSpacing(15);
QPushButton* githubButton = new QPushButton("Contribute on GitHub", this);
githubButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
githubButton->setObjectName("infoButton");
githubButton->setIcon(m_githubIcon);
githubButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(githubButton, &QPushButton::clicked, [](){
QDesktopServices::openUrl(QUrl("https://github.com/CoatiSoftware/Sourcetrail", QUrl::TolerantMode));
});
col->addWidget(githubButton);
col->addSpacing(8);
// QPushButton* patreonButton = new QPushButton("Support on Patreon", this);
QPushButton* patreonButton = new QPushButton("Become a Patron", this);
patreonButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
patreonButton->setObjectName("infoButton");
patreonButton->setIcon(m_patreonIcon);
patreonButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(patreonButton, &QPushButton::clicked, [](){
QDesktopServices::openUrl(QUrl("https://www.patreon.com/sourcetrail", QUrl::TolerantMode));
});
col->addWidget(patreonButton);
col->addSpacing(15);
{
QLabel* newsHeader = new QLabel("News:");
newsHeader->setObjectName("boldLabel");
+7 -5
View File
@@ -48,11 +48,13 @@ private slots:
private:
std::vector<QtRecentProjectButton*> m_recentProjectsButtons;
QIcon m_cppIcon;
QIcon m_cIcon;
QIcon m_pythonIcon;
QIcon m_javaIcon;
QIcon m_projectIcon;
const QIcon m_cppIcon;
const QIcon m_cIcon;
const QIcon m_pythonIcon;
const QIcon m_javaIcon;
const QIcon m_projectIcon;
const QIcon m_githubIcon;
const QIcon m_patreonIcon;
};
#endif // QT_START_SCREEN_H