From d87f743a2bd2fac761b94de77ed7255d7a983f03 Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Tue, 18 Oct 2022 17:49:35 +0100 Subject: [PATCH 01/26] Add flat white icons This is mainly for dark mode users, as I think that the regular colour of the flat icons do not look good with dark mode. --- launcher/resources/flat_white/flat_white.qrc | 46 ++++++++ launcher/resources/flat_white/index.theme | 11 ++ .../resources/flat_white/scalable/about.svg | 3 + .../flat_white/scalable/accounts.svg | 3 + .../resources/flat_white/scalable/bug.svg | 3 + .../resources/flat_white/scalable/cat.svg | 3 + .../flat_white/scalable/centralmods.svg | 3 + .../flat_white/scalable/checkupdate.svg | 3 + .../resources/flat_white/scalable/copy.svg | 3 + .../flat_white/scalable/coremods.svg | 3 + .../flat_white/scalable/custom-commands.svg | 86 +++++++++++++++ .../resources/flat_white/scalable/discord.svg | 4 + .../flat_white/scalable/externaltools.svg | 3 + .../resources/flat_white/scalable/help.svg | 17 +++ .../flat_white/scalable/instance-settings.svg | 3 + .../resources/flat_white/scalable/jarmods.svg | 3 + .../resources/flat_white/scalable/java.svg | 3 + .../flat_white/scalable/language.svg | 103 ++++++++++++++++++ .../flat_white/scalable/launcher.svg | 2 + .../flat_white/scalable/loadermods.svg | 3 + .../resources/flat_white/scalable/log.svg | 3 + .../flat_white/scalable/minecraft.svg | 3 + .../resources/flat_white/scalable/multimc.svg | 3 + .../resources/flat_white/scalable/new.svg | 3 + .../resources/flat_white/scalable/news.svg | 3 + .../resources/flat_white/scalable/notes.svg | 3 + .../flat_white/scalable/packages.svg | 3 + .../resources/flat_white/scalable/patreon.svg | 3 + .../resources/flat_white/scalable/proxy.svg | 3 + .../flat_white/scalable/quickmods.svg | 3 + .../flat_white/scalable/reddit-alien.svg | 3 + .../resources/flat_white/scalable/refresh.svg | 3 + .../flat_white/scalable/resourcepacks.svg | 3 + .../scalable/screenshot-placeholder.svg | 3 + .../flat_white/scalable/screenshots.svg | 3 + .../flat_white/scalable/settings.svg | 3 + .../flat_white/scalable/shaderpacks.svg | 56 ++++++++++ .../resources/flat_white/scalable/star.svg | 3 + .../flat_white/scalable/status-bad.svg | 3 + .../flat_white/scalable/status-good.svg | 3 + .../flat_white/scalable/status-running.svg | 3 + .../flat_white/scalable/status-yellow.svg | 3 + .../flat_white/scalable/viewfolder.svg | 3 + .../resources/flat_white/scalable/worlds.svg | 3 + 44 files changed, 433 insertions(+) create mode 100644 launcher/resources/flat_white/flat_white.qrc create mode 100644 launcher/resources/flat_white/index.theme create mode 100644 launcher/resources/flat_white/scalable/about.svg create mode 100644 launcher/resources/flat_white/scalable/accounts.svg create mode 100644 launcher/resources/flat_white/scalable/bug.svg create mode 100644 launcher/resources/flat_white/scalable/cat.svg create mode 100644 launcher/resources/flat_white/scalable/centralmods.svg create mode 100644 launcher/resources/flat_white/scalable/checkupdate.svg create mode 100644 launcher/resources/flat_white/scalable/copy.svg create mode 100644 launcher/resources/flat_white/scalable/coremods.svg create mode 100644 launcher/resources/flat_white/scalable/custom-commands.svg create mode 100644 launcher/resources/flat_white/scalable/discord.svg create mode 100644 launcher/resources/flat_white/scalable/externaltools.svg create mode 100644 launcher/resources/flat_white/scalable/help.svg create mode 100644 launcher/resources/flat_white/scalable/instance-settings.svg create mode 100644 launcher/resources/flat_white/scalable/jarmods.svg create mode 100644 launcher/resources/flat_white/scalable/java.svg create mode 100644 launcher/resources/flat_white/scalable/language.svg create mode 100644 launcher/resources/flat_white/scalable/launcher.svg create mode 100644 launcher/resources/flat_white/scalable/loadermods.svg create mode 100644 launcher/resources/flat_white/scalable/log.svg create mode 100644 launcher/resources/flat_white/scalable/minecraft.svg create mode 100644 launcher/resources/flat_white/scalable/multimc.svg create mode 100644 launcher/resources/flat_white/scalable/new.svg create mode 100644 launcher/resources/flat_white/scalable/news.svg create mode 100644 launcher/resources/flat_white/scalable/notes.svg create mode 100644 launcher/resources/flat_white/scalable/packages.svg create mode 100644 launcher/resources/flat_white/scalable/patreon.svg create mode 100644 launcher/resources/flat_white/scalable/proxy.svg create mode 100644 launcher/resources/flat_white/scalable/quickmods.svg create mode 100644 launcher/resources/flat_white/scalable/reddit-alien.svg create mode 100644 launcher/resources/flat_white/scalable/refresh.svg create mode 100644 launcher/resources/flat_white/scalable/resourcepacks.svg create mode 100644 launcher/resources/flat_white/scalable/screenshot-placeholder.svg create mode 100644 launcher/resources/flat_white/scalable/screenshots.svg create mode 100644 launcher/resources/flat_white/scalable/settings.svg create mode 100644 launcher/resources/flat_white/scalable/shaderpacks.svg create mode 100644 launcher/resources/flat_white/scalable/star.svg create mode 100644 launcher/resources/flat_white/scalable/status-bad.svg create mode 100644 launcher/resources/flat_white/scalable/status-good.svg create mode 100644 launcher/resources/flat_white/scalable/status-running.svg create mode 100644 launcher/resources/flat_white/scalable/status-yellow.svg create mode 100644 launcher/resources/flat_white/scalable/viewfolder.svg create mode 100644 launcher/resources/flat_white/scalable/worlds.svg diff --git a/launcher/resources/flat_white/flat_white.qrc b/launcher/resources/flat_white/flat_white.qrc new file mode 100644 index 00000000..d2b752b1 --- /dev/null +++ b/launcher/resources/flat_white/flat_white.qrc @@ -0,0 +1,46 @@ + + + + index.theme + scalable/about.svg + scalable/accounts.svg + scalable/bug.svg + scalable/cat.svg + scalable/centralmods.svg + scalable/checkupdate.svg + scalable/copy.svg + scalable/coremods.svg + scalable/custom-commands.svg + scalable/discord.svg + scalable/externaltools.svg + scalable/help.svg + scalable/instance-settings.svg + scalable/jarmods.svg + scalable/java.svg + scalable/language.svg + scalable/launcher.svg + scalable/loadermods.svg + scalable/log.svg + scalable/minecraft.svg + scalable/new.svg + scalable/news.svg + scalable/notes.svg + scalable/packages.svg + scalable/proxy.svg + scalable/quickmods.svg + scalable/reddit-alien.svg + scalable/refresh.svg + scalable/resourcepacks.svg + scalable/shaderpacks.svg + scalable/screenshot-placeholder.svg + scalable/screenshots.svg + scalable/settings.svg + scalable/star.svg + scalable/status-bad.svg + scalable/status-good.svg + scalable/status-running.svg + scalable/status-yellow.svg + scalable/viewfolder.svg + scalable/worlds.svg + + diff --git a/launcher/resources/flat_white/index.theme b/launcher/resources/flat_white/index.theme new file mode 100644 index 00000000..a0b3ba6f --- /dev/null +++ b/launcher/resources/flat_white/index.theme @@ -0,0 +1,11 @@ +[Icon Theme] +Name=White Flat +Comment=White version of the flat icons (for dark mode) +Inherits=multimc +Directories=scalable + +[scalable] +Size=48 +Type=Scalable +MinSize=16 +MaxSize=256 diff --git a/launcher/resources/flat_white/scalable/about.svg b/launcher/resources/flat_white/scalable/about.svg new file mode 100644 index 00000000..e42ca948 --- /dev/null +++ b/launcher/resources/flat_white/scalable/about.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/accounts.svg b/launcher/resources/flat_white/scalable/accounts.svg new file mode 100644 index 00000000..e714bde1 --- /dev/null +++ b/launcher/resources/flat_white/scalable/accounts.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/bug.svg b/launcher/resources/flat_white/scalable/bug.svg new file mode 100644 index 00000000..3122702e --- /dev/null +++ b/launcher/resources/flat_white/scalable/bug.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/cat.svg b/launcher/resources/flat_white/scalable/cat.svg new file mode 100644 index 00000000..18da097a --- /dev/null +++ b/launcher/resources/flat_white/scalable/cat.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/centralmods.svg b/launcher/resources/flat_white/scalable/centralmods.svg new file mode 100644 index 00000000..d8d10f2f --- /dev/null +++ b/launcher/resources/flat_white/scalable/centralmods.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/checkupdate.svg b/launcher/resources/flat_white/scalable/checkupdate.svg new file mode 100644 index 00000000..0fa66fc2 --- /dev/null +++ b/launcher/resources/flat_white/scalable/checkupdate.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/copy.svg b/launcher/resources/flat_white/scalable/copy.svg new file mode 100644 index 00000000..1aaed97b --- /dev/null +++ b/launcher/resources/flat_white/scalable/copy.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/coremods.svg b/launcher/resources/flat_white/scalable/coremods.svg new file mode 100644 index 00000000..32c34383 --- /dev/null +++ b/launcher/resources/flat_white/scalable/coremods.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/custom-commands.svg b/launcher/resources/flat_white/scalable/custom-commands.svg new file mode 100644 index 00000000..3d67d8f1 --- /dev/null +++ b/launcher/resources/flat_white/scalable/custom-commands.svg @@ -0,0 +1,86 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/launcher/resources/flat_white/scalable/discord.svg b/launcher/resources/flat_white/scalable/discord.svg new file mode 100644 index 00000000..ee07ed25 --- /dev/null +++ b/launcher/resources/flat_white/scalable/discord.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/externaltools.svg b/launcher/resources/flat_white/scalable/externaltools.svg new file mode 100644 index 00000000..e7c0930c --- /dev/null +++ b/launcher/resources/flat_white/scalable/externaltools.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/help.svg b/launcher/resources/flat_white/scalable/help.svg new file mode 100644 index 00000000..82b413fe --- /dev/null +++ b/launcher/resources/flat_white/scalable/help.svg @@ -0,0 +1,17 @@ + + + + diff --git a/launcher/resources/flat_white/scalable/instance-settings.svg b/launcher/resources/flat_white/scalable/instance-settings.svg new file mode 100644 index 00000000..7dac7b14 --- /dev/null +++ b/launcher/resources/flat_white/scalable/instance-settings.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/jarmods.svg b/launcher/resources/flat_white/scalable/jarmods.svg new file mode 100644 index 00000000..f0f298f3 --- /dev/null +++ b/launcher/resources/flat_white/scalable/jarmods.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/java.svg b/launcher/resources/flat_white/scalable/java.svg new file mode 100644 index 00000000..56bb481f --- /dev/null +++ b/launcher/resources/flat_white/scalable/java.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/language.svg b/launcher/resources/flat_white/scalable/language.svg new file mode 100644 index 00000000..18c22efb --- /dev/null +++ b/launcher/resources/flat_white/scalable/language.svg @@ -0,0 +1,103 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/launcher/resources/flat_white/scalable/launcher.svg b/launcher/resources/flat_white/scalable/launcher.svg new file mode 100644 index 00000000..d7ad0dd3 --- /dev/null +++ b/launcher/resources/flat_white/scalable/launcher.svg @@ -0,0 +1,2 @@ + + diff --git a/launcher/resources/flat_white/scalable/loadermods.svg b/launcher/resources/flat_white/scalable/loadermods.svg new file mode 100644 index 00000000..100f7a93 --- /dev/null +++ b/launcher/resources/flat_white/scalable/loadermods.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/log.svg b/launcher/resources/flat_white/scalable/log.svg new file mode 100644 index 00000000..69b7c1dc --- /dev/null +++ b/launcher/resources/flat_white/scalable/log.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/minecraft.svg b/launcher/resources/flat_white/scalable/minecraft.svg new file mode 100644 index 00000000..a0348e79 --- /dev/null +++ b/launcher/resources/flat_white/scalable/minecraft.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/multimc.svg b/launcher/resources/flat_white/scalable/multimc.svg new file mode 100644 index 00000000..3dce2699 --- /dev/null +++ b/launcher/resources/flat_white/scalable/multimc.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/new.svg b/launcher/resources/flat_white/scalable/new.svg new file mode 100644 index 00000000..46dc3361 --- /dev/null +++ b/launcher/resources/flat_white/scalable/new.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/news.svg b/launcher/resources/flat_white/scalable/news.svg new file mode 100644 index 00000000..414e5454 --- /dev/null +++ b/launcher/resources/flat_white/scalable/news.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/notes.svg b/launcher/resources/flat_white/scalable/notes.svg new file mode 100644 index 00000000..4ce5f6f1 --- /dev/null +++ b/launcher/resources/flat_white/scalable/notes.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/packages.svg b/launcher/resources/flat_white/scalable/packages.svg new file mode 100644 index 00000000..909ad0b2 --- /dev/null +++ b/launcher/resources/flat_white/scalable/packages.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/patreon.svg b/launcher/resources/flat_white/scalable/patreon.svg new file mode 100644 index 00000000..b745765b --- /dev/null +++ b/launcher/resources/flat_white/scalable/patreon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/proxy.svg b/launcher/resources/flat_white/scalable/proxy.svg new file mode 100644 index 00000000..a86703f4 --- /dev/null +++ b/launcher/resources/flat_white/scalable/proxy.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/quickmods.svg b/launcher/resources/flat_white/scalable/quickmods.svg new file mode 100644 index 00000000..9e0045b2 --- /dev/null +++ b/launcher/resources/flat_white/scalable/quickmods.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/reddit-alien.svg b/launcher/resources/flat_white/scalable/reddit-alien.svg new file mode 100644 index 00000000..be22148c --- /dev/null +++ b/launcher/resources/flat_white/scalable/reddit-alien.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/refresh.svg b/launcher/resources/flat_white/scalable/refresh.svg new file mode 100644 index 00000000..08c63bdf --- /dev/null +++ b/launcher/resources/flat_white/scalable/refresh.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/resourcepacks.svg b/launcher/resources/flat_white/scalable/resourcepacks.svg new file mode 100644 index 00000000..9dd73c3a --- /dev/null +++ b/launcher/resources/flat_white/scalable/resourcepacks.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/screenshot-placeholder.svg b/launcher/resources/flat_white/scalable/screenshot-placeholder.svg new file mode 100644 index 00000000..41eb6fcf --- /dev/null +++ b/launcher/resources/flat_white/scalable/screenshot-placeholder.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/screenshots.svg b/launcher/resources/flat_white/scalable/screenshots.svg new file mode 100644 index 00000000..68cf8969 --- /dev/null +++ b/launcher/resources/flat_white/scalable/screenshots.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/settings.svg b/launcher/resources/flat_white/scalable/settings.svg new file mode 100644 index 00000000..7dac7b14 --- /dev/null +++ b/launcher/resources/flat_white/scalable/settings.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/shaderpacks.svg b/launcher/resources/flat_white/scalable/shaderpacks.svg new file mode 100644 index 00000000..ccae221c --- /dev/null +++ b/launcher/resources/flat_white/scalable/shaderpacks.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + diff --git a/launcher/resources/flat_white/scalable/star.svg b/launcher/resources/flat_white/scalable/star.svg new file mode 100644 index 00000000..116f952e --- /dev/null +++ b/launcher/resources/flat_white/scalable/star.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/status-bad.svg b/launcher/resources/flat_white/scalable/status-bad.svg new file mode 100644 index 00000000..5a121c09 --- /dev/null +++ b/launcher/resources/flat_white/scalable/status-bad.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/status-good.svg b/launcher/resources/flat_white/scalable/status-good.svg new file mode 100644 index 00000000..ccb732ab --- /dev/null +++ b/launcher/resources/flat_white/scalable/status-good.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/status-running.svg b/launcher/resources/flat_white/scalable/status-running.svg new file mode 100644 index 00000000..aa2d5fbf --- /dev/null +++ b/launcher/resources/flat_white/scalable/status-running.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/status-yellow.svg b/launcher/resources/flat_white/scalable/status-yellow.svg new file mode 100644 index 00000000..772699d3 --- /dev/null +++ b/launcher/resources/flat_white/scalable/status-yellow.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/viewfolder.svg b/launcher/resources/flat_white/scalable/viewfolder.svg new file mode 100644 index 00000000..145f8624 --- /dev/null +++ b/launcher/resources/flat_white/scalable/viewfolder.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/worlds.svg b/launcher/resources/flat_white/scalable/worlds.svg new file mode 100644 index 00000000..cea30cf8 --- /dev/null +++ b/launcher/resources/flat_white/scalable/worlds.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file From 92dfd659f1a3e11accdbf0ebbdc7cb91f74d9a21 Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Tue, 18 Oct 2022 17:54:26 +0100 Subject: [PATCH 02/26] Fix .QRC file for flat white icons --- launcher/resources/flat_white/flat_white.qrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/resources/flat_white/flat_white.qrc b/launcher/resources/flat_white/flat_white.qrc index d2b752b1..feda4762 100644 --- a/launcher/resources/flat_white/flat_white.qrc +++ b/launcher/resources/flat_white/flat_white.qrc @@ -1,6 +1,6 @@ - + index.theme scalable/about.svg scalable/accounts.svg From 7eecf454e83314cd6f8029f54678dea568d41843 Mon Sep 17 00:00:00 2001 From: flow Date: Fri, 21 Oct 2022 14:07:43 -0300 Subject: [PATCH 03/26] fix: remove max height logic for mod update changelogs It's not worth it to keep this, it's just a heuristic that fails from time to time. Signed-off-by: flow --- launcher/ui/dialogs/ModUpdateDialog.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/launcher/ui/dialogs/ModUpdateDialog.cpp b/launcher/ui/dialogs/ModUpdateDialog.cpp index 4171586e..cedd4a96 100644 --- a/launcher/ui/dialogs/ModUpdateDialog.cpp +++ b/launcher/ui/dialogs/ModUpdateDialog.cpp @@ -366,33 +366,28 @@ void ModUpdateDialog::appendMod(CheckUpdateTask::UpdatableMod const& info) auto changelog = new QTreeWidgetItem(changelog_item); auto changelog_area = new QTextBrowser(); + QString text = info.changelog; switch (info.provider) { case ModPlatform::Provider::MODRINTH: { HoeDown h; // HoeDown bug?: \n aren't converted to
- auto text = h.process(info.changelog.toUtf8()); + text = h.process(info.changelog.toUtf8()); // Don't convert if there's an HTML tag right after (Qt rendering weirdness) text.remove(QRegularExpression("(\n+)(?=<)")); text.replace('\n', "
"); - changelog_area->setHtml(text); break; } - case ModPlatform::Provider::FLAME: { - changelog_area->setHtml(info.changelog); + default: break; - } } + changelog_area->setHtml(text); changelog_area->setOpenExternalLinks(true); - changelog_area->setLineWrapMode(QTextBrowser::LineWrapMode::NoWrap); + changelog_area->setLineWrapMode(QTextBrowser::LineWrapMode::WidgetWidth); changelog_area->setVerticalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAsNeeded); - // HACK: Is there a better way of achieving this? - auto font_height = QFontMetrics(changelog_area->font()).height(); - changelog_area->setMaximumHeight((changelog_area->toPlainText().count(QRegularExpression("\n|
")) + 2) * font_height); - ui->modTreeWidget->setItemWidget(changelog, 0, changelog_area); ui->modTreeWidget->addTopLevelItem(item_top); From 1288b926153c86b7966727e60de4af8e7dcb4031 Mon Sep 17 00:00:00 2001 From: Hibi <69405847+Hibiii@users.noreply.github.com> Date: Fri, 21 Oct 2022 15:40:28 -0300 Subject: [PATCH 04/26] Add argument to show instance window --- launcher/Application.cpp | 14 +++++++++++++- launcher/Application.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 6ffec1ae..ace06c2c 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -245,7 +245,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) {{"s", "server"}, "Join the specified server on launch (only valid in combination with --launch)", "address"}, {{"a", "profile"}, "Use the account specified by its profile name (only valid in combination with --launch)", "profile"}, {"alive", "Write a small '" + liveCheckFile + "' file after the launcher starts"}, - {{"I", "import"}, "Import instance from specified zip (local path or URL)", "file"} + {{"I", "import"}, "Import instance from specified zip (local path or URL)", "file"}, + {"show", "Opens the window for the specified instance (by instance ID)", "show"} }); parser.addHelpOption(); parser.addVersionOption(); @@ -257,6 +258,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_profileToUse = parser.value("profile"); m_liveCheck = parser.isSet("alive"); m_zipToImport = parser.value("import"); + m_instanceIdToShowWindowOf = parser.value("show"); // error if --launch is missing with --server or --profile if((!m_serverToJoin.isEmpty() || !m_profileToUse.isEmpty()) && m_instanceIdToLaunch.isEmpty()) @@ -986,6 +988,16 @@ void Application::performMainStartupAction() return; } } + if(!m_instanceIdToShowWindowOf.isEmpty()) + { + auto inst = instances()->getInstanceById(m_instanceIdToShowWindowOf); + if(inst) + { + qDebug() << "<> Showing window of instance " << m_instanceIdToShowWindowOf; + showInstanceWindow(inst); + return; + } + } if(!m_mainWindow) { // normal main window diff --git a/launcher/Application.h b/launcher/Application.h index 34ad8c15..c453cc28 100644 --- a/launcher/Application.h +++ b/launcher/Application.h @@ -301,6 +301,7 @@ public: QString m_profileToUse; bool m_liveCheck = false; QUrl m_zipToImport; + QString m_instanceIdToShowWindowOf; std::unique_ptr logFile; }; From 5b75869c0ba60e00147d723d5633c9f6a5d6304e Mon Sep 17 00:00:00 2001 From: Hibi <69405847+Hibiii@users.noreply.github.com> Date: Fri, 21 Oct 2022 16:10:03 -0300 Subject: [PATCH 05/26] Add --show to manual page --- program_info/prismlauncher.6.scd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/program_info/prismlauncher.6.scd b/program_info/prismlauncher.6.scd index e3c7de86..f979e457 100644 --- a/program_info/prismlauncher.6.scd +++ b/program_info/prismlauncher.6.scd @@ -26,6 +26,9 @@ Here are the current features of Prism Launcher. *-l, --launch*=INSTANCE_ID Launch the instance specified by INSTANCE_ID. +*--show*=INSTANCE_ID + Show the configuration window of the instance specified by INSTANCE_ID. + *--alive* Write a small 'live.check' file after Prism Launcher starts. From 82d1dbf1736bb234938db7fdb8aecbc954023989 Mon Sep 17 00:00:00 2001 From: Hibi <69405847+Hibiii@users.noreply.github.com> Date: Fri, 21 Oct 2022 17:59:35 -0300 Subject: [PATCH 06/26] DCO Remediation Commit for Hibi <69405847+Hibiii@users.noreply.github.com> I, Hibi <69405847+Hibiii@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 1288b926153c86b7966727e60de4af8e7dcb4031 I, Hibi <69405847+Hibiii@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 5b75869c0ba60e00147d723d5633c9f6a5d6304e Signed-off-by: Hibi <69405847+Hibiii@users.noreply.github.com> From 56ae4e5b6ad984d4c9569cb024d807bd695555a6 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Sat, 22 Oct 2022 13:04:48 +0200 Subject: [PATCH 07/26] Change old style cast to C++ cast Change old style cast to C++ cast Signed-off-by: Bensuperpc --- launcher/GZip.cpp | 4 ++-- launcher/HoeDown.h | 2 +- launcher/tasks/Task.cpp | 2 +- libraries/LocalPeer/src/LocalPeer.cpp | 2 +- libraries/katabasis/src/DeviceFlow.cpp | 2 +- libraries/murmur2/src/MurmurHash2.cpp | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/launcher/GZip.cpp b/launcher/GZip.cpp index 067104cf..e36dc8a4 100644 --- a/launcher/GZip.cpp +++ b/launcher/GZip.cpp @@ -72,7 +72,7 @@ bool GZip::unzip(const QByteArray &compressedBytes, QByteArray &uncompressedByte uncompLength *= 2; } - strm.next_out = (Bytef *)(uncompressedBytes.data() + strm.total_out); + strm.next_out = reinterpret_cast((uncompressedBytes.data() + strm.total_out)); strm.avail_out = uncompLength - strm.total_out; // Inflate another chunk. @@ -129,7 +129,7 @@ bool GZip::zip(const QByteArray &uncompressedBytes, QByteArray &compressedBytes) { compressedBytes.resize(compressedBytes.size() * 2); } - zs.next_out = (Bytef *) (compressedBytes.data() + offset); + zs.next_out = reinterpret_cast((compressedBytes.data() + offset)); temp = zs.avail_out = compressedBytes.size() - offset; ret = deflate(&zs, Z_FINISH); offset += temp - zs.avail_out; diff --git a/launcher/HoeDown.h b/launcher/HoeDown.h index b9e06ffb..cb62de6c 100644 --- a/launcher/HoeDown.h +++ b/launcher/HoeDown.h @@ -42,7 +42,7 @@ public: } void put(QByteArray input) { - hoedown_buffer_put(buf, (uint8_t *) input.data(), input.size()); + hoedown_buffer_put(buf, reinterpret_cast(input.data()), input.size()); } const uint8_t * data() const { diff --git a/launcher/tasks/Task.cpp b/launcher/tasks/Task.cpp index b4babdd4..9ea1bb26 100644 --- a/launcher/tasks/Task.cpp +++ b/launcher/tasks/Task.cpp @@ -153,7 +153,7 @@ QString Task::describe() auto name = objectName(); if(name.isEmpty()) { - out << QString("0x%1").arg((quintptr)this, 0, 16); + out << QString("0x%1").arg(reinterpret_cast(this), 0, 16); } else { diff --git a/libraries/LocalPeer/src/LocalPeer.cpp b/libraries/LocalPeer/src/LocalPeer.cpp index 3c3d8b4c..b7149c40 100644 --- a/libraries/LocalPeer/src/LocalPeer.cpp +++ b/libraries/LocalPeer/src/LocalPeer.cpp @@ -210,7 +210,7 @@ void LocalPeer::receiveConnection() return; } - while (socket->bytesAvailable() < (int)sizeof(quint32)) + while (socket->bytesAvailable() < static_cast(sizeof(quint32))) { socket->waitForReadyRead(); } diff --git a/libraries/katabasis/src/DeviceFlow.cpp b/libraries/katabasis/src/DeviceFlow.cpp index ba1d121d..f78fd620 100644 --- a/libraries/katabasis/src/DeviceFlow.cpp +++ b/libraries/katabasis/src/DeviceFlow.cpp @@ -445,7 +445,7 @@ void DeviceFlow::onRefreshError(QNetworkReply::NetworkError error, QNetworkReply if(refreshReply) { refreshReply->deleteLater(); } - qDebug() << "DeviceFlow::onRefreshFinished: Error" << (int)error << " - " << errorString; + qDebug() << "DeviceFlow::onRefreshFinished: Error" << static_cast(error) << " - " << errorString; } } diff --git a/libraries/murmur2/src/MurmurHash2.cpp b/libraries/murmur2/src/MurmurHash2.cpp index b625efb1..c13608f0 100644 --- a/libraries/murmur2/src/MurmurHash2.cpp +++ b/libraries/murmur2/src/MurmurHash2.cpp @@ -55,12 +55,12 @@ uint32_t MurmurHash2(std::ifstream&& file_stream, std::size_t buffer_size, std:: // Mix 4 bytes at a time into the hash if (index == 0) - FourBytes_MurmurHash2((unsigned char*)&data, info); + FourBytes_MurmurHash2(reinterpret_cast(&data), info); } } while (!file_stream.eof()); // Do one last bit shuffle in the hash - FourBytes_MurmurHash2((unsigned char*)&data, info); + FourBytes_MurmurHash2(reinterpret_cast(&data), info); delete[] buffer; @@ -72,7 +72,7 @@ void FourBytes_MurmurHash2(const unsigned char* data, IncrementalHashInfo& prev) { if (prev.len >= 4) { // Not the final mix - uint32_t k = *(uint32_t*)data; + uint32_t k = *reinterpret_cast(data); k *= m; k ^= k >> r; From 1dad35ca760662b9fc7c22cc0799403f75780bb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20M=C3=B6ritz?= Date: Sat, 22 Oct 2022 15:00:52 +0200 Subject: [PATCH 08/26] update macos plist contents (fixes #132) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tobias Möritz --- CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 131d3e53..09f62bb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -211,19 +211,19 @@ if(NOT (UNIX AND APPLE)) endif() if(UNIX AND APPLE) - set(BINARY_DEST_DIR "${Launcher_Name}.app/Contents/MacOS") - set(LIBRARY_DEST_DIR "${Launcher_Name}.app/Contents/MacOS") - set(PLUGIN_DEST_DIR "${Launcher_Name}.app/Contents/MacOS") - set(FRAMEWORK_DEST_DIR "${Launcher_Name}.app/Contents/Frameworks") - set(RESOURCES_DEST_DIR "${Launcher_Name}.app/Contents/Resources") - set(JARS_DEST_DIR "${Launcher_Name}.app/Contents/MacOS/jars") + set(BINARY_DEST_DIR "${Launcher_DisplayName}.app/Contents/MacOS") + set(LIBRARY_DEST_DIR "${Launcher_DisplayName}.app/Contents/MacOS") + set(PLUGIN_DEST_DIR "${Launcher_DisplayName}.app/Contents/MacOS") + set(FRAMEWORK_DEST_DIR "${Launcher_DisplayName}.app/Contents/Frameworks") + set(RESOURCES_DEST_DIR "${Launcher_DisplayName}.app/Contents/Resources") + set(JARS_DEST_DIR "${Launcher_DisplayName}.app/Contents/MacOS/jars") # Apps to bundle - set(APPS "\${CMAKE_INSTALL_PREFIX}/${Launcher_Name}.app") + set(APPS "\${CMAKE_INSTALL_PREFIX}/${Launcher_DisplayName}.app") # Mac bundle settings - set(MACOSX_BUNDLE_BUNDLE_NAME "${Launcher_Name}") - 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_BUNDLE_NAME "${Launcher_DisplayName}") + set(MACOSX_BUNDLE_INFO_STRING "${Launcher_DisplayName}: A custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once.") set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.prismlauncher.${Launcher_Name}") set(MACOSX_BUNDLE_BUNDLE_VERSION "${Launcher_VERSION_NAME}") set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${Launcher_VERSION_NAME}") From 500a7eceabd292a7ddef5a5e2cec0fd26d66cef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20M=C3=B6ritz?= Date: Sat, 22 Oct 2022 15:10:32 +0200 Subject: [PATCH 09/26] update macOS build process to work with new .app MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tobias Möritz --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6400791..f67ba4c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -249,8 +249,8 @@ jobs: cmake --install ${{ env.BUILD_DIR }} cd ${{ env.INSTALL_DIR }} - chmod +x "PrismLauncher.app/Contents/MacOS/prismlauncher" - sudo codesign --sign - --deep --force --entitlements "../program_info/App.entitlements" --options runtime "PrismLauncher.app/Contents/MacOS/prismlauncher" + chmod +x "Prism Launcher.app/Contents/MacOS/prismlauncher" + sudo codesign --sign - --deep --force --entitlements "../program_info/App.entitlements" --options runtime "Prism Launcher.app/Contents/MacOS/prismlauncher" tar -czf ../PrismLauncher.tar.gz * - name: Make Sparkle signature (macOS) From a6e65dfc7a7e8080297b59ecf322b788d1c9bad2 Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Sat, 22 Oct 2022 15:40:39 +0100 Subject: [PATCH 10/26] Add new flat white icons --- launcher/resources/flat_white/scalable/delete.svg | 5 +++++ launcher/resources/flat_white/scalable/export.svg | 5 +++++ launcher/resources/flat_white/scalable/rename.svg | 4 ++++ launcher/resources/flat_white/scalable/tag.svg | 4 ++++ 4 files changed, 18 insertions(+) create mode 100644 launcher/resources/flat_white/scalable/delete.svg create mode 100644 launcher/resources/flat_white/scalable/export.svg create mode 100644 launcher/resources/flat_white/scalable/rename.svg create mode 100644 launcher/resources/flat_white/scalable/tag.svg diff --git a/launcher/resources/flat_white/scalable/delete.svg b/launcher/resources/flat_white/scalable/delete.svg new file mode 100644 index 00000000..4cf7206e --- /dev/null +++ b/launcher/resources/flat_white/scalable/delete.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/export.svg b/launcher/resources/flat_white/scalable/export.svg new file mode 100644 index 00000000..a28bb254 --- /dev/null +++ b/launcher/resources/flat_white/scalable/export.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/rename.svg b/launcher/resources/flat_white/scalable/rename.svg new file mode 100644 index 00000000..f2067c16 --- /dev/null +++ b/launcher/resources/flat_white/scalable/rename.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/tag.svg b/launcher/resources/flat_white/scalable/tag.svg new file mode 100644 index 00000000..2473126f --- /dev/null +++ b/launcher/resources/flat_white/scalable/tag.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file From 99e1c13e80d12764f57a993661656d9ed7de27bb Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Sat, 22 Oct 2022 15:50:06 +0100 Subject: [PATCH 11/26] fix: add flat_white to code --- launcher/CMakeLists.txt | 1 + launcher/main.cpp | 1 + launcher/resources/flat_white/index.theme | 2 +- launcher/ui/pages/global/LauncherPage.cpp | 13 ++++++++++--- launcher/ui/pages/global/LauncherPage.ui | 5 +++++ 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 79ac49c7..0dae47df 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -602,6 +602,7 @@ SET(LAUNCHER_SOURCES resources/OSX/OSX.qrc resources/iOS/iOS.qrc resources/flat/flat.qrc + resources/flat_white/flat_white.qrc resources/documents/documents.qrc ../${Launcher_Branding_LogoQRC} diff --git a/launcher/main.cpp b/launcher/main.cpp index c6a7614c..e2116f38 100644 --- a/launcher/main.cpp +++ b/launcher/main.cpp @@ -84,6 +84,7 @@ int main(int argc, char *argv[]) Q_INIT_RESOURCE(OSX); Q_INIT_RESOURCE(iOS); Q_INIT_RESOURCE(flat); + Q_INIT_RESOURCE(flat_white); return app.exec(); } case Application::Failed: diff --git a/launcher/resources/flat_white/index.theme b/launcher/resources/flat_white/index.theme index a0b3ba6f..0292509f 100644 --- a/launcher/resources/flat_white/index.theme +++ b/launcher/resources/flat_white/index.theme @@ -1,5 +1,5 @@ [Icon Theme] -Name=White Flat +Name=Flat (White) Comment=White version of the flat icons (for dark mode) Inherits=multimc Directories=scalable diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp index b8431e8c..536ab22e 100644 --- a/launcher/ui/pages/global/LauncherPage.cpp +++ b/launcher/ui/pages/global/LauncherPage.cpp @@ -310,9 +310,12 @@ void LauncherPage::applySettings() s->set("IconTheme", "flat"); break; case 7: - s->set("IconTheme", "multimc"); + s->set("IconTheme", "flat_white"); break; case 8: + s->set("IconTheme", "multimc"); + break; + case 9: s->set("IconTheme", "custom"); break; } @@ -408,14 +411,18 @@ void LauncherPage::loadSettings() { ui->themeComboBox->setCurrentIndex(6); } - else if (theme == "multimc") + else if (theme == "flat_white") { ui->themeComboBox->setCurrentIndex(7); } - else if (theme == "custom") + else if (theme == "multimc") { ui->themeComboBox->setCurrentIndex(8); } + else if (theme == "custom") + { + ui->themeComboBox->setCurrentIndex(9); + } { auto currentTheme = s->get("ApplicationTheme").toString(); diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui index 0d14f147..76a25f2e 100644 --- a/launcher/ui/pages/global/LauncherPage.ui +++ b/launcher/ui/pages/global/LauncherPage.ui @@ -300,6 +300,11 @@ Flat + + + Flat (White) + + Legacy From 46fe7e77b3285a77ee71df5f055b927b777ca112 Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Sat, 22 Oct 2022 16:14:50 +0100 Subject: [PATCH 12/26] DCO Remediation Commit for he3als <65787561+he3als@users.noreply.github.com> I, he3als <65787561+he3als@users.noreply.github.com>, hereby add my Signed-off-by to this commit: d87f743a2bd2fac761b94de77ed7255d7a983f03 I, he3als <65787561+he3als@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 92dfd659f1a3e11accdbf0ebbdc7cb91f74d9a21 I, he3als <65787561+he3als@users.noreply.github.com>, hereby add my Signed-off-by to this commit: a6e65dfc7a7e8080297b59ecf322b788d1c9bad2 I, he3als <65787561+he3als@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 99e1c13e80d12764f57a993661656d9ed7de27bb Signed-off-by: he3als <65787561+he3als@users.noreply.github.com> --- launcher/resources/flat_white/index.theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/resources/flat_white/index.theme b/launcher/resources/flat_white/index.theme index 0292509f..54dd0e10 100644 --- a/launcher/resources/flat_white/index.theme +++ b/launcher/resources/flat_white/index.theme @@ -1,6 +1,6 @@ [Icon Theme] Name=Flat (White) -Comment=White version of the flat icons (for dark mode) +Comment=White version of the flat icons (dark mode) Inherits=multimc Directories=scalable From 4777a4572267a604dc4fa8e1cd1f4bf2fc068929 Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Sun, 23 Oct 2022 14:32:35 +0100 Subject: [PATCH 13/26] Fix new flat white icons Signed-off-by: he3als <65787561+he3als@users.noreply.github.com> --- launcher/resources/flat_white/flat_white.qrc | 6 +++++- launcher/resources/flat_white/scalable/delete.svg | 2 +- launcher/resources/flat_white/scalable/tag.svg | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/launcher/resources/flat_white/flat_white.qrc b/launcher/resources/flat_white/flat_white.qrc index feda4762..4243760b 100644 --- a/launcher/resources/flat_white/flat_white.qrc +++ b/launcher/resources/flat_white/flat_white.qrc @@ -41,6 +41,10 @@ scalable/status-running.svg scalable/status-yellow.svg scalable/viewfolder.svg - scalable/worlds.svg + scalable/worlds.svg + scalable/delete.svg + scalable/export.svg + scalable/rename.svg + scalable/tag.svg
diff --git a/launcher/resources/flat_white/scalable/delete.svg b/launcher/resources/flat_white/scalable/delete.svg index 4cf7206e..3365a96f 100644 --- a/launcher/resources/flat_white/scalable/delete.svg +++ b/launcher/resources/flat_white/scalable/delete.svg @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/launcher/resources/flat_white/scalable/tag.svg b/launcher/resources/flat_white/scalable/tag.svg index 2473126f..f91fb0b4 100644 --- a/launcher/resources/flat_white/scalable/tag.svg +++ b/launcher/resources/flat_white/scalable/tag.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file From 0aac85dda145603434e64bf04f39823f44509605 Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Sun, 23 Oct 2022 14:35:33 +0100 Subject: [PATCH 14/26] Replace tab with spaces in flat_white.qrc Signed-off-by: he3als <65787561+he3als@users.noreply.github.com> --- launcher/resources/flat_white/flat_white.qrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/resources/flat_white/flat_white.qrc b/launcher/resources/flat_white/flat_white.qrc index 4243760b..9df69060 100644 --- a/launcher/resources/flat_white/flat_white.qrc +++ b/launcher/resources/flat_white/flat_white.qrc @@ -42,7 +42,7 @@ scalable/status-yellow.svg scalable/viewfolder.svg scalable/worlds.svg - scalable/delete.svg + scalable/delete.svg scalable/export.svg scalable/rename.svg scalable/tag.svg From d5109f024b7bde5862a60b7359d815dc3d138663 Mon Sep 17 00:00:00 2001 From: Trisave <42098407+Protrikk@users.noreply.github.com> Date: Sun, 23 Oct 2022 20:32:04 +0200 Subject: [PATCH 15/26] Better dark theme selection contrast Tweak background of the selection background in order to make text more readable Signed-off-by: Trisave <42098407+Protrikk@users.noreply.github.com> --- launcher/ui/themes/DarkTheme.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/ui/themes/DarkTheme.cpp b/launcher/ui/themes/DarkTheme.cpp index 07a2efd2..48231b53 100644 --- a/launcher/ui/themes/DarkTheme.cpp +++ b/launcher/ui/themes/DarkTheme.cpp @@ -31,7 +31,7 @@ QPalette DarkTheme::colorScheme() darkPalette.setColor(QPalette::ButtonText, Qt::white); darkPalette.setColor(QPalette::BrightText, Qt::red); darkPalette.setColor(QPalette::Link, QColor(47,163,198)); - darkPalette.setColor(QPalette::Highlight, QColor(145,205,92)); + darkPalette.setColor(QPalette::Highlight, QColor(150,219,89)); darkPalette.setColor(QPalette::HighlightedText, Qt::black); darkPalette.setColor(QPalette::PlaceholderText, Qt::darkGray); return fadeInactive(darkPalette, fadeAmount(), fadeColor()); From 74b98af8e5573da4ca5a311fd13cb3f455bc1b9c Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 24 Oct 2022 11:23:02 +0200 Subject: [PATCH 16/26] fix: use display name in NSIS Signed-off-by: Sefa Eyeoglu --- program_info/win_install.nsi.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/program_info/win_install.nsi.in b/program_info/win_install.nsi.in index 1c1f29da..0cd7ea11 100644 --- a/program_info/win_install.nsi.in +++ b/program_info/win_install.nsi.in @@ -4,7 +4,7 @@ Unicode true -Name "@Launcher_CommonName@" +Name "@Launcher_DisplayName@" InstallDir "$LOCALAPPDATA\Programs\@Launcher_CommonName@" InstallDirRegKey HKCU "Software\@Launcher_CommonName@" "InstallDir" RequestExecutionLevel user @@ -113,7 +113,7 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "@Launcher_VERSION_NAME4@ ;-------------------------------- ; The stuff to install -Section "@Launcher_CommonName@" +Section "@Launcher_DisplayName@" SectionIn RO From b638a6ae950e472c6e6139cfdbaa2950e848efb0 Mon Sep 17 00:00:00 2001 From: flow Date: Mon, 24 Oct 2022 09:07:41 -0300 Subject: [PATCH 17/26] fix: retry mod search job after aborting it This way, we don't get stuck with an aborted job in our way! :o Signed-off-by: flow --- .../modplatform/helpers/NetworkModAPI.cpp | 1 + launcher/ui/pages/modplatform/ModModel.cpp | 25 ++++++++++++------- launcher/ui/pages/modplatform/ModModel.h | 1 + 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/launcher/modplatform/helpers/NetworkModAPI.cpp b/launcher/modplatform/helpers/NetworkModAPI.cpp index 866e7540..7633030e 100644 --- a/launcher/modplatform/helpers/NetworkModAPI.cpp +++ b/launcher/modplatform/helpers/NetworkModAPI.cpp @@ -15,6 +15,7 @@ void NetworkModAPI::searchMods(CallerType* caller, SearchArgs&& args) const QObject::connect(netJob, &NetJob::started, caller, [caller, netJob] { caller->setActiveJob(netJob); }); QObject::connect(netJob, &NetJob::failed, caller, &CallerType::searchRequestFailed); + QObject::connect(netJob, &NetJob::aborted, caller, &CallerType::searchRequestAborted); QObject::connect(netJob, &NetJob::succeeded, caller, [caller, response] { QJsonParseError parse_error{}; QJsonDocument doc = QJsonDocument::fromJson(*response, &parse_error); diff --git a/launcher/ui/pages/modplatform/ModModel.cpp b/launcher/ui/pages/modplatform/ModModel.cpp index 49766fa6..ed58eb32 100644 --- a/launcher/ui/pages/modplatform/ModModel.cpp +++ b/launcher/ui/pages/modplatform/ModModel.cpp @@ -267,18 +267,25 @@ void ListModel::searchRequestFailed(QString reason) .arg(m_parent->displayName()) .arg(tr("API version too old!\nPlease update %1!").arg(BuildConfig.LAUNCHER_DISPLAYNAME))); } + + jobPtr.reset(); + searchState = Finished; +} + +void ListModel::searchRequestAborted() +{ + if (searchState != ResetRequested) + qCritical() << "Search task in ModModel aborted by an unknown reason!"; + + // Retry fetching jobPtr.reset(); - if (searchState == ResetRequested) { - beginResetModel(); - modpacks.clear(); - endResetModel(); + beginResetModel(); + modpacks.clear(); + endResetModel(); - nextSearchOffset = 0; - performPaginatedSearch(); - } else { - searchState = Finished; - } + nextSearchOffset = 0; + performPaginatedSearch(); } void ListModel::infoRequestFinished(QJsonDocument& doc, ModPlatform::IndexedPack& pack, const QModelIndex& index) diff --git a/launcher/ui/pages/modplatform/ModModel.h b/launcher/ui/pages/modplatform/ModModel.h index a58c7c55..d2636d87 100644 --- a/launcher/ui/pages/modplatform/ModModel.h +++ b/launcher/ui/pages/modplatform/ModModel.h @@ -51,6 +51,7 @@ class ListModel : public QAbstractListModel { public slots: void searchRequestFinished(QJsonDocument& doc); void searchRequestFailed(QString reason); + void searchRequestAborted(); void infoRequestFinished(QJsonDocument& doc, ModPlatform::IndexedPack& pack, const QModelIndex& index); From d9463620e601aa62342cafc3fb2fbeae5f56511c Mon Sep 17 00:00:00 2001 From: tobimori Date: Tue, 25 Oct 2022 09:34:07 +0200 Subject: [PATCH 18/26] move .app rename to packaging process, update mac copyright string Signed-off-by: tobimori --- .github/workflows/build.yml | 5 +++-- CMakeLists.txt | 16 ++++++++-------- program_info/CMakeLists.txt | 1 + 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f67ba4c7..ac701c1e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -249,8 +249,9 @@ jobs: cmake --install ${{ env.BUILD_DIR }} cd ${{ env.INSTALL_DIR }} - chmod +x "Prism Launcher.app/Contents/MacOS/prismlauncher" - sudo codesign --sign - --deep --force --entitlements "../program_info/App.entitlements" --options runtime "Prism Launcher.app/Contents/MacOS/prismlauncher" + chmod +x "PrismLauncher.app/Contents/MacOS/prismlauncher" + sudo codesign --sign - --deep --force --entitlements "../program_info/App.entitlements" --options runtime "PrismLauncher.app/Contents/MacOS/prismlauncher" + mv "PrismLauncher.app" "Prism Launcher.app" tar -czf ../PrismLauncher.tar.gz * - name: Make Sparkle signature (macOS) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09f62bb3..611ca1de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -211,15 +211,15 @@ if(NOT (UNIX AND APPLE)) endif() if(UNIX AND APPLE) - set(BINARY_DEST_DIR "${Launcher_DisplayName}.app/Contents/MacOS") - set(LIBRARY_DEST_DIR "${Launcher_DisplayName}.app/Contents/MacOS") - set(PLUGIN_DEST_DIR "${Launcher_DisplayName}.app/Contents/MacOS") - set(FRAMEWORK_DEST_DIR "${Launcher_DisplayName}.app/Contents/Frameworks") - set(RESOURCES_DEST_DIR "${Launcher_DisplayName}.app/Contents/Resources") - set(JARS_DEST_DIR "${Launcher_DisplayName}.app/Contents/MacOS/jars") + set(BINARY_DEST_DIR "${Launcher_Name}.app/Contents/MacOS") + set(LIBRARY_DEST_DIR "${Launcher_Name}.app/Contents/MacOS") + set(PLUGIN_DEST_DIR "${Launcher_Name}.app/Contents/MacOS") + set(FRAMEWORK_DEST_DIR "${Launcher_Name}.app/Contents/Frameworks") + set(RESOURCES_DEST_DIR "${Launcher_Name}.app/Contents/Resources") + set(JARS_DEST_DIR "${Launcher_Name}.app/Contents/MacOS/jars") # Apps to bundle - set(APPS "\${CMAKE_INSTALL_PREFIX}/${Launcher_DisplayName}.app") + set(APPS "\${CMAKE_INSTALL_PREFIX}/${Launcher_Name}.app") # Mac bundle settings set(MACOSX_BUNDLE_BUNDLE_NAME "${Launcher_DisplayName}") @@ -229,7 +229,7 @@ if(UNIX AND APPLE) set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${Launcher_VERSION_NAME}") set(MACOSX_BUNDLE_LONG_VERSION_STRING "${Launcher_VERSION_NAME}") set(MACOSX_BUNDLE_ICON_FILE ${Launcher_Name}.icns) - set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2021-2022 ${Launcher_Copyright}") + set(MACOSX_BUNDLE_COPYRIGHT "© 2021-2022 ${Launcher_Copyright_Mac}") set(MACOSX_SPARKLE_UPDATE_PUBLIC_KEY "v55ZWWD6QlPoXGV6VLzOTZxZUggWeE51X8cRQyQh6vA=") set(MACOSX_SPARKLE_UPDATE_FEED_URL "https://prismlauncher.org/feed/appcast.xml") diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index f6e2ea84..61949e13 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -15,6 +15,7 @@ set(Launcher_Name "${Launcher_CommonName}" PARENT_SCOPE) set(Launcher_DisplayName "${Launcher_DisplayName}" PARENT_SCOPE) set(Launcher_Copyright "Prism Launcher Contributors\\n© 2021-2022 PolyMC Contributors \\n© 2012-2021 MultiMC Contributors") +set(Launcher_Copyright_Mac "Prism Launcher Contributors, © 2021-2022 PolyMC Contributors and © 2012-2021 MultiMC Contributors" PARENT_SCOPE) set(Launcher_Copyright "${Launcher_Copyright}" PARENT_SCOPE) set(Launcher_Domain "prismlauncher.org" PARENT_SCOPE) set(Launcher_UserAgent "${Launcher_CommonName}/${Launcher_VERSION_NAME}" PARENT_SCOPE) From 482d3a1d76e1c66e351b400c40d772be624cd9b9 Mon Sep 17 00:00:00 2001 From: tobimori Date: Tue, 25 Oct 2022 15:24:41 +0200 Subject: [PATCH 19/26] update macos copyright year Signed-off-by: tobimori --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 611ca1de..d2111fe4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,7 +229,7 @@ if(UNIX AND APPLE) set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${Launcher_VERSION_NAME}") set(MACOSX_BUNDLE_LONG_VERSION_STRING "${Launcher_VERSION_NAME}") set(MACOSX_BUNDLE_ICON_FILE ${Launcher_Name}.icns) - set(MACOSX_BUNDLE_COPYRIGHT "© 2021-2022 ${Launcher_Copyright_Mac}") + set(MACOSX_BUNDLE_COPYRIGHT "© 2022 ${Launcher_Copyright_Mac}") set(MACOSX_SPARKLE_UPDATE_PUBLIC_KEY "v55ZWWD6QlPoXGV6VLzOTZxZUggWeE51X8cRQyQh6vA=") set(MACOSX_SPARKLE_UPDATE_FEED_URL "https://prismlauncher.org/feed/appcast.xml") From 610b9711178d164a41f76106968c3fb511570fd8 Mon Sep 17 00:00:00 2001 From: Adrien <66513643+AshtakaOOf@users.noreply.github.com> Date: Wed, 26 Oct 2022 02:09:45 +0200 Subject: [PATCH 20/26] Improve a bit README.md (#305) Add Open Collective and fix some stuff. --- README.md | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index d7df8e26..dc6cdbc7 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ -

+

Prism Launcher logo Prism Launcher logo

+ Prism Launcher is a custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once. This is a **fork** of the MultiMC Launcher and not endorsed by MultiMC. + ## Installation - All downloads and instructions for Prism Launcher can be found [on our website](https://prismlauncher.org/download/). @@ -16,25 +18,24 @@ This is a **fork** of the MultiMC Launcher and not endorsed by MultiMC. There are development builds available [here](https://github.com/PrismLauncher/PrismLauncher/actions). These have debug information in the binaries, so their file sizes are relatively larger. -Portable builds are provided for on Linux, Windows, and macOS. +Portable builds are provided for Linux, Windows, and macOS. + +For Arch, Debian and Gentoo, respectively, you can use these packages to get compiled development versions: + +[![prismlauncher-git](https://img.shields.io/badge/aur-prismlauncher--git-blue?style=flat-square&logo=appveyor)](https://aur.archlinux.org/packages/prismlauncher-qt5-git/) [![prismlauncher-git](https://img.shields.io/badge/aur-prismlauncher--qt5--git-blue?style=flat-square&logo=appveyor)](https://aur.archlinux.org/packages/prismlauncher-git/) [![prismlauncher-git](https://img.shields.io/badge/mpr-prismlauncher--git-orange?style=flat-square&logo=appveyor)](https://mpr.makedeb.org/packages/prismlauncher-git) [![prismlauncher-9999](https://img.shields.io/badge/gentoo-prismlauncher--9999-purple?style=flat-square&logo=appveyor)](https://packages.gentoo.org/packages/games-action/prismlauncher) -For Debian and Arch, you can use these packages for the latest development versions: -[![prismlauncher-git](https://img.shields.io/badge/aur-prismlauncher--git-blue)](https://aur.archlinux.org/packages/prismlauncher-git/) -[![prismlauncher-git](https://img.shields.io/badge/mpr-prismlauncher--git-orange)](https://mpr.makedeb.org/packages/prismlauncher-git) ## Help & Support -Feel free to create an issue if you need help. However, you might find it easier to ask in the Discord server. +Feel free to create an issue if you need help. +#### Join our Discord server: [![Prism Launcher Discord server](https://discordapp.com/api/guilds/1031648380885147709/widget.png?style=banner3)](https://discord.gg/prismlauncher) -We will also soon be opening up our Matrix channels. -You can already join our Matrix space: +#### Join our Matrix space: +[![PrismLauncher Space](https://img.shields.io/matrix/prismlauncher:matrix.org?style=for-the-badge&logo=appveyor)](https://matrix.to/#/#prismlauncher:matrix.org) -[![PrismLauncher Space](https://img.shields.io/matrix/prismlauncher:matrix.org?label=PrismLauncher%20space)](https://matrix.to/#/#prismlauncher:matrix.org) - -We also have a subreddit you can post your issues and suggestions on: - -[r/PrismLauncher](https://www.reddit.com/r/PrismLauncher/) +#### Join our SubReddit: +[![r/PrismLauncher](https://img.shields.io/reddit/subreddit-subscribers/prismlauncher?style=for-the-badge&logo=appveyor)](https://www.reddit.com/r/PrismLauncher/) ## Building @@ -60,13 +61,11 @@ Be aware that if you build this software without removing the provided API keys If you do not agree with these terms and conditions, then remove the associated API keys from the [CMakeLists.txt](CMakeLists.txt) file by setting them to an empty string (`""`). -## License +## Sponsors & Partners -All launcher code is available under the GPL-3.0-only license. - -The logo and related assets are under the CC BY-SA 4.0 license. +We thank all the wonderful backers over at Open Collective! Support Prism Launcher by [becoming a backer](https://opencollective.com/prismlauncher). -## Sponsors +[![OpenCollective Backers](https://opencollective.com/prismlauncher/backers.svg?width=890&limit=1000)](https://opencollective.com/prismlauncher#backers) Thanks to JetBrains for providing us a few licenses for all their products, as part of their [Open Source program](https://www.jetbrains.com/opensource/). @@ -85,3 +84,12 @@ Thanks to Netlify for providing us their excellent web services, as part of thei Thanks to the awesome people over at [MacStadium](https://www.macstadium.com/), for providing M1-Macs for development purposes! Powered by MacStadium + + +## License + +All launcher code is available under the GPL-3.0-only license. + +![https://github.com/PrismLauncher/PrismLauncher/blob/develop/LICENSE](https://img.shields.io/github/license/PrismLauncher/PrismLauncher?style=for-the-badge) + +The logo and related assets are under the CC BY-SA 4.0 license. From 990cfb7b3378aa5c4f0482c1f6ef4bfa8b073e81 Mon Sep 17 00:00:00 2001 From: Adrien <66513643+AshtakaOOf@users.noreply.github.com> Date: Thu, 27 Oct 2022 18:08:56 +0200 Subject: [PATCH 21/26] Remove appveyor I forgor :skull: But seriously I forgor to remove the &logo=appveyor thing AAAAAH!!! Signed-off-by: Adrien <66513643+AshtakaOOf@users.noreply.github.com> --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dc6cdbc7..db0e2c62 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Portable builds are provided for Linux, Windows, and macOS. For Arch, Debian and Gentoo, respectively, you can use these packages to get compiled development versions: -[![prismlauncher-git](https://img.shields.io/badge/aur-prismlauncher--git-blue?style=flat-square&logo=appveyor)](https://aur.archlinux.org/packages/prismlauncher-qt5-git/) [![prismlauncher-git](https://img.shields.io/badge/aur-prismlauncher--qt5--git-blue?style=flat-square&logo=appveyor)](https://aur.archlinux.org/packages/prismlauncher-git/) [![prismlauncher-git](https://img.shields.io/badge/mpr-prismlauncher--git-orange?style=flat-square&logo=appveyor)](https://mpr.makedeb.org/packages/prismlauncher-git) [![prismlauncher-9999](https://img.shields.io/badge/gentoo-prismlauncher--9999-purple?style=flat-square&logo=appveyor)](https://packages.gentoo.org/packages/games-action/prismlauncher) +[![prismlauncher-git](https://img.shields.io/badge/aur-prismlauncher--git-blue?style=flat-square)](https://aur.archlinux.org/packages/prismlauncher-qt5-git/) [![prismlauncher-git](https://img.shields.io/badge/aur-prismlauncher--qt5--git-blue?style=flat-square)](https://aur.archlinux.org/packages/prismlauncher-git/) [![prismlauncher-git](https://img.shields.io/badge/mpr-prismlauncher--git-orange?style=flat-square)](https://mpr.makedeb.org/packages/prismlauncher-git) [![prismlauncher-9999](https://img.shields.io/badge/gentoo-prismlauncher--9999-purple?style=flat-square)](https://packages.gentoo.org/packages/games-action/prismlauncher) ## Help & Support @@ -32,10 +32,10 @@ Feel free to create an issue if you need help. [![Prism Launcher Discord server](https://discordapp.com/api/guilds/1031648380885147709/widget.png?style=banner3)](https://discord.gg/prismlauncher) #### Join our Matrix space: -[![PrismLauncher Space](https://img.shields.io/matrix/prismlauncher:matrix.org?style=for-the-badge&logo=appveyor)](https://matrix.to/#/#prismlauncher:matrix.org) +[![PrismLauncher Space](https://img.shields.io/matrix/prismlauncher:matrix.org?style=for-the-badge)](https://matrix.to/#/#prismlauncher:matrix.org) #### Join our SubReddit: -[![r/PrismLauncher](https://img.shields.io/reddit/subreddit-subscribers/prismlauncher?style=for-the-badge&logo=appveyor)](https://www.reddit.com/r/PrismLauncher/) +[![r/PrismLauncher](https://img.shields.io/reddit/subreddit-subscribers/prismlauncher?style=for-the-badge)](https://www.reddit.com/r/PrismLauncher/) ## Building From b18466da8430ba782e59f50812f3724defa1f2a9 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Thu, 27 Oct 2022 12:29:41 +0100 Subject: [PATCH 22/26] Fix: Don't specify x86 in manifest Signed-off-by: TheLastRar --- program_info/prismlauncher.manifest.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program_info/prismlauncher.manifest.in b/program_info/prismlauncher.manifest.in index 1d764445..6f4467c7 100644 --- a/program_info/prismlauncher.manifest.in +++ b/program_info/prismlauncher.manifest.in @@ -10,7 +10,7 @@ - + Custom Minecraft launcher for managing multiple installs. From d35c985d2ebca44903bedba87c99efb8db0f158d Mon Sep 17 00:00:00 2001 From: DioEgizio <83089242+DioEgizio@users.noreply.github.com> Date: Sun, 23 Oct 2022 12:57:29 +0200 Subject: [PATCH 23/26] feat(actions): use clang32 for building on windows *way* faster Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com> --- .github/workflows/build.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6400791..a7dd31d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,12 +30,12 @@ jobs: - os: windows-2022 name: "Windows-Legacy" - msystem: mingw32 + msystem: clang32 qt_ver: 5 - os: windows-2022 name: "Windows" - msystem: mingw32 + msystem: clang32 qt_ver: 6 - os: macos-12 @@ -89,6 +89,7 @@ jobs: update: true install: >- git + mingw-w64-x86_64-binutils pacboy: >- toolchain:p cmake:p @@ -99,7 +100,6 @@ jobs: qt${{ matrix.qt_ver }}-imageformats:p quazip-qt${{ matrix.qt_ver }}:p ccache:p - nsis:p ${{ matrix.qt_ver == 6 && 'qt6-5compat:p' || '' }} - name: Setup ccache @@ -194,7 +194,7 @@ jobs: if: runner.os == 'Windows' shell: msys2 {0} run: | - cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -G Ninja + cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DCMAKE_C_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CCACHE_VAR }} -DLauncher_QT_VERSION_MAJOR=${{ matrix.qt_ver }} -DCMAKE_OBJDUMP=/mingw64/bin/objdump.exe -G Ninja - name: Configure CMake (Linux) if: runner.os == 'Linux' @@ -280,7 +280,7 @@ jobs: cd ${{ env.INSTALL_DIR }} if [ "${{ matrix.qt_ver }}" == "5" ]; then - cp /mingw32/bin/libcrypto-1_1.dll /mingw32/bin/libssl-1_1.dll ./ + cp /clang32/bin/libcrypto-1_1.dll /clang32/bin/libssl-1_1.dll ./ fi - name: Package (Windows, portable) @@ -292,7 +292,6 @@ jobs: - name: Package (Windows, installer) if: runner.os == 'Windows' - shell: msys2 {0} run: | cd ${{ env.INSTALL_DIR }} makensis -NOCD "${{ github.workspace }}/${{ env.BUILD_DIR }}/program_info/win_install.nsi" From 2ba3de79d8df31d196f0cd249b1606e7233cf840 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Thu, 27 Oct 2022 21:14:30 +0200 Subject: [PATCH 24/26] chore: add comment about copy bug Signed-off-by: Sefa Eyeoglu --- launcher/FileSystem.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp index 39e68c20..76cfccb0 100644 --- a/launcher/FileSystem.cpp +++ b/launcher/FileSystem.cpp @@ -401,6 +401,7 @@ bool overrideFolder(QString overwritten_path, QString override_path) std::error_code err; fs::copy_options opt = copy_opts::recursive | copy_opts::overwrite_existing; + // FIXME: hello traveller! Apparently std::copy does NOT overwrite existing files on GNU libstdc++ on Windows? fs::copy(toStdString(override_path), toStdString(overwritten_path), opt, err); if (err) { From 93894f62ffcb8c33caf36e8801e163738cc2873d Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Fri, 28 Oct 2022 00:05:11 +0200 Subject: [PATCH 25/26] fix: avoid segfault for unexpected API reponse Signed-off-by: Sefa Eyeoglu --- .../modrinth/ModrinthPackIndex.cpp | 55 +++++++++++-------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp index 3e53becb..ae45e096 100644 --- a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp +++ b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp @@ -1,20 +1,20 @@ // SPDX-License-Identifier: GPL-3.0-only /* -* PolyMC - Minecraft Launcher -* Copyright (c) 2022 flowln -* -* 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, version 3. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -*/ + * PolyMC - Minecraft Launcher + * Copyright (c) 2022 flowln + * + * 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, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include "ModrinthPackIndex.h" #include "ModrinthAPI.h" @@ -35,7 +35,7 @@ void Modrinth::loadIndexedPack(ModPlatform::IndexedPack& pack, QJsonObject& obj) pack.provider = ModPlatform::Provider::MODRINTH; pack.name = Json::requireString(obj, "title"); - + pack.slug = Json::ensureString(obj, "slug", ""); if (!pack.slug.isEmpty()) pack.websiteUrl = "https://modrinth.com/mod/" + pack.slug; @@ -59,23 +59,23 @@ void Modrinth::loadIndexedPack(ModPlatform::IndexedPack& pack, QJsonObject& obj) void Modrinth::loadExtraPackData(ModPlatform::IndexedPack& pack, QJsonObject& obj) { pack.extraData.issuesUrl = Json::ensureString(obj, "issues_url"); - if(pack.extraData.issuesUrl.endsWith('/')) + if (pack.extraData.issuesUrl.endsWith('/')) pack.extraData.issuesUrl.chop(1); pack.extraData.sourceUrl = Json::ensureString(obj, "source_url"); - if(pack.extraData.sourceUrl.endsWith('/')) + if (pack.extraData.sourceUrl.endsWith('/')) pack.extraData.sourceUrl.chop(1); pack.extraData.wikiUrl = Json::ensureString(obj, "wiki_url"); - if(pack.extraData.wikiUrl.endsWith('/')) + if (pack.extraData.wikiUrl.endsWith('/')) pack.extraData.wikiUrl.chop(1); pack.extraData.discordUrl = Json::ensureString(obj, "discord_url"); - if(pack.extraData.discordUrl.endsWith('/')) + if (pack.extraData.discordUrl.endsWith('/')) pack.extraData.discordUrl.chop(1); auto donate_arr = Json::ensureArray(obj, "donation_urls"); - for(auto d : donate_arr){ + for (auto d : donate_arr) { auto d_obj = Json::requireObject(d); ModPlatform::DonationData donate; @@ -104,7 +104,7 @@ void Modrinth::loadIndexedPackVersions(ModPlatform::IndexedPack& pack, auto obj = versionIter.toObject(); auto file = loadIndexedPackVersion(obj); - if(file.fileId.isValid()) // Heuristic to check if the returned value is valid + if (file.fileId.isValid()) // Heuristic to check if the returned value is valid unsortedVersions.append(file); } auto orderSortPredicate = [](const ModPlatform::IndexedVersion& a, const ModPlatform::IndexedVersion& b) -> bool { @@ -116,7 +116,8 @@ void Modrinth::loadIndexedPackVersions(ModPlatform::IndexedPack& pack, pack.versionsLoaded = true; } -auto Modrinth::loadIndexedPackVersion(QJsonObject &obj, QString preferred_hash_type, QString preferred_file_name) -> ModPlatform::IndexedVersion +auto Modrinth::loadIndexedPackVersion(QJsonObject& obj, QString preferred_hash_type, QString preferred_file_name) + -> ModPlatform::IndexedVersion { ModPlatform::IndexedVersion file; @@ -141,6 +142,12 @@ auto Modrinth::loadIndexedPackVersion(QJsonObject &obj, QString preferred_hash_t auto files = Json::requireArray(obj, "files"); int i = 0; + if (files.empty()) { + // This should not happen normally, but check just in case + qWarning() << "Modrinth returned an unexpected empty list of files:" << obj; + return {}; + } + // Find correct file (needed in cases where one version may have multiple files) // Will default to the last one if there's no primary (though I think Modrinth requires that // at least one file is primary, idk) @@ -167,7 +174,7 @@ auto Modrinth::loadIndexedPackVersion(QJsonObject &obj, QString preferred_hash_t file.fileName = Json::requireString(parent, "filename"); file.is_preferred = Json::requireBoolean(parent, "primary") || (files.count() == 1); auto hash_list = Json::requireObject(parent, "hashes"); - + if (hash_list.contains(preferred_hash_type)) { file.hash = Json::requireString(hash_list, preferred_hash_type); file.hash_type = preferred_hash_type; From a5be974f1a53a8e56527d639beb4c16f3a7e18c6 Mon Sep 17 00:00:00 2001 From: DioEgizio <83089242+DioEgizio@users.noreply.github.com> Date: Thu, 27 Oct 2022 21:05:32 +0200 Subject: [PATCH 26/26] feat: use clang64 on qt6 builds Signed-off-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca82d3d8..dd2c0599 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,7 @@ jobs: - os: windows-2022 name: "Windows" - msystem: clang32 + msystem: clang64 qt_ver: 6 - os: macos-12