From da70122d9c46c6281c06fe1dedc558c13077f64f Mon Sep 17 00:00:00 2001 From: swirl Date: Sun, 20 Feb 2022 19:23:08 -0500 Subject: [PATCH 01/25] remove notifications --- CMakeLists.txt | 5 +- buildconfig/BuildConfig.cpp.in | 2 - buildconfig/BuildConfig.h | 7 - launcher/Application.cpp | 5 +- launcher/CMakeLists.txt | 11 -- .../notifications/NotificationChecker.cpp | 129 ------------------ launcher/notifications/NotificationChecker.h | 61 --------- launcher/ui/MainWindow.cpp | 31 ----- launcher/ui/MainWindow.h | 4 - launcher/ui/dialogs/NotificationDialog.cpp | 86 ------------ launcher/ui/dialogs/NotificationDialog.h | 44 ------ launcher/ui/dialogs/NotificationDialog.ui | 85 ------------ launcher/ui/pages/global/LauncherPage.cpp | 5 - launcher/ui/pages/global/LauncherPage.ui | 22 +-- 14 files changed, 3 insertions(+), 494 deletions(-) delete mode 100644 launcher/notifications/NotificationChecker.cpp delete mode 100644 launcher/notifications/NotificationChecker.h delete mode 100644 launcher/ui/dialogs/NotificationDialog.cpp delete mode 100644 launcher/ui/dialogs/NotificationDialog.h delete mode 100644 launcher/ui/dialogs/NotificationDialog.ui diff --git a/CMakeLists.txt b/CMakeLists.txt index d4a27260..6365f4c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,14 +58,11 @@ set(Launcher_VERSION_HOTFIX 6) set(Launcher_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number.") # Build platform. -set(Launcher_BUILD_PLATFORM "" CACHE STRING "A short string identifying the platform that this build was built for. Only used by the notification system and to display in the about dialog.") +set(Launcher_BUILD_PLATFORM "" CACHE STRING "A short string identifying the platform that this build was built for. Only used to display in the about dialog.") # Channel list URL set(Launcher_UPDATER_BASE "" CACHE STRING "Base URL for the updater.") -# Notification URL -set(Launcher_NOTIFICATION_URL "" CACHE STRING "URL for checking for notifications.") - # The metadata server set(Launcher_META_URL "https://meta.polymc.org/v1/" CACHE STRING "URL to fetch Launcher's meta files from.") diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index 0ffc9326..ed6a755a 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -25,8 +25,6 @@ Config::Config() BUILD_PLATFORM = "@Launcher_BUILD_PLATFORM@"; UPDATER_BASE = "@Launcher_UPDATER_BASE@"; - NOTIFICATION_URL = "@Launcher_NOTIFICATION_URL@"; - FULL_VERSION_STR = "@Launcher_VERSION_MAJOR@.@Launcher_VERSION_MINOR@.@Launcher_VERSION_BUILD@"; GIT_COMMIT = "@Launcher_GIT_COMMIT@"; GIT_REFSPEC = "@Launcher_GIT_REFSPEC@"; diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h index 111381ab..a5c3c859 100644 --- a/buildconfig/BuildConfig.h +++ b/buildconfig/BuildConfig.h @@ -46,13 +46,6 @@ public: /// User-Agent to use for uncached requests. QString USER_AGENT_UNCACHED; - - /// URL for notifications - QString NOTIFICATION_URL; - - /// Used for matching notifications - QString FULL_VERSION_STR; - /// The git commit hash of this build QString GIT_COMMIT; diff --git a/launcher/Application.cpp b/launcher/Application.cpp index e916dcf7..ce40c4f3 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -590,9 +590,6 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_settings->registerSetting("IconTheme", QString("pe_colored")); m_settings->registerSetting("ApplicationTheme", QString("system")); - // Notifications - m_settings->registerSetting("ShownNotifications", QString()); - // Remembered state m_settings->registerSetting("LastUsedGroupForNewInstance", QString()); @@ -1512,7 +1509,7 @@ QString Application::getJarsPath() return m_jarsPath; } -QString Application::getMSAClientID() +QString Application::getMSAClientID() { QString clientIDOverride = m_settings->get("MSAClientIDOverride").toString(); if (!clientIDOverride.isEmpty()) { diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 90149c3b..51a63722 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -174,13 +174,6 @@ add_unit_test(DownloadTask DATA updater/testdata ) -# Rarely used notifications -set(NOTIFICATIONS_SOURCES - # Notifications - short warning messages - notifications/NotificationChecker.h - notifications/NotificationChecker.cpp -) - # Backend for the news bar... there's usually no news. set(NEWS_SOURCES # News System @@ -568,7 +561,6 @@ set(LOGIC_SOURCES ${NET_SOURCES} ${LAUNCH_SOURCES} ${UPDATE_SOURCES} - ${NOTIFICATIONS_SOURCES} ${NEWS_SOURCES} ${MINECRAFT_SOURCES} ${SCREENSHOTS_SOURCES} @@ -800,8 +792,6 @@ SET(LAUNCHER_SOURCES ui/dialogs/NewComponentDialog.h ui/dialogs/NewInstanceDialog.cpp ui/dialogs/NewInstanceDialog.h - ui/dialogs/NotificationDialog.cpp - ui/dialogs/NotificationDialog.h ui/pagedialog/PageDialog.cpp ui/pagedialog/PageDialog.h ui/dialogs/ProgressDialog.cpp @@ -903,7 +893,6 @@ qt5_wrap_ui(LAUNCHER_UI ui/dialogs/ProfileSetupDialog.ui ui/dialogs/ProgressDialog.ui ui/dialogs/NewInstanceDialog.ui - ui/dialogs/NotificationDialog.ui ui/dialogs/UpdateDialog.ui ui/dialogs/NewComponentDialog.ui ui/dialogs/ProfileSelectDialog.ui diff --git a/launcher/notifications/NotificationChecker.cpp b/launcher/notifications/NotificationChecker.cpp deleted file mode 100644 index 10b91691..00000000 --- a/launcher/notifications/NotificationChecker.cpp +++ /dev/null @@ -1,129 +0,0 @@ -#include "NotificationChecker.h" - -#include -#include -#include -#include - -#include "net/Download.h" - -#include "Application.h" - -NotificationChecker::NotificationChecker(QObject *parent) - : QObject(parent) -{ -} - -void NotificationChecker::setNotificationsUrl(const QUrl ¬ificationsUrl) -{ - m_notificationsUrl = notificationsUrl; -} - -void NotificationChecker::setApplicationChannel(QString channel) -{ - m_appVersionChannel = channel; -} - -void NotificationChecker::setApplicationFullVersion(QString version) -{ - m_appFullVersion = version; -} - -void NotificationChecker::setApplicationPlatform(QString platform) -{ - m_appPlatform = platform; -} - -QList NotificationChecker::notificationEntries() const -{ - return m_entries; -} - -void NotificationChecker::checkForNotifications() -{ - if (!m_notificationsUrl.isValid()) - { - qCritical() << "Failed to check for notifications. No notifications URL set." - << "If you'd like to use PolyMC's notification system, please pass the " - "URL to CMake at compile time."; - return; - } - if (m_checkJob) - { - return; - } - m_checkJob = new NetJob("Checking for notifications", APPLICATION->network()); - auto entry = APPLICATION->metacache()->resolveEntry("root", "notifications.json"); - entry->setStale(true); - m_checkJob->addNetAction(m_download = Net::Download::makeCached(m_notificationsUrl, entry)); - connect(m_download.get(), &Net::Download::succeeded, this, &NotificationChecker::downloadSucceeded); - m_checkJob->start(); -} - -void NotificationChecker::downloadSucceeded(int) -{ - m_entries.clear(); - - QFile file(m_download->getTargetFilepath()); - if (file.open(QFile::ReadOnly)) - { - QJsonArray root = QJsonDocument::fromJson(file.readAll()).array(); - for (auto it = root.begin(); it != root.end(); ++it) - { - QJsonObject obj = (*it).toObject(); - NotificationEntry entry; - entry.id = obj.value("id").toDouble(); - entry.message = obj.value("message").toString(); - entry.channel = obj.value("channel").toString(); - entry.platform = obj.value("platform").toString(); - entry.from = obj.value("from").toString(); - entry.to = obj.value("to").toString(); - const QString type = obj.value("type").toString("critical"); - if (type == "critical") - { - entry.type = NotificationEntry::Critical; - } - else if (type == "warning") - { - entry.type = NotificationEntry::Warning; - } - else if (type == "information") - { - entry.type = NotificationEntry::Information; - } - if(entryApplies(entry)) - m_entries.append(entry); - } - } - - m_checkJob.reset(); - - emit notificationCheckFinished(); -} - -bool versionLessThan(const QString &v1, const QString &v2) -{ - QStringList l1 = v1.split('.'); - QStringList l2 = v2.split('.'); - while (!l1.isEmpty() && !l2.isEmpty()) - { - int one = l1.isEmpty() ? 0 : l1.takeFirst().toInt(); - int two = l2.isEmpty() ? 0 : l2.takeFirst().toInt(); - if (one != two) - { - return one < two; - } - } - return false; -} - -bool NotificationChecker::entryApplies(const NotificationChecker::NotificationEntry& entry) const -{ - bool channelApplies = entry.channel.isEmpty() || entry.channel == m_appVersionChannel; - bool platformApplies = entry.platform.isEmpty() || entry.platform == m_appPlatform; - bool fromApplies = - entry.from.isEmpty() || entry.from == m_appFullVersion || !versionLessThan(m_appFullVersion, entry.from); - bool toApplies = - entry.to.isEmpty() || entry.to == m_appFullVersion || !versionLessThan(entry.to, m_appFullVersion); - return channelApplies && platformApplies && fromApplies && toApplies; -} diff --git a/launcher/notifications/NotificationChecker.h b/launcher/notifications/NotificationChecker.h deleted file mode 100644 index 0f305f33..00000000 --- a/launcher/notifications/NotificationChecker.h +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once - -#include - -#include "net/NetJob.h" -#include "net/Download.h" - -class NotificationChecker : public QObject -{ - Q_OBJECT - -public: - explicit NotificationChecker(QObject *parent = 0); - - void setNotificationsUrl(const QUrl ¬ificationsUrl); - void setApplicationPlatform(QString platform); - void setApplicationChannel(QString channel); - void setApplicationFullVersion(QString version); - - struct NotificationEntry - { - int id; - QString message; - enum - { - Critical, - Warning, - Information - } type; - QString channel; - QString platform; - QString from; - QString to; - }; - - QList notificationEntries() const; - -public -slots: - void checkForNotifications(); - -private -slots: - void downloadSucceeded(int); - -signals: - void notificationCheckFinished(); - -private: - bool entryApplies(const NotificationEntry &entry) const; - -private: - QList m_entries; - QUrl m_notificationsUrl; - NetJob::Ptr m_checkJob; - Net::Download::Ptr m_download; - - QString m_appVersionChannel; - QString m_appPlatform; - QString m_appFullVersion; -}; diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index ad7227cc..a3da64e4 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -82,7 +81,6 @@ #include "ui/dialogs/CopyInstanceDialog.h" #include "ui/dialogs/UpdateDialog.h" #include "ui/dialogs/EditAccountDialog.h" -#include "ui/dialogs/NotificationDialog.h" #include "ui/dialogs/ExportInstanceDialog.h" #include "UpdateController.h" @@ -835,17 +833,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow } } - { - auto checker = new NotificationChecker(); - checker->setNotificationsUrl(QUrl(BuildConfig.NOTIFICATION_URL)); - checker->setApplicationChannel(BuildConfig.VERSION_CHANNEL); - checker->setApplicationPlatform(BuildConfig.BUILD_PLATFORM); - checker->setApplicationFullVersion(BuildConfig.FULL_VERSION_STR); - m_notificationChecker.reset(checker); - connect(m_notificationChecker.get(), &NotificationChecker::notificationCheckFinished, this, &MainWindow::notificationsChanged); - checker->checkForNotifications(); - } - setSelectedInstanceById(APPLICATION->settings()->get("SelectedInstance").toString()); // removing this looks stupid @@ -1257,24 +1244,6 @@ QString intListToString(const QList &list) } return slist.join(','); } -void MainWindow::notificationsChanged() -{ - QList entries = m_notificationChecker->notificationEntries(); - QList shownNotifications = stringToIntList(APPLICATION->settings()->get("ShownNotifications").toString()); - for (auto it = entries.begin(); it != entries.end(); ++it) - { - NotificationChecker::NotificationEntry entry = *it; - if (!shownNotifications.contains(entry.id)) - { - NotificationDialog dialog(entry, this); - if (dialog.exec() == NotificationDialog::DontShowAgain) - { - shownNotifications.append(entry.id); - } - } - } - APPLICATION->settings()->set("ShownNotifications", intListToString(shownNotifications)); -} void MainWindow::downloadUpdates(GoUpdate::Status status) { diff --git a/launcher/ui/MainWindow.h b/launcher/ui/MainWindow.h index f6940ab0..fd65620e 100644 --- a/launcher/ui/MainWindow.h +++ b/launcher/ui/MainWindow.h @@ -28,7 +28,6 @@ class LaunchController; class NewsChecker; -class NotificationChecker; class QToolButton; class InstanceProxyModel; class LabeledToolButton; @@ -166,8 +165,6 @@ private slots: void updateNotAvailable(); - void notificationsChanged(); - void defaultAccountChanged(); void changeActiveAccount(); @@ -213,7 +210,6 @@ private: KonamiCode * secretEventFilter = nullptr; unique_qobject_ptr m_newsChecker; - unique_qobject_ptr m_notificationChecker; InstancePtr m_selectedInstance; QString m_currentInstIcon; diff --git a/launcher/ui/dialogs/NotificationDialog.cpp b/launcher/ui/dialogs/NotificationDialog.cpp deleted file mode 100644 index f2a35ae2..00000000 --- a/launcher/ui/dialogs/NotificationDialog.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#include "NotificationDialog.h" -#include "ui_NotificationDialog.h" - -#include -#include - -NotificationDialog::NotificationDialog(const NotificationChecker::NotificationEntry &entry, QWidget *parent) : - QDialog(parent, Qt::MSWindowsFixedSizeDialogHint | Qt::WindowTitleHint | Qt::CustomizeWindowHint), - ui(new Ui::NotificationDialog) -{ - ui->setupUi(this); - - QStyle::StandardPixmap icon; - switch (entry.type) - { - case NotificationChecker::NotificationEntry::Critical: - icon = QStyle::SP_MessageBoxCritical; - break; - case NotificationChecker::NotificationEntry::Warning: - icon = QStyle::SP_MessageBoxWarning; - break; - default: - case NotificationChecker::NotificationEntry::Information: - icon = QStyle::SP_MessageBoxInformation; - break; - } - ui->iconLabel->setPixmap(style()->standardPixmap(icon, 0, this)); - ui->messageLabel->setText(entry.message); - - m_dontShowAgainText = tr("Don't show again"); - m_closeText = tr("Close"); - - ui->dontShowAgainBtn->setText(m_dontShowAgainText + QString(" (%1)").arg(m_dontShowAgainTime)); - ui->closeBtn->setText(m_closeText + QString(" (%1)").arg(m_closeTime)); - - startTimer(1000); -} - -NotificationDialog::~NotificationDialog() -{ - delete ui; -} - -void NotificationDialog::timerEvent(QTimerEvent *event) -{ - if (m_dontShowAgainTime > 0) - { - m_dontShowAgainTime--; - if (m_dontShowAgainTime == 0) - { - ui->dontShowAgainBtn->setText(m_dontShowAgainText); - ui->dontShowAgainBtn->setEnabled(true); - } - else - { - ui->dontShowAgainBtn->setText(m_dontShowAgainText + QString(" (%1)").arg(m_dontShowAgainTime)); - } - } - if (m_closeTime > 0) - { - m_closeTime--; - if (m_closeTime == 0) - { - ui->closeBtn->setText(m_closeText); - ui->closeBtn->setEnabled(true); - } - else - { - ui->closeBtn->setText(m_closeText + QString(" (%1)").arg(m_closeTime)); - } - } - - if (m_closeTime == 0 && m_dontShowAgainTime == 0) - { - killTimer(event->timerId()); - } -} - -void NotificationDialog::on_dontShowAgainBtn_clicked() -{ - done(DontShowAgain); -} -void NotificationDialog::on_closeBtn_clicked() -{ - done(Normal); -} diff --git a/launcher/ui/dialogs/NotificationDialog.h b/launcher/ui/dialogs/NotificationDialog.h deleted file mode 100644 index e1cbb9fa..00000000 --- a/launcher/ui/dialogs/NotificationDialog.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef NOTIFICATIONDIALOG_H -#define NOTIFICATIONDIALOG_H - -#include - -#include "notifications/NotificationChecker.h" - -namespace Ui { -class NotificationDialog; -} - -class NotificationDialog : public QDialog -{ - Q_OBJECT - -public: - explicit NotificationDialog(const NotificationChecker::NotificationEntry &entry, QWidget *parent = 0); - ~NotificationDialog(); - - enum ExitCode - { - Normal, - DontShowAgain - }; - -protected: - void timerEvent(QTimerEvent *event); - -private: - Ui::NotificationDialog *ui; - - int m_dontShowAgainTime = 10; - int m_closeTime = 5; - - QString m_dontShowAgainText; - QString m_closeText; - -private -slots: - void on_dontShowAgainBtn_clicked(); - void on_closeBtn_clicked(); -}; - -#endif // NOTIFICATIONDIALOG_H diff --git a/launcher/ui/dialogs/NotificationDialog.ui b/launcher/ui/dialogs/NotificationDialog.ui deleted file mode 100644 index 3e6c22bc..00000000 --- a/launcher/ui/dialogs/NotificationDialog.ui +++ /dev/null @@ -1,85 +0,0 @@ - - - NotificationDialog - - - - 0 - 0 - 320 - 240 - - - - Notification - - - - - - - - TextLabel - - - - - - - TextLabel - - - true - - - true - - - Qt::TextBrowserInteraction - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - false - - - Don't show again - - - - - - - false - - - Close - - - - - - - - - - diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp index 0ffe8050..9e1d761b 100644 --- a/launcher/ui/pages/global/LauncherPage.cpp +++ b/launcher/ui/pages/global/LauncherPage.cpp @@ -234,11 +234,6 @@ void LauncherPage::applySettings() { auto s = APPLICATION->settings(); - if (ui->resetNotificationsBtn->isChecked()) - { - s->set("ShownNotifications", QString()); - } - // Updates s->set("AutoUpdate", ui->autoUpdateCheckBox->isChecked()); s->set("UpdateChannel", m_currentUpdateChannel); diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui index 47fed873..3722072d 100644 --- a/launcher/ui/pages/global/LauncherPage.ui +++ b/launcher/ui/pages/global/LauncherPage.ui @@ -38,7 +38,7 @@ QTabWidget::Rounded - 0 + 1 @@ -184,25 +184,6 @@ User Interface - - - - Launcher notifications - - - - - - Reset hidden notifications - - - true - - - - - - @@ -499,7 +480,6 @@ modsDirBrowseBtn iconsDirTextBox iconsDirBrowseBtn - resetNotificationsBtn sortLastLaunchedBtn sortByNameBtn themeComboBox From 6d1f9d4d02cef93e92ebf0ba46a1c1296da50673 Mon Sep 17 00:00:00 2001 From: swirl Date: Mon, 21 Feb 2022 12:44:34 -0500 Subject: [PATCH 02/25] fix --- launcher/ui/pages/global/LauncherPage.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui index 3722072d..6f68d0dd 100644 --- a/launcher/ui/pages/global/LauncherPage.ui +++ b/launcher/ui/pages/global/LauncherPage.ui @@ -38,7 +38,7 @@ QTabWidget::Rounded - 1 + 0 From 3697d70b48ec2c54d1574fdb0b051c61c2430f51 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sat, 5 Mar 2022 20:29:54 +0100 Subject: [PATCH 03/25] fix: reorganize icon themes Rename MultiMC to Legacy Simple (Colored) is now the first icon theme Custom is now the last icon theme, which also fixes a loading issue when Legacy was selected Fix loading of Legacy theme --- launcher/ui/pages/global/LauncherPage.cpp | 16 ++++++++-------- launcher/ui/pages/global/LauncherPage.ui | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp index 0ffe8050..cec496dc 100644 --- a/launcher/ui/pages/global/LauncherPage.cpp +++ b/launcher/ui/pages/global/LauncherPage.cpp @@ -247,16 +247,16 @@ void LauncherPage::applySettings() switch (ui->themeComboBox->currentIndex()) { case 0: - s->set("IconTheme", "pe_dark"); + s->set("IconTheme", "pe_colored"); break; case 1: s->set("IconTheme", "pe_light"); break; case 2: - s->set("IconTheme", "pe_blue"); + s->set("IconTheme", "pe_dark"); break; case 3: - s->set("IconTheme", "pe_colored"); + s->set("IconTheme", "pe_blue"); break; case 4: s->set("IconTheme", "OSX"); @@ -268,10 +268,10 @@ void LauncherPage::applySettings() s->set("IconTheme", "flat"); break; case 7: - s->set("IconTheme", "custom"); + s->set("IconTheme", "multimc"); break; case 8: - s->set("IconTheme", "multimc"); + s->set("IconTheme", "custom"); break; } @@ -324,7 +324,7 @@ void LauncherPage::loadSettings() m_currentUpdateChannel = s->get("UpdateChannel").toString(); //FIXME: make generic auto theme = s->get("IconTheme").toString(); - if (theme == "pe_dark") + if (theme == "pe_colored") { ui->themeComboBox->setCurrentIndex(0); } @@ -332,11 +332,11 @@ void LauncherPage::loadSettings() { ui->themeComboBox->setCurrentIndex(1); } - else if (theme == "pe_blue") + else if (theme == "pe_dark") { ui->themeComboBox->setCurrentIndex(2); } - else if (theme == "pe_colored") + else if (theme == "pe_blue") { ui->themeComboBox->setCurrentIndex(3); } diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui index 47fed873..59096a28 100644 --- a/launcher/ui/pages/global/LauncherPage.ui +++ b/launcher/ui/pages/global/LauncherPage.ui @@ -264,7 +264,7 @@ - Simple (Dark Icons) + Simple (Colored Icons) @@ -274,12 +274,12 @@ - Simple (Blue Icons) + Simple (Dark Icons) - Simple (Colored Icons) + Simple (Blue Icons) @@ -294,7 +294,12 @@ - Flat + Flat + + + + + Legacy @@ -302,11 +307,6 @@ Custom - - - MultiMC - - From b162351ff45a124b9f1df7658f4cfb8d607737a3 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sat, 5 Mar 2022 21:49:13 +0100 Subject: [PATCH 04/25] fix: switch to polymc.org wiki --- launcher/ui/widgets/PageContainer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/ui/widgets/PageContainer.cpp b/launcher/ui/widgets/PageContainer.cpp index 6de49467..368bfe40 100644 --- a/launcher/ui/widgets/PageContainer.cpp +++ b/launcher/ui/widgets/PageContainer.cpp @@ -207,7 +207,7 @@ void PageContainer::help() QString pageId = m_currentPage->helpPage(); if (pageId.isEmpty()) return; - DesktopServices::openUrl(QUrl("https://github.com/PolyMC/PolyMC/wiki/" + pageId)); + DesktopServices::openUrl(QUrl("https://polymc.org/wiki/" + pageId)); } } From 6545d250e8f3e10385cbf86f0d7f46feb7b2456c Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sun, 6 Mar 2022 11:31:50 +0100 Subject: [PATCH 05/25] refactor: move help URL into buildconfig --- CMakeLists.txt | 1 + buildconfig/BuildConfig.cpp.in | 1 + buildconfig/BuildConfig.h | 5 +++++ launcher/ui/widgets/PageContainer.cpp | 3 ++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c370b6ea..bf1b222b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_DEPRECATED_WARNINGS=Y") ######## Set URLs ######## set(Launcher_NEWS_RSS_URL "https://polymc.github.io/feed/feed.xml" CACHE STRING "URL to fetch PolyMC's news RSS feed from.") set(Launcher_NEWS_OPEN_URL "https://polymc.github.io/news/" CACHE STRING "URL that gets opened when the user clicks 'More News'") +set(Launcher_HELP_URL "https://polymc.org/wiki/%1" CACHE STRING "URL (with arg %1 to be substituted with page-id) that gets opened when the user requests help") ######## Set version numbers ######## set(Launcher_VERSION_MAJOR 1) diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index 0ffc9326..80c67037 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -50,6 +50,7 @@ Config::Config() VERSION_STR = "@Launcher_VERSION_STRING@"; NEWS_RSS_URL = "@Launcher_NEWS_RSS_URL@"; NEWS_OPEN_URL = "@Launcher_NEWS_OPEN_URL@"; + HELP_URL = "@Launcher_HELP_URL@"; IMGUR_CLIENT_ID = "@Launcher_IMGUR_CLIENT_ID@"; MSA_CLIENT_ID = "@Launcher_MSA_CLIENT_ID@"; META_URL = "@Launcher_META_URL@"; diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h index 863f88df..95619587 100644 --- a/buildconfig/BuildConfig.h +++ b/buildconfig/BuildConfig.h @@ -73,6 +73,11 @@ public: */ QString NEWS_OPEN_URL; + /** + * URL (with arg %1 to be substituted with page-id) that gets opened when the user requests help + */ + QString HELP_URL; + /** * Client ID you can get from Imgur when you register an application */ diff --git a/launcher/ui/widgets/PageContainer.cpp b/launcher/ui/widgets/PageContainer.cpp index 368bfe40..558a98fb 100644 --- a/launcher/ui/widgets/PageContainer.cpp +++ b/launcher/ui/widgets/PageContainer.cpp @@ -14,6 +14,7 @@ */ #include "PageContainer.h" +#include "BuildConfig.h" #include "PageContainer_p.h" #include @@ -207,7 +208,7 @@ void PageContainer::help() QString pageId = m_currentPage->helpPage(); if (pageId.isEmpty()) return; - DesktopServices::openUrl(QUrl("https://polymc.org/wiki/" + pageId)); + DesktopServices::openUrl(QUrl(BuildConfig.HELP_URL.arg(pageId))); } } From b93daf1fb743f09d48595f554d93a49fe448d6b7 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sun, 6 Mar 2022 11:32:06 +0100 Subject: [PATCH 06/25] fix: update news links to point to polymc.org --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf1b222b..e2545ba5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,8 +46,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_DEPRECATED_WARNINGS=Y") ##################################### Set Application options ##################################### ######## Set URLs ######## -set(Launcher_NEWS_RSS_URL "https://polymc.github.io/feed/feed.xml" CACHE STRING "URL to fetch PolyMC's news RSS feed from.") -set(Launcher_NEWS_OPEN_URL "https://polymc.github.io/news/" CACHE STRING "URL that gets opened when the user clicks 'More News'") +set(Launcher_NEWS_RSS_URL "https://polymc.org/feed/feed.xml" CACHE STRING "URL to fetch PolyMC's news RSS feed from.") +set(Launcher_NEWS_OPEN_URL "https://polymc.org/news" CACHE STRING "URL that gets opened when the user clicks 'More News'") set(Launcher_HELP_URL "https://polymc.org/wiki/%1" CACHE STRING "URL (with arg %1 to be substituted with page-id) that gets opened when the user requests help") ######## Set version numbers ######## From ae39d16c11d5c4bc5d10e3cc87d5e55367ef2f9b Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sun, 6 Mar 2022 11:40:11 +0100 Subject: [PATCH 07/25] chore: bump to 1.1.0 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c370b6ea..d567af80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,8 +51,8 @@ set(Launcher_NEWS_OPEN_URL "https://polymc.github.io/news/" CACHE STRING "URL th ######## Set version numbers ######## set(Launcher_VERSION_MAJOR 1) -set(Launcher_VERSION_MINOR 0) -set(Launcher_VERSION_HOTFIX 6) +set(Launcher_VERSION_MINOR 1) +set(Launcher_VERSION_HOTFIX 0) # Build number set(Launcher_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number.") From 4fe13c64a15137c22a72f314a041c647ec266175 Mon Sep 17 00:00:00 2001 From: Ezekiel Smith Date: Tue, 8 Mar 2022 19:07:21 +1000 Subject: [PATCH 08/25] Update README.md --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5d83a8f9..30b87510 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ If you want to contribute to PolyMC you might find it useful to join our Discord ## Building -If you want to build PolyMC yourself, check [BUILD.md](BUILD.md) for build instructions. +If you want to build PolyMC yourself, check [Build Instructions](https://polymc.org/wiki/development/build-instructions/) for build instructions. ## Code formatting @@ -72,3 +72,9 @@ To modify download infomation or change packaging infomation send a pull request ## Forking/Redistributing/Custom builds policy Do whatever you want, we don't care. Just follow the license. If you have any questions about this feel free to ask in an issue. + +All launcher code is available under the GPL-3 license. + +[Source for the website](https://github.com/PolyMC/polymc.github.io) is hosted under the AGPL-3 License. + +The logo and related assets are under the CC BY-NC-SA 4.0 license. From 0813eba3675e8c9fcfc6962377732b70bb62b1bb Mon Sep 17 00:00:00 2001 From: Ezekiel Smith Date: Tue, 8 Mar 2022 19:09:54 +1000 Subject: [PATCH 09/25] Update BUILD.md --- BUILD.md | 340 +------------------------------------------------------ 1 file changed, 2 insertions(+), 338 deletions(-) diff --git a/BUILD.md b/BUILD.md index fa6a8d04..d53fb7a7 100644 --- a/BUILD.md +++ b/BUILD.md @@ -1,341 +1,5 @@ # Build Instructions -# Contents +Build instructions are available on [the website](https://polymc.org/wiki/development/build-instructions/). -- [Getting the source](#getting-the-source) -- [Linux](#linux) -- [Windows](#windows) -- [macOS](#macos) - -# Getting the source - -Clone the source code using git and grab all the submodules: - -``` -git clone https://github.com/PolyMC/PolyMC.git -cd PolyMC -git submodule init -git submodule update -``` - -The rest of the documentation assumes you have already cloned the repository. - -# Linux and FreeBSD - -Getting the project to build and run on Linux is easy if you use any modern and up-to-date linux distribution. If you're using FreeBSD you should use 13.0-RELEASE or newer. - -## Build dependencies -- A C++ compiler capable of building C++11 code. -- Qt Development tools 5.6 or newer (`qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5` on Debian-based system) -- cmake 3.1 or newer (`cmake` on Debian-based system) -- zlib (`zlib1g-dev` on Debian-based system) -- Java JDK (`openjdk-17-jdk`on Debian-based system) -- GL headers (`libgl1-mesa-dev` on Debian-based system) -- games/lwjgl port if using FreeBSD - -You can use IDEs like KDevelop or QtCreator to open the CMake project if you want to work on the code. - -### Building a portable binary - -```sh -mkdir install -# configure the project -cmake -S . -B build \ - -DCMAKE_INSTALL_PREFIX=./install -# build -cd build -make -j$(nproc) install -``` - -### Building & Installing to the System - -This is the preferred method for installation, and is suitable for packages. - -```sh -# configure everything -cmake -S . -B build \ -  -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX="/usr" \ # Use "/usr" when building Linux packages. If building on FreeBSD or not for package, use "/usr/local" - -DLauncher_PORTABLE=OFF -cd build -make -j$(nproc) install # Optionally specify DESTDIR for packages (i.e. DESTDIR=${pkgdir}) -``` - -### Building a .deb - -Requirements: [makedeb](https://docs.makedeb.org/) installed on your system. - -``` -git clone https://mpr.makedeb.org/polymc.git -cd polymc -makedeb -s -``` - -The deb will be located in the directory the repo was cloned in. - -### Building an .rpm - -Build dependencies are automatically installed using `dnf`, but you do need the `rpmdevtools` package (on Fedora) -in order to fetch sources and setup your tree. -You don't need to clone the repo for this; the spec file handles that - -``` -cd ~ -# setup your ~/rpmbuild directory, required for rpmbuild to work. -rpmdev-setuptree -# get the rpm spec file from the polymc-misc repo -wget https://raw.githubusercontent.com/PolyMC/polymc-misc/master/rpm/polymc.spec -# install build dependencies -sudo dnf builddep polymc.spec -# download build sources -spectool -g -R polymc.spec -# now build! -rpmbuild -bb polymc.spec -``` - -The path to the rpm packages will be printed when the build is complete. - -### Building a Slackware package - -To build a Slackware package, first install [qt5 SlackBuild](http://slackbuilds.org/repository/14.2/libraries/qt5/) (on 15.0 and newer installed by defualt), then set up a [JDK](https://codeberg.org/glowiak/SlackBuilds/raw/branch/master/tgz/adoptium-jdk8.tar.gz). - -If you're using Slackware 14.2, update cmake with these commands: - -``` -mkdir -p /tmp/SBo -cd /tmp/SBo -wget -c https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2.tar.gz -tar xzvf cmake-3.22.2.tar.gz -cd cmake-3.22.2 -./configure --prefix=/usr -make -sudo make install -``` - -Next, download the [SlackBuild](https://codeberg.org/glowiak/SlackBuilds/raw/branch/master/tgz/polymc.tar.gz), unpack it and type in extracted directory: - -``` -sudo ./polymc.SlackBuild # script will do everything, just sit up and wait -sudo /sbin/installpkg /tmp/polymc-version-arch-1_SBo.tgz # install the created package -``` - -### Building a flatpak - -You don't need to clone the entire PolyMC repo for this; the flatpak file handles that. -`flatpak` and `flatpak-builder` need to be installed on your system - -```sh -git clone https://github.com/flathub/org.polymc.PolyMC -cd org.polymc.PolyMC -# remove --user --install if you want to build without installing -flatpak-builder --user --install flatbuild org.polymc.PolyMC.yml -``` - -### Installing Qt using the installer (optional) - -1. Run the Qt installer. -2. Choose a place to install Qt. -3. Choose the components you want to install. - - You need Qt 5.6.x 64-bit ticked. - - You need Tools/Qt Creator ticked. - - Other components are selected by default, you can untick them if you don't need them. -4. Accept the license agreements. -5. Double check the install details and then click "Install". - - Installation can take a very long time, go grab a cup of tea or something and let it work. - -### Loading the project in Qt Creator (optional) - -1. Open Qt Creator. -2. Choose `File->Open File or Project`. -3. Navigate to the Launcher source folder you cloned and choose CMakeLists.txt. -4. Read the instructions that just popped up about a build location and choose one. -5. You should see "Run CMake" in the window. - - Make sure that Generator is set to "Unix Generator (Desktop Qt 5.6.x GCC 64bit)". - - Hit the "Run CMake" button. - - You'll see warnings and it might not be clear that it succeeded until you scroll to the bottom of the window. - - Hit "Finish" if CMake ran successfully. -6. Cross your fingers and press the Run button (bottom left of Qt Creator). - - If the project builds successfully it will run and the Launcher window will pop up. - -**If this doesn't work for you, let us know on our Discord.** - -# Windows - -Getting the project to build and run on Windows is easy if you use Qt's IDE, Qt Creator. The project will simply not compile using Microsoft build tools, because that's not something we do. If it does compile, it is by chance only. - -## Dependencies - -- [Qt 5.6+ Development tools](http://qt-project.org/downloads) -- Qt Online Installer for Windows - - http://download.qt.io/new_archive/qt/5.6/5.6.0/qt-opensource-windows-x86-mingw492-5.6.0.exe - - Download the MinGW version (MSVC version does not work). -- [OpenSSL](https://github.com/IndySockets/OpenSSL-Binaries/tree/master/Archive/) -- Win32 OpenSSL, version 1.0.2g (from 2016) - - https://github.com/IndySockets/OpenSSL-Binaries/raw/master/Archive/openssl-1.0.2g-i386-win32.zip - - the usual OpenSSL for Windows (http://slproweb.com/products/Win32OpenSSL.html) only provides the newest version of OpenSSL, and we need the 1.0.2g version - - **Download the 32-bit version, not 64-bit.** - - Microsoft Visual C++ 2008 Redist is required for this, there's a link on the OpenSSL download page above next to the main download. - - We use a custom build of OpenSSL that doesn't have this dependency. For normal development, the custom build is not necessary though. -- [zlib 1.2+](http://gnuwin32.sourceforge.net/packages/zlib.htm) - the Setup is fine -- [Java JDK 8](https://adoptium.net/releases.html?variant=openjdk8) - Use the MSI installer. -- [CMake](http://www.cmake.org/cmake/resources/software.html) -- Windows (Win32 Installer) - -Ensure that OpenSSL, zlib, Java and CMake are on `PATH`. - -## Getting set up - -### Installing Qt - -1. Run the Qt installer -2. Choose a place to install Qt (C:\Qt is the default), -3. Choose the components you want to install - - You need Qt 5.6 (32 bit) ticked, - - You need Tools/Qt Creator ticked, - - Other components are selected by default, you can untick them if you don't need them. -4. Accept the license agreements, -5. Double check the install details and then click "Install" - - Installation can take a very long time, go grab a cup of tea or something and let it work. - -### Installing OpenSSL - -1. Download .zip file from the link above. -2. Unzip and add the directory to PATH, so CMake can find it. - -### Installing CMake - -1. Run the CMake installer, -2. It's easiest if you choose to add CMake to the PATH for all users, - - If you don't choose to do this, remember where you installed CMake. - -### Loading the project - -1. Open Qt Creator, -2. Choose File->Open File or Project, -3. Navigate to the Launcher source folder you cloned and choose CMakeLists.txt, -4. Read the instructions that just popped up about a build location and choose one, -5. If you chose not to add CMake to the system PATH, tell Qt Creator where you installed it, - - Otherwise you can skip this step. -6. You should see "Run CMake" in the window, - - Make sure that Generator is set to "MinGW Generator (Desktop Qt 5.6.x MinGW 32bit)", - - Hit the "Run CMake" button, - - You'll see warnings and it might not be clear that it succeeded until you scroll to the bottom of the window. - - Hit "Finish" if CMake ran successfully. -7. Cross your fingers and press the Run button (bottom left of Qt Creator)! - - If the project builds successfully it will run and the Launcher window will pop up, - - Test OpenSSL by making an instance and trying to log in. If Qt Creator couldn't find OpenSSL during the CMake stage, login will fail and you'll get an error. - -The following .dlls are needed for the app to run (copy them to build directory if you want to be able to move the build to another pc): - -``` - -platforms/qwindows.dll -libeay32.dll -libgcc_s_dw2-1.dll -libssp-0.dll -libstdc++-6.dll -libwinpthread-1.dll -Qt5Core.dll -Qt5Gui.dll -Qt5Network.dll -Qt5Svg.dll -Qt5Widgets.dll -Qt5Xml.dll -ssleay32.dll -zlib1.dll - -``` - -**These build instructions worked for me (Drayshak) on a fresh Windows 8 x64 Professional install. If they don't work for you, let us know on our Discord.** - -### Compile from command line on Windows - -1. If you installed Qt with the web installer, there should be a shortcut called `Qt 5.4 for Desktop (MinGW 4.9 32-bit)` in the Start menu on Windows 7 and 10. Best way to find it is to search for it. Do note you cannot just use cmd.exe, you have to use the shortcut, otherwise the proper MinGW software will not be on the PATH. -2. Once that is open, change into your user directory, and clone PolyMC by doing `git clone --recursive https://github.com/PolyMC/PolyMC.git`, and change directory to the folder you cloned to. -3. Make a build directory, and change directory to the directory and do `cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=C:\Path\that\makes\sense\for\you`. By default, it will install to C:\Program Files (x86), which you might not want, if you want a local installation. If you want to install it to that directory, make sure to run the command window as administrator. -4. If you want PolyMC to store its data in `%APPDATA%`, append `-DLauncher_PORTABLE=OFF` to the previous command. -5. Do `mingw32-make -j$(nproc)`, where X is the number of cores your CPU has plus one. -6. Now to wait for it to compile. This could take some time. Hopefully it compiles properly. -7. Run the command `mingw32-make install`, and it should install PolyMC, to whatever the `-DCMAKE_INSTALL_PREFIX` was. -8. In most cases, whenever compiling, the OpenSSL dll's aren't put into the directory to where PolyMC installs, meaning you cannot log in. The best way to fix this is just to do `copy C:\OpenSSL-Win32\*.dll C:\Where\you\installed\PolyMC\to`. This should copy the required OpenSSL dll's to log in. - -# macOS - -### Install prerequisites: - -- Install XCode Command Line tools -- Install the official build of CMake (https://cmake.org/download/) -- Install JDK 8 (https://adoptium.net/releases.html?variant=openjdk8&jvmVariant=hotspot) -- Get Qt 5.6 and install it (https://download.qt.io/new_archive/qt/5.6/5.6.3/) or higher (tested) (https://www.qt.io/download-qt-installer?utm_referrer=https%3A%2F%2Fwww.qt.io%2Fdownload-open-source) - -You can use `homebrew` to simplify the installation of build dependencies - -### XCode Command Line tools - -If you don't have XCode CommandLine tools installed, you can install them by using this command in the Terminal App - -```bash -xcode-select --install -``` - -### Build - -Pick an installation path - this is where the final `PolyMC.app` will be constructed when you run `make install`. Supply it as the `CMAKE_INSTALL_PREFIX` argument during CMake configuration. By default, it's in the dist folder under PolyMC - -``` -mkdir build -cd build -cmake \ - -DCMAKE_C_COMPILER=/usr/bin/clang \ - -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX:PATH="$(dirname $PWD)/dist/" \ - -DCMAKE_PREFIX_PATH="/path/to/Qt/" \ - -DQt5_DIR="/path/to/Qt/" \ - -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 \ - .. -make install -``` - -Remember to replace `/path/to/Qt/` with the actual path. For newer Qt installations, it is often in your home directory. - -**Note:** The final app bundle may not run due to code signing issues, which -need to be fixed with `codesign -fs -`. - -# OpenBSD - -Tested on OpenBSD 7.0-alpha i386, on older should work too - -## Build dependencies -- A C++ compiler capable of building C++11 code (included in base system) -- Qt Development tools 5.6 or newer ([meta/qt5](https://openports.se/meta/qt5)) -- cmake 3.1 or newer ([devel/cmake](https://openports.se/devel/cmake)) -- zlib (included in base system) -- Java JDK ([devel/jdk-1.8](https://openports.se/devel/jdk/1.8)) -- GL headers (included in base system) -- lwjgl ([games/lwjgl](https://openports.se/games/lwjgl) and [games/lwjgl3](https://openports.se/games/lwjgl3)) - -You can use IDEs like KDevelop or QtCreator to open the CMake project if you want to work on the code. - -### Building a portable binary - -```sh -mkdir install -# configure the project -cmake -S . -B build \ - -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_PREFIX_PATH=/usr/local/lib/qt5/cmake -# build -cd build -make -j$(nproc) install -``` - -### Building & Installing to the System - -This is the preferred method for installation, and is suitable for packages. - -```sh -# configure everything -cmake -S . -B build \ -  -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX="/usr/local" \ # /usr/local is default in OpenBSD and FreeBSD - -DLauncher_PORTABLE=OFF -DCMAKE_PREFIX_PATH=/usr/local/lib/qt5/cmake # use linux layout and point to qt5 libs -cd build -make -j$(nproc) install # Optionally specify DESTDIR for packages (i.e. DESTDIR=${pkgdir}) -``` +If you would like to contribute or fix an issue with the Build instructions your can do so [here](https://github.com/PolyMC/polymc.github.io/blob/master/src/wiki/development/build-instructions.md) From 49d122a2c47fdf7aed04dfb950b2333f60ba855c Mon Sep 17 00:00:00 2001 From: deadmeu Date: Tue, 8 Mar 2022 23:24:11 +1000 Subject: [PATCH 10/25] Fix missing space in "No Accounts" message --- launcher/LaunchController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/LaunchController.cpp b/launcher/LaunchController.cpp index 40178b70..4fd2eade 100644 --- a/launcher/LaunchController.cpp +++ b/launcher/LaunchController.cpp @@ -56,7 +56,7 @@ void LaunchController::decideAccount() m_parentWidget, tr("No Accounts"), tr("In order to play Minecraft, you must have at least one Mojang or Minecraft " - "account logged in." + "account logged in. " "Would you like to open the account manager to add an account now?"), QMessageBox::Information, QMessageBox::Yes | QMessageBox::No From d814e21f0d68b560d94cd69edb0b673a1507aa63 Mon Sep 17 00:00:00 2001 From: dada513 Date: Tue, 8 Mar 2022 18:41:23 +0100 Subject: [PATCH 11/25] add matrix button --- CMakeLists.txt | 5 +++++ buildconfig/BuildConfig.cpp.in | 1 + buildconfig/BuildConfig.h | 1 + launcher/resources/multimc/multimc.qrc | 4 ++++ launcher/resources/multimc/scalable/matrix.svg | 7 +++++++ launcher/ui/MainWindow.cpp | 18 +++++++++++++++++- launcher/ui/MainWindow.h | 2 ++ 7 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 launcher/resources/multimc/scalable/matrix.svg diff --git a/CMakeLists.txt b/CMakeLists.txt index e2545ba5..e633eb55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,9 +82,14 @@ set(Launcher_BUG_TRACKER_URL "https://github.com/PolyMC/PolyMC/issues" CACHE STR # Translations Platform URL set(Launcher_TRANSLATIONS_URL "https://hosted.weblate.org/projects/polymc/polymc/" CACHE STRING "URL for the translations platform.") +# Matrix Space +set(Launcher_MATRIX_URL "https://matrix.to/#/#polymc:polymc.org" CACHE STRING "URL to the Matrix Space") + # Discord URL set(Launcher_DISCORD_URL "https://discord.gg/Z52pwxWCHP" CACHE STRING "URL for the Discord guild.") + + # Subreddit URL set(Launcher_SUBREDDIT_URL "" CACHE STRING "URL for the subreddit.") diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index 80c67037..d1bd4d05 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -57,6 +57,7 @@ Config::Config() BUG_TRACKER_URL = "@Launcher_BUG_TRACKER_URL@"; TRANSLATIONS_URL = "@Launcher_TRANSLATIONS_URL@"; + MATRIX_URL = "@Launcher_MATRIX_URL@"; DISCORD_URL = "@Launcher_DISCORD_URL@"; SUBREDDIT_URL = "@Launcher_SUBREDDIT_URL@"; } diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h index 95619587..cf74b39e 100644 --- a/buildconfig/BuildConfig.h +++ b/buildconfig/BuildConfig.h @@ -95,6 +95,7 @@ public: QString BUG_TRACKER_URL; QString TRANSLATIONS_URL; + QString MATRIX_URL; QString DISCORD_URL; QString SUBREDDIT_URL; diff --git a/launcher/resources/multimc/multimc.qrc b/launcher/resources/multimc/multimc.qrc index ef29cf9b..d31885b9 100644 --- a/launcher/resources/multimc/multimc.qrc +++ b/launcher/resources/multimc/multimc.qrc @@ -246,9 +246,13 @@ scalable/screenshot-placeholder.svg + + scalable/matrix.svg + scalable/discord.svg + 32x32/instances/chicken.png 128x128/instances/chicken.png diff --git a/launcher/resources/multimc/scalable/matrix.svg b/launcher/resources/multimc/scalable/matrix.svg new file mode 100644 index 00000000..237c55a2 --- /dev/null +++ b/launcher/resources/multimc/scalable/matrix.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index ad7227cc..2cb3c7fd 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -235,6 +235,7 @@ public: TranslatedToolButton helpMenuButton; TranslatedAction actionReportBug; TranslatedAction actionDISCORD; + TranslatedAction actionMATRIX; TranslatedAction actionREDDIT; TranslatedAction actionAbout; @@ -343,13 +344,23 @@ public: all_actions.append(&actionReportBug); helpMenu->addAction(actionReportBug); } + + if(!BuildConfig.MATRIX_URL.isEmpty()) { + actionMATRIX = TranslatedAction(MainWindow); + actionMATRIX->setObjectName(QStringLiteral("actionMATRIX")); + actionMATRIX->setIcon(APPLICATION->getThemedIcon("matrix")); + actionMATRIX.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Matrix")); + actionMATRIX.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open %1 Matrix space")); + all_actions.append(&actionMATRIX); + helpMenu->addAction(actionMATRIX); + } if (!BuildConfig.DISCORD_URL.isEmpty()) { actionDISCORD = TranslatedAction(MainWindow); actionDISCORD->setObjectName(QStringLiteral("actionDISCORD")); actionDISCORD->setIcon(APPLICATION->getThemedIcon("discord")); actionDISCORD.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Discord")); - actionDISCORD.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open %1 discord voice chat.")); + actionDISCORD.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open %1 Discord guild.")); all_actions.append(&actionDISCORD); helpMenu->addAction(actionDISCORD); } @@ -1500,6 +1511,11 @@ void MainWindow::on_actionDISCORD_triggered() DesktopServices::openUrl(QUrl(BuildConfig.DISCORD_URL)); } +void MainWindow::on_actionMATRIX_triggered() +{ + DesktopServices::openUrl(QUrl(BuildConfig.MATRIX_URL)); +} + void MainWindow::on_actionChangeInstIcon_triggered() { if (!m_selectedInstance) diff --git a/launcher/ui/MainWindow.h b/launcher/ui/MainWindow.h index f6940ab0..bdbe81aa 100644 --- a/launcher/ui/MainWindow.h +++ b/launcher/ui/MainWindow.h @@ -73,6 +73,8 @@ private slots: void on_actionREDDIT_triggered(); + void on_actionMATRIX_triggered(); + void on_actionDISCORD_triggered(); void on_actionCopyInstance_triggered(); From c1201997a3d753e364db5599c25554df803896ae Mon Sep 17 00:00:00 2001 From: txtsd Date: Thu, 10 Mar 2022 13:38:16 +0530 Subject: [PATCH 12/25] Fix Ubuntu system Qt failure --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af5a1074..b5797e95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,6 +100,7 @@ jobs: - name: Install System Qt on Linux if: runner.os == 'Linux' && matrix.app_image != true run: | + sudo apt-get -y update sudo apt-get -y install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5 - name: Install Ninja From c799faaca6e0d57364cb9509be4b1a842e4398ee Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Fri, 11 Mar 2022 09:21:59 +0100 Subject: [PATCH 13/25] fix: typos --- BUILD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD.md b/BUILD.md index d53fb7a7..8a76b68b 100644 --- a/BUILD.md +++ b/BUILD.md @@ -2,4 +2,4 @@ Build instructions are available on [the website](https://polymc.org/wiki/development/build-instructions/). -If you would like to contribute or fix an issue with the Build instructions your can do so [here](https://github.com/PolyMC/polymc.github.io/blob/master/src/wiki/development/build-instructions.md) +If you would like to contribute or fix an issue with the Build instructions you can do so [here](https://github.com/PolyMC/polymc.github.io/blob/master/src/wiki/development/build-instructions.md). From a3d7ad731da927cc8cc856f6335b4aec22689db5 Mon Sep 17 00:00:00 2001 From: flow Date: Fri, 11 Mar 2022 18:43:17 -0300 Subject: [PATCH 14/25] fix missing translation strings my mistake, sorry! ToT --- launcher/ui/pages/instance/ModFolderPage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp index e4ad9012..ffb87bbe 100644 --- a/launcher/ui/pages/instance/ModFolderPage.cpp +++ b/launcher/ui/pages/instance/ModFolderPage.cpp @@ -152,8 +152,8 @@ ModFolderPage::ModFolderPage( ui->actionsToolbar->insertActionBefore(ui->actionAdd, act); connect(act, &QAction::triggered, this, &ModFolderPage::on_actionInstall_mods_triggered); - ui->actionAdd->setText("Add .jar"); - ui->actionAdd->setToolTip("Add mods via local file"); + ui->actionAdd->setText(tr("Add .jar")); + ui->actionAdd->setToolTip(tr("Add mods via local file")); } ui->actionsToolbar->insertSpacer(ui->actionView_configs); From 641a96e4a9bfe70aeec0c58ec5b81a2027c71a61 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sat, 12 Mar 2022 18:17:25 +0100 Subject: [PATCH 15/25] fix(metainfo): update URLs --- program_info/org.polymc.PolyMC.metainfo.xml.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/program_info/org.polymc.PolyMC.metainfo.xml.in b/program_info/org.polymc.PolyMC.metainfo.xml.in index 03401f3d..7972965c 100644 --- a/program_info/org.polymc.PolyMC.metainfo.xml.in +++ b/program_info/org.polymc.PolyMC.metainfo.xml.in @@ -11,7 +11,7 @@ CC0-1.0 GPL-3.0-or-later https://polymc.org/ - https://github.com/PolyMC/PolyMC#help--support + https://polymc.org/wiki/

PolyMC is a custom launcher for Minecraft that focuses on predictability, long term stability and simplicity.

Features:

@@ -28,23 +28,23 @@ The main PolyMC window - https://polymc.github.io/assets/img/screenshots/LauncherDark.png + https://polymc.org/img/screenshots/LauncherDark.png Modpack installation - https://polymc.github.io/assets/img/screenshots/ModpackInstallDark.png + https://polymc.org/img/screenshots/ModpackInstallDark.png Mod installation - https://polymc.github.io/assets/img/screenshots/ModInstallDark.png + https://polymc.org/img/screenshots/ModInstallDark.png Instance management - https://polymc.github.io/assets/img/screenshots/PropertiesDark.png + https://polymc.org/img/screenshots/PropertiesDark.png Cat :) - https://polymc.github.io/assets/img/screenshots/LauncherCatDark.png + https://polymc.org/img/screenshots/LauncherCatDark.png From bb2b344d3300cfc2f13211cd12956e23c98459de Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sun, 13 Mar 2022 11:44:30 +0100 Subject: [PATCH 16/25] fix: define jars path relative to application root Fixes #117 --- CMakeLists.txt | 3 ++- launcher/Application.cpp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5250d0ff..6cabab7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,7 +207,8 @@ elseif(UNIX) set(LAUNCHER_METAINFO_DEST_DIR "share/metainfo" CACHE STRING "Path to the metainfo directory") set(LAUNCHER_ICON_DEST_DIR "share/icons/hicolor/scalable/apps" CACHE STRING "Path to the scalable icon directory") - set(Launcher_APP_BINARY_DEFS "-DMULTIMC_JARS_LOCATION=${CMAKE_INSTALL_PREFIX}/${JARS_DEST_DIR}") + # jars path is determined on runtime, relative to "Application root path", generally /usr for Launcher_PORTABLE=0 + set(Launcher_APP_BINARY_DEFS "-DLAUNCHER_JARS_LOCATION=${JARS_DEST_DIR}") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_Desktop} DESTINATION ${LAUNCHER_DESKTOP_DEST_DIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${Launcher_MetaInfo} DESTINATION ${LAUNCHER_METAINFO_DEST_DIR}) diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 0ce80d4b..c699d840 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -515,8 +515,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) FS::updateTimestamp(m_rootPath); #endif -#ifdef MULTIMC_JARS_LOCATION - m_jarsPath = TOSTRING(MULTIMC_JARS_LOCATION); +#ifdef LAUNCHER_JARS_LOCATION + m_jarsPath = TOSTRING(LAUNCHER_JARS_LOCATION); #endif qDebug() << BuildConfig.LAUNCHER_DISPLAYNAME << ", (c) 2013-2021 " << BuildConfig.LAUNCHER_COPYRIGHT; @@ -1494,7 +1494,7 @@ QString Application::getJarsPath() { return FS::PathCombine(QCoreApplication::applicationDirPath(), "jars"); } - return m_jarsPath; + return FS::PathCombine(m_rootPath, m_jarsPath); } QString Application::getMSAClientID() From 84a142096f205c938ce7a561d029d6c2c4f2cda2 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Fri, 11 Mar 2022 17:09:44 +0100 Subject: [PATCH 17/25] chore: switch logo font to Josefin Sans --- program_info/polymc-header-black.svg | 37 ++++--- program_info/polymc-header.Source.svg | 139 ++++++++++++++++++++++++++ program_info/polymc-header.svg | 37 ++++--- 3 files changed, 175 insertions(+), 38 deletions(-) create mode 100644 program_info/polymc-header.Source.svg diff --git a/program_info/polymc-header-black.svg b/program_info/polymc-header-black.svg index 34cda4ab..e93be00c 100644 --- a/program_info/polymc-header-black.svg +++ b/program_info/polymc-header-black.svg @@ -1,31 +1,30 @@ - - + - - - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + + + diff --git a/program_info/polymc-header.Source.svg b/program_info/polymc-header.Source.svg new file mode 100644 index 00000000..c960f33b --- /dev/null +++ b/program_info/polymc-header.Source.svg @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + PolyMC + + + + diff --git a/program_info/polymc-header.svg b/program_info/polymc-header.svg index a896787f..bfad7215 100644 --- a/program_info/polymc-header.svg +++ b/program_info/polymc-header.svg @@ -1,31 +1,30 @@ - - + - - - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + + + From f1c21a912a180cd542f5789f623bf50617f41387 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Fri, 11 Mar 2022 17:44:54 +0100 Subject: [PATCH 18/25] fix: simplify header SVG using SVGO --- program_info/polymc-header-black.svg | 33 +++++++++++----------------- program_info/polymc-header.svg | 33 +++++++++++----------------- 2 files changed, 26 insertions(+), 40 deletions(-) diff --git a/program_info/polymc-header-black.svg b/program_info/polymc-header-black.svg index e93be00c..e9e7c3e2 100644 --- a/program_info/polymc-header-black.svg +++ b/program_info/polymc-header-black.svg @@ -1,30 +1,23 @@ - + - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/program_info/polymc-header.svg b/program_info/polymc-header.svg index bfad7215..837004e1 100644 --- a/program_info/polymc-header.svg +++ b/program_info/polymc-header.svg @@ -1,30 +1,23 @@ - + - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + From 71a4333f5570fcbd8dc9d8937f44a40cc66ab6ac Mon Sep 17 00:00:00 2001 From: Ezekiel Smith Date: Sun, 13 Mar 2022 23:25:17 +1000 Subject: [PATCH 19/25] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 30b87510..a114869c 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,8 @@ In general, in order of importance: The translation effort for PolyMC is hosted on [Weblate](https://hosted.weblate.org/projects/polymc/polymc/) and information about translating PolyMC is available at https://github.com/PolyMC/Translations -## Download infomation -To modify download infomation or change packaging infomation send a pull request or issue to the website [Here](https://github.com/PolyMC/polymc.github.io/blob/master/src/download.md) +## Download information +To modify download information or change packaging information send a pull request or issue to the website [Here](https://github.com/PolyMC/polymc.github.io/blob/master/src/download.md) ## Forking/Redistributing/Custom builds policy From b3b613d8b4a5012d22b9e1646f4367fd27c783e3 Mon Sep 17 00:00:00 2001 From: flow Date: Sun, 13 Mar 2022 11:50:18 -0300 Subject: [PATCH 20/25] feat(ui): make a better "Mod download confirmation dialog" --- launcher/CMakeLists.txt | 3 + launcher/ui/dialogs/ModDownloadDialog.cpp | 27 ++----- launcher/ui/dialogs/ReviewMessageBox.cpp | 31 +++++++ launcher/ui/dialogs/ReviewMessageBox.h | 23 ++++++ launcher/ui/dialogs/ReviewMessageBox.ui | 98 +++++++++++++++++++++++ 5 files changed, 163 insertions(+), 19 deletions(-) create mode 100644 launcher/ui/dialogs/ReviewMessageBox.cpp create mode 100644 launcher/ui/dialogs/ReviewMessageBox.h create mode 100644 launcher/ui/dialogs/ReviewMessageBox.ui diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 86c05651..039841ef 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -797,6 +797,8 @@ SET(LAUNCHER_SOURCES ui/pagedialog/PageDialog.h ui/dialogs/ProgressDialog.cpp ui/dialogs/ProgressDialog.h + ui/dialogs/ReviewMessageBox.cpp + ui/dialogs/ReviewMessageBox.h ui/dialogs/UpdateDialog.cpp ui/dialogs/UpdateDialog.h ui/dialogs/VersionSelectDialog.cpp @@ -905,6 +907,7 @@ qt5_wrap_ui(LAUNCHER_UI ui/dialogs/AboutDialog.ui ui/dialogs/LoginDialog.ui ui/dialogs/EditAccountDialog.ui + ui/dialogs/ReviewMessageBox.ui ) qt5_add_resources(LAUNCHER_RESOURCES diff --git a/launcher/ui/dialogs/ModDownloadDialog.cpp b/launcher/ui/dialogs/ModDownloadDialog.cpp index 23ca8731..a53f93e8 100644 --- a/launcher/ui/dialogs/ModDownloadDialog.cpp +++ b/launcher/ui/dialogs/ModDownloadDialog.cpp @@ -5,7 +5,7 @@ #include #include "ProgressDialog.h" -#include "CustomMessageBox.h" +#include "ReviewMessageBox.h" #include #include @@ -75,27 +75,16 @@ void ModDownloadDialog::confirm() auto keys = modTask.keys(); keys.sort(Qt::CaseInsensitive); - auto info = QString(tr("You're about to download the following mods:")); - info.append("\n\n"); - for(auto task : keys){ - info.append(task); - info.append("\n --> "); - info.append(tr("File name: ")); - info.append(modTask.find(task).value()->getFilename()); - info.append('\n'); - } - - auto confirm_dialog = CustomMessageBox::selectable( + auto confirm_dialog = ReviewMessageBox::create( this, - tr("Confirm mods to download"), - info, - QMessageBox::NoIcon, - QMessageBox::Cancel | QMessageBox::Ok, - QMessageBox::Ok + tr("Confirm mods to download") ); - auto AcceptButton = confirm_dialog->button(QMessageBox::Ok); - connect(AcceptButton, &QPushButton::clicked, this, &ModDownloadDialog::accept); + for(auto task : keys){ + confirm_dialog->appendMod(task, modTask.find(task).value()->getFilename()); + } + + connect(confirm_dialog, &QDialog::accepted, this, &ModDownloadDialog::accept); confirm_dialog->open(); } diff --git a/launcher/ui/dialogs/ReviewMessageBox.cpp b/launcher/ui/dialogs/ReviewMessageBox.cpp new file mode 100644 index 00000000..139d05f1 --- /dev/null +++ b/launcher/ui/dialogs/ReviewMessageBox.cpp @@ -0,0 +1,31 @@ +#include "ReviewMessageBox.h" +#include "ui_ReviewMessageBox.h" + +ReviewMessageBox::ReviewMessageBox(QWidget* parent, QString const& title, QString const& icon) + : QDialog(parent), ui(new Ui::ReviewMessageBox) +{ + ui->setupUi(this); +} + +ReviewMessageBox::~ReviewMessageBox() +{ + delete ui; +} + +auto ReviewMessageBox::create(QWidget* parent, QString&& title, QString&& icon) -> ReviewMessageBox* +{ + return new ReviewMessageBox(parent, title, icon); +} + +void ReviewMessageBox::appendMod(const QString& name, const QString& filename) +{ + auto itemTop = new QTreeWidgetItem(ui->modTreeWidget); + itemTop->setText(0, name); + + auto filenameItem = new QTreeWidgetItem(itemTop); + filenameItem->setText(0, QString("Filename: %1").arg(filename)); + + itemTop->insertChildren(0, { filenameItem }); + + ui->modTreeWidget->addTopLevelItem(itemTop); +} diff --git a/launcher/ui/dialogs/ReviewMessageBox.h b/launcher/ui/dialogs/ReviewMessageBox.h new file mode 100644 index 00000000..48742cd9 --- /dev/null +++ b/launcher/ui/dialogs/ReviewMessageBox.h @@ -0,0 +1,23 @@ +#pragma once + +#include + +namespace Ui { +class ReviewMessageBox; +} + +class ReviewMessageBox final : public QDialog { + Q_OBJECT + + public: + static auto create(QWidget* parent, QString&& title, QString&& icon = "") -> ReviewMessageBox*; + + void appendMod(const QString& name, const QString& filename); + + ~ReviewMessageBox(); + + private: + ReviewMessageBox(QWidget* parent, const QString& title, const QString& icon); + + Ui::ReviewMessageBox* ui; +}; diff --git a/launcher/ui/dialogs/ReviewMessageBox.ui b/launcher/ui/dialogs/ReviewMessageBox.ui new file mode 100644 index 00000000..d04f3b3f --- /dev/null +++ b/launcher/ui/dialogs/ReviewMessageBox.ui @@ -0,0 +1,98 @@ + + + ReviewMessageBox + + + + 0 + 0 + 400 + 300 + + + + Confirm mod selection + + + true + + + true + + + + + + You're about to download the following mods: + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + true + + + QAbstractItemView::NoSelection + + + QAbstractItemView::SelectItems + + + false + + + + + + + + + + + + + + buttonBox + accepted() + ReviewMessageBox + accept() + + + 200 + 265 + + + 199 + 149 + + + + + buttonBox + rejected() + ReviewMessageBox + reject() + + + 200 + 265 + + + 199 + 149 + + + + + From f1e44291cc794fa16e4c975beb95b1f78584f4e5 Mon Sep 17 00:00:00 2001 From: flow Date: Sun, 13 Mar 2022 13:11:35 -0300 Subject: [PATCH 21/25] add translation string --- launcher/ui/dialogs/ReviewMessageBox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/ui/dialogs/ReviewMessageBox.cpp b/launcher/ui/dialogs/ReviewMessageBox.cpp index 139d05f1..2bfd02e0 100644 --- a/launcher/ui/dialogs/ReviewMessageBox.cpp +++ b/launcher/ui/dialogs/ReviewMessageBox.cpp @@ -23,7 +23,7 @@ void ReviewMessageBox::appendMod(const QString& name, const QString& filename) itemTop->setText(0, name); auto filenameItem = new QTreeWidgetItem(itemTop); - filenameItem->setText(0, QString("Filename: %1").arg(filename)); + filenameItem->setText(0, tr("Filename: %1").arg(filename)); itemTop->insertChildren(0, { filenameItem }); From ec9d0e70fbd8bf6ecd72a8cf756e46706725320f Mon Sep 17 00:00:00 2001 From: DioEgizio <83089242+DioEgizio@users.noreply.github.com> Date: Sun, 13 Mar 2022 17:57:25 +0100 Subject: [PATCH 22/25] [macos] update copyright and info string --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5250d0ff..5b1b97d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -170,13 +170,13 @@ if(UNIX AND APPLE) # Mac bundle settings set(MACOSX_BUNDLE_BUNDLE_NAME "${Launcher_Name}") - set(MACOSX_BUNDLE_INFO_STRING "${Launcher_Name}: Minecraft launcher and management utility.") + set(MACOSX_BUNDLE_INFO_STRING "${Launcher_Name}: A custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once.") set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.polymc.${Launcher_Name}") set(MACOSX_BUNDLE_BUNDLE_VERSION "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.${Launcher_VERSION_HOTFIX}.${Launcher_VERSION_BUILD}") set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.${Launcher_VERSION_HOTFIX}.${Launcher_VERSION_BUILD}") set(MACOSX_BUNDLE_LONG_VERSION_STRING "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.${Launcher_VERSION_HOTFIX}.${Launcher_VERSION_BUILD}") set(MACOSX_BUNDLE_ICON_FILE ${Launcher_Name}.icns) - set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2015-2021 ${Launcher_Copyright}") + set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2021-2022 ${Launcher_Copyright}") # directories to look for dependencies set(DIRS ${QT_LIBS_DIR} ${QT_LIBEXECS_DIR} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) From a0f76cba62e8e702d8f17d5b7556bd1292cff655 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Mar 2022 18:42:41 +0100 Subject: [PATCH 23/25] chore: clarify GPL-3.0-only --- COPYING.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/COPYING.md b/COPYING.md index 1ac6d5cb..273a5b3a 100644 --- a/COPYING.md +++ b/COPYING.md @@ -5,8 +5,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + the Free Software Foundation, version 3. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of From 199740cc6101e634923b215ae87d5b60e98235b3 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 14 Mar 2022 18:44:02 +0100 Subject: [PATCH 24/25] fix(metainfo): clarify GPL-3.0-only --- program_info/org.polymc.PolyMC.metainfo.xml.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program_info/org.polymc.PolyMC.metainfo.xml.in b/program_info/org.polymc.PolyMC.metainfo.xml.in index 7972965c..ff4af1c3 100644 --- a/program_info/org.polymc.PolyMC.metainfo.xml.in +++ b/program_info/org.polymc.PolyMC.metainfo.xml.in @@ -9,7 +9,7 @@ PolyMC Team A custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once CC0-1.0 - GPL-3.0-or-later + GPL-3.0-only https://polymc.org/ https://polymc.org/wiki/ From a268ac71410c228d0d76cd2a9cf9a6057b1f9085 Mon Sep 17 00:00:00 2001 From: Philipp David Date: Tue, 15 Mar 2022 09:04:43 +0100 Subject: [PATCH 25/25] Add GITDIR-NOTFOUND check This adds a check for a GIT_REFSPEC value of "GITDIR-NOTFOUND" and sets the VERSION_CHANNEL to stable in that case. Without this change, "GITDIR-N" is appended to the version string when building from a source archive instead of a git checkout. --- buildconfig/BuildConfig.cpp.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index 6524fb5d..4625b1bf 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -28,7 +28,11 @@ Config::Config() GIT_COMMIT = "@Launcher_GIT_COMMIT@"; GIT_REFSPEC = "@Launcher_GIT_REFSPEC@"; - if(GIT_REFSPEC.startsWith("refs/heads/")) + if (GIT_REFSPEC == QStringLiteral("GITDIR-NOTFOUND")) + { + VERSION_CHANNEL = QStringLiteral("stable"); + } + else if(GIT_REFSPEC.startsWith("refs/heads/")) { VERSION_CHANNEL = GIT_REFSPEC; VERSION_CHANNEL.remove("refs/heads/");