Connect numerous QPushButtons to use clicked signal instead of pressed. This unifies UI behaviour more.

This commit is contained in:
Silent
2019-07-24 00:18:58 +02:00
parent 29ba53f6c3
commit 3529dfd691
23 changed files with 70 additions and 70 deletions

View File

@ -80,9 +80,9 @@ void ARCodeWidget::ConnectWidgets()
connect(m_code_list, &QListWidget::customContextMenuRequested, this,
&ARCodeWidget::OnContextMenuRequested);
connect(m_code_add, &QPushButton::pressed, this, &ARCodeWidget::OnCodeAddPressed);
connect(m_code_edit, &QPushButton::pressed, this, &ARCodeWidget::OnCodeEditPressed);
connect(m_code_remove, &QPushButton::pressed, this, &ARCodeWidget::OnCodeRemovePressed);
connect(m_code_add, &QPushButton::clicked, this, &ARCodeWidget::OnCodeAddClicked);
connect(m_code_edit, &QPushButton::clicked, this, &ARCodeWidget::OnCodeEditClicked);
connect(m_code_remove, &QPushButton::clicked, this, &ARCodeWidget::OnCodeRemoveClicked);
}
void ARCodeWidget::OnItemChanged(QListWidgetItem* item)
@ -183,7 +183,7 @@ void ARCodeWidget::AddCode(ActionReplay::ARCode code)
SaveCodes();
}
void ARCodeWidget::OnCodeAddPressed()
void ARCodeWidget::OnCodeAddClicked()
{
ActionReplay::ARCode ar;
ar.active = true;
@ -201,7 +201,7 @@ void ARCodeWidget::OnCodeAddPressed()
}
}
void ARCodeWidget::OnCodeEditPressed()
void ARCodeWidget::OnCodeEditClicked()
{
auto items = m_code_list->selectedItems();
@ -228,7 +228,7 @@ void ARCodeWidget::OnCodeEditPressed()
UpdateList();
}
void ARCodeWidget::OnCodeRemovePressed()
void ARCodeWidget::OnCodeRemoveClicked()
{
auto items = m_code_list->selectedItems();

View File

@ -45,9 +45,9 @@ private:
void SaveCodes();
void SortAlphabetically();
void OnCodeAddPressed();
void OnCodeEditPressed();
void OnCodeRemovePressed();
void OnCodeAddClicked();
void OnCodeEditClicked();
void OnCodeRemoveClicked();
void OnListReordered();

View File

@ -80,6 +80,6 @@ void CheatWarningWidget::Update(bool running)
void CheatWarningWidget::ConnectWidgets()
{
connect(m_config_button, &QPushButton::pressed, this,
connect(m_config_button, &QPushButton::clicked, this,
&CheatWarningWidget::OpenCheatEnableSettings);
}

View File

@ -204,7 +204,7 @@ void GameConfigWidget::CreateWidgets()
void GameConfigWidget::ConnectWidgets()
{
// Buttons
connect(m_refresh_config, &QPushButton::pressed, this, &GameConfigWidget::LoadSettings);
connect(m_refresh_config, &QPushButton::clicked, this, &GameConfigWidget::LoadSettings);
for (QCheckBox* box : {m_enable_dual_core, m_enable_mmu, m_enable_fprf, m_sync_gpu,
m_enable_fast_disc, m_use_dsp_hle, m_use_monoscopic_shadows})

View File

@ -125,10 +125,10 @@ void GeckoCodeWidget::ConnectWidgets()
connect(m_code_list, &QListWidget::customContextMenuRequested, this,
&GeckoCodeWidget::OnContextMenuRequested);
connect(m_add_code, &QPushButton::pressed, this, &GeckoCodeWidget::AddCode);
connect(m_remove_code, &QPushButton::pressed, this, &GeckoCodeWidget::RemoveCode);
connect(m_edit_code, &QPushButton::pressed, this, &GeckoCodeWidget::EditCode);
connect(m_download_codes, &QPushButton::pressed, this, &GeckoCodeWidget::DownloadCodes);
connect(m_add_code, &QPushButton::clicked, this, &GeckoCodeWidget::AddCode);
connect(m_remove_code, &QPushButton::clicked, this, &GeckoCodeWidget::RemoveCode);
connect(m_edit_code, &QPushButton::clicked, this, &GeckoCodeWidget::EditCode);
connect(m_download_codes, &QPushButton::clicked, this, &GeckoCodeWidget::DownloadCodes);
connect(m_warning, &CheatWarningWidget::OpenCheatEnableSettings, this,
&GeckoCodeWidget::OpenGeneralSettings);
}

View File

@ -145,7 +145,7 @@ void EnhancementsWidget::ConnectWidgets()
SaveSettings();
});
connect(m_configure_pp_effect, &QPushButton::pressed, this,
connect(m_configure_pp_effect, &QPushButton::clicked, this,
&EnhancementsWidget::ConfigurePostProcessingShader);
}

View File

@ -71,7 +71,7 @@ void NewPatchDialog::ConnectWidgets()
connect(m_name_edit, static_cast<void (QLineEdit::*)(const QString&)>(&QLineEdit::textEdited),
[this](const QString& name) { m_patch.name = name.toStdString(); });
connect(m_add_button, &QPushButton::pressed, this, &NewPatchDialog::AddEntry);
connect(m_add_button, &QPushButton::clicked, this, &NewPatchDialog::AddEntry);
connect(m_button_box, &QDialogButtonBox::accepted, this, &NewPatchDialog::accept);
connect(m_button_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
@ -164,7 +164,7 @@ QGroupBox* NewPatchDialog::CreateEntry(PatchEngine::PatchEntry& entry)
value->setPalette(palette);
});
connect(remove, &QPushButton::pressed, [this, box, entry] {
connect(remove, &QPushButton::clicked, [this, box, entry] {
if (m_patch.entries.size() > 1)
{
box->setVisible(false);

View File

@ -58,9 +58,9 @@ void PatchesWidget::ConnectWidgets()
{
connect(m_list, &QListWidget::itemSelectionChanged, this, &PatchesWidget::UpdateActions);
connect(m_list, &QListWidget::itemChanged, this, &PatchesWidget::OnItemChanged);
connect(m_remove_button, &QPushButton::pressed, this, &PatchesWidget::OnRemove);
connect(m_add_button, &QPushButton::pressed, this, &PatchesWidget::OnAdd);
connect(m_edit_button, &QPushButton::pressed, this, &PatchesWidget::OnEdit);
connect(m_remove_button, &QPushButton::clicked, this, &PatchesWidget::OnRemove);
connect(m_add_button, &QPushButton::clicked, this, &PatchesWidget::OnAdd);
connect(m_edit_button, &QPushButton::clicked, this, &PatchesWidget::OnEdit);
}
void PatchesWidget::OnItemChanged(QListWidgetItem* item)