mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-02-20 07:13:49 -07:00
Notify mapping window when changes occurs
Co-Authored-By: iTrooz <hey@itrooz.fr> Co-Authored-By: Max Chateau <maxban.chateau@gmail.com> Co-Authored-By: Damien R. <rodriguezdamien1677@gmail.com>
This commit is contained in:
parent
2a7dd35706
commit
ac4eaec777
@ -770,6 +770,9 @@ void IOWindow::UpdateExpression(std::string new_expression, UpdateMode mode)
|
||||
const auto status = m_reference->GetParseStatus();
|
||||
m_controller->UpdateSingleControlReference(g_controller_interface, m_reference);
|
||||
|
||||
// Emit signal that this IOWindow's expression changed.
|
||||
emit ExpressionChanged(QString::fromStdString(m_reference->GetExpression()));
|
||||
|
||||
// This is the only place where we need to update the user variables. Keep the first 4 items.
|
||||
while (m_variables_combo->count() > 4)
|
||||
{
|
||||
|
||||
@ -71,6 +71,7 @@ public:
|
||||
signals:
|
||||
void DetectInputComplete();
|
||||
void TestOutputComplete();
|
||||
void ExpressionChanged(const QString& expression);
|
||||
|
||||
private:
|
||||
std::shared_ptr<ciface::Core::Device> GetSelectedDevice() const;
|
||||
|
||||
@ -92,6 +92,12 @@ void MappingButton::AdvancedPressed()
|
||||
|
||||
IOWindow io(m_mapping_window, m_mapping_window->GetController(), m_reference,
|
||||
m_reference->IsInput() ? IOWindow::Type::Input : IOWindow::Type::Output);
|
||||
|
||||
// Connect to IOWindow's ExpressionChanged signal
|
||||
connect(&io, &IOWindow::ExpressionChanged, m_mapping_window, [this](const QString& expr) {
|
||||
m_mapping_window->ExpressionChanged(1);
|
||||
});
|
||||
|
||||
io.exec();
|
||||
|
||||
ConfigChanged();
|
||||
|
||||
@ -133,6 +133,7 @@ public:
|
||||
m_parent->GetController()->UpdateSingleControlReference(g_controller_interface,
|
||||
control_reference);
|
||||
m_parent->GetController()->GetConfig()->GenerateControllerTextures();
|
||||
m_parent->ExpressionChanged(0);
|
||||
}
|
||||
|
||||
void UpdateInputDetectionStartTimer()
|
||||
|
||||
@ -616,3 +616,8 @@ void MappingWindow::ActivateExtensionTab()
|
||||
{
|
||||
m_tab_widget->setCurrentIndex(3);
|
||||
}
|
||||
|
||||
void MappingWindow::ExpressionChanged(int source)
|
||||
{
|
||||
printf("ExpressionChanged(%d)\n", source);
|
||||
}
|
||||
@ -56,6 +56,7 @@ public:
|
||||
bool IsIterativeMappingEnabled() const;
|
||||
void ShowExtensionMotionTabs(bool show);
|
||||
void ActivateExtensionTab();
|
||||
void ExpressionChanged(int source);
|
||||
|
||||
signals:
|
||||
// Emitted when config has changed so widgets can update to reflect the change.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user