MythControls Class Reference

#include <mythcontrols.h>

Inheritance diagram for MythControls:

MythScreenType MythUIType XMLParseBase

List of all members.


Detailed Description

The myth controls configuration class.

Definition at line 41 of file mythcontrols.h.


Public Types

enum  ListType { kContextList, kKeyList, kActionList }

Public Member Functions

 MythControls (MythScreenStack *parent, const char *name)
 ~MythControls ()
virtual bool Create (void)
 Loads UI elements from theme.
virtual bool keyPressEvent (QKeyEvent *)
virtual void customEvent (QCustomEvent *)
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 (MythListButton *uilist, const QStringList &contents, bool arrows=false)
 Set the contents of a list.
void UpdateRightList (void)
 Update the right list.
uint GetCurrentButton (void)
 Returns the focused button, or Action::kMaximumNumberOfBindings if no buttons are focued.
QString GetTypeDesc (ListType type) const

Static Protected Member Functions

static bool ResolveConflict (ActionID *conflict, int error_level)

Private Slots

void AddKeyToAction (void)
 Add a key to the currently selected action.
void DeleteKey (void)
 Delete the currently active key to action mapping.
void LeftSelected (MythListButtonItem *)
 Refreshes the right list when an item in the left list is selected.
void RightSelected (MythListButtonItem *)
 Refreshes key information when an item in the right list is selected.
bool JumpTo (QKeyEvent *event)
void Save (void)
 Save the bindings to the Database.
void RefreshKeyInformation (void)
 Updates the list of keys that are shown and the description of the action.

Private Attributes

ViewType m_currentView
MythUITypem_focusedUIElement
MythListButtonm_leftList
MythListButtonm_rightList
MythUITextm_description
MythUITextm_leftDescription
MythUITextm_rightDescription
QPtrList< MythUIButtonm_actionButtons
MythDialogBoxm_menuPopup
KeyBindingsm_bindings
QStringList m_sortedContexts
 sorted list of contexts
QDict< QStringList > m_contexts
 actions for a given context
ListType m_leftListType
ListType m_rightListType

Member Enumeration Documentation

Enumerator:
kContextList 
kKeyList 
kActionList 

Definition at line 54 of file mythcontrols.h.


Constructor & Destructor Documentation

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

Definition at line 54 of file mythcontrols.cpp.

MythControls::~MythControls (  ) 

Definition at line 70 of file mythcontrols.cpp.


Member Function Documentation

bool MythControls::Create ( void   )  [virtual]

Loads UI elements from theme.

This method grabs all of the UI elements that are needed by mythcontrols. If this method returns false the plugin must exit, otherwise the application will crash.

Returns:
true if all UI elements load successfully.

Reimplemented from MythScreenType.

Definition at line 95 of file mythcontrols.cpp.

Referenced by mythplugin_run().

bool MythControls::keyPressEvent ( QKeyEvent *  event  )  [virtual]

Reimplemented from MythUIType.

Definition at line 209 of file mythcontrols.cpp.

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

Reimplemented from MythUIType.

Definition at line 695 of file mythcontrols.cpp.

QString MythControls::GetCurrentContext ( void   ) 

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 425 of file mythcontrols.cpp.

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

QString MythControls::GetCurrentAction ( void   ) 

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 450 of file mythcontrols.cpp.

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

QString MythControls::GetCurrentKey ( void   ) 

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 505 of file mythcontrols.cpp.

Referenced by DeleteKey(), and keyPressEvent().

void MythControls::Teardown ( void   )  [protected]

Definition at line 75 of file mythcontrols.cpp.

Referenced by ~MythControls().

bool MythControls::LoadUI ( void   )  [protected]

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

Load the settings for a particular host.

Parameters:
hostname The host to load settings for.

Definition at line 542 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 173 of file mythcontrols.cpp.

Referenced by keyPressEvent().

void MythControls::ChangeView ( void   )  [protected]

Change the view.

Definition at line 187 of file mythcontrols.cpp.

Referenced by customEvent().

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

Set the contents of a list.

Parameters:
uilist The list being changed.
contents The contents of the list.
arrows True to draw with arrows, otherwise arrows are not drawn.

Definition at line 348 of file mythcontrols.cpp.

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

void MythControls::UpdateRightList ( void   )  [protected]

Update the right list.

Definition at line 363 of file mythcontrols.cpp.

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

uint MythControls::GetCurrentButton ( void   )  [protected]

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

Definition at line 486 of file mythcontrols.cpp.

Referenced by AddKeyToAction(), and GetCurrentKey().

bool MythControls::ResolveConflict ( ActionID conflict,
int  error_level 
) [static, protected]

Definition at line 608 of file mythcontrols.cpp.

Referenced by AddKeyToAction().

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

void MythControls::AddKeyToAction ( void   )  [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 643 of file mythcontrols.cpp.

Referenced by customEvent(), and keyPressEvent().

void MythControls::DeleteKey ( void   )  [private, slot]

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 572 of file mythcontrols.cpp.

Referenced by customEvent().

void MythControls::LeftSelected ( MythListButtonItem  )  [private, slot]

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

Definition at line 328 of file mythcontrols.cpp.

Referenced by Create().

void MythControls::RightSelected ( MythListButtonItem  )  [private, slot]

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

Definition at line 337 of file mythcontrols.cpp.

Referenced by Create().

bool MythControls::JumpTo ( QKeyEvent *  event  )  [inline, private, slot]

Definition at line 91 of file mythcontrols.h.

void MythControls::Save ( void   )  [inline, private, slot]

Save the bindings to the Database.

Definition at line 93 of file mythcontrols.h.

Referenced by customEvent().

void MythControls::RefreshKeyInformation ( void   )  [private, slot]

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

Definition at line 393 of file mythcontrols.cpp.

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


Member Data Documentation

Definition at line 97 of file mythcontrols.h.

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

Definition at line 98 of file mythcontrols.h.

Definition at line 101 of file mythcontrols.h.

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

Definition at line 102 of file mythcontrols.h.

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

Definition at line 103 of file mythcontrols.h.

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

Definition at line 104 of file mythcontrols.h.

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

Definition at line 105 of file mythcontrols.h.

Referenced by ChangeView(), customEvent(), keyPressEvent(), and MythControls().

QStringList MythControls::m_sortedContexts [private]

sorted list of contexts

Definition at line 108 of file mythcontrols.h.

Referenced by LoadData().

QDict<QStringList> MythControls::m_contexts [private]

actions for a given context

Definition at line 109 of file mythcontrols.h.

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


The documentation for this class was generated from the following files:

Generated on Sat Dec 18 05:16:07 2010 for MythTV by  doxygen 1.5.5