Merge branch 'develop' into refactor/net-split-headers-to-proxy-class

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers
2023-07-31 22:26:20 -07:00
committed by GitHub
201 changed files with 4510 additions and 3686 deletions

View File

@ -33,8 +33,8 @@
* limitations under the License.
*/
#include "VanillaPage.h"
#include "ui_VanillaPage.h"
#include "CustomPage.h"
#include "ui_CustomPage.h"
#include <QTabBar>
@ -46,32 +46,32 @@
#include "minecraft/VanillaInstanceCreationTask.h"
#include "ui/dialogs/NewInstanceDialog.h"
VanillaPage::VanillaPage(NewInstanceDialog *dialog, QWidget *parent)
: QWidget(parent), dialog(dialog), ui(new Ui::VanillaPage)
CustomPage::CustomPage(NewInstanceDialog *dialog, QWidget *parent)
: QWidget(parent), dialog(dialog), ui(new Ui::CustomPage)
{
ui->setupUi(this);
ui->tabWidget->tabBar()->hide();
connect(ui->versionList, &VersionSelectWidget::selectedVersionChanged, this, &VanillaPage::setSelectedVersion);
connect(ui->versionList, &VersionSelectWidget::selectedVersionChanged, this, &CustomPage::setSelectedVersion);
filterChanged();
connect(ui->alphaFilter, &QCheckBox::stateChanged, this, &VanillaPage::filterChanged);
connect(ui->betaFilter, &QCheckBox::stateChanged, this, &VanillaPage::filterChanged);
connect(ui->snapshotFilter, &QCheckBox::stateChanged, this, &VanillaPage::filterChanged);
connect(ui->oldSnapshotFilter, &QCheckBox::stateChanged, this, &VanillaPage::filterChanged);
connect(ui->releaseFilter, &QCheckBox::stateChanged, this, &VanillaPage::filterChanged);
connect(ui->experimentsFilter, &QCheckBox::stateChanged, this, &VanillaPage::filterChanged);
connect(ui->refreshBtn, &QPushButton::clicked, this, &VanillaPage::refresh);
connect(ui->alphaFilter, &QCheckBox::stateChanged, this, &CustomPage::filterChanged);
connect(ui->betaFilter, &QCheckBox::stateChanged, this, &CustomPage::filterChanged);
connect(ui->snapshotFilter, &QCheckBox::stateChanged, this, &CustomPage::filterChanged);
connect(ui->oldSnapshotFilter, &QCheckBox::stateChanged, this, &CustomPage::filterChanged);
connect(ui->releaseFilter, &QCheckBox::stateChanged, this, &CustomPage::filterChanged);
connect(ui->experimentsFilter, &QCheckBox::stateChanged, this, &CustomPage::filterChanged);
connect(ui->refreshBtn, &QPushButton::clicked, this, &CustomPage::refresh);
connect(ui->loaderVersionList, &VersionSelectWidget::selectedVersionChanged, this, &VanillaPage::setSelectedLoaderVersion);
connect(ui->noneFilter, &QRadioButton::toggled, this, &VanillaPage::loaderFilterChanged);
connect(ui->forgeFilter, &QRadioButton::toggled, this, &VanillaPage::loaderFilterChanged);
connect(ui->fabricFilter, &QRadioButton::toggled, this, &VanillaPage::loaderFilterChanged);
connect(ui->quiltFilter, &QRadioButton::toggled, this, &VanillaPage::loaderFilterChanged);
connect(ui->liteLoaderFilter, &QRadioButton::toggled, this, &VanillaPage::loaderFilterChanged);
connect(ui->loaderRefreshBtn, &QPushButton::clicked, this, &VanillaPage::loaderRefresh);
connect(ui->loaderVersionList, &VersionSelectWidget::selectedVersionChanged, this, &CustomPage::setSelectedLoaderVersion);
connect(ui->noneFilter, &QRadioButton::toggled, this, &CustomPage::loaderFilterChanged);
connect(ui->forgeFilter, &QRadioButton::toggled, this, &CustomPage::loaderFilterChanged);
connect(ui->fabricFilter, &QRadioButton::toggled, this, &CustomPage::loaderFilterChanged);
connect(ui->quiltFilter, &QRadioButton::toggled, this, &CustomPage::loaderFilterChanged);
connect(ui->liteLoaderFilter, &QRadioButton::toggled, this, &CustomPage::loaderFilterChanged);
connect(ui->loaderRefreshBtn, &QPushButton::clicked, this, &CustomPage::loaderRefresh);
}
void VanillaPage::openedImpl()
void CustomPage::openedImpl()
{
if(!initialized)
{
@ -85,19 +85,19 @@ void VanillaPage::openedImpl()
}
}
void VanillaPage::refresh()
void CustomPage::refresh()
{
ui->versionList->loadList();
}
void VanillaPage::loaderRefresh()
void CustomPage::loaderRefresh()
{
if(ui->noneFilter->isChecked())
return;
ui->loaderVersionList->loadList();
}
void VanillaPage::filterChanged()
void CustomPage::filterChanged()
{
QStringList out;
if(ui->alphaFilter->isChecked())
@ -116,7 +116,7 @@ void VanillaPage::filterChanged()
ui->versionList->setFilter(BaseVersionList::TypeRole, new RegexpFilter(regexp, false));
}
void VanillaPage::loaderFilterChanged()
void CustomPage::loaderFilterChanged()
{
QString minecraftVersion;
if (m_selectedVersion)
@ -172,37 +172,37 @@ void VanillaPage::loaderFilterChanged()
ui->loaderVersionList->setEmptyString(tr("No versions are currently available for Minecraft %1").arg(minecraftVersion));
}
VanillaPage::~VanillaPage()
CustomPage::~CustomPage()
{
delete ui;
}
bool VanillaPage::shouldDisplay() const
bool CustomPage::shouldDisplay() const
{
return true;
}
void VanillaPage::retranslate()
void CustomPage::retranslate()
{
ui->retranslateUi(this);
}
BaseVersion::Ptr VanillaPage::selectedVersion() const
BaseVersion::Ptr CustomPage::selectedVersion() const
{
return m_selectedVersion;
}
BaseVersion::Ptr VanillaPage::selectedLoaderVersion() const
BaseVersion::Ptr CustomPage::selectedLoaderVersion() const
{
return m_selectedLoaderVersion;
}
QString VanillaPage::selectedLoader() const
QString CustomPage::selectedLoader() const
{
return m_selectedLoader;
}
void VanillaPage::suggestCurrent()
void CustomPage::suggestCurrent()
{
if (!isOpened)
{
@ -227,14 +227,14 @@ void VanillaPage::suggestCurrent()
dialog->setSuggestedIcon("default");
}
void VanillaPage::setSelectedVersion(BaseVersion::Ptr version)
void CustomPage::setSelectedVersion(BaseVersion::Ptr version)
{
m_selectedVersion = version;
suggestCurrent();
loaderFilterChanged();
}
void VanillaPage::setSelectedLoaderVersion(BaseVersion::Ptr version)
void CustomPage::setSelectedLoaderVersion(BaseVersion::Ptr version)
{
m_selectedLoaderVersion = version;
suggestCurrent();

View File

@ -43,21 +43,21 @@
namespace Ui
{
class VanillaPage;
class CustomPage;
}
class NewInstanceDialog;
class VanillaPage : public QWidget, public BasePage
class CustomPage : public QWidget, public BasePage
{
Q_OBJECT
public:
explicit VanillaPage(NewInstanceDialog *dialog, QWidget *parent = 0);
virtual ~VanillaPage();
explicit CustomPage(NewInstanceDialog *dialog, QWidget *parent = 0);
virtual ~CustomPage();
virtual QString displayName() const override
{
return tr("Vanilla");
return tr("Custom");
}
virtual QIcon icon() const override
{
@ -96,7 +96,7 @@ private:
private:
bool initialized = false;
NewInstanceDialog *dialog = nullptr;
Ui::VanillaPage *ui = nullptr;
Ui::CustomPage *ui = nullptr;
bool m_versionSetByUser = false;
BaseVersion::Ptr m_selectedVersion;
BaseVersion::Ptr m_selectedLoaderVersion;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>VanillaPage</class>
<widget class="QWidget" name="VanillaPage">
<class>CustomPage</class>
<widget class="QWidget" name="CustomPage">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -104,6 +104,7 @@ void ResourcePage::openedImpl()
updateSelectionButton();
triggerSearch();
m_ui->searchEdit->setFocus();
}
auto ResourcePage::eventFilter(QObject* watched, QEvent* event) -> bool

View File

@ -116,8 +116,8 @@ Page::Page(NewInstanceDialog* dialog, QWidget *parent)
connect(ui->thirdPartyPackList->selectionModel(), &QItemSelectionModel::currentChanged, this, &Page::onThirdPartyPackSelectionChanged);
connect(ui->privatePackList->selectionModel(), &QItemSelectionModel::currentChanged, this, &Page::onPrivatePackSelectionChanged);
connect(ui->addPackBtn, &QPushButton::pressed, this, &Page::onAddPackClicked);
connect(ui->removePackBtn, &QPushButton::pressed, this, &Page::onRemovePackClicked);
connect(ui->addPackBtn, &QPushButton::clicked, this, &Page::onAddPackClicked);
connect(ui->removePackBtn, &QPushButton::clicked, this, &Page::onRemovePackClicked);
connect(ui->tabWidget, &QTabWidget::currentChanged, this, &Page::onTabChanged);