mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
Ref T218, only report conflicts for same machine
This commit is contained in:
@@ -134,17 +134,19 @@ namespace BlackGui
|
|||||||
|
|
||||||
bool CSettingsHotkeyComponent::checkAndConfirmConflicts(const CActionHotkey &actionHotkey, const CActionHotkeyList &ignore)
|
bool CSettingsHotkeyComponent::checkAndConfirmConflicts(const CActionHotkey &actionHotkey, const CActionHotkeyList &ignore)
|
||||||
{
|
{
|
||||||
const auto configuredHotkeys = m_actionHotkeys.getThreadLocal();
|
// check the hotkeys of the same machine only
|
||||||
CActionHotkeyList conflicts = configuredHotkeys.findSupersetsOf(actionHotkey);
|
// and avoid duplicates (replace or add)
|
||||||
conflicts.push_back(configuredHotkeys.findSubsetsOf(actionHotkey));
|
const CActionHotkeyList configuredHotkeysSameMachine = m_actionHotkeys.getThreadLocal().findBySameMachine(actionHotkey);
|
||||||
conflicts.removeIfIn(ignore);
|
CActionHotkeyList conflicts = configuredHotkeysSameMachine.findSupersetsOf(actionHotkey);
|
||||||
|
conflicts.replaceOrAdd(configuredHotkeysSameMachine.findSubsetsOf(actionHotkey));
|
||||||
|
conflicts.removeIfIn(ignore.findBySameMachine(actionHotkey));
|
||||||
|
|
||||||
if (!conflicts.isEmpty())
|
if (!conflicts.isEmpty())
|
||||||
{
|
{
|
||||||
QString message = QString("The selected combination conflicts with the following %1 combinations(s):\n\n").arg(conflicts.size());
|
QString message = QString("The selected combination conflicts with the following %1 combination(s):\n\n").arg(conflicts.size());
|
||||||
for (const auto &conflict : conflicts)
|
for (const CActionHotkey &conflict : conflicts)
|
||||||
{
|
{
|
||||||
message += conflict.getCombination().toQString();
|
message += conflict.toQString();
|
||||||
message += "\n";
|
message += "\n";
|
||||||
}
|
}
|
||||||
message += "\n Do you want to use it anway?";
|
message += "\n Do you want to use it anway?";
|
||||||
|
|||||||
Reference in New Issue
Block a user