mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-12 05:07:46 +02:00
rename snake_case to camelCase
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
@ -55,7 +55,7 @@
|
||||
namespace ResourceDownload {
|
||||
|
||||
ResourcePage::ResourcePage(ResourceDownloadDialog* parent, BaseInstance& base_instance)
|
||||
: QWidget(parent), m_base_instance(base_instance), m_ui(new Ui::ResourcePage), m_parent_dialog(parent), m_fetch_progress(this, false)
|
||||
: QWidget(parent), m_baseInstance(base_instance), m_ui(new Ui::ResourcePage), m_parentDialog(parent), m_fetchProgress(this, false)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@ -64,18 +64,18 @@ ResourcePage::ResourcePage(ResourceDownloadDialog* parent, BaseInstance& base_in
|
||||
m_ui->versionSelectionBox->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
m_ui->versionSelectionBox->view()->parentWidget()->setMaximumHeight(300);
|
||||
|
||||
m_search_timer.setTimerType(Qt::TimerType::CoarseTimer);
|
||||
m_search_timer.setSingleShot(true);
|
||||
m_searchTimer.setTimerType(Qt::TimerType::CoarseTimer);
|
||||
m_searchTimer.setSingleShot(true);
|
||||
|
||||
connect(&m_search_timer, &QTimer::timeout, this, &ResourcePage::triggerSearch);
|
||||
connect(&m_searchTimer, &QTimer::timeout, this, &ResourcePage::triggerSearch);
|
||||
|
||||
// hide progress bar to prevent weird artifact
|
||||
m_fetch_progress.hide();
|
||||
m_fetch_progress.hideIfInactive(true);
|
||||
m_fetch_progress.setFixedHeight(24);
|
||||
m_fetch_progress.progressFormat("");
|
||||
m_fetchProgress.hide();
|
||||
m_fetchProgress.hideIfInactive(true);
|
||||
m_fetchProgress.setFixedHeight(24);
|
||||
m_fetchProgress.progressFormat("");
|
||||
|
||||
m_ui->verticalLayout->insertWidget(1, &m_fetch_progress);
|
||||
m_ui->verticalLayout->insertWidget(1, &m_fetchProgress);
|
||||
|
||||
m_ui->packView->setItemDelegate(new ProjectItemDelegate(this));
|
||||
m_ui->packView->installEventFilter(this);
|
||||
@ -121,10 +121,10 @@ auto ResourcePage::eventFilter(QObject* watched, QEvent* event) -> bool
|
||||
keyEvent->accept();
|
||||
return true;
|
||||
} else {
|
||||
if (m_search_timer.isActive())
|
||||
m_search_timer.stop();
|
||||
if (m_searchTimer.isActive())
|
||||
m_searchTimer.stop();
|
||||
|
||||
m_search_timer.start(350);
|
||||
m_searchTimer.start(350);
|
||||
}
|
||||
} else if (watched == m_ui->packView) {
|
||||
if (keyEvent->key() == Qt::Key_Return) {
|
||||
@ -248,7 +248,7 @@ void ResourcePage::updateUi()
|
||||
|
||||
void ResourcePage::updateSelectionButton()
|
||||
{
|
||||
if (!isOpened || m_selected_version_index < 0) {
|
||||
if (!isOpened || m_selectedVersionIndex < 0) {
|
||||
m_ui->resourceSelectionButton->setEnabled(false);
|
||||
return;
|
||||
}
|
||||
@ -258,7 +258,7 @@ void ResourcePage::updateSelectionButton()
|
||||
if (current_pack->versionsLoaded && current_pack->versions.empty()) {
|
||||
m_ui->resourceSelectionButton->setEnabled(false);
|
||||
qWarning() << tr("No version available for the selected pack");
|
||||
} else if (!current_pack->isVersionSelected(m_selected_version_index))
|
||||
} else if (!current_pack->isVersionSelected(m_selectedVersionIndex))
|
||||
m_ui->resourceSelectionButton->setText(tr("Select %1 for download").arg(resourceString()));
|
||||
else
|
||||
m_ui->resourceSelectionButton->setText(tr("Deselect %1 for download").arg(resourceString()));
|
||||
@ -327,18 +327,18 @@ void ResourcePage::onSelectionChanged(QModelIndex curr, [[maybe_unused]] QModelI
|
||||
|
||||
void ResourcePage::onVersionSelectionChanged(int)
|
||||
{
|
||||
m_selected_version_index = m_ui->versionSelectionBox->currentData().toInt();
|
||||
m_selectedVersionIndex = m_ui->versionSelectionBox->currentData().toInt();
|
||||
updateSelectionButton();
|
||||
}
|
||||
|
||||
void ResourcePage::addResourceToDialog(ModPlatform::IndexedPack::Ptr pack, ModPlatform::IndexedVersion& version)
|
||||
{
|
||||
m_parent_dialog->addResource(pack, version);
|
||||
m_parentDialog->addResource(pack, version);
|
||||
}
|
||||
|
||||
void ResourcePage::removeResourceFromDialog(const QString& pack_name)
|
||||
{
|
||||
m_parent_dialog->removeResource(pack_name);
|
||||
m_parentDialog->removeResource(pack_name);
|
||||
}
|
||||
|
||||
void ResourcePage::addResourceToPage(ModPlatform::IndexedPack::Ptr pack,
|
||||
@ -355,14 +355,14 @@ void ResourcePage::removeResourceFromPage(const QString& name)
|
||||
|
||||
void ResourcePage::onResourceSelected()
|
||||
{
|
||||
if (m_selected_version_index < 0)
|
||||
if (m_selectedVersionIndex < 0)
|
||||
return;
|
||||
|
||||
auto current_pack = getCurrentPack();
|
||||
if (!current_pack || !current_pack->versionsLoaded || current_pack->versions.size() < m_selected_version_index)
|
||||
if (!current_pack || !current_pack->versionsLoaded || current_pack->versions.size() < m_selectedVersionIndex)
|
||||
return;
|
||||
|
||||
auto& version = current_pack->versions[m_selected_version_index];
|
||||
auto& version = current_pack->versions[m_selectedVersionIndex];
|
||||
if (version.downloadUrl.isNull()) {
|
||||
CustomMessageBox::selectable(this, tr("How?"),
|
||||
"You managed to select a resource that doesn't have a download link. Because of this missing "
|
||||
@ -409,14 +409,14 @@ void ResourcePage::openUrl(const QUrl& url)
|
||||
}
|
||||
}
|
||||
|
||||
if (!page.isNull() && !m_do_not_jump_to_mod) {
|
||||
if (!page.isNull() && !m_doNotJumpToMod) {
|
||||
const QString slug = match.captured(1);
|
||||
|
||||
// ensure the user isn't opening the same mod
|
||||
if (auto current_pack = getCurrentPack(); current_pack && slug != current_pack->slug) {
|
||||
m_parent_dialog->selectPage(page);
|
||||
m_parentDialog->selectPage(page);
|
||||
|
||||
auto newPage = m_parent_dialog->selectedPage();
|
||||
auto newPage = m_parentDialog->selectedPage();
|
||||
|
||||
QLineEdit* searchEdit = newPage->m_ui->searchEdit;
|
||||
auto model = newPage->m_model;
|
||||
@ -460,7 +460,7 @@ void ResourcePage::openProject(QVariant projectID)
|
||||
m_ui->resourceFilterButton->hide();
|
||||
m_ui->packView->hide();
|
||||
m_ui->resourceSelectionButton->hide();
|
||||
m_do_not_jump_to_mod = true;
|
||||
m_doNotJumpToMod = true;
|
||||
|
||||
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
|
||||
|
||||
@ -477,10 +477,10 @@ void ResourcePage::openProject(QVariant projectID)
|
||||
|
||||
connect(okBtn, &QPushButton::clicked, this, [this] {
|
||||
onResourceSelected();
|
||||
m_parent_dialog->accept();
|
||||
m_parentDialog->accept();
|
||||
});
|
||||
|
||||
connect(cancelBtn, &QPushButton::clicked, m_parent_dialog, &ResourceDownloadDialog::reject);
|
||||
connect(cancelBtn, &QPushButton::clicked, m_parentDialog, &ResourceDownloadDialog::reject);
|
||||
m_ui->gridLayout_4->addWidget(buttonBox, 1, 2);
|
||||
|
||||
auto jump = [this, okBtn] {
|
||||
|
Reference in New Issue
Block a user