From 9c10965997d873b0de56deef5d5ec5e768db1d8f Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Thu, 1 Jun 2023 16:39:04 -0700 Subject: refactor: split out setting api headers for downloads Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- launcher/ui/pages/instance/ManagedPackPage.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'launcher/ui/pages/instance') diff --git a/launcher/ui/pages/instance/ManagedPackPage.cpp b/launcher/ui/pages/instance/ManagedPackPage.cpp index d0701a7a..68119f06 100644 --- a/launcher/ui/pages/instance/ManagedPackPage.cpp +++ b/launcher/ui/pages/instance/ManagedPackPage.cpp @@ -23,6 +23,8 @@ #include "ui/dialogs/CustomMessageBox.h" #include "ui/dialogs/ProgressDialog.h" +#include "net/ApiDownload.h" + /** This is just to override the combo box popup behavior so that the combo box doesn't take the whole screen. * ... thanks Qt. */ @@ -226,7 +228,7 @@ void ModrinthManagedPackPage::parseManagedPack() QString id = m_inst->getManagedPackID(); - m_fetch_job->addNetAction(Net::Download::makeByteArray(QString("%1/project/%2/version").arg(BuildConfig.MODRINTH_PROD_URL, id), response.get())); + m_fetch_job->addNetAction(Net::ApiDownload::makeByteArray(QString("%1/project/%2/version").arg(BuildConfig.MODRINTH_PROD_URL, id), response.get())); QObject::connect(m_fetch_job.get(), &NetJob::succeeded, this, [this, response, id] { QJsonParseError parse_error{}; @@ -369,7 +371,7 @@ void FlameManagedPackPage::parseManagedPack() QString id = m_inst->getManagedPackID(); - m_fetch_job->addNetAction(Net::Download::makeByteArray(QString("%1/mods/%2/files").arg(BuildConfig.FLAME_BASE_URL, id), response.get())); + m_fetch_job->addNetAction(Net::ApiDownload::makeByteArray(QString("%1/mods/%2/files").arg(BuildConfig.FLAME_BASE_URL, id), response.get())); QObject::connect(m_fetch_job.get(), &NetJob::succeeded, this, [this, response, id] { QJsonParseError parse_error{}; -- cgit From f9578066d6b9d2813e05ad6501935304a787ce52 Mon Sep 17 00:00:00 2001 From: leo78913 Date: Wed, 28 Jun 2023 17:30:11 -0300 Subject: make "browse" buttons and java pages more consistent Signed-off-by: leo78913 --- launcher/ui/pages/global/ExternalToolsPage.ui | 8 +- launcher/ui/pages/global/JavaPage.ui | 150 ++++++++++----------- launcher/ui/pages/global/LauncherPage.ui | 8 +- launcher/ui/pages/instance/InstanceSettingsPage.ui | 62 +++++---- 4 files changed, 114 insertions(+), 114 deletions(-) (limited to 'launcher/ui/pages/instance') diff --git a/launcher/ui/pages/global/ExternalToolsPage.ui b/launcher/ui/pages/global/ExternalToolsPage.ui index 3643094d..47c77842 100644 --- a/launcher/ui/pages/global/ExternalToolsPage.ui +++ b/launcher/ui/pages/global/ExternalToolsPage.ui @@ -47,7 +47,7 @@ - ... + Browse @@ -84,7 +84,7 @@ - ... + Browse @@ -121,7 +121,7 @@ - ... + Browse @@ -166,7 +166,7 @@ - ... + Browse diff --git a/launcher/ui/pages/global/JavaPage.ui b/launcher/ui/pages/global/JavaPage.ui index 6749cbe4..85afd5d6 100644 --- a/launcher/ui/pages/global/JavaPage.ui +++ b/launcher/ui/pages/global/JavaPage.ui @@ -160,37 +160,73 @@ Java Runtime - - + + + + true + - + 0 0 - - &Auto-detect... + + + 16777215 + 100 + - - + + - + 0 0 - - JVM arguments: + + If enabled, the launcher will not check if an instance is compatible with the selected Java version. - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + &Skip Java compatibility checks - - + + + + + + + 0 + 0 + + + + &Auto-detect... + + + + + + + + 0 + 0 + + + + &Test + + + + + + + 0 @@ -198,69 +234,50 @@ - &Java path: - - - javaPathTextBox - - - - - - - - 0 - 0 - + JVM arguments: - - &Test + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - + + + + + + 0 + 0 + + + + &Java path: + + + javaPathTextBox + + + - + 0 0 - - - 28 - 16777215 - - - ... + Browse - - - - - 0 - 0 - - - - If enabled, the launcher will not check if an instance is compatible with the selected Java version. - - - &Skip Java compatibility checks - - - - + If enabled, the launcher will not prompt you to choose a Java version if one isn't found. @@ -270,25 +287,6 @@ - - - - true - - - - 0 - 0 - - - - - 16777215 - 100 - - - - @@ -317,8 +315,6 @@ permGenSpinBox javaBrowseBtn javaPathTextBox - javaDetectBtn - javaTestBtn tabWidget diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui index d9116bfc..7c80c3af 100644 --- a/launcher/ui/pages/global/LauncherPage.ui +++ b/launcher/ui/pages/global/LauncherPage.ui @@ -99,7 +99,7 @@ - ... + Browse @@ -109,7 +109,7 @@ - ... + Browse @@ -126,14 +126,14 @@ - ... + Browse - ... + Browse diff --git a/launcher/ui/pages/instance/InstanceSettingsPage.ui b/launcher/ui/pages/instance/InstanceSettingsPage.ui index 8427965d..277deb2a 100644 --- a/launcher/ui/pages/instance/InstanceSettingsPage.ui +++ b/launcher/ui/pages/instance/InstanceSettingsPage.ui @@ -61,31 +61,7 @@ false - - - - - - - Auto-detect... - - - - - - - Browse... - - - - - - - Test - - - - + If enabled, the launcher will not check if an instance is compatible with the selected Java version. @@ -95,6 +71,38 @@ + + + + + + + + + Browse + + + + + + + + + + + Auto-detect... + + + + + + + Test + + + + + @@ -674,10 +682,6 @@ openGlobalJavaSettingsButton settingsTabs javaSettingsGroupBox - javaPathTextBox - javaDetectBtn - javaBrowseBtn - javaTestBtn memoryGroupBox minMemSpinBox maxMemSpinBox -- cgit