#include <keybindings.h>
This class can retrieve, set, and modify the keybindings used by MythTV
Definition at line 38 of file keybindings.h.
Public Types | |
| enum | ConflictLevels { kKeyBindingWarning, kKeyBindingError } |
| Levels of conflict. More... | |
Public Member Functions | |
| KeyBindings (const QString &hostname) | |
| Create a new KeyBindings instance. | |
| bool | AddActionKey (const QString &context_name, const QString &action_name, const QString &key) |
| Add a key to an action. | |
| ActionID * | GetConflict (const QString &context_name, const QString &key, int &level) const |
| Determine if adding a key would cause a conflict. | |
| void | ReplaceActionKey (const QString &context_name, const QString &action_name, const QString &newkey, const QString &oldkey) |
| bool | RemoveActionKey (const QString &context_name, const QString &action_name, const QString &key) |
| Unbind a key from an action. | |
| void | CommitChanges (void) |
| Commit all changes made to the keybindings. | |
| QStringList | GetKeys (void) const |
| Returns a list of all keys bound to an action. | |
| QStringList | GetContexts (void) const |
| Returns a list of the context names. | |
| QStringList | GetActions (const QString &context) const |
| Get a list of the actions in a context. | |
| void | GetKeyActions (const QString &key, ActionList &list) const |
| Get a list of the actions in a context. | |
| QStringList | GetActionKeys (const QString &context_name, const QString &action_name) const |
| Get an action's keys. | |
| QStringList | GetContextKeys (const QString &context) const |
| Get the keys within a context. | |
| QStringList | GetKeyContexts (const QString &key) const |
| Get the context names in which a key is bound. | |
| QString | GetActionDescription (const QString &context_name, const QString &action_name) const |
| Get an action's description. | |
| bool | HasMandatoryBindings (void) const |
| Returns true iff all mandatory bindings are satisfied. | |
| bool | HasChanges (void) const |
Protected Member Functions | |
| void | CommitJumppoint (const ActionID &id) |
| Commit a jumppoint to the database. | |
| void | CommitAction (const ActionID &id) |
| Commit an action to the database, and reload its keybindings. | |
| void | LoadMandatoryBindings (void) |
| Load the mandatory bindings. | |
| void | LoadContexts (void) |
| void | LoadJumppoints (void) |
Private Attributes | |
| QString | m_hostname |
| ActionList | m_mandatoryBindings |
| QStringList | m_defaultKeys |
| ActionSet | m_actionSet |
| KeyBindings::KeyBindings | ( | const QString & | hostname | ) |
Create a new KeyBindings instance.
| hostname | The host for which to create the key bindings. |
Definition at line 44 of file keybindings.cpp.
| bool KeyBindings::AddActionKey | ( | const QString & | context_name, | |
| const QString & | action_name, | |||
| const QString & | key | |||
| ) |
Add a key to an action.
This does not take effect until CommitChanges() is called.
| context_name | The name of the context. | |
| action_name | The name of the action. | |
| key | The key to add. |
Definition at line 158 of file keybindings.cpp.
Referenced by MythControls::AddKeyToAction().
| ActionID * KeyBindings::GetConflict | ( | const QString & | context_name, | |
| const QString & | key, | |||
| int & | level | |||
| ) | const |
Determine if adding a key would cause a conflict.
| context_name | The name of the context. | |
| key | The key to add. | |
| level | The level of conflict if this returns an ActionID |
NOTE: If this returns a non-null pointer, the ActionID returned must be explicitly deleted with C++ "delete".
Definition at line 185 of file keybindings.cpp.
Referenced by MythControls::AddKeyToAction().
| void KeyBindings::ReplaceActionKey | ( | const QString & | context_name, | |
| const QString & | action_name, | |||
| const QString & | newkey, | |||
| const QString & | oldkey | |||
| ) |
| bool KeyBindings::RemoveActionKey | ( | const QString & | context_name, | |
| const QString & | action_name, | |||
| const QString & | key | |||
| ) |
Unbind a key from an action.
Unless the action is Mandatory there is only one key in the action, this method should return true.
| context_name | The name of the context. | |
| action_name | The name of the action. | |
| key | The key to remove. |
Definition at line 249 of file keybindings.cpp.
Referenced by MythControls::DeleteKey().
| void KeyBindings::CommitChanges | ( | void | ) |
Commit all changes made to the keybindings.
This method will write the changes to the database, unbind MythTV's current bindings for those actions that changed, and setup the new bindings.
Definition at line 331 of file keybindings.cpp.
Referenced by MythControls::Save().
| QStringList KeyBindings::GetKeys | ( | void | ) | const |
Returns a list of all keys bound to an action.
Definition at line 53 of file keybindings.cpp.
Referenced by MythControls::customEvent().
| QStringList KeyBindings::GetContexts | ( | void | ) | const |
Returns a list of the context names.
Definition at line 62 of file keybindings.cpp.
Referenced by MythControls::Create(), MythControls::customEvent(), and MythControls::LoadData().
| QStringList KeyBindings::GetActions | ( | const QString & | context | ) | const |
Get a list of the actions in a context.
| context | The name of the context. |
Definition at line 77 of file keybindings.cpp.
Referenced by MythControls::LoadData().
| void KeyBindings::GetKeyActions | ( | const QString & | key, | |
| ActionList & | list | |||
| ) | const |
Get a list of the actions in a context.
| key | The name of the context. |
Definition at line 89 of file keybindings.cpp.
| QStringList KeyBindings::GetActionKeys | ( | const QString & | context_name, | |
| const QString & | action_name | |||
| ) | const |
Get an action's keys.
| context_name | The name of the context. | |
| action_name | The name of the action. |
Definition at line 100 of file keybindings.cpp.
Referenced by MythControls::AddKeyToAction(), MythControls::GetCurrentKey(), and MythControls::RefreshKeyInformation().
| QStringList KeyBindings::GetContextKeys | ( | const QString & | context | ) | const |
Get the keys within a context.
| context | The context name. |
Definition at line 112 of file keybindings.cpp.
Referenced by MythControls::UpdateRightList().
| QStringList KeyBindings::GetKeyContexts | ( | const QString & | key | ) | const |
Get the context names in which a key is bound.
Definition at line 121 of file keybindings.cpp.
Referenced by MythControls::UpdateRightList().
| QString KeyBindings::GetActionDescription | ( | const QString & | context_name, | |
| const QString & | action_name | |||
| ) | const |
Get an action's description.
| context_name | The name of the context. | |
| action_name | The name of the action. |
Definition at line 142 of file keybindings.cpp.
Referenced by MythControls::RefreshKeyInformation().
| bool KeyBindings::HasMandatoryBindings | ( | void | ) | const |
Returns true iff all mandatory bindings are satisfied.
Definition at line 450 of file keybindings.cpp.
| bool KeyBindings::HasChanges | ( | void | ) | const [inline] |
| void KeyBindings::CommitJumppoint | ( | const ActionID & | id | ) | [protected] |
Commit a jumppoint to the database.
TODO FIXME This does not reload the jumppoint.
Definition at line 300 of file keybindings.cpp.
Referenced by CommitChanges().
| void KeyBindings::CommitAction | ( | const ActionID & | id | ) | [protected] |
Commit an action to the database, and reload its keybindings.
Definition at line 269 of file keybindings.cpp.
Referenced by CommitChanges().
| void KeyBindings::LoadMandatoryBindings | ( | void | ) | [protected] |
Load the mandatory bindings.
Definition at line 423 of file keybindings.cpp.
Referenced by KeyBindings().
| void KeyBindings::LoadContexts | ( | void | ) | [protected] |
| void KeyBindings::LoadJumppoints | ( | void | ) | [protected] |
QString KeyBindings::m_hostname [private] |
Definition at line 84 of file keybindings.h.
Referenced by CommitAction(), CommitJumppoint(), LoadContexts(), and LoadJumppoints().
ActionList KeyBindings::m_mandatoryBindings [private] |
Definition at line 85 of file keybindings.h.
Referenced by HasMandatoryBindings(), LoadMandatoryBindings(), and RemoveActionKey().
QStringList KeyBindings::m_defaultKeys [private] |
ActionSet KeyBindings::m_actionSet [private] |
Definition at line 87 of file keybindings.h.
Referenced by AddActionKey(), CommitAction(), CommitChanges(), CommitJumppoint(), GetActionDescription(), GetActionKeys(), GetActions(), GetConflict(), GetContextKeys(), GetContexts(), GetKeyActions(), GetKeyContexts(), GetKeys(), HasChanges(), HasMandatoryBindings(), LoadContexts(), LoadJumppoints(), RemoveActionKey(), and ReplaceActionKey().
1.5.5