Merge pull request #398 from kthchew/feature/ml-instance-creation
This commit is contained in:
commit
ef76bd355a
@ -9,6 +9,15 @@
|
|||||||
InstanceCreationTask::InstanceCreationTask(BaseVersionPtr version)
|
InstanceCreationTask::InstanceCreationTask(BaseVersionPtr version)
|
||||||
{
|
{
|
||||||
m_version = version;
|
m_version = version;
|
||||||
|
m_usingLoader = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
InstanceCreationTask::InstanceCreationTask(BaseVersionPtr version, QString loader, BaseVersionPtr loaderVersion)
|
||||||
|
{
|
||||||
|
m_version = version;
|
||||||
|
m_usingLoader = true;
|
||||||
|
m_loader = loader;
|
||||||
|
m_loaderVersion = loaderVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
void InstanceCreationTask::executeTask()
|
void InstanceCreationTask::executeTask()
|
||||||
@ -21,6 +30,8 @@ void InstanceCreationTask::executeTask()
|
|||||||
auto components = inst.getPackProfile();
|
auto components = inst.getPackProfile();
|
||||||
components->buildingFromScratch();
|
components->buildingFromScratch();
|
||||||
components->setComponentVersion("net.minecraft", m_version->descriptor(), true);
|
components->setComponentVersion("net.minecraft", m_version->descriptor(), true);
|
||||||
|
if(m_usingLoader)
|
||||||
|
components->setComponentVersion(m_loader, m_loaderVersion->descriptor(), true);
|
||||||
inst.setName(m_instName);
|
inst.setName(m_instName);
|
||||||
inst.setIconKey(m_instIcon);
|
inst.setIconKey(m_instIcon);
|
||||||
instanceSettings->resumeSave();
|
instanceSettings->resumeSave();
|
||||||
|
@ -12,6 +12,7 @@ class InstanceCreationTask : public InstanceTask
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit InstanceCreationTask(BaseVersionPtr version);
|
explicit InstanceCreationTask(BaseVersionPtr version);
|
||||||
|
explicit InstanceCreationTask(BaseVersionPtr version, QString loader, BaseVersionPtr loaderVersion);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//! Entry point for tasks.
|
//! Entry point for tasks.
|
||||||
@ -19,4 +20,7 @@ protected:
|
|||||||
|
|
||||||
private: /* data */
|
private: /* data */
|
||||||
BaseVersionPtr m_version;
|
BaseVersionPtr m_version;
|
||||||
|
bool m_usingLoader;
|
||||||
|
QString m_loader;
|
||||||
|
BaseVersionPtr m_loaderVersion;
|
||||||
};
|
};
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
#include "ui/dialogs/NewInstanceDialog.h"
|
#include "ui/dialogs/NewInstanceDialog.h"
|
||||||
#include "Filter.h"
|
#include "Filter.h"
|
||||||
#include "InstanceCreationTask.h"
|
#include "InstanceCreationTask.h"
|
||||||
|
#include "Version.h"
|
||||||
|
|
||||||
VanillaPage::VanillaPage(NewInstanceDialog *dialog, QWidget *parent)
|
VanillaPage::VanillaPage(NewInstanceDialog *dialog, QWidget *parent)
|
||||||
: QWidget(parent), dialog(dialog), ui(new Ui::VanillaPage)
|
: QWidget(parent), dialog(dialog), ui(new Ui::VanillaPage)
|
||||||
@ -59,6 +60,15 @@ VanillaPage::VanillaPage(NewInstanceDialog *dialog, QWidget *parent)
|
|||||||
connect(ui->releaseFilter, &QCheckBox::stateChanged, this, &VanillaPage::filterChanged);
|
connect(ui->releaseFilter, &QCheckBox::stateChanged, this, &VanillaPage::filterChanged);
|
||||||
connect(ui->experimentsFilter, &QCheckBox::stateChanged, this, &VanillaPage::filterChanged);
|
connect(ui->experimentsFilter, &QCheckBox::stateChanged, this, &VanillaPage::filterChanged);
|
||||||
connect(ui->refreshBtn, &QPushButton::clicked, this, &VanillaPage::refresh);
|
connect(ui->refreshBtn, &QPushButton::clicked, this, &VanillaPage::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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VanillaPage::openedImpl()
|
void VanillaPage::openedImpl()
|
||||||
@ -80,6 +90,13 @@ void VanillaPage::refresh()
|
|||||||
ui->versionList->loadList();
|
ui->versionList->loadList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VanillaPage::loaderRefresh()
|
||||||
|
{
|
||||||
|
if(ui->noneFilter->isChecked())
|
||||||
|
return;
|
||||||
|
ui->loaderVersionList->loadList();
|
||||||
|
}
|
||||||
|
|
||||||
void VanillaPage::filterChanged()
|
void VanillaPage::filterChanged()
|
||||||
{
|
{
|
||||||
QStringList out;
|
QStringList out;
|
||||||
@ -99,6 +116,52 @@ void VanillaPage::filterChanged()
|
|||||||
ui->versionList->setFilter(BaseVersionList::TypeRole, new RegexpFilter(regexp, false));
|
ui->versionList->setFilter(BaseVersionList::TypeRole, new RegexpFilter(regexp, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VanillaPage::loaderFilterChanged()
|
||||||
|
{
|
||||||
|
auto minecraftVersion = m_selectedVersion->descriptor();
|
||||||
|
if(ui->noneFilter->isChecked())
|
||||||
|
{
|
||||||
|
ui->loaderVersionList->setExactFilter(BaseVersionList::ParentVersionRole, "AAA"); // empty list
|
||||||
|
ui->loaderVersionList->setEmptyString(tr("No mod loader is selected."));
|
||||||
|
ui->loaderVersionList->setEmptyMode(VersionListView::String);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if(ui->forgeFilter->isChecked())
|
||||||
|
{
|
||||||
|
ui->loaderVersionList->setExactFilter(BaseVersionList::ParentVersionRole, minecraftVersion);
|
||||||
|
m_selectedLoader = "net.minecraftforge";
|
||||||
|
}
|
||||||
|
else if(ui->fabricFilter->isChecked())
|
||||||
|
{
|
||||||
|
// FIXME: dirty hack because the launcher is unaware of Fabric's dependencies
|
||||||
|
if (Version(minecraftVersion) >= Version("1.14")) // Fabric/Quilt supported
|
||||||
|
ui->loaderVersionList->setExactFilter(BaseVersionList::ParentVersionRole, "");
|
||||||
|
else // Fabric/Quilt unsupported
|
||||||
|
ui->loaderVersionList->setExactFilter(BaseVersionList::ParentVersionRole, "AAA"); // clear list
|
||||||
|
m_selectedLoader = "net.fabricmc.fabric-loader";
|
||||||
|
}
|
||||||
|
else if(ui->quiltFilter->isChecked())
|
||||||
|
{
|
||||||
|
// FIXME: dirty hack because the launcher is unaware of Quilt's dependencies (same as Fabric)
|
||||||
|
if (Version(minecraftVersion) >= Version("1.14")) // Fabric/Quilt supported
|
||||||
|
ui->loaderVersionList->setExactFilter(BaseVersionList::ParentVersionRole, "");
|
||||||
|
else // Fabric/Quilt unsupported
|
||||||
|
ui->loaderVersionList->setExactFilter(BaseVersionList::ParentVersionRole, "AAA"); // clear list
|
||||||
|
m_selectedLoader = "org.quiltmc.quilt-loader";
|
||||||
|
}
|
||||||
|
else if(ui->liteLoaderFilter->isChecked())
|
||||||
|
{
|
||||||
|
ui->loaderVersionList->setExactFilter(BaseVersionList::ParentVersionRole, minecraftVersion);
|
||||||
|
m_selectedLoader = "com.mumfrey.liteloader";
|
||||||
|
}
|
||||||
|
|
||||||
|
auto vlist = APPLICATION->metadataIndex()->get(m_selectedLoader);
|
||||||
|
ui->loaderVersionList->initialize(vlist.get());
|
||||||
|
ui->loaderVersionList->selectRecommended();
|
||||||
|
suggestCurrent();
|
||||||
|
ui->loaderVersionList->setEmptyString(tr("No versions are currently available for Minecraft %1").arg(minecraftVersion));
|
||||||
|
}
|
||||||
|
|
||||||
VanillaPage::~VanillaPage()
|
VanillaPage::~VanillaPage()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
@ -119,6 +182,16 @@ BaseVersionPtr VanillaPage::selectedVersion() const
|
|||||||
return m_selectedVersion;
|
return m_selectedVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BaseVersionPtr VanillaPage::selectedLoaderVersion() const
|
||||||
|
{
|
||||||
|
return m_selectedLoaderVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString VanillaPage::selectedLoader() const
|
||||||
|
{
|
||||||
|
return m_selectedLoader;
|
||||||
|
}
|
||||||
|
|
||||||
void VanillaPage::suggestCurrent()
|
void VanillaPage::suggestCurrent()
|
||||||
{
|
{
|
||||||
if (!isOpened)
|
if (!isOpened)
|
||||||
@ -132,7 +205,15 @@ void VanillaPage::suggestCurrent()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog->setSuggestedPack(m_selectedVersion->descriptor(), new InstanceCreationTask(m_selectedVersion));
|
// List is empty if either no mod loader is selected, or no versions are available
|
||||||
|
if(!ui->loaderVersionList->hasVersions())
|
||||||
|
dialog->setSuggestedPack(m_selectedVersion->descriptor(), new InstanceCreationTask(m_selectedVersion));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dialog->setSuggestedPack(m_selectedVersion->descriptor(),
|
||||||
|
new InstanceCreationTask(m_selectedVersion, m_selectedLoader,
|
||||||
|
m_selectedLoaderVersion));
|
||||||
|
}
|
||||||
dialog->setSuggestedIcon("default");
|
dialog->setSuggestedIcon("default");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,4 +221,11 @@ void VanillaPage::setSelectedVersion(BaseVersionPtr version)
|
|||||||
{
|
{
|
||||||
m_selectedVersion = version;
|
m_selectedVersion = version;
|
||||||
suggestCurrent();
|
suggestCurrent();
|
||||||
|
loaderFilterChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
void VanillaPage::setSelectedLoaderVersion(BaseVersionPtr version)
|
||||||
|
{
|
||||||
|
m_selectedLoaderVersion = version;
|
||||||
|
suggestCurrent();
|
||||||
}
|
}
|
||||||
|
@ -77,15 +77,20 @@ public:
|
|||||||
void openedImpl() override;
|
void openedImpl() override;
|
||||||
|
|
||||||
BaseVersionPtr selectedVersion() const;
|
BaseVersionPtr selectedVersion() const;
|
||||||
|
BaseVersionPtr selectedLoaderVersion() const;
|
||||||
|
QString selectedLoader() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setSelectedVersion(BaseVersionPtr version);
|
void setSelectedVersion(BaseVersionPtr version);
|
||||||
|
void setSelectedLoaderVersion(BaseVersionPtr version);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void filterChanged();
|
void filterChanged();
|
||||||
|
void loaderFilterChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void refresh();
|
void refresh();
|
||||||
|
void loaderRefresh();
|
||||||
void suggestCurrent();
|
void suggestCurrent();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -94,4 +99,6 @@ private:
|
|||||||
Ui::VanillaPage *ui = nullptr;
|
Ui::VanillaPage *ui = nullptr;
|
||||||
bool m_versionSetByUser = false;
|
bool m_versionSetByUser = false;
|
||||||
BaseVersionPtr m_selectedVersion;
|
BaseVersionPtr m_selectedVersion;
|
||||||
|
BaseVersionPtr m_selectedLoaderVersion;
|
||||||
|
QString m_selectedLoader;
|
||||||
};
|
};
|
||||||
|
@ -33,113 +33,231 @@
|
|||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="0" column="1">
|
<item row="2" column="0">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<widget class="Line" name="line">
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Filter</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="releaseFilter">
|
|
||||||
<property name="text">
|
|
||||||
<string>Releases</string>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="snapshotFilter">
|
|
||||||
<property name="text">
|
|
||||||
<string>Snapshots</string>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="oldSnapshotFilter">
|
|
||||||
<property name="text">
|
|
||||||
<string>Old Snapshots</string>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="betaFilter">
|
|
||||||
<property name="text">
|
|
||||||
<string>Betas</string>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="alphaFilter">
|
|
||||||
<property name="text">
|
|
||||||
<string>Alphas</string>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="experimentsFilter">
|
|
||||||
<property name="text">
|
|
||||||
<string>Experiments</string>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="refreshBtn">
|
|
||||||
<property name="text">
|
|
||||||
<string>Refresh</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="VersionSelectWidget" name="versionList" native="true">
|
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="minecraftLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="VersionSelectWidget" name="versionList" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Filter</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="releaseFilter">
|
||||||
|
<property name="text">
|
||||||
|
<string>Releases</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="snapshotFilter">
|
||||||
|
<property name="text">
|
||||||
|
<string>Snapshots</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="oldSnapshotFilter">
|
||||||
|
<property name="text">
|
||||||
|
<string>Old Snapshots</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="betaFilter">
|
||||||
|
<property name="text">
|
||||||
|
<string>Betas</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="alphaFilter">
|
||||||
|
<property name="text">
|
||||||
|
<string>Alphas</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="experimentsFilter">
|
||||||
|
<property name="text">
|
||||||
|
<string>Experiments</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="refreshBtn">
|
||||||
|
<property name="text">
|
||||||
|
<string>Refresh</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="loaderLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="VersionSelectWidget" name="loaderVersionList" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="loaderLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Mod Loader</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="noneFilter">
|
||||||
|
<property name="text">
|
||||||
|
<string>None</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<attribute name="buttonGroup">
|
||||||
|
<string notr="true">loaderBtnGroup</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="forgeFilter">
|
||||||
|
<property name="text">
|
||||||
|
<string>Forge</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="buttonGroup">
|
||||||
|
<string notr="true">loaderBtnGroup</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="fabricFilter">
|
||||||
|
<property name="text">
|
||||||
|
<string>Fabric</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="buttonGroup">
|
||||||
|
<string notr="true">loaderBtnGroup</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="quiltFilter">
|
||||||
|
<property name="text">
|
||||||
|
<string>Quilt</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="buttonGroup">
|
||||||
|
<string notr="true">loaderBtnGroup</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="liteLoaderFilter">
|
||||||
|
<property name="text">
|
||||||
|
<string>LiteLoader</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="buttonGroup">
|
||||||
|
<string notr="true">loaderBtnGroup</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="loaderRefreshBtn">
|
||||||
|
<property name="text">
|
||||||
|
<string>Refresh</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@ -166,4 +284,7 @@
|
|||||||
</tabstops>
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
<buttongroups>
|
||||||
|
<buttongroup name="loaderBtnGroup"/>
|
||||||
|
</buttongroups>
|
||||||
</ui>
|
</ui>
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
|
|
||||||
#include "VersionListView.h"
|
|
||||||
#include "VersionProxyModel.h"
|
#include "VersionProxyModel.h"
|
||||||
|
|
||||||
#include "ui/dialogs/CustomMessageBox.h"
|
#include "ui/dialogs/CustomMessageBox.h"
|
||||||
@ -57,6 +56,11 @@ void VersionSelectWidget::setEmptyErrorString(QString emptyErrorString)
|
|||||||
listView->setEmptyErrorString(emptyErrorString);
|
listView->setEmptyErrorString(emptyErrorString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VersionSelectWidget::setEmptyMode(VersionListView::EmptyMode mode)
|
||||||
|
{
|
||||||
|
listView->setEmptyMode(mode);
|
||||||
|
}
|
||||||
|
|
||||||
VersionSelectWidget::~VersionSelectWidget()
|
VersionSelectWidget::~VersionSelectWidget()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include "BaseVersionList.h"
|
#include "BaseVersionList.h"
|
||||||
|
#include "VersionListView.h"
|
||||||
|
|
||||||
class VersionProxyModel;
|
class VersionProxyModel;
|
||||||
class VersionListView;
|
class VersionListView;
|
||||||
@ -49,6 +50,7 @@ public:
|
|||||||
void setFilter(BaseVersionList::ModelRoles role, Filter *filter);
|
void setFilter(BaseVersionList::ModelRoles role, Filter *filter);
|
||||||
void setEmptyString(QString emptyString);
|
void setEmptyString(QString emptyString);
|
||||||
void setEmptyErrorString(QString emptyErrorString);
|
void setEmptyErrorString(QString emptyErrorString);
|
||||||
|
void setEmptyMode(VersionListView::EmptyMode mode);
|
||||||
void setResizeOn(int column);
|
void setResizeOn(int column);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
Loading…
Reference in New Issue
Block a user