mirror of
https://github.com/stenzek/duckstation.git
synced 2026-02-04 05:04:33 +00:00
Qt: Remove a bunch of unnecessary QSignalBlockers
QAction::setChecked() does not invoke triggered().
This commit is contained in:
@@ -247,15 +247,11 @@ void AchievementSettingsWidget::onLoginCompleted()
|
||||
// Login can enable achievements/hardcore.
|
||||
if (!m_ui.enable->isChecked() && Host::GetBaseBoolSettingValue("Cheevos", "Enabled", false))
|
||||
{
|
||||
QSignalBlocker sb(m_ui.enable);
|
||||
m_ui.enable->setChecked(true);
|
||||
updateEnableState();
|
||||
}
|
||||
if (!m_ui.hardcoreMode->isChecked() && Host::GetBaseBoolSettingValue("Cheevos", "ChallengeMode", false))
|
||||
{
|
||||
QSignalBlocker sb(m_ui.hardcoreMode);
|
||||
m_ui.hardcoreMode->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
void AchievementSettingsWidget::onViewProfilePressed()
|
||||
|
||||
@@ -51,21 +51,14 @@ void DebuggerWindow::onSystemPaused()
|
||||
setUIEnabled(true, true);
|
||||
refreshAll();
|
||||
|
||||
{
|
||||
QSignalBlocker sb(m_ui.actionPause);
|
||||
m_ui.actionPause->setChecked(true);
|
||||
}
|
||||
m_ui.actionPause->setChecked(true);
|
||||
}
|
||||
|
||||
void DebuggerWindow::onSystemResumed()
|
||||
{
|
||||
setUIEnabled(false, true);
|
||||
m_ui.codeView->invalidatePC();
|
||||
|
||||
{
|
||||
QSignalBlocker sb(m_ui.actionPause);
|
||||
m_ui.actionPause->setChecked(false);
|
||||
}
|
||||
m_ui.actionPause->setChecked(false);
|
||||
}
|
||||
|
||||
void DebuggerWindow::onDebuggerMessageReported(const QString& message)
|
||||
@@ -589,19 +582,10 @@ void DebuggerWindow::setMemoryViewRegion(Bus::MemoryRegion region)
|
||||
((region == Bus::MemoryRegion::RAM) ? static_cast<MemoryViewWidget::EditCallback>(edit_ram_callback) : nullptr);
|
||||
m_ui.memoryView->setData(start, mem_ptr, end - start, mem_writable, edit_callback);
|
||||
|
||||
#define SET_REGION_RADIO_BUTTON(name, rb_region) \
|
||||
do \
|
||||
{ \
|
||||
QSignalBlocker sb(name); \
|
||||
name->setChecked(region == rb_region); \
|
||||
} while (0)
|
||||
|
||||
SET_REGION_RADIO_BUTTON(m_ui.memoryRegionRAM, Bus::MemoryRegion::RAM);
|
||||
SET_REGION_RADIO_BUTTON(m_ui.memoryRegionEXP1, Bus::MemoryRegion::EXP1);
|
||||
SET_REGION_RADIO_BUTTON(m_ui.memoryRegionScratchpad, Bus::MemoryRegion::Scratchpad);
|
||||
SET_REGION_RADIO_BUTTON(m_ui.memoryRegionBIOS, Bus::MemoryRegion::BIOS);
|
||||
|
||||
#undef SET_REGION_REGION_BUTTON
|
||||
m_ui.memoryRegionRAM->setChecked(region == Bus::MemoryRegion::RAM);
|
||||
m_ui.memoryRegionEXP1->setChecked(region == Bus::MemoryRegion::EXP1);
|
||||
m_ui.memoryRegionScratchpad->setChecked(region == Bus::MemoryRegion::Scratchpad);
|
||||
m_ui.memoryRegionBIOS->setChecked(region == Bus::MemoryRegion::BIOS);
|
||||
|
||||
m_ui.memoryView->repaint();
|
||||
}
|
||||
|
||||
@@ -569,12 +569,7 @@ void MainWindow::onSystemStarted()
|
||||
|
||||
void MainWindow::onSystemPaused()
|
||||
{
|
||||
// update UI
|
||||
{
|
||||
QSignalBlocker sb(m_ui.actionPause);
|
||||
m_ui.actionPause->setChecked(true);
|
||||
}
|
||||
|
||||
m_ui.actionPause->setChecked(true);
|
||||
s_system_paused = true;
|
||||
updateStatusBarWidgetVisibility();
|
||||
m_ui.statusBar->showMessage(tr("Paused"));
|
||||
@@ -583,12 +578,7 @@ void MainWindow::onSystemPaused()
|
||||
|
||||
void MainWindow::onSystemResumed()
|
||||
{
|
||||
// update UI
|
||||
{
|
||||
QSignalBlocker sb(m_ui.actionPause);
|
||||
m_ui.actionPause->setChecked(false);
|
||||
}
|
||||
|
||||
m_ui.actionPause->setChecked(false);
|
||||
s_system_paused = false;
|
||||
m_was_disc_change_request = false;
|
||||
m_ui.statusBar->clearMessage();
|
||||
@@ -600,12 +590,7 @@ void MainWindow::onSystemResumed()
|
||||
|
||||
void MainWindow::onSystemStopping()
|
||||
{
|
||||
// update UI
|
||||
{
|
||||
QSignalBlocker sb(m_ui.actionPause);
|
||||
m_ui.actionPause->setChecked(false);
|
||||
}
|
||||
|
||||
m_ui.actionPause->setChecked(false);
|
||||
s_system_starting = false;
|
||||
s_system_valid = false;
|
||||
s_system_paused = false;
|
||||
@@ -654,13 +639,11 @@ void MainWindow::onSystemUndoStateAvailabilityChanged(bool available, quint64 ti
|
||||
|
||||
void MainWindow::onMediaCaptureStarted()
|
||||
{
|
||||
QSignalBlocker sb(m_ui.actionMediaCapture);
|
||||
m_ui.actionMediaCapture->setChecked(true);
|
||||
}
|
||||
|
||||
void MainWindow::onMediaCaptureStopped()
|
||||
{
|
||||
QSignalBlocker sb(m_ui.actionMediaCapture);
|
||||
m_ui.actionMediaCapture->setChecked(false);
|
||||
}
|
||||
|
||||
@@ -1405,7 +1388,6 @@ void MainWindow::onPauseActionToggled(bool checked)
|
||||
{
|
||||
// Restore action state.
|
||||
Host::RunOnUIThread([]() {
|
||||
QSignalBlocker sb(g_main_window->m_ui.actionPause);
|
||||
g_main_window->m_ui.actionPause->setChecked(false);
|
||||
});
|
||||
}
|
||||
@@ -1442,7 +1424,6 @@ void MainWindow::onViewToolbarLockActionToggled(bool checked)
|
||||
m_ui.toolBar->setMovable(!checked);
|
||||
|
||||
// ensure synced
|
||||
const QSignalBlocker sb(m_ui.actionViewLockToolbar);
|
||||
m_ui.actionViewLockToolbar->setChecked(checked);
|
||||
}
|
||||
|
||||
@@ -1453,7 +1434,6 @@ void MainWindow::onViewToolbarSmallIconsActionToggled(bool checked)
|
||||
updateToolbarIconStyle();
|
||||
|
||||
// ensure synced
|
||||
const QSignalBlocker sb(m_ui.actionViewSmallToolbarIcons);
|
||||
m_ui.actionViewSmallToolbarIcons->setChecked(checked);
|
||||
}
|
||||
|
||||
@@ -1464,7 +1444,6 @@ void MainWindow::onViewToolbarLabelsActionToggled(bool checked)
|
||||
updateToolbarIconStyle();
|
||||
|
||||
// ensure synced
|
||||
const QSignalBlocker sb(m_ui.actionViewToolbarLabels);
|
||||
m_ui.actionViewToolbarLabels->setChecked(checked);
|
||||
}
|
||||
|
||||
@@ -1475,7 +1454,6 @@ void MainWindow::onViewToolbarLabelsBesideIconsActionToggled(bool checked)
|
||||
updateToolbarIconStyle();
|
||||
|
||||
// ensure synced
|
||||
const QSignalBlocker sb(m_ui.actionViewToolbarLabelsBesideIcons);
|
||||
m_ui.actionViewToolbarLabelsBesideIcons->setChecked(checked);
|
||||
}
|
||||
|
||||
@@ -1942,10 +1920,7 @@ void MainWindow::onGameListSortIndicatorOrderChanged(int column, Qt::SortOrder o
|
||||
activate = (action->data() == column);
|
||||
|
||||
if (activate)
|
||||
{
|
||||
const QSignalBlocker sb(m_ui.menuSortBy);
|
||||
action->setChecked(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3314,8 +3289,6 @@ void MainWindow::onToolsMediaCaptureToggled(bool checked)
|
||||
path = QDir::toNativeSeparators(QFileDialog::getSaveFileName(this, tr("Media Capture"), path, filter));
|
||||
if (path.isEmpty())
|
||||
{
|
||||
// uncheck it again
|
||||
QSignalBlocker sb(m_ui.actionMediaCapture);
|
||||
m_ui.actionMediaCapture->setChecked(false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -636,15 +636,11 @@ void SetupWizardDialog::onAchievementsLoginCompleted()
|
||||
// Login can enable achievements/hardcore.
|
||||
if (!m_ui.enable->isChecked() && Host::GetBaseBoolSettingValue("Cheevos", "Enabled", false))
|
||||
{
|
||||
QSignalBlocker sb(m_ui.enable);
|
||||
m_ui.enable->setChecked(true);
|
||||
updateAchievementsLoginState();
|
||||
}
|
||||
if (!m_ui.hardcoreMode->isChecked() && Host::GetBaseBoolSettingValue("Cheevos", "ChallengeMode", false))
|
||||
{
|
||||
QSignalBlocker sb(m_ui.hardcoreMode);
|
||||
m_ui.hardcoreMode->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
void SetupWizardDialog::onAchievementsViewProfileClicked()
|
||||
|
||||
Reference in New Issue
Block a user