From b5a1d18a21cf30ee1478bb58b23086a1fb385a4b Mon Sep 17 00:00:00 2001 From: huxingyi Date: Mon, 13 Jul 2020 07:49:34 +0930 Subject: [PATCH] Thanks Igor Costa de Faria for the sponsership [skip ci] --- SUPPORTERS | 2 ++ resources.qrc | 1 + src/documentwindow.cpp | 25 +++++++++++++++++++++++++ src/documentwindow.h | 3 +++ 4 files changed, 31 insertions(+) create mode 100644 SUPPORTERS diff --git a/SUPPORTERS b/SUPPORTERS new file mode 100644 index 00000000..64048e40 --- /dev/null +++ b/SUPPORTERS @@ -0,0 +1,2 @@ +# Supporters ordered by first donation. +Igor Costa de Faria \ No newline at end of file diff --git a/resources.qrc b/resources.qrc index 630cc83e..8917b0b5 100644 --- a/resources.qrc +++ b/resources.qrc @@ -35,6 +35,7 @@ ACKNOWLEDGEMENTS.html AUTHORS CONTRIBUTORS + SUPPORTERS languages/dust3d_es_AR.qm languages/dust3d_it_IT.qm diff --git a/src/documentwindow.cpp b/src/documentwindow.cpp index 76c9dd02..ebde70eb 100644 --- a/src/documentwindow.cpp +++ b/src/documentwindow.cpp @@ -56,6 +56,7 @@ std::map g_documentWindows; QTextBrowser *g_acknowlegementsWidget = nullptr; AboutWidget *g_aboutWidget = nullptr; QTextBrowser *g_contributorsWidget = nullptr; +QTextBrowser *g_supportersWidget = nullptr; UpdatesCheckWidget *g_updatesCheckWidget = nullptr; void outputMessage(QtMsgType type, const QMessageLogContext &context, const QString &msg) @@ -107,6 +108,21 @@ void DocumentWindow::showContributors() g_contributorsWidget->raise(); } +void DocumentWindow::showSupporters() +{ + if (!g_supportersWidget) { + g_supportersWidget = new QTextBrowser; + g_supportersWidget->setWindowTitle(unifiedWindowTitle(tr("Supporters"))); + g_supportersWidget->setMinimumSize(QSize(400, 300)); + QFile supporters(":/SUPPORTERS"); + supporters.open(QFile::ReadOnly | QFile::Text); + g_supportersWidget->setHtml("

SUPPORTERS

" + supporters.readAll() + "
"); + } + g_supportersWidget->show(); + g_supportersWidget->activateWindow(); + g_supportersWidget->raise(); +} + void DocumentWindow::showAbout() { if (!g_aboutWidget) { @@ -902,6 +918,10 @@ DocumentWindow::DocumentWindow() : m_seeContributorsAction = new QAction(tr("Contributors"), this); connect(m_seeContributorsAction, &QAction::triggered, this, &DocumentWindow::seeContributors); m_helpMenu->addAction(m_seeContributorsAction); + + m_seeSupportersAction = new QAction(tr("Supporters"), this); + connect(m_seeSupportersAction, &QAction::triggered, this, &DocumentWindow::seeSupporters); + m_helpMenu->addAction(m_seeSupportersAction); m_seeAcknowlegementsAction = new QAction(tr("Acknowlegements"), this); connect(m_seeAcknowlegementsAction, &QAction::triggered, this, &DocumentWindow::seeAcknowlegements); @@ -1404,6 +1424,11 @@ void DocumentWindow::seeContributors() DocumentWindow::showContributors(); } +void DocumentWindow::seeSupporters() +{ + DocumentWindow::showSupporters(); +} + void DocumentWindow::initLockButton(QPushButton *button) { QFont font; diff --git a/src/documentwindow.h b/src/documentwindow.h index 5f9fe1a2..cb2cf8aa 100644 --- a/src/documentwindow.h +++ b/src/documentwindow.h @@ -39,6 +39,7 @@ public: static const std::map &documentWindows(); static void showAcknowlegements(); static void showContributors(); + static void showSupporters(); static void showAbout(); static size_t total(); protected: @@ -68,6 +69,7 @@ public slots: void reportIssues(); void seeAcknowlegements(); void seeContributors(); + void seeSupporters(); void seeReferenceGuide(); void documentChanged(); void updateRotationButtonState(); @@ -203,6 +205,7 @@ private: QAction *m_checkForUpdatesAction; QAction *m_reportIssuesAction; QAction *m_seeContributorsAction; + QAction *m_seeSupportersAction; QAction *m_seeAcknowlegementsAction; QAction *m_seeReferenceGuideAction;