Add the missing handling when user selects a different machine

So far, the case that a user selects a different machine, was not handled
yet.

refs #881
This commit is contained in:
Roland Winklmeier
2017-03-05 14:08:45 +01:00
committed by Mathew Sutcliffe
parent 3a2618fadb
commit 9749bb5d31
2 changed files with 10 additions and 0 deletions

View File

@@ -100,6 +100,7 @@ namespace BlackGui
connect(m_inputManager, &BlackCore::CInputManager::combinationSelectionChanged, this, &CHotkeyDialog::ps_combinationSelectionChanged);
connect(m_inputManager, &BlackCore::CInputManager::combinationSelectionFinished, this, &CHotkeyDialog::ps_combinationSelectionFinished);
connect(ui->tv_Actions->selectionModel(), &QItemSelectionModel::selectionChanged, this, &CHotkeyDialog::ps_changeSelectedAction);
connect(ui->cb_Identifier, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &CHotkeyDialog::changeApplicableMachine);
initStyleSheet();
}
@@ -169,6 +170,14 @@ namespace BlackGui
m_actionHotkey.setAction(index.data(Models::CActionModel::ActionRole).toString());
}
void CHotkeyDialog::changeApplicableMachine(int index)
{
Q_UNUSED(index);
QVariant userData = ui->cb_Identifier->currentData(Qt::UserRole);
Q_ASSERT(userData.canConvert<CIdentifier>());
m_actionHotkey.setApplicableMachine(userData.value<CIdentifier>());
}
void CHotkeyDialog::ps_accept()
{
if (m_actionHotkey.getApplicableMachine().getMachineName().isEmpty())