Merge remote-tracking branch 'upstream/develop' into unused-code
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
@@ -28,8 +28,8 @@ class DataPackPage : public ExternalResourcesPage {
|
||||
public:
|
||||
explicit DataPackPage(BaseInstance* instance, std::shared_ptr<DataPackFolderModel> model, QWidget* parent = nullptr);
|
||||
|
||||
QString displayName() const override { return QObject::tr("Data packs"); }
|
||||
QIcon icon() const override { return APPLICATION->getThemedIcon("datapacks"); }
|
||||
QString displayName() const override { return QObject::tr("Data Packs"); }
|
||||
QIcon icon() const override { return QIcon::fromTheme("datapacks"); }
|
||||
QString id() const override { return "datapacks"; }
|
||||
QString helpPage() const override { return "Data-packs"; }
|
||||
bool shouldDisplay() const override { return true; }
|
||||
|
||||
@@ -52,7 +52,7 @@ ExternalResourcesPage::ExternalResourcesPage(BaseInstance* instance, std::shared
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->actionsToolbar->insertSpacer(ui->actionViewConfigs);
|
||||
ui->actionsToolbar->insertSpacer(ui->actionViewFolder);
|
||||
|
||||
m_filterModel = model->createFilterProxyModel(this);
|
||||
m_filterModel->setDynamicSortFilter(true);
|
||||
|
||||
@@ -24,31 +24,7 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="4" column="1" colspan="3">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="filterEdit"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="filterLabel">
|
||||
<property name="text">
|
||||
<string>Filter:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="3">
|
||||
<widget class="InfoFrame" name="frame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="3">
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="ModListView" name="treeView">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
@@ -60,13 +36,30 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::DropOnly</enum>
|
||||
<enum>QAbstractItemView::DragDropMode::DropOnly</enum>
|
||||
</property>
|
||||
<property name="uniformRowHeights">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="InfoFrame" name="frame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="filterEdit">
|
||||
<property name="placeholderText">
|
||||
<string>Search</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="WideBar" name="actionsToolbar">
|
||||
@@ -74,7 +67,7 @@
|
||||
<string>Actions</string>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonIconOnly</enum>
|
||||
<enum>Qt::ToolButtonStyle::ToolButtonIconOnly</enum>
|
||||
</property>
|
||||
<property name="useDefaultAction" stdset="0">
|
||||
<bool>true</bool>
|
||||
@@ -92,7 +85,6 @@
|
||||
<addaction name="actionDisableItem"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionViewHomepage"/>
|
||||
<addaction name="actionViewConfigs"/>
|
||||
<addaction name="actionViewFolder"/>
|
||||
</widget>
|
||||
<action name="actionAddItem">
|
||||
@@ -179,7 +171,7 @@
|
||||
<string>Reset Update Metadata</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::NoRole</enum>
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionVerifyItemDependencies">
|
||||
@@ -187,7 +179,7 @@
|
||||
<string>Verify Dependencies</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::NoRole</enum>
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionExportMetadata">
|
||||
@@ -212,7 +204,7 @@
|
||||
<string>Change a resource's version.</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::NoRole</enum>
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewHomepage">
|
||||
@@ -247,7 +239,6 @@
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>treeView</tabstop>
|
||||
<tabstop>filterEdit</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
69
launcher/ui/pages/instance/GameOptionsPage.h
Normal file
69
launcher/ui/pages/instance/GameOptionsPage.h
Normal file
@@ -0,0 +1,69 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
/*
|
||||
* Prism Launcher - Minecraft Launcher
|
||||
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
||||
*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* This file incorporates work covered by the following copyright and
|
||||
* permission notice:
|
||||
*
|
||||
* Copyright 2013-2021 MultiMC Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
|
||||
#include "ui/pages/BasePage.h"
|
||||
|
||||
namespace Ui {
|
||||
class GameOptionsPage;
|
||||
}
|
||||
|
||||
class GameOptions;
|
||||
class MinecraftInstance;
|
||||
|
||||
class GameOptionsPage : public QWidget, public BasePage {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit GameOptionsPage(MinecraftInstance* inst, QWidget* parent = 0);
|
||||
virtual ~GameOptionsPage();
|
||||
|
||||
void openedImpl() override;
|
||||
void closedImpl() override;
|
||||
|
||||
virtual QString displayName() const override { return tr("Game Options"); }
|
||||
virtual QIcon icon() const override { return QIcon::fromTheme("settings"); }
|
||||
virtual QString id() const override { return "gameoptions"; }
|
||||
virtual QString helpPage() const override { return "Game-Options-management"; }
|
||||
void retranslate() override;
|
||||
|
||||
private: // data
|
||||
Ui::GameOptionsPage* ui = nullptr;
|
||||
std::shared_ptr<GameOptions> m_model;
|
||||
};
|
||||
@@ -36,7 +36,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "Application.h"
|
||||
#include "BaseInstance.h"
|
||||
#include "ui/pages/BasePage.h"
|
||||
#include "ui/widgets/MinecraftSettingsWidget.h"
|
||||
@@ -53,7 +52,7 @@ class InstanceSettingsPage : public MinecraftSettingsWidget, public BasePage {
|
||||
}
|
||||
~InstanceSettingsPage() override {}
|
||||
QString displayName() const override { return tr("Settings"); }
|
||||
QIcon icon() const override { return APPLICATION->getThemedIcon("instance-settings"); }
|
||||
QIcon icon() const override { return QIcon::fromTheme("instance-settings"); }
|
||||
QString id() const override { return "settings"; }
|
||||
bool apply() override
|
||||
{
|
||||
|
||||
@@ -131,7 +131,6 @@ QModelIndex LogFormatProxyModel::find(const QModelIndex& start, const QString& v
|
||||
LogPage::LogPage(InstancePtr instance, QWidget* parent) : QWidget(parent), ui(new Ui::LogPage), m_instance(instance)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->tabWidget->tabBar()->hide();
|
||||
|
||||
m_proxy = new LogFormatProxyModel(this);
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include <QIdentityProxyModel>
|
||||
#include <QWidget>
|
||||
|
||||
#include <Application.h>
|
||||
#include "BaseInstance.h"
|
||||
#include "launch/LaunchTask.h"
|
||||
#include "ui/pages/BasePage.h"
|
||||
@@ -67,7 +66,7 @@ class LogPage : public QWidget, public BasePage {
|
||||
explicit LogPage(InstancePtr instance, QWidget* parent = 0);
|
||||
virtual ~LogPage();
|
||||
virtual QString displayName() const override { return tr("Minecraft Log"); }
|
||||
virtual QIcon icon() const override { return APPLICATION->getThemedIcon("log"); }
|
||||
virtual QIcon icon() const override { return QIcon::fromTheme("log"); }
|
||||
virtual QString id() const override { return "console"; }
|
||||
virtual bool apply() override;
|
||||
virtual QString helpPage() const override { return "Minecraft-Logs"; }
|
||||
|
||||
@@ -10,161 +10,153 @@
|
||||
<height>782</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<item row="1" column="0" colspan="5">
|
||||
<widget class="LogView" name="text">
|
||||
<property name="undoRedoEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="plainText">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
<property name="centerOnScroll">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="5">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="trackLogCheckbox">
|
||||
<property name="text">
|
||||
<string>Keep updating</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="wrapCheckbox">
|
||||
<property name="text">
|
||||
<string>Wrap lines</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="colorCheckbox">
|
||||
<property name="text">
|
||||
<string>Color lines</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnCopy">
|
||||
<property name="toolTip">
|
||||
<string>Copy the whole log into the clipboard</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Copy</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnPaste">
|
||||
<property name="toolTip">
|
||||
<string>Upload the log to the paste service configured in preferences</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Upload</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnClear">
|
||||
<property name="toolTip">
|
||||
<string>Clear the log</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="findButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Find</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QPushButton" name="btnBottom">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Scroll all the way to bottom</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Bottom</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLineEdit" name="searchBar">
|
||||
<property name="placeholderText">
|
||||
<string>Search</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string notr="true">Tab 1</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0" colspan="5">
|
||||
<widget class="LogView" name="text">
|
||||
<property name="undoRedoEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="plainText">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
<property name="centerOnScroll">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="5">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="trackLogCheckbox">
|
||||
<property name="text">
|
||||
<string>Keep updating</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="wrapCheckbox">
|
||||
<property name="text">
|
||||
<string>Wrap lines</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="colorCheckbox">
|
||||
<property name="text">
|
||||
<string>Color lines</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnCopy">
|
||||
<property name="toolTip">
|
||||
<string>Copy the whole log into the clipboard</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Copy</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnPaste">
|
||||
<property name="toolTip">
|
||||
<string>Upload the log to the paste service configured in preferences</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Upload</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnClear">
|
||||
<property name="toolTip">
|
||||
<string>Clear the log</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Search:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="findButton">
|
||||
<property name="text">
|
||||
<string>Find</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="searchBar"/>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QPushButton" name="btnBottom">
|
||||
<property name="toolTip">
|
||||
<string>Scroll all the way to bottom</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Bottom</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -177,7 +169,6 @@
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>trackLogCheckbox</tabstop>
|
||||
<tabstop>wrapCheckbox</tabstop>
|
||||
<tabstop>colorCheckbox</tabstop>
|
||||
@@ -185,7 +176,6 @@
|
||||
<tabstop>btnPaste</tabstop>
|
||||
<tabstop>btnClear</tabstop>
|
||||
<tabstop>text</tabstop>
|
||||
<tabstop>searchBar</tabstop>
|
||||
<tabstop>findButton</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
#include "Markdown.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
#include "modplatform/modrinth/ModrinthPackManifest.h"
|
||||
|
||||
#include "ui/InstanceWindow.h"
|
||||
#include "ui/dialogs/CustomMessageBox.h"
|
||||
#include "ui/dialogs/ProgressDialog.h"
|
||||
@@ -168,7 +166,7 @@ QString ManagedPackPage::displayName() const
|
||||
|
||||
QIcon ManagedPackPage::icon() const
|
||||
{
|
||||
return APPLICATION->getThemedIcon(m_inst->getManagedPackType());
|
||||
return QIcon::fromTheme(m_inst->getManagedPackType());
|
||||
}
|
||||
|
||||
QString ManagedPackPage::helpPage() const
|
||||
@@ -213,7 +211,7 @@ bool ManagedPackPage::runUpdateTask(InstanceTask* task)
|
||||
|
||||
void ManagedPackPage::suggestVersion()
|
||||
{
|
||||
ui->updateButton->setText(tr("Update pack"));
|
||||
ui->updateButton->setText(tr("Update Pack"));
|
||||
ui->updateButton->setDisabled(false);
|
||||
}
|
||||
|
||||
@@ -256,36 +254,13 @@ void ModrinthManagedPackPage::parseManagedPack()
|
||||
if (m_fetch_job && m_fetch_job->isRunning())
|
||||
m_fetch_job->abort();
|
||||
|
||||
m_fetch_job.reset(new NetJob(QString("Modrinth::PackVersions(%1)").arg(m_inst->getManagedPackName()), APPLICATION->network()));
|
||||
auto response = std::make_shared<QByteArray>();
|
||||
ResourceAPI::Callback<QVector<ModPlatform::IndexedVersion>> callbacks{};
|
||||
m_pack = { m_inst->getManagedPackID() };
|
||||
|
||||
QString id = m_inst->getManagedPackID();
|
||||
|
||||
m_fetch_job->addNetAction(
|
||||
Net::ApiDownload::makeByteArray(QString("%1/project/%2/version").arg(BuildConfig.MODRINTH_PROD_URL, id), response));
|
||||
|
||||
connect(m_fetch_job.get(), &NetJob::succeeded, this, [this, response, id] {
|
||||
QJsonParseError parse_error{};
|
||||
QJsonDocument doc = QJsonDocument::fromJson(*response, &parse_error);
|
||||
if (parse_error.error != QJsonParseError::NoError) {
|
||||
qWarning() << "Error while parsing JSON response from Modrinth at " << parse_error.offset
|
||||
<< " reason: " << parse_error.errorString();
|
||||
qWarning() << *response;
|
||||
|
||||
setFailState();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Modrinth::loadIndexedVersions(m_pack, doc);
|
||||
} catch (const JSONValidationError& e) {
|
||||
qDebug() << *response;
|
||||
qWarning() << "Error while reading modrinth modpack version: " << e.cause();
|
||||
|
||||
setFailState();
|
||||
return;
|
||||
}
|
||||
// Use default if no callbacks are set
|
||||
callbacks.on_succeed = [this](auto& doc) {
|
||||
m_pack.versions = doc;
|
||||
m_pack.versionsLoaded = true;
|
||||
|
||||
// We block signals here so that suggestVersion() doesn't get called, causing an assertion fail.
|
||||
ui->versionsComboBox->blockSignals(true);
|
||||
@@ -293,22 +268,23 @@ void ModrinthManagedPackPage::parseManagedPack()
|
||||
ui->versionsComboBox->blockSignals(false);
|
||||
|
||||
for (const auto& version : m_pack.versions) {
|
||||
QString name = Modrinth::getVersionDisplayString(version);
|
||||
QString name = version.getVersionDisplayString();
|
||||
|
||||
// NOTE: the id from version isn't the same id in the modpack format spec...
|
||||
// e.g. HexMC's 4.4.0 has versionId 4.0.0 in the modpack index..............
|
||||
if (version.version == m_inst->getManagedPackVersionName())
|
||||
name = tr("%1 (Current)").arg(name);
|
||||
|
||||
ui->versionsComboBox->addItem(name, QVariant(version.id));
|
||||
ui->versionsComboBox->addItem(name, version.fileId);
|
||||
}
|
||||
|
||||
suggestVersion();
|
||||
|
||||
m_loaded = true;
|
||||
});
|
||||
connect(m_fetch_job.get(), &NetJob::failed, this, &ModrinthManagedPackPage::setFailState);
|
||||
connect(m_fetch_job.get(), &NetJob::aborted, this, &ModrinthManagedPackPage::setFailState);
|
||||
};
|
||||
callbacks.on_fail = [this](QString reason, int) { setFailState(); };
|
||||
callbacks.on_abort = [this]() { setFailState(); };
|
||||
m_fetch_job = m_api.getProjectVersions({ m_pack, {}, {}, ModPlatform::ResourceType::Modpack }, std::move(callbacks));
|
||||
|
||||
ui->changelogTextBrowser->setText(tr("Fetching changelogs..."));
|
||||
|
||||
@@ -370,10 +346,10 @@ void ModrinthManagedPackPage::update()
|
||||
QMap<QString, QString> extra_info;
|
||||
// NOTE: Don't use 'm_pack.id' here, since we didn't completely parse all the metadata for the pack, including this field.
|
||||
extra_info.insert("pack_id", m_inst->getManagedPackID());
|
||||
extra_info.insert("pack_version_id", version.id);
|
||||
extra_info.insert("pack_version_id", version.fileId.toString());
|
||||
extra_info.insert("original_instance_id", m_inst->id());
|
||||
|
||||
auto extracted = new InstanceImportTask(version.download_url, this, std::move(extra_info));
|
||||
auto extracted = new InstanceImportTask(version.downloadUrl, this, std::move(extra_info));
|
||||
|
||||
InstanceName inst_name(m_inst->getManagedPackName(), version.version);
|
||||
inst_name.setName(m_inst->name().replace(m_inst->getManagedPackVersionName(), version.version));
|
||||
@@ -449,37 +425,15 @@ void FlameManagedPackPage::parseManagedPack()
|
||||
if (m_fetch_job && m_fetch_job->isRunning())
|
||||
m_fetch_job->abort();
|
||||
|
||||
m_fetch_job.reset(new NetJob(QString("Flame::PackVersions(%1)").arg(m_inst->getManagedPackName()), APPLICATION->network()));
|
||||
auto response = std::make_shared<QByteArray>();
|
||||
|
||||
QString id = m_inst->getManagedPackID();
|
||||
m_pack = { id };
|
||||
|
||||
m_fetch_job->addNetAction(Net::ApiDownload::makeByteArray(QString("%1/mods/%2/files").arg(BuildConfig.FLAME_BASE_URL, id), response));
|
||||
ResourceAPI::Callback<QVector<ModPlatform::IndexedVersion>> callbacks{};
|
||||
|
||||
connect(m_fetch_job.get(), &NetJob::succeeded, this, [this, response, id] {
|
||||
QJsonParseError parse_error{};
|
||||
QJsonDocument doc = QJsonDocument::fromJson(*response, &parse_error);
|
||||
if (parse_error.error != QJsonParseError::NoError) {
|
||||
qWarning() << "Error while parsing JSON response from Flame at " << parse_error.offset
|
||||
<< " reason: " << parse_error.errorString();
|
||||
qWarning() << *response;
|
||||
|
||||
setFailState();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
auto obj = doc.object();
|
||||
auto data = Json::ensureArray(obj, "data");
|
||||
Flame::loadIndexedPackVersions(m_pack, data);
|
||||
} catch (const JSONValidationError& e) {
|
||||
qDebug() << *response;
|
||||
qWarning() << "Error while reading flame modpack version: " << e.cause();
|
||||
|
||||
setFailState();
|
||||
return;
|
||||
}
|
||||
// Use default if no callbacks are set
|
||||
callbacks.on_succeed = [this](auto& doc) {
|
||||
m_pack.versions = doc;
|
||||
m_pack.versionsLoaded = true;
|
||||
|
||||
// We block signals here so that suggestVersion() doesn't get called, causing an assertion fail.
|
||||
ui->versionsComboBox->blockSignals(true);
|
||||
@@ -487,7 +441,7 @@ void FlameManagedPackPage::parseManagedPack()
|
||||
ui->versionsComboBox->blockSignals(false);
|
||||
|
||||
for (const auto& version : m_pack.versions) {
|
||||
QString name = Flame::getVersionDisplayString(version);
|
||||
QString name = version.getVersionDisplayString();
|
||||
|
||||
if (version.fileId == m_inst->getManagedPackVersionID().toInt())
|
||||
name = tr("%1 (Current)").arg(name);
|
||||
@@ -498,9 +452,10 @@ void FlameManagedPackPage::parseManagedPack()
|
||||
suggestVersion();
|
||||
|
||||
m_loaded = true;
|
||||
});
|
||||
connect(m_fetch_job.get(), &NetJob::failed, this, &FlameManagedPackPage::setFailState);
|
||||
connect(m_fetch_job.get(), &NetJob::aborted, this, &FlameManagedPackPage::setFailState);
|
||||
};
|
||||
callbacks.on_fail = [this](QString reason, int) { setFailState(); };
|
||||
callbacks.on_abort = [this]() { setFailState(); };
|
||||
m_fetch_job = m_api.getProjectVersions({ m_pack, {}, {}, ModPlatform::ResourceType::Modpack }, std::move(callbacks));
|
||||
|
||||
m_fetch_job->start();
|
||||
}
|
||||
@@ -521,7 +476,7 @@ void FlameManagedPackPage::suggestVersion()
|
||||
auto version = m_pack.versions.at(index);
|
||||
|
||||
ui->changelogTextBrowser->setHtml(
|
||||
StringUtils::htmlListPatch(m_api.getModFileChangelog(m_inst->getManagedPackID().toInt(), version.fileId)));
|
||||
StringUtils::htmlListPatch(m_api.getModFileChangelog(m_inst->getManagedPackID().toInt(), version.fileId.toInt())));
|
||||
|
||||
ManagedPackPage::suggestVersion();
|
||||
}
|
||||
@@ -537,7 +492,7 @@ void FlameManagedPackPage::update()
|
||||
|
||||
QMap<QString, QString> extra_info;
|
||||
extra_info.insert("pack_id", m_inst->getManagedPackID());
|
||||
extra_info.insert("pack_version_id", QString::number(version.fileId));
|
||||
extra_info.insert("pack_version_id", version.fileId.toString());
|
||||
extra_info.insert("original_instance_id", m_inst->id());
|
||||
|
||||
auto extracted = new InstanceImportTask(version.downloadUrl, this, std::move(extra_info));
|
||||
|
||||
@@ -6,11 +6,10 @@
|
||||
|
||||
#include "BaseInstance.h"
|
||||
|
||||
#include "modplatform/ModIndex.h"
|
||||
#include "modplatform/modrinth/ModrinthAPI.h"
|
||||
#include "modplatform/modrinth/ModrinthPackManifest.h"
|
||||
|
||||
#include "modplatform/flame/FlameAPI.h"
|
||||
#include "modplatform/flame/FlamePackIndex.h"
|
||||
|
||||
#include "net/NetJob.h"
|
||||
|
||||
@@ -37,11 +36,11 @@ class ManagedPackPage : public QWidget, public BasePage {
|
||||
static ManagedPackPage* createPage(BaseInstance* inst, QString type, QWidget* parent = nullptr);
|
||||
~ManagedPackPage() override;
|
||||
|
||||
[[nodiscard]] QString displayName() const override;
|
||||
[[nodiscard]] QIcon icon() const override;
|
||||
[[nodiscard]] QString helpPage() const override;
|
||||
[[nodiscard]] QString id() const override { return "managed_pack"; }
|
||||
[[nodiscard]] bool shouldDisplay() const override;
|
||||
QString displayName() const override;
|
||||
QIcon icon() const override;
|
||||
QString helpPage() const override;
|
||||
QString id() const override { return "managed_pack"; }
|
||||
bool shouldDisplay() const override;
|
||||
|
||||
void openedImpl() override;
|
||||
|
||||
@@ -55,7 +54,7 @@ class ManagedPackPage : public QWidget, public BasePage {
|
||||
/** URL of the managed pack.
|
||||
* Not the version-specific one.
|
||||
*/
|
||||
[[nodiscard]] virtual QString url() const { return {}; };
|
||||
virtual QString url() const { return {}; };
|
||||
|
||||
void setInstanceWindow(InstanceWindow* window) { m_instance_window = window; }
|
||||
|
||||
@@ -109,7 +108,7 @@ class GenericManagedPackPage final : public ManagedPackPage {
|
||||
~GenericManagedPackPage() override = default;
|
||||
|
||||
// TODO: We may want to show this page with some useful info at some point.
|
||||
[[nodiscard]] bool shouldDisplay() const override { return false; };
|
||||
bool shouldDisplay() const override { return false; };
|
||||
};
|
||||
|
||||
class ModrinthManagedPackPage final : public ManagedPackPage {
|
||||
@@ -120,8 +119,8 @@ class ModrinthManagedPackPage final : public ManagedPackPage {
|
||||
~ModrinthManagedPackPage() override = default;
|
||||
|
||||
void parseManagedPack() override;
|
||||
[[nodiscard]] QString url() const override;
|
||||
[[nodiscard]] QString helpPage() const override { return "modrinth-managed-pack"; }
|
||||
QString url() const override;
|
||||
QString helpPage() const override { return "modrinth-managed-pack"; }
|
||||
|
||||
public slots:
|
||||
void suggestVersion() override;
|
||||
@@ -130,9 +129,9 @@ class ModrinthManagedPackPage final : public ManagedPackPage {
|
||||
void updateFromFile() override;
|
||||
|
||||
private:
|
||||
NetJob::Ptr m_fetch_job = nullptr;
|
||||
Task::Ptr m_fetch_job = nullptr;
|
||||
|
||||
Modrinth::Modpack m_pack;
|
||||
ModPlatform::IndexedPack m_pack;
|
||||
ModrinthAPI m_api;
|
||||
};
|
||||
|
||||
@@ -144,8 +143,8 @@ class FlameManagedPackPage final : public ManagedPackPage {
|
||||
~FlameManagedPackPage() override = default;
|
||||
|
||||
void parseManagedPack() override;
|
||||
[[nodiscard]] QString url() const override;
|
||||
[[nodiscard]] QString helpPage() const override { return "curseforge-managed-pack"; }
|
||||
QString url() const override;
|
||||
QString helpPage() const override { return "curseforge-managed-pack"; }
|
||||
|
||||
public slots:
|
||||
void suggestVersion() override;
|
||||
@@ -154,8 +153,8 @@ class FlameManagedPackPage final : public ManagedPackPage {
|
||||
void updateFromFile() override;
|
||||
|
||||
private:
|
||||
NetJob::Ptr m_fetch_job = nullptr;
|
||||
Task::Ptr m_fetch_job = nullptr;
|
||||
|
||||
Flame::IndexedPack m_pack;
|
||||
ModPlatform::IndexedPack m_pack;
|
||||
FlameAPI m_api;
|
||||
};
|
||||
|
||||
@@ -12,16 +12,16 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>9</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
@@ -34,7 +34,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Pack information</string>
|
||||
<string>Pack Information</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<item row="0" column="0">
|
||||
@@ -42,7 +42,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="packNameLabel">
|
||||
<property name="text">
|
||||
<string>Pack name:</string>
|
||||
<string>Pack Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -162,7 +162,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Update from file</string>
|
||||
<string>Update From File</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -106,6 +106,8 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr<ModFolderModel>
|
||||
ui->actionExportMetadata->setToolTip(tr("Export mod's metadata to text."));
|
||||
connect(ui->actionExportMetadata, &QAction::triggered, this, &ModFolderPage::exportModMetadata);
|
||||
ui->actionsToolbar->insertActionAfter(ui->actionViewHomepage, ui->actionExportMetadata);
|
||||
|
||||
ui->actionsToolbar->insertActionAfter(ui->actionViewFolder, ui->actionViewConfigs);
|
||||
}
|
||||
|
||||
bool ModFolderPage::shouldDisplay() const
|
||||
|
||||
@@ -52,7 +52,7 @@ class ModFolderPage : public ExternalResourcesPage {
|
||||
void setFilter(const QString& filter) { m_fileSelectionFilter = filter; }
|
||||
|
||||
virtual QString displayName() const override { return tr("Mods"); }
|
||||
virtual QIcon icon() const override { return APPLICATION->getThemedIcon("loadermods"); }
|
||||
virtual QIcon icon() const override { return QIcon::fromTheme("loadermods"); }
|
||||
virtual QString id() const override { return "mods"; }
|
||||
virtual QString helpPage() const override { return "Loader-mods"; }
|
||||
|
||||
@@ -82,8 +82,8 @@ class CoreModFolderPage : public ModFolderPage {
|
||||
explicit CoreModFolderPage(BaseInstance* inst, std::shared_ptr<ModFolderModel> mods, QWidget* parent = 0);
|
||||
virtual ~CoreModFolderPage() = default;
|
||||
|
||||
virtual QString displayName() const override { return tr("Core mods"); }
|
||||
virtual QIcon icon() const override { return APPLICATION->getThemedIcon("coremods"); }
|
||||
virtual QString displayName() const override { return tr("Core Mods"); }
|
||||
virtual QIcon icon() const override { return QIcon::fromTheme("coremods"); }
|
||||
virtual QString id() const override { return "coremods"; }
|
||||
virtual QString helpPage() const override { return "Core-mods"; }
|
||||
|
||||
@@ -97,7 +97,7 @@ class NilModFolderPage : public ModFolderPage {
|
||||
virtual ~NilModFolderPage() = default;
|
||||
|
||||
virtual QString displayName() const override { return tr("Nilmods"); }
|
||||
virtual QIcon icon() const override { return APPLICATION->getThemedIcon("coremods"); }
|
||||
virtual QIcon icon() const override { return QIcon::fromTheme("coremods"); }
|
||||
virtual QString id() const override { return "nilmods"; }
|
||||
virtual QString helpPage() const override { return "Nilmods"; }
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include <Application.h>
|
||||
#include "BaseInstance.h"
|
||||
#include "ui/pages/BasePage.h"
|
||||
|
||||
@@ -54,9 +53,9 @@ class NotesPage : public QWidget, public BasePage {
|
||||
virtual QString displayName() const override { return tr("Notes"); }
|
||||
virtual QIcon icon() const override
|
||||
{
|
||||
auto icon = APPLICATION->getThemedIcon("notes");
|
||||
auto icon = QIcon::fromTheme("notes");
|
||||
if (icon.isNull())
|
||||
icon = APPLICATION->getThemedIcon("news");
|
||||
icon = QIcon::fromTheme("news");
|
||||
return icon;
|
||||
}
|
||||
virtual QString id() const override { return "notes"; }
|
||||
|
||||
@@ -61,7 +61,6 @@ OtherLogsPage::OtherLogsPage(QString id, QString displayName, QString helpPage,
|
||||
, m_logSearchPaths(instance ? instance->getLogFileSearchPaths() : QStringList{ "logs" })
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->tabWidget->tabBar()->hide();
|
||||
|
||||
m_proxy = new LogFormatProxyModel(this);
|
||||
if (m_instance) {
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include <QWidget>
|
||||
|
||||
#include <Application.h>
|
||||
#include <pathmatcher/IPathMatcher.h>
|
||||
#include <QFileSystemWatcher>
|
||||
#include "LogPage.h"
|
||||
#include "ui/pages/BasePage.h"
|
||||
@@ -58,7 +57,7 @@ class OtherLogsPage : public QWidget, public BasePage {
|
||||
|
||||
QString id() const override { return m_id; }
|
||||
QString displayName() const override { return m_displayName; }
|
||||
QIcon icon() const override { return APPLICATION->getThemedIcon("log"); }
|
||||
QIcon icon() const override { return QIcon::fromTheme("log"); }
|
||||
QString helpPage() const override { return m_helpPage; }
|
||||
void retranslate() override;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<height>538</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -18,194 +18,189 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="findButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string notr="true">Tab 1</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Search:</string>
|
||||
<property name="text">
|
||||
<string>&Find</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QPushButton" name="btnBottom">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Scroll all the way to bottom</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Bottom</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="5">
|
||||
<widget class="LogView" name="text">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="undoRedoEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="plainText">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
<property name="centerOnScroll">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="5">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="5">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QComboBox" name="selectLogBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="searchBar"/>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="findButton">
|
||||
<property name="text">
|
||||
<string>&Find</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QPushButton" name="btnBottom">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnDelete">
|
||||
<property name="toolTip">
|
||||
<string>Scroll all the way to bottom</string>
|
||||
<string>Delete the selected log</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Bottom</string>
|
||||
<string>&Delete Selected</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="5">
|
||||
<widget class="LogView" name="text">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnClean">
|
||||
<property name="toolTip">
|
||||
<string>Delete all the logs</string>
|
||||
</property>
|
||||
<property name="undoRedoEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="plainText">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
<property name="centerOnScroll">
|
||||
<bool>false</bool>
|
||||
<property name="text">
|
||||
<string>Delete &All</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="5">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="5">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QComboBox" name="selectLogBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnDelete">
|
||||
<property name="toolTip">
|
||||
<string>Delete the selected log</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Delete Selected</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnClean">
|
||||
<property name="toolTip">
|
||||
<string>Delete all the logs</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete &All</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="5">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout1">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="trackLogCheckbox">
|
||||
<property name="text">
|
||||
<string>Keep updating</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="wrapCheckbox">
|
||||
<property name="text">
|
||||
<string>Wrap lines</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="colorCheckbox">
|
||||
<property name="text">
|
||||
<string>Color lines</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnCopy">
|
||||
<property name="toolTip">
|
||||
<string>Copy the whole log into the clipboard</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Copy</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnPaste">
|
||||
<property name="toolTip">
|
||||
<string>Upload the log to the paste service configured in preferences</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Upload</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnReload">
|
||||
<property name="toolTip">
|
||||
<string>Reload the contents of the log from the disk</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Reload</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="5">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout1">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="trackLogCheckbox">
|
||||
<property name="text">
|
||||
<string>Keep updating</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="wrapCheckbox">
|
||||
<property name="text">
|
||||
<string>Wrap lines</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="colorCheckbox">
|
||||
<property name="text">
|
||||
<string>Color lines</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnCopy">
|
||||
<property name="toolTip">
|
||||
<string>Copy the whole log into the clipboard</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Copy</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnPaste">
|
||||
<property name="toolTip">
|
||||
<string>Upload the log to the paste service configured in preferences</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Upload</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnReload">
|
||||
<property name="toolTip">
|
||||
<string>Reload the contents of the log from the disk</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Reload</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLineEdit" name="searchBar">
|
||||
<property name="placeholderText">
|
||||
<string>Search</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -218,7 +213,6 @@
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>selectLogBox</tabstop>
|
||||
<tabstop>btnReload</tabstop>
|
||||
<tabstop>btnCopy</tabstop>
|
||||
|
||||
@@ -50,8 +50,8 @@ class ResourcePackPage : public ExternalResourcesPage {
|
||||
public:
|
||||
explicit ResourcePackPage(MinecraftInstance* instance, std::shared_ptr<ResourcePackFolderModel> model, QWidget* parent = 0);
|
||||
|
||||
QString displayName() const override { return tr("Resource packs"); }
|
||||
QIcon icon() const override { return APPLICATION->getThemedIcon("resourcepacks"); }
|
||||
QString displayName() const override { return tr("Resource Packs"); }
|
||||
QIcon icon() const override { return QIcon::fromTheme("resourcepacks"); }
|
||||
QString id() const override { return "resourcepacks"; }
|
||||
QString helpPage() const override { return "Resource-packs"; }
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ class FilterModel : public QIdentityProxyModel {
|
||||
{
|
||||
m_thumbnailingPool.setMaxThreadCount(4);
|
||||
m_thumbnailCache = std::make_shared<SharedIconCache>();
|
||||
m_thumbnailCache->add("placeholder", APPLICATION->getThemedIcon("screenshot-placeholder"));
|
||||
m_thumbnailCache->add("placeholder", QIcon::fromTheme("screenshot-placeholder"));
|
||||
connect(&watcher, &QFileSystemWatcher::fileChanged, this, &FilterModel::fileChanged);
|
||||
}
|
||||
virtual ~FilterModel()
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
#include <Application.h>
|
||||
#include "ui/pages/BasePage.h"
|
||||
|
||||
#include "settings/Setting.h"
|
||||
@@ -67,7 +66,7 @@ class ScreenshotsPage : public QMainWindow, public BasePage {
|
||||
|
||||
virtual bool eventFilter(QObject*, QEvent*) override;
|
||||
virtual QString displayName() const override { return tr("Screenshots"); }
|
||||
virtual QIcon icon() const override { return APPLICATION->getThemedIcon("screenshots"); }
|
||||
virtual QIcon icon() const override { return QIcon::fromTheme("screenshots"); }
|
||||
virtual QString id() const override { return "screenshots"; }
|
||||
virtual QString helpPage() const override { return "Screenshots-management"; }
|
||||
virtual bool apply() override { return !m_uploadActive; }
|
||||
|
||||
@@ -26,11 +26,17 @@
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QListView" name="listView">
|
||||
<property name="showDropIndicator" stdset="0">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
<enum>QAbstractItemView::SelectionMode::ExtendedSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
<enum>QAbstractItemView::SelectionBehavior::SelectRows</enum>
|
||||
</property>
|
||||
<property name="movement">
|
||||
<enum>QListView::Movement::Static</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -41,7 +47,7 @@
|
||||
<string>Actions</string>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextOnly</enum>
|
||||
<enum>Qt::ToolButtonStyle::ToolButtonTextOnly</enum>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>RightToolBarArea</enum>
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
*/
|
||||
|
||||
#include "ServersPage.h"
|
||||
#include "Application.h"
|
||||
#include "ServerPingTask.h"
|
||||
#include "ui/dialogs/CustomMessageBox.h"
|
||||
#include "ui_ServersPage.h"
|
||||
@@ -319,7 +320,7 @@ class ServersModel : public QAbstractListModel {
|
||||
if (px.loadFromData(bytes))
|
||||
return QIcon(px);
|
||||
}
|
||||
return APPLICATION->getThemedIcon("unknown_server");
|
||||
return QIcon::fromTheme("unknown_server");
|
||||
}
|
||||
case 1:
|
||||
return m_servers[row].m_address;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <QMainWindow>
|
||||
#include <QString>
|
||||
|
||||
#include <Application.h>
|
||||
#include "BaseInstance.h"
|
||||
#include "ui/pages/BasePage.h"
|
||||
|
||||
#include "settings/Setting.h"
|
||||
@@ -63,7 +63,7 @@ class ServersPage : public QMainWindow, public BasePage {
|
||||
void closedImpl() override;
|
||||
|
||||
virtual QString displayName() const override { return tr("Servers"); }
|
||||
virtual QIcon icon() const override { return APPLICATION->getThemedIcon("server"); }
|
||||
virtual QIcon icon() const override { return QIcon::fromTheme("server"); }
|
||||
virtual QString id() const override { return "servers"; }
|
||||
virtual QString helpPage() const override { return "Servers-management"; }
|
||||
void retranslate() override;
|
||||
|
||||
@@ -47,8 +47,8 @@ class ShaderPackPage : public ExternalResourcesPage {
|
||||
explicit ShaderPackPage(MinecraftInstance* instance, std::shared_ptr<ShaderPackFolderModel> model, QWidget* parent = nullptr);
|
||||
~ShaderPackPage() override = default;
|
||||
|
||||
QString displayName() const override { return tr("Shader packs"); }
|
||||
QIcon icon() const override { return APPLICATION->getThemedIcon("shaderpacks"); }
|
||||
QString displayName() const override { return tr("Shader Packs"); }
|
||||
QIcon icon() const override { return QIcon::fromTheme("shaderpacks"); }
|
||||
QString id() const override { return "shaderpacks"; }
|
||||
QString helpPage() const override { return "shader-packs"; }
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ class TexturePackPage : public ExternalResourcesPage {
|
||||
explicit TexturePackPage(MinecraftInstance* instance, std::shared_ptr<TexturePackFolderModel> model, QWidget* parent = nullptr);
|
||||
|
||||
QString displayName() const override { return tr("Texture packs"); }
|
||||
QIcon icon() const override { return APPLICATION->getThemedIcon("resourcepacks"); }
|
||||
QIcon icon() const override { return QIcon::fromTheme("resourcepacks"); }
|
||||
QString id() const override { return "texturepacks"; }
|
||||
QString helpPage() const override { return "Texture-packs"; }
|
||||
|
||||
|
||||
@@ -91,12 +91,12 @@ class IconProxy : public QIdentityProxyModel {
|
||||
if (!var.isNull()) {
|
||||
auto string = var.toString();
|
||||
if (string == "warning") {
|
||||
return APPLICATION->getThemedIcon("status-yellow");
|
||||
return QIcon::fromTheme("status-yellow");
|
||||
} else if (string == "error") {
|
||||
return APPLICATION->getThemedIcon("status-bad");
|
||||
return QIcon::fromTheme("status-bad");
|
||||
}
|
||||
}
|
||||
return APPLICATION->getThemedIcon("status-good");
|
||||
return QIcon::fromTheme("status-good");
|
||||
}
|
||||
return var;
|
||||
}
|
||||
|
||||
@@ -43,18 +43,11 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="filterEdit"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="filterLabel">
|
||||
<property name="text">
|
||||
<string>Filter:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QLineEdit" name="filterEdit">
|
||||
<property name="placeholderText">
|
||||
<string>Search</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="InfoFrame" name="frame">
|
||||
|
||||
@@ -48,10 +48,10 @@
|
||||
#include <QKeyEvent>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QTreeView>
|
||||
#include <Qt>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "FileSystem.h"
|
||||
#include "tools/MCEditTool.h"
|
||||
@@ -77,7 +77,7 @@ class WorldListProxyModel : public QSortFilterProxyModel {
|
||||
auto iconFile = worlds->data(sourceIndex, WorldList::IconFileRole).toString();
|
||||
if (iconFile.isNull()) {
|
||||
// NOTE: Minecraft uses the same placeholder for servers AND worlds
|
||||
return APPLICATION->getThemedIcon("unknown_server");
|
||||
return QIcon::fromTheme("unknown_server");
|
||||
}
|
||||
return QIcon(iconFile);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
#include <Application.h>
|
||||
#include <LoggedProcess.h>
|
||||
#include "minecraft/MinecraftInstance.h"
|
||||
#include "ui/pages/BasePage.h"
|
||||
@@ -57,7 +56,7 @@ class WorldListPage : public QMainWindow, public BasePage {
|
||||
virtual ~WorldListPage();
|
||||
|
||||
virtual QString displayName() const override { return tr("Worlds"); }
|
||||
virtual QIcon icon() const override { return APPLICATION->getThemedIcon("worlds"); }
|
||||
virtual QIcon icon() const override { return QIcon::fromTheme("worlds"); }
|
||||
virtual QString id() const override { return "worlds"; }
|
||||
virtual QString helpPage() const override { return "Worlds"; }
|
||||
virtual bool shouldDisplay() const override;
|
||||
|
||||
Reference in New Issue
Block a user