|
MythTV
0.27pre
|
Encapsulates information about the current keybindings. More...
#include <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) |
| Replace a key in an action. | |
| 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) |
| Load the keybindings from the database. | |
| void | LoadJumppoints (void) |
| Load the jumppoints from the database. | |
Private Attributes | |
| QString | m_hostname |
| ActionList | m_mandatoryBindings |
| QStringList | m_defaultKeys |
| ActionSet | m_actionSet |
Encapsulates information about the current keybindings.
This class can retrieve, set, and modify the keybindings used by MythTV
Definition at line 37 of file keybindings.h.
Levels of conflict.
Definition at line 41 of file keybindings.h.
| KeyBindings::KeyBindings | ( | const QString & | hostname | ) |
Create a new KeyBindings instance.
| hostname | The host for which to create the key bindings. |
Definition at line 40 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 153 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 |
Conflicts occur if:
If the method does not return NULL, check the value given to level. Warnings can be ignored (at the users disgression), but errors should be prevented no matter what.
NOTE: If this returns a non-null pointer, the ActionID returned must be explicitly deleted with C++ "delete".
Definition at line 180 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 | ||
| ) |
Replace a key in 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. |
| newkey | The key to add. |
| oldkey | The index of the key to be replaced |
Definition at line 223 of file keybindings.cpp.
Referenced by MythControls::AddKeyToAction().
| 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 243 of file keybindings.cpp.
Referenced by MythControls::DeleteKey().
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 325 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 50 of file keybindings.cpp.
Referenced by MythControls::customEvent().
| QStringList KeyBindings::GetContexts | ( | void | ) | const |
Returns a list of the context names.
Definition at line 59 of file keybindings.cpp.
Referenced by MythControls::Create(), MythControls::customEvent(), Frontend::InitialiseActions(), 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 73 of file keybindings.cpp.
Referenced by Frontend::InitialiseActions(), and 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 85 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 96 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 107 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 116 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 137 of file keybindings.cpp.
Referenced by Frontend::InitialiseActions(), and MythControls::RefreshKeyInformation().
Returns true iff all mandatory bindings are satisfied.
Definition at line 444 of file keybindings.cpp.
Definition at line 72 of file keybindings.h.
Referenced by MythControls::Close().
Commit a jumppoint to the database.
TODO FIXME This does not reload the jumppoint.
Definition at line 294 of file keybindings.cpp.
Referenced by CommitChanges().
Commit an action to the database, and reload its keybindings.
Definition at line 263 of file keybindings.cpp.
Referenced by CommitChanges().
Load the mandatory bindings.
Definition at line 417 of file keybindings.cpp.
Referenced by KeyBindings().
Load the keybindings from the database.
This will load the keybindings which apply to the hostname specified to the constructor.
Definition at line 390 of file keybindings.cpp.
Referenced by KeyBindings().
Load the jumppoints from the database.
This method will load the keybindings for jump points.
Definition at line 351 of file keybindings.cpp.
Referenced by KeyBindings().
|
private |
Definition at line 83 of file keybindings.h.
Referenced by CommitAction(), CommitJumppoint(), KeyBindings(), LoadContexts(), and LoadJumppoints().
|
private |
Definition at line 84 of file keybindings.h.
Referenced by HasMandatoryBindings(), LoadMandatoryBindings(), and RemoveActionKey().
|
private |
Definition at line 85 of file keybindings.h.
Referenced by LoadMandatoryBindings().
|
private |
Definition at line 86 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.8.1.2