MythTV  0.26-pre
Public Types | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes
MythControls Class Reference

Screen for managing and configuring keyboard input bindings. More...

#include <mythcontrols.h>

Inheritance diagram for MythControls:
MythScreenType MythUIType XMLParseBase

List of all members.

Public Types

enum  ListType { kContextList, kKeyList, kActionList }

Public Member Functions

 MythControls (MythScreenStack *parent, const char *name)
 Creates a new MythControls wizard.
 ~MythControls ()
bool Create (void)
 Loads UI elements from theme.
void customEvent (QEvent *)
QString GetCurrentContext (void)
 Get the currently selected context string.
QString GetCurrentAction (void)
 Get the currently selected action string.
QString GetCurrentKey (void)
 Get the currently selected key string.

Protected Member Functions

void Teardown (void)
bool LoadUI (void)
void LoadData (const QString &hostname)
 Load the settings for a particular host.
void ChangeButtonFocus (int direction)
 Change button focus in a particular direction.
void ChangeView (void)
 Change the view.
void SetListContents (MythUIButtonList *uilist, const QStringList &contents, bool arrows=false)
 Set the contents of a list.
void UpdateRightList (void)
 Update the right list.
void GrabKey (void)
void DeleteKey (void)
 Delete the currently active key to action mapping.
void Save (void)
uint GetCurrentButton (void)
 Returns the focused button, or Action::kMaximumNumberOfBindings if no buttons are focued.
void ResolveConflict (ActionID *conflict, int error_level, const QString &key)
 Resolve a potential conflict.
QString GetTypeDesc (ListType type) const

Private Slots

void LeftSelected (MythUIButtonListItem *)
 Refreshes the right list when an item in the left list is selected.
void RightSelected (MythUIButtonListItem *)
 Refreshes key information when an item in the right list is selected.
void LeftPressed (MythUIButtonListItem *)
 Slot handling a button being pressed in the left list.
void RightPressed (MythUIButtonListItem *)
 Slot handling a button being pressed in the left list.
void ActionButtonPressed ()
 Slot handling a button being pressed in the left list.
void RefreshKeyInformation (void)
 Updates the list of keys that are shown and the description of the action.
void AddKeyToAction (QString key, bool ignoreconflict=false)
 Add a key to the currently selected action.

Private Member Functions

void ShowMenu (void)
void Close (void)

Private Attributes

ViewType m_currentView
MythUIButtonListm_leftList
MythUIButtonListm_rightList
MythUITextm_description
MythUITextm_leftDescription
MythUITextm_rightDescription
QList< MythUIButton * > m_actionButtons
MythDialogBoxm_menuPopup
KeyBindingsm_bindings
QStringList m_sortedContexts
 sorted list of contexts
QHash< QString, QStringList > m_contexts
 actions for a given context
ListType m_leftListType
ListType m_rightListType

Detailed Description

Screen for managing and configuring keyboard input bindings.

Definition at line 49 of file mythcontrols.h.


Member Enumeration Documentation

Enumerator:
kContextList 
kKeyList 
kActionList 

Definition at line 61 of file mythcontrols.h.


Constructor & Destructor Documentation

MythControls::MythControls ( MythScreenStack parent,
const char *  name 
)

Creates a new MythControls wizard.

Parameters:
parentPointer to the screen stack
nameThe name of the window

Definition at line 56 of file mythcontrols.cpp.

Definition at line 70 of file mythcontrols.cpp.


Member Function Documentation

bool MythControls::Create ( void  ) [virtual]

Loads UI elements from theme.

Returns:
true if all UI elements load successfully.

Reimplemented from MythScreenType.

Definition at line 91 of file mythcontrols.cpp.

Referenced by startKeysSetup().

void MythControls::customEvent ( QEvent *  event) [virtual]

Reimplemented from MythUIType.

Definition at line 690 of file mythcontrols.cpp.

Get the currently selected context string.

If no context is selected, an empty string is returned.

Returns:
The currently selected context string.

Definition at line 388 of file mythcontrols.cpp.

Referenced by AddKeyToAction(), DeleteKey(), GetCurrentKey(), and RefreshKeyInformation().

Get the currently selected action string.

If no action is selected, an empty string is returned.

Returns:
The currently selected action string.

Definition at line 414 of file mythcontrols.cpp.

Referenced by AddKeyToAction(), DeleteKey(), GetCurrentKey(), and RefreshKeyInformation().

Get the currently selected key string.

If no key is selected, an empty string is returned.

Returns:
The currently selected key string

Definition at line 479 of file mythcontrols.cpp.

Referenced by ActionButtonPressed(), and DeleteKey().

void MythControls::Teardown ( void  ) [protected]

Definition at line 75 of file mythcontrols.cpp.

Referenced by customEvent(), and ~MythControls().

bool MythControls::LoadUI ( void  ) [protected]
void MythControls::LoadData ( const QString &  hostname) [protected]

Load the settings for a particular host.

Parameters:
hostnameThe host to load settings for.

Definition at line 524 of file mythcontrols.cpp.

Referenced by Create().

void MythControls::ChangeButtonFocus ( int  direction) [protected]

Change button focus in a particular direction.

Parameters:
direction+1 moves focus to the right, -1 moves to the left, and 0 changes the focus to the first button.

Definition at line 161 of file mythcontrols.cpp.

Referenced by RightPressed().

void MythControls::ChangeView ( void  ) [protected]

Change the view.

Definition at line 220 of file mythcontrols.cpp.

Referenced by customEvent().

void MythControls::SetListContents ( MythUIButtonList uilist,
const QStringList &  contents,
bool  arrows = false 
) [protected]

Set the contents of a list.

Parameters:
uilistThe list being changed.
contentsThe contents of the list.
arrowsTrue to draw with arrows, otherwise arrows are not drawn.

Definition at line 308 of file mythcontrols.cpp.

Referenced by Create(), customEvent(), and UpdateRightList().

Update the right list.

Definition at line 327 of file mythcontrols.cpp.

Referenced by Create(), customEvent(), and LeftSelected().

void MythControls::GrabKey ( void  ) [protected]

Definition at line 631 of file mythcontrols.cpp.

Referenced by ActionButtonPressed(), and customEvent().

void MythControls::DeleteKey ( void  ) [protected]

Delete the currently active key to action mapping.

TODO FIXME This code needs work to support deleteKey in any mode exc. Context/Action

Definition at line 556 of file mythcontrols.cpp.

Referenced by customEvent().

void MythControls::Save ( void  ) [inline, protected]

Definition at line 88 of file mythcontrols.h.

Referenced by customEvent().

Returns the focused button, or Action::kMaximumNumberOfBindings if no buttons are focued.

Definition at line 459 of file mythcontrols.cpp.

Referenced by AddKeyToAction(), and GetCurrentKey().

void MythControls::ResolveConflict ( ActionID conflict,
int  error_level,
const QString &  key 
) [protected]

Resolve a potential conflict.

Returns:
true if the conflict should be bound, false otherwise.

Definition at line 597 of file mythcontrols.cpp.

Referenced by AddKeyToAction().

QString MythControls::GetTypeDesc ( ListType  type) const [protected]

Refreshes the right list when an item in the left list is selected.

Definition at line 287 of file mythcontrols.cpp.

Referenced by Create().

Refreshes key information when an item in the right list is selected.

Definition at line 296 of file mythcontrols.cpp.

Referenced by Create().

Slot handling a button being pressed in the left list.

Definition at line 173 of file mythcontrols.cpp.

Referenced by Create().

Slot handling a button being pressed in the left list.

Definition at line 182 of file mythcontrols.cpp.

Referenced by Create().

Slot handling a button being pressed in the left list.

Definition at line 192 of file mythcontrols.cpp.

Referenced by Create().

Updates the list of keys that are shown and the description of the action.

Definition at line 355 of file mythcontrols.cpp.

Referenced by AddKeyToAction(), Create(), customEvent(), DeleteKey(), and RightSelected().

void MythControls::AddKeyToAction ( QString  key,
bool  ignoreconflict = false 
) [private, slot]

Add a key to the currently selected action.

TODO FIXME This code needs work to support deleteKey in any mode exc. Context/Action TODO FIXME This code needs work to deal with multiple binding conflicts.

Definition at line 654 of file mythcontrols.cpp.

Referenced by customEvent(), and GrabKey().

void MythControls::ShowMenu ( void  ) [private, virtual]

Reimplemented from MythScreenType.

Definition at line 241 of file mythcontrols.cpp.

void MythControls::Close ( void  ) [private, virtual]

Reimplemented from MythScreenType.

Definition at line 261 of file mythcontrols.cpp.

Referenced by customEvent().


Member Data Documentation

Definition at line 111 of file mythcontrols.h.

Referenced by Create(), customEvent(), MythControls(), RightPressed(), and UpdateRightList().

Definition at line 114 of file mythcontrols.h.

Referenced by Create(), MythControls(), and RefreshKeyInformation().

Definition at line 115 of file mythcontrols.h.

Referenced by Create(), customEvent(), and MythControls().

Definition at line 116 of file mythcontrols.h.

Referenced by Create(), customEvent(), and MythControls().

Definition at line 117 of file mythcontrols.h.

Referenced by ChangeButtonFocus(), Create(), GetCurrentButton(), and RefreshKeyInformation().

Definition at line 118 of file mythcontrols.h.

Referenced by ActionButtonPressed(), ChangeView(), customEvent(), MythControls(), and ShowMenu().

QStringList MythControls::m_sortedContexts [private]

sorted list of contexts

Definition at line 121 of file mythcontrols.h.

Referenced by LoadData().

QHash<QString, QStringList> MythControls::m_contexts [private]

actions for a given context

Definition at line 123 of file mythcontrols.h.

Referenced by LoadData(), Teardown(), and UpdateRightList().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends