swift
src
gui
components
settingshotkeycomponent.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6
#ifndef SWIFT_GUI_COMPONENTS_SETTINGSHOTKEYCOMPONENT_H
7
#define SWIFT_GUI_COMPONENTS_SETTINGSHOTKEYCOMPONENT_H
8
9
#include <QFrame>
10
#include <QObject>
11
#include <QScopedPointer>
12
#include <QWizardPage>
13
14
#include "
core/actionbind.h
"
15
#include "
core/application/applicationsettings.h
"
16
#include "
gui/models/actionhotkeylistmodel.h
"
17
#include "
gui/swiftguiexport.h
"
18
#include "
misc/icons.h
"
19
#include "
misc/identifierlist.h
"
20
#include "
misc/settingscache.h
"
21
22
namespace
Ui
23
{
24
class
CSettingsHotkeyComponent;
25
}
26
namespace
swift::gui::components
27
{
29
class
SWIFT_GUI_EXPORT
CSettingsHotkeyComponent
:
public
QFrame
30
{
31
Q_OBJECT
32
33
public
:
35
CSettingsHotkeyComponent
(
QWidget
*parent =
nullptr
);
36
38
virtual
~
CSettingsHotkeyComponent
()
override
;
39
41
void
saveSettings();
42
44
void
registerDummyPttEntry();
45
47
void
reloadHotkeysFromSettings();
48
49
private
:
50
void
addEntry();
51
void
editEntry();
52
void
removeEntry();
53
void
hotkeySlot(
bool
keyDown);
54
void
addHotkeyToSettings(
const
swift::misc::input::CActionHotkey
&actionHotkey);
55
void
updateHotkeyInSettings(
const
swift::misc::input::CActionHotkey
&oldValue,
56
const
swift::misc::input::CActionHotkey
&newValue);
57
void
removeHotkeyFromSettings(
const
swift::misc::input::CActionHotkey
&actionHotkey);
58
bool
checkAndConfirmConflicts(
const
swift::misc::input::CActionHotkey
&actionHotkey,
59
const
swift::misc::input::CActionHotkeyList
&ignore = {});
60
swift::misc::CIdentifierList
getAllIdentifiers()
const
;
61
void
resizeView();
62
63
QScopedPointer<Ui::CSettingsHotkeyComponent>
ui;
64
models::CActionHotkeyListModel
m_model;
65
swift::misc::CSetting<swift::core::application::TActionHotkeys>
m_actionHotkeys {
66
this
, &
CSettingsHotkeyComponent::reloadHotkeysFromSettings
67
};
68
swift::core::CActionBind
m_action {
"/Test/Message"
, swift::misc::CIcons::StandardIconWrench16,
this
,
69
&CSettingsHotkeyComponent::hotkeySlot };
70
};
71
75
class
CConfigHotkeyWizardPage
:
public
QWizardPage
76
{
77
Q_OBJECT
78
79
public
:
81
using
QWizardPage::QWizardPage
;
82
84
void
setConfigComponent
(
CSettingsHotkeyComponent
*config) { m_config = config; }
85
87
virtual
bool
validatePage
()
override
;
88
90
virtual
void
initializePage
()
override
;
91
92
private
:
93
CSettingsHotkeyComponent
*m_config =
nullptr
;
94
};
95
}
// namespace swift::gui::components
96
97
#endif
// SWIFT_GUI_COMPONENTS_SETTINGSHOTKEYCOMPONENT_H
actionbind.h
actionhotkeylistmodel.h
applicationsettings.h
swift::core::CActionBind
CActionBind binds a member function to an action.
Definition:
actionbind.h:18
swift::gui::components::CConfigHotkeyWizardPage
Wizard page for CConfigSimulatorComponent.
Definition:
settingshotkeycomponent.h:76
swift::gui::components::CConfigHotkeyWizardPage::setConfigComponent
void setConfigComponent(CSettingsHotkeyComponent *config)
Set config.
Definition:
settingshotkeycomponent.h:84
swift::gui::components::CConfigHotkeyWizardPage::initializePage
virtual void initializePage()
Definition:
settingshotkeycomponent.cpp:235
swift::gui::components::CConfigHotkeyWizardPage::validatePage
virtual bool validatePage()
Definition:
settingshotkeycomponent.cpp:227
swift::gui::components::CSettingsHotkeyComponent
Configure hotkeys.
Definition:
settingshotkeycomponent.h:30
swift::gui::components::CSettingsHotkeyComponent::reloadHotkeysFromSettings
void reloadHotkeysFromSettings()
Reload keys from settings.
Definition:
settingshotkeycomponent.cpp:180
swift::gui::models::CActionHotkeyListModel
Hotkey list model.
Definition:
actionhotkeylistmodel.h:23
swift::misc::CIdentifierList
Value object encapsulating a list of object identifiers.
Definition:
identifierlist.h:24
swift::misc::CSetting< swift::core::application::TActionHotkeys >
swift::misc::input::CActionHotkey
Value object encapsulating a action hotkey.
Definition:
actionhotkey.h:25
swift::misc::input::CActionHotkeyList
Value object encapsulating a list of hotkeys.
Definition:
actionhotkeylist.h:28
icons.h
identifierlist.h
swift::gui::components
High level reusable GUI components.
Definition:
aboutdialog.cpp:13
QFrame
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QScopedPointer< Ui::CSettingsHotkeyComponent >
QWidget
QWizardPage
QWizardPage::QWizardPage
QWizardPage(QWidget *parent)
settingscache.h
swiftguiexport.h
SWIFT_GUI_EXPORT
#define SWIFT_GUI_EXPORT
Export a class or function from the library.
Definition:
swiftguiexport.h:19
Generated on Wed Sep 3 2025 21:41:18 for swift by
1.9.1