mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Ref T211, hotkey dialog fixes
* add identifier of current hotkey if any * utility function getAllIdentifiers * setWindowFlags to hide "?"
This commit is contained in:
@@ -69,6 +69,7 @@ namespace BlackGui
|
||||
m_actionHotkey(actionHotkey),
|
||||
m_actionModel(this)
|
||||
{
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
m_inputManager = BlackCore::CInputManager::instance();
|
||||
|
||||
ui->setupUi(this);
|
||||
@@ -80,15 +81,22 @@ namespace BlackGui
|
||||
|
||||
if (!actionHotkey.getCombination().isEmpty()) { ui->pb_SelectedHotkey->setText(actionHotkey.getCombination().toQString()); }
|
||||
|
||||
CIdentifierList machineIdentifiers(identifiers);
|
||||
if (actionHotkey.isValid()) { machineIdentifiers.push_back(actionHotkey.getApplicableMachine()); }
|
||||
int index = -1;
|
||||
const CIdentifierList machinesUnique = applications.getMachinesUnique();
|
||||
for (const auto &app : machinesUnique)
|
||||
const CIdentifierList machineIdentifiersUnique = machineIdentifiers.getMachinesUnique();
|
||||
for (const auto &app : machineIdentifiersUnique)
|
||||
{
|
||||
ui->cb_Identifier->addItem(app.getMachineName(), QVariant::fromValue(app));
|
||||
if (m_actionHotkey.getApplicableMachine().isFromSameMachine(app)) { index = ui->cb_Identifier->count() - 1; }
|
||||
}
|
||||
|
||||
if (index != ui->cb_Identifier->currentIndex())
|
||||
if (index < 0 && ui->cb_Identifier->count() > 0)
|
||||
{
|
||||
// if nothing was found
|
||||
ui->cb_Identifier->setCurrentIndex(0);
|
||||
}
|
||||
else if (index != ui->cb_Identifier->currentIndex())
|
||||
{
|
||||
ui->cb_Identifier->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user