mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-13 05:37:42 +02:00
onToggle -> onResourceToggle
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
@ -84,8 +84,8 @@ ResourcePage::ResourcePage(ResourceDownloadDialog* parent, BaseInstance& base_in
|
|||||||
|
|
||||||
connect(m_ui->packDescription, &QTextBrowser::anchorClicked, this, &ResourcePage::openUrl);
|
connect(m_ui->packDescription, &QTextBrowser::anchorClicked, this, &ResourcePage::openUrl);
|
||||||
|
|
||||||
connect(m_ui->packView, &QListView::doubleClicked, this, &ResourcePage::onToggle);
|
connect(m_ui->packView, &QListView::doubleClicked, this, &ResourcePage::onResourceToggle);
|
||||||
connect(delegate, &ProjectItemDelegate::checkboxClicked, this, &ResourcePage::onToggle);
|
connect(delegate, &ProjectItemDelegate::checkboxClicked, this, &ResourcePage::onResourceToggle);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourcePage::~ResourcePage()
|
ResourcePage::~ResourcePage()
|
||||||
@ -134,7 +134,7 @@ auto ResourcePage::eventFilter(QObject* watched, QEvent* event) -> bool
|
|||||||
} else if (watched == m_ui->packView) {
|
} else if (watched == m_ui->packView) {
|
||||||
// stop the event from going to the confirm button
|
// stop the event from going to the confirm button
|
||||||
if (keyEvent->key() == Qt::Key_Return) {
|
if (keyEvent->key() == Qt::Key_Return) {
|
||||||
onToggle(m_ui->packView->currentIndex());
|
onResourceToggle(m_ui->packView->currentIndex());
|
||||||
keyEvent->accept();
|
keyEvent->accept();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -306,12 +306,12 @@ void ResourcePage::versionListUpdated(const QModelIndex& index)
|
|||||||
|
|
||||||
if (m_enableQueue.contains(index.row())) {
|
if (m_enableQueue.contains(index.row())) {
|
||||||
m_enableQueue.remove(index.row());
|
m_enableQueue.remove(index.row());
|
||||||
onToggle(index);
|
onResourceToggle(index);
|
||||||
} else
|
} else
|
||||||
updateSelectionButton();
|
updateSelectionButton();
|
||||||
} else if (m_enableQueue.contains(index.row())) {
|
} else if (m_enableQueue.contains(index.row())) {
|
||||||
m_enableQueue.remove(index.row());
|
m_enableQueue.remove(index.row());
|
||||||
onToggle(index);
|
onResourceToggle(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,7 +406,7 @@ void ResourcePage::onResourceSelected()
|
|||||||
m_ui->packView->repaint();
|
m_ui->packView->repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourcePage::onToggle(const QModelIndex& index)
|
void ResourcePage::onResourceToggle(const QModelIndex& index)
|
||||||
{
|
{
|
||||||
const bool isSelected = index == m_ui->packView->currentIndex();
|
const bool isSelected = index == m_ui->packView->currentIndex();
|
||||||
auto pack = m_model->data(index, Qt::UserRole).value<ModPlatform::IndexedPack::Ptr>();
|
auto pack = m_model->data(index, Qt::UserRole).value<ModPlatform::IndexedPack::Ptr>();
|
||||||
|
@ -93,7 +93,7 @@ class ResourcePage : public QWidget, public BasePage {
|
|||||||
void onSelectionChanged(QModelIndex first, QModelIndex second);
|
void onSelectionChanged(QModelIndex first, QModelIndex second);
|
||||||
void onVersionSelectionChanged(int index);
|
void onVersionSelectionChanged(int index);
|
||||||
void onResourceSelected();
|
void onResourceSelected();
|
||||||
void onToggle(const QModelIndex& index);
|
void onResourceToggle(const QModelIndex& index);
|
||||||
|
|
||||||
// NOTE: Can't use [[nodiscard]] here because of https://bugreports.qt.io/browse/QTBUG-58628 on Qt 5.12
|
// NOTE: Can't use [[nodiscard]] here because of https://bugreports.qt.io/browse/QTBUG-58628 on Qt 5.12
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user