Qt: Use proper signals

This commit is contained in:
spycrab 2018-05-12 23:54:35 +02:00
parent 79533ef789
commit 6c09ce3d95
5 changed files with 22 additions and 22 deletions

View File

@ -21,10 +21,11 @@
AdvancedPane::AdvancedPane(QWidget* parent) : QWidget(parent) AdvancedPane::AdvancedPane(QWidget* parent) : QWidget(parent)
{ {
CreateLayout(); CreateLayout();
Update();
ConnectLayout(); ConnectLayout();
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, &AdvancedPane::Update); connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, &AdvancedPane::Update);
Update();
} }
void AdvancedPane::CreateLayout() void AdvancedPane::CreateLayout()

View File

@ -112,9 +112,6 @@ void AudioPane::CreateWidgets()
m_main_layout = new QGridLayout; m_main_layout = new QGridLayout;
m_main_layout->setRowStretch(0, 0);
m_main_layout->setRowStretch(0, 0);
m_main_layout->setRowStretch(0, 0); m_main_layout->setRowStretch(0, 0);
dsp_box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); dsp_box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

View File

@ -171,22 +171,24 @@ void InterfacePane::CreateInGame()
void InterfacePane::ConnectLayout() void InterfacePane::ConnectLayout()
{ {
connect(m_checkbox_top_window, &QCheckBox::clicked, this, &InterfacePane::OnSaveConfig); connect(m_checkbox_top_window, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_use_builtin_title_database, &QCheckBox::clicked, this, connect(m_checkbox_use_builtin_title_database, &QCheckBox::toggled, this,
&InterfacePane::OnSaveConfig); &InterfacePane::OnSaveConfig);
connect(m_checkbox_show_debugging_ui, &QCheckBox::clicked, this, &InterfacePane::OnSaveConfig); connect(m_checkbox_show_debugging_ui, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_combobox_theme, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::activated), connect(m_combobox_theme,
static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged),
&Settings::Instance(), &Settings::SetThemeName); &Settings::Instance(), &Settings::SetThemeName);
connect(m_combobox_userstyle, connect(m_combobox_userstyle,
static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged), this, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged), this,
&InterfacePane::OnSaveConfig); &InterfacePane::OnSaveConfig);
connect(m_combobox_language, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, connect(m_combobox_language,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&InterfacePane::OnSaveConfig); &InterfacePane::OnSaveConfig);
connect(m_checkbox_confirm_on_stop, &QCheckBox::clicked, this, &InterfacePane::OnSaveConfig); connect(m_checkbox_confirm_on_stop, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_use_panic_handlers, &QCheckBox::clicked, this, &InterfacePane::OnSaveConfig); connect(m_checkbox_use_panic_handlers, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_enable_osd, &QCheckBox::clicked, this, &InterfacePane::OnSaveConfig); connect(m_checkbox_enable_osd, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_pause_on_focus_lost, &QCheckBox::clicked, this, &InterfacePane::OnSaveConfig); connect(m_checkbox_pause_on_focus_lost, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_hide_mouse, &QCheckBox::clicked, &Settings::Instance(), connect(m_checkbox_hide_mouse, &QCheckBox::toggled, &Settings::Instance(),
&Settings::SetHideCursor); &Settings::SetHideCursor);
connect(m_checkbox_use_userstyle, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig); connect(m_checkbox_use_userstyle, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig);
} }

View File

@ -147,8 +147,8 @@ QGroupBox* PathPane::MakeGameFolderBox()
Settings::Instance().ReloadPath(path); Settings::Instance().ReloadPath(path);
}); });
connect(add, &QPushButton::clicked, this, &PathPane::Browse); connect(add, &QPushButton::pressed, this, &PathPane::Browse);
connect(m_remove_path, &QPushButton::clicked, this, &PathPane::RemovePath); connect(m_remove_path, &QPushButton::pressed, this, &PathPane::RemovePath);
game_box->setLayout(vlayout); game_box->setLayout(vlayout);
return game_box; return game_box;
@ -165,7 +165,7 @@ QGridLayout* PathPane::MakePathsLayout()
connect(&Settings::Instance(), &Settings::DefaultGameChanged, connect(&Settings::Instance(), &Settings::DefaultGameChanged,
[this](const QString& path) { m_game_edit->setText(path); }); [this](const QString& path) { m_game_edit->setText(path); });
QPushButton* game_open = new QPushButton(QStringLiteral("...")); QPushButton* game_open = new QPushButton(QStringLiteral("..."));
connect(game_open, &QPushButton::clicked, this, &PathPane::BrowseDefaultGame); connect(game_open, &QPushButton::pressed, this, &PathPane::BrowseDefaultGame);
layout->addWidget(new QLabel(tr("Default ISO:")), 0, 0); layout->addWidget(new QLabel(tr("Default ISO:")), 0, 0);
layout->addWidget(m_game_edit, 0, 1); layout->addWidget(m_game_edit, 0, 1);
layout->addWidget(game_open, 0, 2); layout->addWidget(game_open, 0, 2);
@ -173,7 +173,7 @@ QGridLayout* PathPane::MakePathsLayout()
m_nand_edit = new QLineEdit(QString::fromStdString(SConfig::GetInstance().m_NANDPath)); m_nand_edit = new QLineEdit(QString::fromStdString(SConfig::GetInstance().m_NANDPath));
connect(m_nand_edit, &QLineEdit::editingFinished, this, &PathPane::OnNANDPathChanged); connect(m_nand_edit, &QLineEdit::editingFinished, this, &PathPane::OnNANDPathChanged);
QPushButton* nand_open = new QPushButton(QStringLiteral("...")); QPushButton* nand_open = new QPushButton(QStringLiteral("..."));
connect(nand_open, &QPushButton::clicked, this, &PathPane::BrowseWiiNAND); connect(nand_open, &QPushButton::pressed, this, &PathPane::BrowseWiiNAND);
layout->addWidget(new QLabel(tr("Wii NAND Root:")), 1, 0); layout->addWidget(new QLabel(tr("Wii NAND Root:")), 1, 0);
layout->addWidget(m_nand_edit, 1, 1); layout->addWidget(m_nand_edit, 1, 1);
layout->addWidget(nand_open, 1, 2); layout->addWidget(nand_open, 1, 2);
@ -182,7 +182,7 @@ QGridLayout* PathPane::MakePathsLayout()
connect(m_dump_edit, &QLineEdit::editingFinished, connect(m_dump_edit, &QLineEdit::editingFinished,
[=] { SConfig::GetInstance().m_DumpPath = m_dump_edit->text().toStdString(); }); [=] { SConfig::GetInstance().m_DumpPath = m_dump_edit->text().toStdString(); });
QPushButton* dump_open = new QPushButton(QStringLiteral("...")); QPushButton* dump_open = new QPushButton(QStringLiteral("..."));
connect(dump_open, &QPushButton::clicked, this, &PathPane::BrowseDump); connect(dump_open, &QPushButton::pressed, this, &PathPane::BrowseDump);
layout->addWidget(new QLabel(tr("Dump Path:")), 2, 0); layout->addWidget(new QLabel(tr("Dump Path:")), 2, 0);
layout->addWidget(m_dump_edit, 2, 1); layout->addWidget(m_dump_edit, 2, 1);
layout->addWidget(dump_open, 2, 2); layout->addWidget(dump_open, 2, 2);
@ -190,7 +190,7 @@ QGridLayout* PathPane::MakePathsLayout()
m_sdcard_edit = new QLineEdit(QString::fromStdString(SConfig::GetInstance().m_strWiiSDCardPath)); m_sdcard_edit = new QLineEdit(QString::fromStdString(SConfig::GetInstance().m_strWiiSDCardPath));
connect(m_sdcard_edit, &QLineEdit::editingFinished, this, &PathPane::OnSDCardPathChanged); connect(m_sdcard_edit, &QLineEdit::editingFinished, this, &PathPane::OnSDCardPathChanged);
QPushButton* sdcard_open = new QPushButton(QStringLiteral("...")); QPushButton* sdcard_open = new QPushButton(QStringLiteral("..."));
connect(sdcard_open, &QPushButton::clicked, this, &PathPane::BrowseSDCard); connect(sdcard_open, &QPushButton::pressed, this, &PathPane::BrowseSDCard);
layout->addWidget(new QLabel(tr("SD Card Path:")), 3, 0); layout->addWidget(new QLabel(tr("SD Card Path:")), 3, 0);
layout->addWidget(m_sdcard_edit, 3, 1); layout->addWidget(m_sdcard_edit, 3, 1);
layout->addWidget(sdcard_open, 3, 2); layout->addWidget(sdcard_open, 3, 2);

View File

@ -72,9 +72,9 @@ void WiiPane::ConnectLayout()
// Whitelisted USB Passthrough Devices // Whitelisted USB Passthrough Devices
connect(m_whitelist_usb_list, &QListWidget::itemClicked, this, &WiiPane::ValidateSelectionState); connect(m_whitelist_usb_list, &QListWidget::itemClicked, this, &WiiPane::ValidateSelectionState);
connect(m_whitelist_usb_add_button, &QPushButton::released, this, connect(m_whitelist_usb_add_button, &QPushButton::pressed, this,
&WiiPane::OnUSBWhitelistAddButton); &WiiPane::OnUSBWhitelistAddButton);
connect(m_whitelist_usb_remove_button, &QPushButton::released, this, connect(m_whitelist_usb_remove_button, &QPushButton::pressed, this,
&WiiPane::OnUSBWhitelistRemoveButton); &WiiPane::OnUSBWhitelistRemoveButton);
// Wii Remote Settings // Wii Remote Settings