MythTV  master
mythcontrols.cpp
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
28 #include "mythcontrols.h"
29 
30 // Qt headers
31 #include <QStringList>
32 #include <QCoreApplication>
33 
34 // MythTV headers
35 #include "mythcorecontext.h"
36 #include "mythmainwindow.h"
37 
38 // MythUI headers
39 #include "mythuitext.h"
40 #include "mythuibutton.h"
41 #include "mythuibuttonlist.h"
42 #include "mythdialogbox.h"
43 
44 // MythControls headers
45 #include "keygrabber.h"
46 
47 #define LOC QString("MythControls: ")
48 #define LOC_ERR QString("MythControls, Error: ")
49 
51 {
52  Teardown();
53 }
54 
56 {
57  if (m_bindings)
58  {
59  delete m_bindings;
60  m_bindings = nullptr;
61  }
62 
63  m_contexts.clear();
64 }
65 
72 {
73  // Load the theme for this screen
74  bool foundtheme = LoadWindowFromXML("controls-ui.xml", "controls", this);
75  if (!foundtheme)
76  return false;
77 
78  m_description = dynamic_cast<MythUIText *>(GetChild("description"));
79  m_leftList = dynamic_cast<MythUIButtonList *>(GetChild("leftlist"));
80  m_rightList = dynamic_cast<MythUIButtonList *>(GetChild("rightlist"));
81  m_leftDescription = dynamic_cast<MythUIText *>(GetChild("leftdesc"));
82  m_rightDescription = dynamic_cast<MythUIText *>(GetChild("rightdesc"));
83 
84  if (!m_description || !m_leftList || !m_rightList ||
86  {
87  LOG(VB_GENERAL, LOG_ERR, "Theme is missing critical theme elements.");
88  return false;
89  }
90 
95 
102 
103  for (uint i = 0; i < Action::kMaximumNumberOfBindings; i++)
104  {
105  MythUIButton *button = dynamic_cast<MythUIButton *>
106  (GetChild(QString("action_%1").arg(i)));
107 
108  if (!button)
109  {
110  LOG(VB_GENERAL, LOG_ERR, LOC +
111  QString("Unable to load action button action_%1").arg(i));
112 
113  return false;
114  }
115 
117 
118  m_actionButtons.append(button);
119  }
120 
121  BuildFocusList();
122 
124 
125  /* start off with the actions by contexts view */
128  UpdateRightList();
129 
130  return true;
131 }
132 
139 {
141  return;
142 
143  if (direction == 0)
145 }
146 
151 {
152  (void) item;
153  NextPrevWidgetFocus(true);
154 }
155 
160 {
161  (void) item;
164 }
165 
170 {
171  QString key = GetCurrentKey();
172  if (!key.isEmpty())
173  {
174  QString label = tr("Modify Action");
175 
176  MythScreenStack *popupStack =
177  GetMythMainWindow()->GetStack("popup stack");
178 
179  m_menuPopup =
180  new MythDialogBox(label, popupStack, "actionmenu");
181 
182  if (m_menuPopup->Create())
183  popupStack->AddScreen(m_menuPopup);
184 
185  m_menuPopup->SetReturnEvent(this, "action");
186 
187  m_menuPopup->AddButton(tr("Set Binding"));
188  m_menuPopup->AddButton(tr("Remove Binding"));
189  }
190  else // for blank keys, no reason to ask what to do
191  GrabKey();
192 }
193 
198 {
199  QString label = tr("Change View");
200 
201  MythScreenStack *popupStack =
202  GetMythMainWindow()->GetStack("popup stack");
203 
204  m_menuPopup =
205  new MythDialogBox(label, popupStack, "mcviewmenu");
206 
207  if (m_menuPopup->Create())
208  popupStack->AddScreen(m_menuPopup);
209 
210  m_menuPopup->SetReturnEvent(this, "view");
211 
212  m_menuPopup->AddButton(tr("Actions By Context"));
213  m_menuPopup->AddButton(tr("Contexts By Key"));
214  m_menuPopup->AddButton(tr("Keys By Context"));
215 
216 }
217 
219 {
220  QString label = tr("Options");
221 
222  MythScreenStack *popupStack =
223  GetMythMainWindow()->GetStack("popup stack");
224 
225  m_menuPopup =
226  new MythDialogBox(label, popupStack, "optionmenu");
227 
228  if (m_menuPopup->Create())
229  popupStack->AddScreen(m_menuPopup);
230 
231  m_menuPopup->SetReturnEvent(this, "option");
232 
233  m_menuPopup->AddButton(tr("Save"));
234  m_menuPopup->AddButton(tr("Change View"));
235  m_menuPopup->AddButton(tr("Reset All Keys to Defaults"));
236 }
237 
239 {
240  if (m_bindings && m_bindings->HasChanges())
241  {
242  /* prompt user to save changes */
243  QString label = tr("Save changes?");
244 
245  MythScreenStack *popupStack =
246  GetMythMainWindow()->GetStack("popup stack");
247 
248  auto *confirmPopup = new MythConfirmationDialog(popupStack, label, true);
249 
250  if (confirmPopup->Create())
251  popupStack->AddScreen(confirmPopup);
252 
253  confirmPopup->SetReturnEvent(this, "exit");
254  }
255  else
257 }
258 
264 {
265  UpdateRightList();
266 }
267 
273 {
275 }
276 
277 
285  MythUIButtonList *uilist, const QStringList &contents, bool arrows)
286 {
287  // remove all strings from the current list
288  uilist->Reset();
289 
290  // add each new string
291  for (const auto & content : qAsConst(contents))
292  {
293  auto *item = new MythUIButtonListItem(uilist, content);
294  item->setDrawArrow(arrows);
295  }
296 }
297 
302 {
303  // get the selected item in the right list.
305 
306  if (!item)
307  return;
308 
309  QString rtstr = item->GetText();
310 
311  switch(m_currentView)
312  {
313  case kActionsByContext:
315  break;
316  case kKeysByContext:
318  break;
319  case kContextsByKey:
321  break;
322  }
323 }
324 
330 {
331  for (uint i = 0; i < Action::kMaximumNumberOfBindings; i++)
332  m_actionButtons.at(i)->SetText("");
333 
334  if (GetFocusWidget() == m_leftList)
335  {
336  m_description->Reset();
337  return;
338  }
339 
340  const QString context = GetCurrentContext();
341  const QString action = GetCurrentAction();
342 
343  QString desc = m_bindings->GetActionDescription(context, action);
344  m_description->SetText(tr(desc.toLatin1().constData()));
345 
346  QStringList keys = m_bindings->GetActionKeys(context, action);
347  for (int i = 0; (i < keys.count()) &&
348  (i < (int)Action::kMaximumNumberOfBindings); i++)
349  {
350  m_actionButtons.at(i)->SetText(keys[i]);
351  }
352 }
353 
354 
363 {
365  return m_leftList->GetItemCurrent()->GetText();
366 
367  if (GetFocusWidget() == m_leftList)
368  return QString();
369 
370  QString desc = m_rightList->GetItemCurrent()->GetText();
371  int loc = desc.indexOf(" => ");
372  if (loc == -1)
373  return QString(); // Should not happen
374 
376  return desc.left(loc);
377 
378  return desc.mid(loc + 4);
379 }
380 
389 {
391  {
393  {
394  return m_leftList->GetItemCurrent()->GetText();
395  }
396  return QString();
397  }
398 
399  if (GetFocusWidget() == m_leftList)
400  return QString();
401 
403  return QString();
404 
405  QString desc = m_rightList->GetItemCurrent()->GetText();
406  if (kContextList == m_leftListType &&
408  {
409  return desc;
410  }
411 
412  int loc = desc.indexOf(" => ");
413  if (loc == -1)
414  return QString(); // should not happen..
415 
417  return desc.left(loc);
418 
419  QString rv = desc.mid(loc+4);
420  if (rv == "<none>")
421  return QString();
422 
423  return rv;
424 }
425 
431 {
432  for (uint i = 0; i < Action::kMaximumNumberOfBindings; i++)
433  {
434  MythUIButton *button = m_actionButtons.at(i);
435  MythUIType *uitype = GetFocusWidget();
436  if (uitype == button)
437  return i;
438  }
439 
441 }
442 
451 {
452  MythUIButtonListItem* currentButton = nullptr;
453  if (m_leftListType == kKeyList &&
454  (currentButton = m_leftList->GetItemCurrent()))
455  {
456  return currentButton->GetText();
457  }
458 
459  if (GetFocusWidget() == m_leftList)
460  return QString();
461 
463  {
464  QString context = GetCurrentContext();
465  QString action = GetCurrentAction();
466  uint b = GetCurrentButton();
467  QStringList keys = m_bindings->GetActionKeys(context, action);
468 
469  if (b < (uint)keys.count())
470  return keys[b];
471 
472  return QString();
473  }
474 
475  currentButton = m_rightList->GetItemCurrent();
476  QString desc;
477  if (currentButton)
478  desc = currentButton->GetText();
479 
480  int loc = desc.indexOf(" => ");
481  if (loc == -1)
482  return QString(); // Should not happen
483 
484 
485  if (m_rightListType == kKeyList)
486  return desc.left(loc);
487 
488  return desc.mid(loc + 4);
489 }
490 
495 void MythControls::LoadData(const QString &hostname)
496 {
497  /* create the key bindings and the tree */
500 
501  /* Alphabetic order, but jump and global at the top */
502  m_sortedContexts.sort();
505  m_sortedContexts.insert(m_sortedContexts.begin(),
507  m_sortedContexts.insert(m_sortedContexts.begin(),
509 
510  for (const auto & ctx_name : qAsConst(m_sortedContexts))
511  {
512  QStringList actions = m_bindings->GetActions(ctx_name);
513  actions.sort();
514  m_contexts.insert(ctx_name, actions);
515  }
516 }
517 
525 {
526  QString context = GetCurrentContext();
527  QString key = GetCurrentKey();
528  QString action = GetCurrentAction();
529 
530  if (context.isEmpty() || key.isEmpty() || action.isEmpty())
531  {
532  LOG(VB_GENERAL, LOG_ERR,
533  "Unable to delete binding, missing information");
534  return;
535  }
536 
537  if (m_bindings->RemoveActionKey(context, action, key))
538  {
540  return;
541  }
542 
543  QString label = tr("This action is mandatory and needs at least one key "
544  "bound to it. Instead, try rebinding with another key.");
545 
546  MythScreenStack *popupStack =
547  GetMythMainWindow()->GetStack("popup stack");
548 
549  auto *confirmPopup = new MythConfirmationDialog(popupStack, label, false);
550 
551  if (confirmPopup->Create())
552  {
553  confirmPopup->SetReturnEvent(this, "mandatorydelete");
554  popupStack->AddScreen(confirmPopup);
555  }
556  else
557  delete confirmPopup;
558 }
559 
564 void MythControls::ResolveConflict(ActionID *conflict, int error_level,
565  const QString &key)
566 {
567  if (!conflict)
568  return;
569 
570  QString label;
571 
572  bool error = (KeyBindings::kKeyBindingError == error_level);
573 
574  if (error)
575  {
576  label = tr("This key binding conflicts with %1 in the %2 context. "
577  "Unable to bind key.")
578  .arg(conflict->GetAction()).arg(conflict->GetContext());
579  }
580  else
581  {
582  label = tr("This key binding conflicts with %1 in the %2 context. "
583  "Do you want to bind it anyway?")
584  .arg(conflict->GetAction()).arg(conflict->GetContext());
585  }
586 
587  MythScreenStack *popupStack =
588  GetMythMainWindow()->GetStack("popup stack");
589 
590  auto *confirmPopup = new MythConfirmationDialog(popupStack, label, !error);
591 
592  if (!error)
593  {
594  confirmPopup->SetData(QVariant::fromValue(key));
595  confirmPopup->SetReturnEvent(this, "conflict");
596  }
597 
598  if (confirmPopup->Create())
599  popupStack->AddScreen(confirmPopup);
600 
601  delete conflict;
602 }
603 
604 void MythControls::GrabKey(void) const
605 {
606  /* grab a key from the user */
607  MythScreenStack *popupStack =
608  GetMythMainWindow()->GetStack("popup stack");
609 
610  auto *keyGrabPopup = new KeyGrabPopupBox(popupStack);
611 
612  if (keyGrabPopup->Create())
613  popupStack->AddScreen(keyGrabPopup, false);
614 
615  connect(keyGrabPopup, &KeyGrabPopupBox::HaveResult,
616  this, qOverload<const QString&>(&MythControls::AddKeyToAction),
617  Qt::QueuedConnection);
618 }
619 
628 void MythControls::AddKeyToAction(const QString& key, bool ignoreconflict)
629 {
630  QString action = GetCurrentAction();
631  QString context = GetCurrentContext();
632  QStringList keys = m_bindings->GetActionKeys(context, action);
633 
634  // Don't recreating an existing binding...
635  int binding_index = GetCurrentButton();
636  if ((binding_index >= (int)Action::kMaximumNumberOfBindings) ||
637  ((binding_index < keys.size()) && (keys[binding_index] == key)))
638  {
639  return;
640  }
641 
642  if (!ignoreconflict)
643  {
644  // Check for first of the potential conflicts.
645  int err_level = 0;
646  ActionID *conflict = m_bindings->GetConflict(context, key, err_level);
647  if (conflict)
648  {
649  ResolveConflict(conflict, err_level, key);
650 
651  return;
652  }
653  }
654 
655  if (binding_index < keys.count())
656  {
657  m_bindings->ReplaceActionKey(context, action, key,
658  keys[binding_index]);
659  }
660  else
661  {
662  m_bindings->AddActionKey(context, action, key);
663  }
664 
666 }
667 
668 void MythControls::AddKeyToAction(const QString& key)
669 {
670  AddKeyToAction(key, false);
671 }
672 
673 void MythControls::customEvent(QEvent *event)
674 {
675  if (event->type() == DialogCompletionEvent::kEventType)
676  {
677  auto *dce = (DialogCompletionEvent*)(event);
678 
679  QString resultid = dce->GetId();
680  int buttonnum = dce->GetResult();
681 
682  if (resultid == "action")
683  {
684  if (buttonnum == 0)
685  GrabKey();
686  else if (buttonnum == 1)
687  DeleteKey();
688  }
689  else if (resultid == "option")
690  {
691  if (buttonnum == 0)
692  Save();
693  else if (buttonnum == 1)
694  ChangeView();
695  else if (buttonnum == 2)
696  GetMythMainWindow()->JumpTo("Reset All Keys");
697  }
698  else if (resultid == "exit")
699  {
700  if (buttonnum == 1)
701  Save();
702  else
703  Teardown();
704 
705  Close();
706  }
707  else if (resultid == "view")
708  {
709  QStringList contents;
710  QString leftcaption;
711  QString rightcaption;
712 
713  if (buttonnum == 0)
714  {
715  leftcaption = tr("Contexts");
716  rightcaption = tr("Actions");
718  contents = m_bindings->GetContexts();
719  }
720  else if (buttonnum == 1)
721  {
722  leftcaption = tr("Contexts");
723  rightcaption = tr("Keys");
725  contents = m_bindings->GetContexts();
726  }
727  else if (buttonnum == 2)
728  {
729  leftcaption = tr("Keys");
730  rightcaption = tr("Contexts");
732  contents = m_bindings->GetKeys();
733  }
734  else
735  return;
736 
737  m_leftDescription->SetText(leftcaption);
738  m_rightDescription->SetText(rightcaption);
739 
740  SetListContents(m_leftList, contents, true);
742  UpdateRightList();
743 
744  if (GetFocusWidget() != m_leftList)
746  }
747  else if (resultid == "conflict")
748  {
749  if (buttonnum == 1)
750  {
751  QString key = dce->GetData().toString();
752  AddKeyToAction(key, true);
753  }
754  }
755 
756  if (m_menuPopup)
757  m_menuPopup = nullptr;
758  }
759 
760 }
761 
762 /* vim: set expandtab tabstop=4 shiftwidth=4: */
MythUIButton::Clicked
void Clicked()
KeyBindings::GetKeys
QStringList GetKeys(void) const
Returns a list of all keys bound to an action.
Definition: keybindings.cpp:49
MythControls::m_rightListType
ListType m_rightListType
Definition: mythcontrols.h:134
MythDialogBox::SetReturnEvent
void SetReturnEvent(QObject *retobject, const QString &resultid)
Definition: mythdialogbox.cpp:300
MythUIButtonList::GetItemCurrent
MythUIButtonListItem * GetItemCurrent() const
Definition: mythuibuttonlist.cpp:1590
mythuitext.h
MythScreenType::NextPrevWidgetFocus
virtual bool NextPrevWidgetFocus(bool up_or_down)
Definition: mythscreentype.cpp:157
MythControls::m_contexts
QHash< QString, QStringList > m_contexts
actions for a given context
Definition: mythcontrols.h:132
MythUIText::Reset
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitext.cpp:84
error
static void error(const char *str,...)
Definition: vbi.cpp:42
MythControls::m_leftListType
ListType m_leftListType
Definition: mythcontrols.h:133
KeyBindings::kKeyBindingError
@ kKeyBindingError
Definition: keybindings.h:47
MythMainWindow::JumpTo
void JumpTo(const QString &destination, bool pop=true)
Definition: mythmainwindow.cpp:1486
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:402
MythControls::m_actionButtons
QList< MythUIButton * > m_actionButtons
Definition: mythcontrols.h:126
MythControls::Teardown
void Teardown(void)
Definition: mythcontrols.cpp:55
MythUIType::GetChild
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
Definition: mythuitype.cpp:131
build_compdb.content
content
Definition: build_compdb.py:38
DialogCompletionEvent::kEventType
static Type kEventType
Definition: mythdialogbox.h:57
MythUIButtonList::itemSelected
void itemSelected(MythUIButtonListItem *item)
LOC
#define LOC
Definition: mythcontrols.cpp:47
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:16
arg
arg(title).arg(filename).arg(doDelete))
MythControls::DeleteKey
void DeleteKey(void)
Delete the currently active key to action mapping.
Definition: mythcontrols.cpp:524
MythControls::ChangeView
void ChangeView(void)
Change the view.
Definition: mythcontrols.cpp:197
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
KeyBindings::GetActions
QStringList GetActions(const QString &context) const
Get a list of the actions in a context.
Definition: keybindings.cpp:72
MythControls::SetListContents
static void SetListContents(MythUIButtonList *uilist, const QStringList &contents, bool arrows=false)
Set the contents of a list.
Definition: mythcontrols.cpp:284
MythControls::GetCurrentContext
QString GetCurrentContext(void)
Get the currently selected context string.
Definition: mythcontrols.cpp:362
MythControls::ResolveConflict
void ResolveConflict(ActionID *conflict, int error_level, const QString &key)
Resolve a potential conflict.
Definition: mythcontrols.cpp:564
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &stackname)
Definition: mythmainwindow.cpp:329
mythuibuttonlist.h
MythScreenType::GetFocusWidget
MythUIType * GetFocusWidget(void) const
Definition: mythscreentype.cpp:112
MythUIType::TakingFocus
void TakingFocus()
MythControls::ChangeButtonFocus
void ChangeButtonFocus(int direction)
Change button focus in a particular direction.
Definition: mythcontrols.cpp:138
ActionID::GetAction
QString GetAction(void) const
Returns the action name.
Definition: action.h:103
KeyBindings
Encapsulates information about the current keybindings.
Definition: keybindings.h:37
MythControls::GetCurrentKey
QString GetCurrentKey(void)
Get the currently selected key string.
Definition: mythcontrols.cpp:450
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
MythControls::kKeyList
@ kKeyList
Definition: mythcontrols.h:72
KeyBindings::ReplaceActionKey
void ReplaceActionKey(const QString &context_name, const QString &action_name, const QString &newkey, const QString &oldkey)
Replace a key in an action.
Definition: keybindings.cpp:222
MythUIButtonList::itemClicked
void itemClicked(MythUIButtonListItem *item)
MythControls::kActionList
@ kActionList
Definition: mythcontrols.h:73
MythControls::m_menuPopup
MythDialogBox * m_menuPopup
Definition: mythcontrols.h:127
Action::kMaximumNumberOfBindings
static const unsigned int kMaximumNumberOfBindings
The maximum number of keys that can be bound to an action.
Definition: action.h:71
MythControls::RefreshKeyInformation
void RefreshKeyInformation(void)
Updates the list of keys that are shown and the description of the action.
Definition: mythcontrols.cpp:329
MythScreenType::SetFocusWidget
bool SetFocusWidget(MythUIType *widget=nullptr)
Definition: mythscreentype.cpp:117
MythControls::~MythControls
~MythControls() override
Definition: mythcontrols.cpp:50
MythDialogBox::AddButton
void AddButton(const QString &title)
Definition: mythdialogbox.h:197
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:167
MythControls::LeftPressed
void LeftPressed(MythUIButtonListItem *item)
Slot handling a button being pressed in the left list.
Definition: mythcontrols.cpp:150
MythDialogBox::Create
bool Create(void) override
Definition: mythdialogbox.cpp:127
mythcontrols.h
Main header for mythcontrols.
MythControls::m_filters
KeyBindings::Filter m_filters
Definition: mythcontrols.h:135
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:222
MythUIButton
A single button widget.
Definition: mythuibutton.h:22
KeyGrabPopupBox::HaveResult
void HaveResult(QString)
MythControls::kContextList
@ kContextList
Definition: mythcontrols.h:71
uint
unsigned int uint
Definition: compat.h:141
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
KeyBindings::GetKeyContexts
QStringList GetKeyContexts(const QString &key) const
Get the context names in which a key is bound.
Definition: keybindings.cpp:115
kActionsByContext
@ kActionsByContext
Definition: mythcontrols.h:41
MythControls::m_leftDescription
MythUIText * m_leftDescription
Definition: mythcontrols.h:124
MythControls::Save
void Save(void)
Definition: mythcontrols.h:96
MythControls::m_description
MythUIText * m_description
Definition: mythcontrols.h:123
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:85
MythUIButtonListItem::GetText
QString GetText(const QString &name="") const
Definition: mythuibuttonlist.cpp:3305
MythControls::AddKeyToAction
void AddKeyToAction(const QString &key, bool ignoreconflict)
Add a key to the currently selected action.
Definition: mythcontrols.cpp:628
ActionSet::kJumpContext
static const QString kJumpContext
The statically assigned context for jump point actions.
Definition: actionset.h:80
MythControls::GetCurrentButton
uint GetCurrentButton(void)
Returns the focused button, or Action::kMaximumNumberOfBindings if no buttons are focued.
Definition: mythcontrols.cpp:430
MythControls::m_bindings
KeyBindings * m_bindings
Definition: mythcontrols.h:129
KeyGrabPopupBox
Captures a key.
Definition: keygrabber.h:16
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
KeyBindings::RemoveActionKey
bool RemoveActionKey(const QString &context_name, const QString &action_name, const QString &key)
Unbind a key from an action.
Definition: keybindings.cpp:242
MythControls::GetCurrentAction
QString GetCurrentAction(void)
Get the currently selected action string.
Definition: mythcontrols.cpp:388
MythConfirmationDialog
Dialog asking for user confirmation.
Definition: mythdialogbox.h:271
MythControls::RightSelected
void RightSelected(MythUIButtonListItem *item)
Refreshes key information when an item in the right list is selected.
Definition: mythcontrols.cpp:272
mythcorecontext.h
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:692
MythControls::GrabKey
void GrabKey(void) const
Definition: mythcontrols.cpp:604
KeyBindings::GetActionKeys
QStringList GetActionKeys(const QString &context_name, const QString &action_name) const
Get an action's keys.
Definition: keybindings.cpp:95
MythControls::m_sortedContexts
QStringList m_sortedContexts
sorted list of contexts
Definition: mythcontrols.h:130
kKeysByContext
@ kKeysByContext
Definition: mythcontrols.h:41
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:42
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:134
MythControls::RightPressed
void RightPressed(MythUIButtonListItem *item)
Slot handling a button being pressed in the left list.
Definition: mythcontrols.cpp:159
ActionSet::kGlobalContext
static const QString kGlobalContext
The name of global actions.
Definition: actionset.h:82
MythControls::m_currentView
ViewType m_currentView
Definition: mythcontrols.h:120
MythUIButtonList::Reset
void Reset() override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuibuttonlist.cpp:114
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:108
KeyBindings::GetContexts
QStringList GetContexts(void) const
Returns a list of the context names.
Definition: keybindings.cpp:58
build_compdb.action
action
Definition: build_compdb.py:9
KeyBindings::GetContextKeys
QStringList GetContextKeys(const QString &context) const
Get the keys within a context.
Definition: keybindings.cpp:106
MythControls::Create
bool Create(void) override
Loads UI elements from theme.
Definition: mythcontrols.cpp:71
mythuibutton.h
ActionID
A class that uniquely identifies an action.
Definition: action.h:85
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:859
KeyBindings::GetActionDescription
QString GetActionDescription(const QString &context_name, const QString &action_name) const
Get an action's description.
Definition: keybindings.cpp:136
MythControls::UpdateRightList
void UpdateRightList(void)
Update the right list.
Definition: mythcontrols.cpp:301
KeyBindings::AddActionKey
bool AddActionKey(const QString &context_name, const QString &action_name, const QString &key)
Add a key to an action.
Definition: keybindings.cpp:152
musicbrainzngs.caa.hostname
string hostname
Definition: caa.py:17
MythControls::customEvent
void customEvent(QEvent *event) override
Definition: mythcontrols.cpp:673
MythControls::m_rightList
MythUIButtonList * m_rightList
Definition: mythcontrols.h:122
MythControls::ShowMenu
void ShowMenu(void) override
Definition: mythcontrols.cpp:218
MythControls::LeftSelected
void LeftSelected(MythUIButtonListItem *item)
Refreshes the right list when an item in the left list is selected.
Definition: mythcontrols.cpp:263
kContextsByKey
@ kContextsByKey
Definition: mythcontrols.h:41
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:152
mythmainwindow.h
MythControls::LoadData
void LoadData(const QString &hostname)
Load the settings for a particular host.
Definition: mythcontrols.cpp:495
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:52
KeyBindings::GetConflict
ActionID * GetConflict(const QString &context_name, const QString &key, int &level) const
Determine if adding a key would cause a conflict.
Definition: keybindings.cpp:179
MythControls::m_leftList
MythUIButtonList * m_leftList
Definition: mythcontrols.h:121
MythControls::ActionButtonPressed
void ActionButtonPressed()
Slot handling a button being pressed in the left list.
Definition: mythcontrols.cpp:169
KeyBindings::HasChanges
bool HasChanges(void) const
Definition: keybindings.h:78
MythControls::m_rightDescription
MythUIText * m_rightDescription
Definition: mythcontrols.h:125
ActionID::GetContext
QString GetContext(void) const
Returns the context name.
Definition: action.h:100
MythControls::Close
void Close(void) override
Definition: mythcontrols.cpp:238
keygrabber.h