mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 18:25:37 +08:00
refs #912, formatting, typos, const
This commit is contained in:
committed by
Mathew Sutcliffe
parent
ea50533755
commit
422e6626c8
@@ -14,7 +14,6 @@
|
||||
#include "blackmisc/icons.h"
|
||||
#include "blackmisc/identifier.h"
|
||||
#include "blackmisc/input/hotkeycombination.h"
|
||||
#include "blackmisc/input/keyboardkey.h"
|
||||
#include "blackmisc/input/keyboardkeylist.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
@@ -80,8 +79,8 @@ namespace BlackGui
|
||||
|
||||
if (!actionHotkey.getCombination().isEmpty()) { ui->pb_SelectedHotkey->setText(actionHotkey.getCombination().toQString()); }
|
||||
|
||||
CIdentifierList machinesUnique = applications.getMachinesUnique();
|
||||
int index = -1;
|
||||
const CIdentifierList machinesUnique = applications.getMachinesUnique();
|
||||
for (const auto &app : machinesUnique)
|
||||
{
|
||||
ui->cb_Identifier->addItem(app.getMachineName(), QVariant::fromValue(app));
|
||||
@@ -240,7 +239,7 @@ namespace BlackGui
|
||||
}
|
||||
ksb->setSelectedIndex(currentIndex);
|
||||
ui->qf_Advanced->layout()->addWidget(ksb);
|
||||
int position = ui->qf_Advanced->layout()->count() - 1;
|
||||
const int position = ui->qf_Advanced->layout()->count() - 1;
|
||||
ksb->setProperty("position", position);
|
||||
connect(ksb, &CKeySelectionBox::keySelectionChanged, this, &CHotkeyDialog::advancedKeyChanged);
|
||||
}
|
||||
|
||||
@@ -79,8 +79,10 @@ namespace BlackGui
|
||||
void initStyleSheet();
|
||||
|
||||
//! Runs the hotkey dialog and returns the result
|
||||
static BlackMisc::Input::CActionHotkey getActionHotkey(const BlackMisc::Input::CActionHotkey &initial, const BlackMisc::CIdentifierList &applications,
|
||||
QWidget *parent = nullptr);
|
||||
static BlackMisc::Input::CActionHotkey getActionHotkey(
|
||||
const BlackMisc::Input::CActionHotkey &initial,
|
||||
const BlackMisc::CIdentifierList &applications,
|
||||
QWidget *parent = nullptr);
|
||||
|
||||
private:
|
||||
void ps_advancedModeChanged();
|
||||
@@ -88,9 +90,9 @@ namespace BlackGui
|
||||
void ps_combinationSelectionChanged(const BlackMisc::Input::CHotkeyCombination &combination);
|
||||
void ps_combinationSelectionFinished(const BlackMisc::Input::CHotkeyCombination &combination);
|
||||
void ps_changeSelectedAction(const QItemSelection &selected, const QItemSelection &deselected);
|
||||
void changeApplicableMachine(int index);
|
||||
void ps_accept();
|
||||
|
||||
void changeApplicableMachine(int index);
|
||||
void synchronize();
|
||||
void synchronizeSimpleSelection();
|
||||
void synchronizeAdvancedSelection();
|
||||
@@ -102,7 +104,7 @@ namespace BlackGui
|
||||
QScopedPointer<Ui::CHotkeyDialog> ui;
|
||||
BlackMisc::Input::CActionHotkey m_actionHotkey;
|
||||
BlackGui::Models::CActionModel m_actionModel;
|
||||
BlackCore::CInputManager *m_inputManager;
|
||||
BlackCore::CInputManager *m_inputManager = nullptr;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackcore/context/contextapplication.h"
|
||||
#include "blackgui/components/hotkeydialog.h"
|
||||
#include "blackgui/components/configurationwizard.h"
|
||||
#include "blackgui/components/settingshotkeycomponent.h"
|
||||
#include "blackgui/components/hotkeydialog.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackmisc/identifier.h"
|
||||
#include "blackmisc/identifierlist.h"
|
||||
#include "blackmisc/input/hotkeycombination.h"
|
||||
#include "blackcore/context/contextapplication.h"
|
||||
#include "blackcore/context/contextaudio.h"
|
||||
#include "blackcore/inputmanager.h"
|
||||
#include "ui_settingshotkeycomponent.h"
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
@@ -53,8 +53,7 @@ namespace BlackGui
|
||||
}
|
||||
|
||||
CSettingsHotkeyComponent::~CSettingsHotkeyComponent()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
void CSettingsHotkeyComponent::ps_addEntry()
|
||||
{
|
||||
@@ -80,13 +79,15 @@ namespace BlackGui
|
||||
|
||||
const auto model = ui->tv_Hotkeys->model();
|
||||
const QModelIndex indexHotkey = model->index(index.row(), 0, QModelIndex());
|
||||
Q_ASSERT(indexHotkey.data(CActionHotkeyListModel::ActionHotkeyRole).canConvert<CActionHotkey>());
|
||||
Q_ASSERT_X(indexHotkey.data(CActionHotkeyListModel::ActionHotkeyRole).canConvert<CActionHotkey>(), Q_FUNC_INFO, "No action hotkey");
|
||||
CActionHotkey actionHotkey = indexHotkey.data(CActionHotkeyListModel::ActionHotkeyRole).value<CActionHotkey>();
|
||||
BlackMisc::CIdentifierList registeredApps;
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Missing sGui");
|
||||
if (sGui->getIContextApplication()) registeredApps = sGui->getIContextApplication()->getRegisteredApplications();
|
||||
|
||||
// add local application
|
||||
registeredApps.push_back(CIdentifier());
|
||||
auto selectedActionHotkey = CHotkeyDialog::getActionHotkey(actionHotkey, registeredApps, this);
|
||||
const auto selectedActionHotkey = CHotkeyDialog::getActionHotkey(actionHotkey, registeredApps, this);
|
||||
if (selectedActionHotkey.isValid() && checkAndConfirmConflicts(selectedActionHotkey, { actionHotkey }))
|
||||
{
|
||||
updateHotkeyInSettings(actionHotkey, selectedActionHotkey);
|
||||
@@ -156,7 +157,7 @@ namespace BlackGui
|
||||
m_model.clear();
|
||||
for (const auto &hotkey : hotkeys)
|
||||
{
|
||||
int position = m_model.rowCount();
|
||||
const int position = m_model.rowCount();
|
||||
m_model.insertRows(position, 1, QModelIndex());
|
||||
QModelIndex index = m_model.index(position, 0, QModelIndex());
|
||||
m_model.setData(index, QVariant::fromValue(hotkey), CActionHotkeyListModel::ActionHotkeyRole);
|
||||
|
||||
Reference in New Issue
Block a user