mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
fix change version triggering an intial search
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
4463c21c98
commit
b174dec0d2
9 changed files with 90 additions and 34 deletions
|
|
@ -50,11 +50,12 @@
|
||||||
|
|
||||||
namespace ResourceDownload {
|
namespace ResourceDownload {
|
||||||
|
|
||||||
ResourceDownloadDialog::ResourceDownloadDialog(QWidget* parent, ResourceFolderModel* baseModel)
|
ResourceDownloadDialog::ResourceDownloadDialog(QWidget* parent, ResourceFolderModel* baseModel, bool suppressInitialSearch)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, m_base_model(baseModel)
|
, m_base_model(baseModel)
|
||||||
, m_buttons(QDialogButtonBox::Help | QDialogButtonBox::Ok | QDialogButtonBox::Cancel)
|
, m_buttons(QDialogButtonBox::Help | QDialogButtonBox::Ok | QDialogButtonBox::Cancel)
|
||||||
, m_vertical_layout(this)
|
, m_vertical_layout(this)
|
||||||
|
, m_suppressInitialSearch(suppressInitialSearch)
|
||||||
{
|
{
|
||||||
setObjectName(QStringLiteral("ResourceDownloadDialog"));
|
setObjectName(QStringLiteral("ResourceDownloadDialog"));
|
||||||
|
|
||||||
|
|
@ -270,6 +271,11 @@ QList<ResourceDownloadDialog::DownloadTaskPtr> ResourceDownloadDialog::getTasks(
|
||||||
|
|
||||||
void ResourceDownloadDialog::selectedPageChanged(BasePage* previous, BasePage* selected)
|
void ResourceDownloadDialog::selectedPageChanged(BasePage* previous, BasePage* selected)
|
||||||
{
|
{
|
||||||
|
// If previous is null (first selection), nothing to sync
|
||||||
|
if (!previous) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto* prevPage = dynamic_cast<ResourcePage*>(previous);
|
auto* prevPage = dynamic_cast<ResourcePage*>(previous);
|
||||||
if (!prevPage) {
|
if (!prevPage) {
|
||||||
qCritical() << "Page '" << previous->displayName() << "' in ResourceDownloadDialog is not a ResourcePage!";
|
qCritical() << "Page '" << previous->displayName() << "' in ResourceDownloadDialog is not a ResourcePage!";
|
||||||
|
|
@ -282,8 +288,8 @@ void ResourceDownloadDialog::selectedPageChanged(BasePage* previous, BasePage* s
|
||||||
result->setSearchTerm(prevPage->getSearchTerm());
|
result->setSearchTerm(prevPage->getSearchTerm());
|
||||||
}
|
}
|
||||||
|
|
||||||
ModDownloadDialog::ModDownloadDialog(QWidget* parent, ModFolderModel* mods, BaseInstance* instance)
|
ModDownloadDialog::ModDownloadDialog(QWidget* parent, ModFolderModel* mods, BaseInstance* instance, bool suppressInitialSearch)
|
||||||
: ResourceDownloadDialog(parent, mods), m_instance(instance)
|
: ResourceDownloadDialog(parent, mods, suppressInitialSearch), m_instance(instance)
|
||||||
{
|
{
|
||||||
setWindowTitle(dialogTitle());
|
setWindowTitle(dialogTitle());
|
||||||
|
|
||||||
|
|
@ -302,10 +308,14 @@ QList<BasePage*> ModDownloadDialog::getPages()
|
||||||
auto loaders = static_cast<MinecraftInstance*>(m_instance)->getPackProfile()->getSupportedModLoaders().value();
|
auto loaders = static_cast<MinecraftInstance*>(m_instance)->getPackProfile()->getSupportedModLoaders().value();
|
||||||
|
|
||||||
if (ModrinthAPI::validateModLoaders(loaders)) {
|
if (ModrinthAPI::validateModLoaders(loaders)) {
|
||||||
pages.append(ModrinthModPage::create(this, *m_instance));
|
auto* page = ModrinthModPage::create(this, *m_instance);
|
||||||
|
page->setSuppressInitialSearch(m_suppressInitialSearch);
|
||||||
|
pages.append(page);
|
||||||
}
|
}
|
||||||
if (APPLICATION->capabilities() & Application::SupportsFlame && FlameAPI::validateModLoaders(loaders)) {
|
if (APPLICATION->capabilities() & Application::SupportsFlame && FlameAPI::validateModLoaders(loaders)) {
|
||||||
pages.append(FlameModPage::create(this, *m_instance));
|
auto* page = FlameModPage::create(this, *m_instance);
|
||||||
|
page->setSuppressInitialSearch(m_suppressInitialSearch);
|
||||||
|
pages.append(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
return pages;
|
return pages;
|
||||||
|
|
@ -326,8 +336,11 @@ GetModDependenciesTask::Ptr ModDownloadDialog::getModDependenciesTask()
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourcePackDownloadDialog::ResourcePackDownloadDialog(QWidget* parent, ResourcePackFolderModel* resourcePacks, BaseInstance* instance)
|
ResourcePackDownloadDialog::ResourcePackDownloadDialog(QWidget* parent,
|
||||||
: ResourceDownloadDialog(parent, resourcePacks), m_instance(instance)
|
ResourcePackFolderModel* resourcePacks,
|
||||||
|
BaseInstance* instance,
|
||||||
|
bool suppressInitialSearch)
|
||||||
|
: ResourceDownloadDialog(parent, resourcePacks, suppressInitialSearch), m_instance(instance)
|
||||||
{
|
{
|
||||||
setWindowTitle(dialogTitle());
|
setWindowTitle(dialogTitle());
|
||||||
|
|
||||||
|
|
@ -343,16 +356,23 @@ QList<BasePage*> ResourcePackDownloadDialog::getPages()
|
||||||
{
|
{
|
||||||
QList<BasePage*> pages;
|
QList<BasePage*> pages;
|
||||||
|
|
||||||
pages.append(ModrinthResourcePackPage::create(this, *m_instance));
|
auto* modrinthPage = ModrinthResourcePackPage::create(this, *m_instance);
|
||||||
|
modrinthPage->setSuppressInitialSearch(m_suppressInitialSearch);
|
||||||
|
pages.append(modrinthPage);
|
||||||
if (APPLICATION->capabilities() & Application::SupportsFlame) {
|
if (APPLICATION->capabilities() & Application::SupportsFlame) {
|
||||||
pages.append(FlameResourcePackPage::create(this, *m_instance));
|
auto* flamePage = FlameResourcePackPage::create(this, *m_instance);
|
||||||
|
flamePage->setSuppressInitialSearch(m_suppressInitialSearch);
|
||||||
|
pages.append(flamePage);
|
||||||
}
|
}
|
||||||
|
|
||||||
return pages;
|
return pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
TexturePackDownloadDialog::TexturePackDownloadDialog(QWidget* parent, TexturePackFolderModel* resourcePacks, BaseInstance* instance)
|
TexturePackDownloadDialog::TexturePackDownloadDialog(QWidget* parent,
|
||||||
: ResourceDownloadDialog(parent, resourcePacks), m_instance(instance)
|
TexturePackFolderModel* resourcePacks,
|
||||||
|
BaseInstance* instance,
|
||||||
|
bool suppressInitialSearch)
|
||||||
|
: ResourceDownloadDialog(parent, resourcePacks, suppressInitialSearch), m_instance(instance)
|
||||||
{
|
{
|
||||||
setWindowTitle(dialogTitle());
|
setWindowTitle(dialogTitle());
|
||||||
|
|
||||||
|
|
@ -368,16 +388,23 @@ QList<BasePage*> TexturePackDownloadDialog::getPages()
|
||||||
{
|
{
|
||||||
QList<BasePage*> pages;
|
QList<BasePage*> pages;
|
||||||
|
|
||||||
pages.append(ModrinthTexturePackPage::create(this, *m_instance));
|
auto* modrinthPage = ModrinthTexturePackPage::create(this, *m_instance);
|
||||||
|
modrinthPage->setSuppressInitialSearch(m_suppressInitialSearch);
|
||||||
|
pages.append(modrinthPage);
|
||||||
if (APPLICATION->capabilities() & Application::SupportsFlame) {
|
if (APPLICATION->capabilities() & Application::SupportsFlame) {
|
||||||
pages.append(FlameTexturePackPage::create(this, *m_instance));
|
auto* flamePage = FlameTexturePackPage::create(this, *m_instance);
|
||||||
|
flamePage->setSuppressInitialSearch(m_suppressInitialSearch);
|
||||||
|
pages.append(flamePage);
|
||||||
}
|
}
|
||||||
|
|
||||||
return pages;
|
return pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderPackDownloadDialog::ShaderPackDownloadDialog(QWidget* parent, ShaderPackFolderModel* shaders, BaseInstance* instance)
|
ShaderPackDownloadDialog::ShaderPackDownloadDialog(QWidget* parent,
|
||||||
: ResourceDownloadDialog(parent, shaders), m_instance(instance)
|
ShaderPackFolderModel* shaders,
|
||||||
|
BaseInstance* instance,
|
||||||
|
bool suppressInitialSearch)
|
||||||
|
: ResourceDownloadDialog(parent, shaders, suppressInitialSearch), m_instance(instance)
|
||||||
{
|
{
|
||||||
setWindowTitle(dialogTitle());
|
setWindowTitle(dialogTitle());
|
||||||
|
|
||||||
|
|
@ -392,9 +419,13 @@ ShaderPackDownloadDialog::ShaderPackDownloadDialog(QWidget* parent, ShaderPackFo
|
||||||
QList<BasePage*> ShaderPackDownloadDialog::getPages()
|
QList<BasePage*> ShaderPackDownloadDialog::getPages()
|
||||||
{
|
{
|
||||||
QList<BasePage*> pages;
|
QList<BasePage*> pages;
|
||||||
pages.append(ModrinthShaderPackPage::create(this, *m_instance));
|
auto* modrinthPage = ModrinthShaderPackPage::create(this, *m_instance);
|
||||||
|
modrinthPage->setSuppressInitialSearch(m_suppressInitialSearch);
|
||||||
|
pages.append(modrinthPage);
|
||||||
if (APPLICATION->capabilities() & Application::SupportsFlame) {
|
if (APPLICATION->capabilities() & Application::SupportsFlame) {
|
||||||
pages.append(FlameShaderPackPage::create(this, *m_instance));
|
auto* flamePage = FlameShaderPackPage::create(this, *m_instance);
|
||||||
|
flamePage->setSuppressInitialSearch(m_suppressInitialSearch);
|
||||||
|
pages.append(flamePage);
|
||||||
}
|
}
|
||||||
return pages;
|
return pages;
|
||||||
}
|
}
|
||||||
|
|
@ -409,6 +440,7 @@ void ResourceDownloadDialog::setResourceMetadata(const std::shared_ptr<Metadata:
|
||||||
selectPage(Flame::id());
|
selectPage(Flame::id());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
setWindowTitle(tr("Change %1 version").arg(meta->name));
|
setWindowTitle(tr("Change %1 version").arg(meta->name));
|
||||||
m_container->hidePageList();
|
m_container->hidePageList();
|
||||||
m_buttons.hide();
|
m_buttons.hide();
|
||||||
|
|
@ -416,8 +448,11 @@ void ResourceDownloadDialog::setResourceMetadata(const std::shared_ptr<Metadata:
|
||||||
page->openProject(meta->project_id);
|
page->openProject(meta->project_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
DataPackDownloadDialog::DataPackDownloadDialog(QWidget* parent, DataPackFolderModel* dataPacks, BaseInstance* instance)
|
DataPackDownloadDialog::DataPackDownloadDialog(QWidget* parent,
|
||||||
: ResourceDownloadDialog(parent, dataPacks), m_instance(instance)
|
DataPackFolderModel* dataPacks,
|
||||||
|
BaseInstance* instance,
|
||||||
|
bool suppressInitialSearch)
|
||||||
|
: ResourceDownloadDialog(parent, dataPacks, suppressInitialSearch), m_instance(instance)
|
||||||
{
|
{
|
||||||
setWindowTitle(dialogTitle());
|
setWindowTitle(dialogTitle());
|
||||||
|
|
||||||
|
|
@ -432,9 +467,13 @@ DataPackDownloadDialog::DataPackDownloadDialog(QWidget* parent, DataPackFolderMo
|
||||||
QList<BasePage*> DataPackDownloadDialog::getPages()
|
QList<BasePage*> DataPackDownloadDialog::getPages()
|
||||||
{
|
{
|
||||||
QList<BasePage*> pages;
|
QList<BasePage*> pages;
|
||||||
pages.append(ModrinthDataPackPage::create(this, *m_instance));
|
auto* modrinthPage = ModrinthDataPackPage::create(this, *m_instance);
|
||||||
|
modrinthPage->setSuppressInitialSearch(m_suppressInitialSearch);
|
||||||
|
pages.append(modrinthPage);
|
||||||
if (APPLICATION->capabilities() & Application::SupportsFlame) {
|
if (APPLICATION->capabilities() & Application::SupportsFlame) {
|
||||||
pages.append(FlameDataPackPage::create(this, *m_instance));
|
auto* flamePage = FlameDataPackPage::create(this, *m_instance);
|
||||||
|
flamePage->setSuppressInitialSearch(m_suppressInitialSearch);
|
||||||
|
pages.append(flamePage);
|
||||||
}
|
}
|
||||||
return pages;
|
return pages;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class ResourceDownloadDialog : public QDialog, public BasePageProvider {
|
||||||
public:
|
public:
|
||||||
using DownloadTaskPtr = shared_qobject_ptr<ResourceDownloadTask>;
|
using DownloadTaskPtr = shared_qobject_ptr<ResourceDownloadTask>;
|
||||||
|
|
||||||
ResourceDownloadDialog(QWidget* parent, ResourceFolderModel* baseModel);
|
ResourceDownloadDialog(QWidget* parent, ResourceFolderModel* baseModel, bool suppressInitialSearch = false);
|
||||||
|
|
||||||
void initializeContainer();
|
void initializeContainer();
|
||||||
void connectButtons();
|
void connectButtons();
|
||||||
|
|
@ -94,13 +94,16 @@ class ResourceDownloadDialog : public QDialog, public BasePageProvider {
|
||||||
|
|
||||||
QDialogButtonBox m_buttons;
|
QDialogButtonBox m_buttons;
|
||||||
QVBoxLayout m_vertical_layout;
|
QVBoxLayout m_vertical_layout;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool m_suppressInitialSearch = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ModDownloadDialog final : public ResourceDownloadDialog {
|
class ModDownloadDialog final : public ResourceDownloadDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ModDownloadDialog(QWidget* parent, ModFolderModel* mods, BaseInstance* instance);
|
explicit ModDownloadDialog(QWidget* parent, ModFolderModel* mods, BaseInstance* instance, bool suppressInitialSearch = false);
|
||||||
~ModDownloadDialog() override = default;
|
~ModDownloadDialog() override = default;
|
||||||
|
|
||||||
//: String that gets appended to the mod download dialog title ("Download " + resourcesString())
|
//: String that gets appended to the mod download dialog title ("Download " + resourcesString())
|
||||||
|
|
@ -118,7 +121,7 @@ class ResourcePackDownloadDialog final : public ResourceDownloadDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ResourcePackDownloadDialog(QWidget* parent, ResourcePackFolderModel* resourcePacks, BaseInstance* instance);
|
explicit ResourcePackDownloadDialog(QWidget* parent, ResourcePackFolderModel* resourcePacks, BaseInstance* instance, bool suppressInitialSearch = false);
|
||||||
~ResourcePackDownloadDialog() override = default;
|
~ResourcePackDownloadDialog() override = default;
|
||||||
|
|
||||||
//: String that gets appended to the resource pack download dialog title ("Download " + resourcesString())
|
//: String that gets appended to the resource pack download dialog title ("Download " + resourcesString())
|
||||||
|
|
@ -135,7 +138,7 @@ class TexturePackDownloadDialog final : public ResourceDownloadDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TexturePackDownloadDialog(QWidget* parent, TexturePackFolderModel* resourcePacks, BaseInstance* instance);
|
explicit TexturePackDownloadDialog(QWidget* parent, TexturePackFolderModel* resourcePacks, BaseInstance* instance, bool suppressInitialSearch = false);
|
||||||
~TexturePackDownloadDialog() override = default;
|
~TexturePackDownloadDialog() override = default;
|
||||||
|
|
||||||
//: String that gets appended to the texture pack download dialog title ("Download " + resourcesString())
|
//: String that gets appended to the texture pack download dialog title ("Download " + resourcesString())
|
||||||
|
|
@ -152,7 +155,7 @@ class ShaderPackDownloadDialog final : public ResourceDownloadDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ShaderPackDownloadDialog(QWidget* parent, ShaderPackFolderModel* shaders, BaseInstance* instance);
|
explicit ShaderPackDownloadDialog(QWidget* parent, ShaderPackFolderModel* shaders, BaseInstance* instance, bool suppressInitialSearch = false);
|
||||||
~ShaderPackDownloadDialog() override = default;
|
~ShaderPackDownloadDialog() override = default;
|
||||||
|
|
||||||
//: String that gets appended to the shader pack download dialog title ("Download " + resourcesString())
|
//: String that gets appended to the shader pack download dialog title ("Download " + resourcesString())
|
||||||
|
|
@ -169,7 +172,7 @@ class DataPackDownloadDialog final : public ResourceDownloadDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DataPackDownloadDialog(QWidget* parent, DataPackFolderModel* dataPacks, BaseInstance* instance);
|
explicit DataPackDownloadDialog(QWidget* parent, DataPackFolderModel* dataPacks, BaseInstance* instance, bool suppressInitialSearch = false);
|
||||||
~DataPackDownloadDialog() override = default;
|
~DataPackDownloadDialog() override = default;
|
||||||
|
|
||||||
//: String that gets appended to the data pack download dialog title ("Download " + resourcesString())
|
//: String that gets appended to the data pack download dialog title ("Download " + resourcesString())
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,7 @@ void DataPackPage::changeDataPackVersion()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourceDownload::DataPackDownloadDialog mdownload(this, m_model, m_instance);
|
ResourceDownload::DataPackDownloadDialog mdownload(this, m_model, m_instance, true);
|
||||||
mdownload.setResourceMetadata(resource.metadata());
|
mdownload.setResourceMetadata(resource.metadata());
|
||||||
if (mdownload.exec() != 0) {
|
if (mdownload.exec() != 0) {
|
||||||
auto* tasks = new ConcurrentTask("Download Data Packs", APPLICATION->settings()->get("NumberOfConcurrentDownloads").toInt());
|
auto* tasks = new ConcurrentTask("Download Data Packs", APPLICATION->settings()->get("NumberOfConcurrentDownloads").toInt());
|
||||||
|
|
|
||||||
|
|
@ -352,7 +352,7 @@ void ModFolderPage::changeModVersion()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_downloadDialog = new ResourceDownload::ModDownloadDialog(this, m_model, m_instance);
|
m_downloadDialog = new ResourceDownload::ModDownloadDialog(this, m_model, m_instance, true);
|
||||||
connect(this, &QObject::destroyed, m_downloadDialog, &QDialog::close);
|
connect(this, &QObject::destroyed, m_downloadDialog, &QDialog::close);
|
||||||
connect(m_downloadDialog, &QDialog::finished, this, &ModFolderPage::downloadDialogFinished);
|
connect(m_downloadDialog, &QDialog::finished, this, &ModFolderPage::downloadDialogFinished);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -259,7 +259,7 @@ void ResourcePackPage::changeResourcePackVersion()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_downloadDialog = new ResourceDownload::ResourcePackDownloadDialog(this, m_model, m_instance);
|
m_downloadDialog = new ResourceDownload::ResourcePackDownloadDialog(this, m_model, m_instance, true);
|
||||||
connect(this, &QObject::destroyed, m_downloadDialog, &QDialog::close);
|
connect(this, &QObject::destroyed, m_downloadDialog, &QDialog::close);
|
||||||
connect(m_downloadDialog, &QDialog::finished, this, &ResourcePackPage::downloadDialogFinished);
|
connect(m_downloadDialog, &QDialog::finished, this, &ResourcePackPage::downloadDialogFinished);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -256,7 +256,7 @@ void ShaderPackPage::changeShaderPackVersion()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_downloadDialog = new ResourceDownload::ShaderPackDownloadDialog(this, m_model, m_instance);
|
m_downloadDialog = new ResourceDownload::ShaderPackDownloadDialog(this, m_model, m_instance, true);
|
||||||
connect(this, &QObject::destroyed, m_downloadDialog, &QDialog::close);
|
connect(this, &QObject::destroyed, m_downloadDialog, &QDialog::close);
|
||||||
connect(m_downloadDialog, &QDialog::finished, this, &ShaderPackPage::downloadDialogFinished);
|
connect(m_downloadDialog, &QDialog::finished, this, &ShaderPackPage::downloadDialogFinished);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -264,7 +264,7 @@ void TexturePackPage::changeTexturePackVersion()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_downloadDialog = new ResourceDownload::TexturePackDownloadDialog(this, m_model, m_instance);
|
m_downloadDialog = new ResourceDownload::TexturePackDownloadDialog(this, m_model, m_instance, true);
|
||||||
connect(this, &QObject::destroyed, m_downloadDialog, &QDialog::close);
|
connect(this, &QObject::destroyed, m_downloadDialog, &QDialog::close);
|
||||||
connect(m_downloadDialog, &QDialog::finished, this, &TexturePackPage::downloadDialogFinished);
|
connect(m_downloadDialog, &QDialog::finished, this, &TexturePackPage::downloadDialogFinished);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -115,10 +115,19 @@ void ResourcePage::openedImpl()
|
||||||
m_ui->resourceSelectionButton->setText(tr("Select %1 for download").arg(resourceString()));
|
m_ui->resourceSelectionButton->setText(tr("Select %1 for download").arg(resourceString()));
|
||||||
|
|
||||||
updateSelectionButton();
|
updateSelectionButton();
|
||||||
triggerSearch();
|
if (!m_suppressInitialSearch) {
|
||||||
|
triggerSearch();
|
||||||
|
} else {
|
||||||
|
m_suppressInitialSearch = false;
|
||||||
|
}
|
||||||
m_ui->searchEdit->setFocus();
|
m_ui->searchEdit->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ResourcePage::setSuppressInitialSearch(bool suppress)
|
||||||
|
{
|
||||||
|
m_suppressInitialSearch = suppress;
|
||||||
|
}
|
||||||
|
|
||||||
auto ResourcePage::eventFilter(QObject* watched, QEvent* event) -> bool
|
auto ResourcePage::eventFilter(QObject* watched, QEvent* event) -> bool
|
||||||
{
|
{
|
||||||
if (event->type() == QEvent::KeyPress) {
|
if (event->type() == QEvent::KeyPress) {
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,9 @@ class ResourcePage : public QWidget, public BasePage {
|
||||||
QList<DownloadTaskPtr> selectedPacks() { return m_model->selectedPacks(); }
|
QList<DownloadTaskPtr> selectedPacks() { return m_model->selectedPacks(); }
|
||||||
bool hasSelectedPacks() { return !(m_model->selectedPacks().isEmpty()); }
|
bool hasSelectedPacks() { return !(m_model->selectedPacks().isEmpty()); }
|
||||||
|
|
||||||
virtual void openProject(QVariant projectID);
|
virtual void openProject(const QVariant& projectID);
|
||||||
|
|
||||||
|
void setSuppressInitialSearch(bool suppress);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
virtual void triggerSearch() = 0;
|
virtual void triggerSearch() = 0;
|
||||||
|
|
@ -118,6 +120,9 @@ class ResourcePage : public QWidget, public BasePage {
|
||||||
bool m_doNotJumpToMod = false;
|
bool m_doNotJumpToMod = false;
|
||||||
|
|
||||||
QSet<int> m_enableQueue;
|
QSet<int> m_enableQueue;
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool m_suppressInitialSearch = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ResourceDownload
|
} // namespace ResourceDownload
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue