MythTV  master
mythcontrols.cpp
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
28 // Qt headers
29 #include <QCoreApplication>
30 #include <QStringList>
31 
32 // MythTV headers
36 #include "libmythui/mythuibutton.h"
38 #include "libmythui/mythuitext.h"
39 
40 // MythControls headers
41 #include "keygrabber.h"
42 #include "mythcontrols.h"
43 
44 #define LOC QString("MythControls: ")
45 #define LOC_ERR QString("MythControls, Error: ")
46 
48 {
49  Teardown();
50 }
51 
53 {
54  if (m_bindings)
55  {
56  delete m_bindings;
57  m_bindings = nullptr;
58  }
59 
60  m_contexts.clear();
61 }
62 
69 {
70  // Load the theme for this screen
71  bool foundtheme = LoadWindowFromXML("controls-ui.xml", "controls", this);
72  if (!foundtheme)
73  return false;
74 
75  m_description = dynamic_cast<MythUIText *>(GetChild("description"));
76  m_leftList = dynamic_cast<MythUIButtonList *>(GetChild("leftlist"));
77  m_rightList = dynamic_cast<MythUIButtonList *>(GetChild("rightlist"));
78  m_leftDescription = dynamic_cast<MythUIText *>(GetChild("leftdesc"));
79  m_rightDescription = dynamic_cast<MythUIText *>(GetChild("rightdesc"));
80 
81  if (!m_description || !m_leftList || !m_rightList ||
83  {
84  LOG(VB_GENERAL, LOG_ERR, "Theme is missing critical theme elements.");
85  return false;
86  }
87 
92 
99 
100  for (uint i = 0; i < Action::kMaximumNumberOfBindings; i++)
101  {
102  MythUIButton *button = dynamic_cast<MythUIButton *>
103  (GetChild(QString("action_%1").arg(i)));
104 
105  if (!button)
106  {
107  LOG(VB_GENERAL, LOG_ERR, LOC +
108  QString("Unable to load action button action_%1").arg(i));
109 
110  return false;
111  }
112 
114 
115  m_actionButtons.append(button);
116  }
117 
118  BuildFocusList();
119 
121 
122  /* start off with the actions by contexts view */
125  UpdateRightList();
126 
127  return true;
128 }
129 
136 {
138  return;
139 
140  if (direction == 0)
142 }
143 
148 {
149  (void) item;
150  NextPrevWidgetFocus(true);
151 }
152 
157 {
158  (void) item;
161 }
162 
167 {
168  QString key = GetCurrentKey();
169  if (!key.isEmpty())
170  {
171  QString label = tr("Modify Action");
172 
173  MythScreenStack *popupStack =
174  GetMythMainWindow()->GetStack("popup stack");
175 
176  m_menuPopup =
177  new MythDialogBox(label, popupStack, "actionmenu");
178 
179  if (m_menuPopup->Create())
180  popupStack->AddScreen(m_menuPopup);
181 
182  m_menuPopup->SetReturnEvent(this, "action");
183 
184  m_menuPopup->AddButton(tr("Set Binding"));
185  m_menuPopup->AddButton(tr("Remove Binding"));
186  }
187  else // for blank keys, no reason to ask what to do
188  GrabKey();
189 }
190 
195 {
196  QString label = tr("Change View");
197 
198  MythScreenStack *popupStack =
199  GetMythMainWindow()->GetStack("popup stack");
200 
201  m_menuPopup =
202  new MythDialogBox(label, popupStack, "mcviewmenu");
203 
204  if (m_menuPopup->Create())
205  popupStack->AddScreen(m_menuPopup);
206 
207  m_menuPopup->SetReturnEvent(this, "view");
208 
209  m_menuPopup->AddButton(tr("Actions By Context"));
210  m_menuPopup->AddButton(tr("Contexts By Key"));
211  m_menuPopup->AddButton(tr("Keys By Context"));
212 
213 }
214 
216 {
217  QString label = tr("Options");
218 
219  MythScreenStack *popupStack =
220  GetMythMainWindow()->GetStack("popup stack");
221 
222  m_menuPopup =
223  new MythDialogBox(label, popupStack, "optionmenu");
224 
225  if (m_menuPopup->Create())
226  popupStack->AddScreen(m_menuPopup);
227 
228  m_menuPopup->SetReturnEvent(this, "option");
229 
230  m_menuPopup->AddButton(tr("Save"));
231  m_menuPopup->AddButton(tr("Change View"));
232  m_menuPopup->AddButton(tr("Reset All Keys to Defaults"));
233 }
234 
236 {
237  if (m_bindings && m_bindings->HasChanges())
238  {
239  /* prompt user to save changes */
240  QString label = tr("Save changes?");
241 
242  MythScreenStack *popupStack =
243  GetMythMainWindow()->GetStack("popup stack");
244 
245  auto *confirmPopup = new MythConfirmationDialog(popupStack, label, true);
246 
247  if (confirmPopup->Create())
248  popupStack->AddScreen(confirmPopup);
249 
250  confirmPopup->SetReturnEvent(this, "exit");
251  }
252  else
254 }
255 
261 {
262  UpdateRightList();
263 }
264 
270 {
272 }
273 
274 
282  MythUIButtonList *uilist, const QStringList &contents, bool arrows)
283 {
284  // remove all strings from the current list
285  uilist->Reset();
286 
287  // add each new string
288  for (const auto & content : qAsConst(contents))
289  {
290  auto *item = new MythUIButtonListItem(uilist, content);
291  item->setDrawArrow(arrows);
292  }
293 }
294 
299 {
300  // get the selected item in the right list.
302 
303  if (!item)
304  return;
305 
306  QString rtstr = item->GetText();
307 
308  switch(m_currentView)
309  {
310  case kActionsByContext:
312  break;
313  case kKeysByContext:
315  break;
316  case kContextsByKey:
318  break;
319  }
320 }
321 
327 {
328  for (uint i = 0; i < Action::kMaximumNumberOfBindings; i++)
329  m_actionButtons.at(i)->SetText("");
330 
331  if (GetFocusWidget() == m_leftList)
332  {
333  m_description->Reset();
334  return;
335  }
336 
337  const QString context = GetCurrentContext();
338  const QString action = GetCurrentAction();
339 
340  QString desc = m_bindings->GetActionDescription(context, action);
341  m_description->SetText(tr(desc.toLatin1().constData()));
342 
343  QStringList keys = m_bindings->GetActionKeys(context, action);
344  for (int i = 0; (i < keys.count()) &&
345  (i < (int)Action::kMaximumNumberOfBindings); i++)
346  {
347  m_actionButtons.at(i)->SetText(keys[i]);
348  }
349 }
350 
351 
360 {
362  return m_leftList->GetItemCurrent()->GetText();
363 
364  if (GetFocusWidget() == m_leftList)
365  return {};
366 
367  QString desc = m_rightList->GetItemCurrent()->GetText();
368  int loc = desc.indexOf(" => ");
369  if (loc == -1)
370  return {}; // Should not happen
371 
373  return desc.left(loc);
374 
375  return desc.mid(loc + 4);
376 }
377 
386 {
388  {
390  {
391  return m_leftList->GetItemCurrent()->GetText();
392  }
393  return {};
394  }
395 
396  if (GetFocusWidget() == m_leftList)
397  return {};
398 
400  return {};
401 
402  QString desc = m_rightList->GetItemCurrent()->GetText();
403  if (kContextList == m_leftListType &&
405  {
406  return desc;
407  }
408 
409  int loc = desc.indexOf(" => ");
410  if (loc == -1)
411  return {}; // should not happen..
412 
414  return desc.left(loc);
415 
416  QString rv = desc.mid(loc+4);
417  if (rv == "<none>")
418  return {};
419 
420  return rv;
421 }
422 
428 {
429  for (uint i = 0; i < Action::kMaximumNumberOfBindings; i++)
430  {
431  MythUIButton *button = m_actionButtons.at(i);
432  MythUIType *uitype = GetFocusWidget();
433  if (uitype == button)
434  return i;
435  }
436 
438 }
439 
448 {
449  MythUIButtonListItem* currentButton = nullptr;
450  if (m_leftListType == kKeyList &&
451  (currentButton = m_leftList->GetItemCurrent()))
452  {
453  return currentButton->GetText();
454  }
455 
456  if (GetFocusWidget() == m_leftList)
457  return {};
458 
460  {
461  QString context = GetCurrentContext();
462  QString action = GetCurrentAction();
463  uint b = GetCurrentButton();
464  QStringList keys = m_bindings->GetActionKeys(context, action);
465 
466  if (b < (uint)keys.count())
467  return keys[b];
468 
469  return {};
470  }
471 
472  currentButton = m_rightList->GetItemCurrent();
473  QString desc;
474  if (currentButton)
475  desc = currentButton->GetText();
476 
477  int loc = desc.indexOf(" => ");
478  if (loc == -1)
479  return {}; // Should not happen
480 
481 
482  if (m_rightListType == kKeyList)
483  return desc.left(loc);
484 
485  return desc.mid(loc + 4);
486 }
487 
492 void MythControls::LoadData(const QString &hostname)
493 {
494  /* create the key bindings and the tree */
497 
498  /* Alphabetic order, but jump and global at the top */
499  m_sortedContexts.sort();
502  m_sortedContexts.insert(m_sortedContexts.begin(),
504  m_sortedContexts.insert(m_sortedContexts.begin(),
506 
507  for (const auto & ctx_name : qAsConst(m_sortedContexts))
508  {
509  QStringList actions = m_bindings->GetActions(ctx_name);
510  actions.sort();
511  m_contexts.insert(ctx_name, actions);
512  }
513 }
514 
522 {
523  QString context = GetCurrentContext();
524  QString key = GetCurrentKey();
525  QString action = GetCurrentAction();
526 
527  if (context.isEmpty() || key.isEmpty() || action.isEmpty())
528  {
529  LOG(VB_GENERAL, LOG_ERR,
530  "Unable to delete binding, missing information");
531  return;
532  }
533 
534  if (m_bindings->RemoveActionKey(context, action, key))
535  {
537  return;
538  }
539 
540  QString label = tr("This action is mandatory and needs at least one key "
541  "bound to it. Instead, try rebinding with another key.");
542 
543  MythScreenStack *popupStack =
544  GetMythMainWindow()->GetStack("popup stack");
545 
546  auto *confirmPopup = new MythConfirmationDialog(popupStack, label, false);
547 
548  if (confirmPopup->Create())
549  {
550  confirmPopup->SetReturnEvent(this, "mandatorydelete");
551  popupStack->AddScreen(confirmPopup);
552  }
553  else
554  delete confirmPopup;
555 }
556 
561 void MythControls::ResolveConflict(ActionID *conflict, int error_level,
562  const QString &key)
563 {
564  if (!conflict)
565  return;
566 
567  QString label;
568 
569  bool error = (KeyBindings::kKeyBindingError == error_level);
570 
571  if (error)
572  {
573  label = tr("This key binding conflicts with %1 in the %2 context. "
574  "Unable to bind key.")
575  .arg(conflict->GetAction(), conflict->GetContext());
576  }
577  else
578  {
579  label = tr("This key binding conflicts with %1 in the %2 context. "
580  "Do you want to bind it anyway?")
581  .arg(conflict->GetAction(), conflict->GetContext());
582  }
583 
584  MythScreenStack *popupStack =
585  GetMythMainWindow()->GetStack("popup stack");
586 
587  auto *confirmPopup = new MythConfirmationDialog(popupStack, label, !error);
588 
589  if (!error)
590  {
591  confirmPopup->SetData(QVariant::fromValue(key));
592  confirmPopup->SetReturnEvent(this, "conflict");
593  }
594 
595  if (confirmPopup->Create())
596  popupStack->AddScreen(confirmPopup);
597 
598  delete conflict;
599 }
600 
601 void MythControls::GrabKey(void) const
602 {
603  /* grab a key from the user */
604  MythScreenStack *popupStack =
605  GetMythMainWindow()->GetStack("popup stack");
606 
607  auto *keyGrabPopup = new KeyGrabPopupBox(popupStack);
608 
609  if (keyGrabPopup->Create())
610  popupStack->AddScreen(keyGrabPopup, false);
611 
612  connect(keyGrabPopup, &KeyGrabPopupBox::HaveResult,
613  this, qOverload<const QString&>(&MythControls::AddKeyToAction),
614  Qt::QueuedConnection);
615 }
616 
625 void MythControls::AddKeyToAction(const QString& key, bool ignoreconflict)
626 {
627  QString action = GetCurrentAction();
628  QString context = GetCurrentContext();
629  QStringList keys = m_bindings->GetActionKeys(context, action);
630 
631  // Don't recreating an existing binding...
632  int binding_index = GetCurrentButton();
633  if ((binding_index >= (int)Action::kMaximumNumberOfBindings) ||
634  ((binding_index < keys.size()) && (keys[binding_index] == key)))
635  {
636  return;
637  }
638 
639  if (!ignoreconflict)
640  {
641  // Check for first of the potential conflicts.
642  int err_level = 0;
643  ActionID *conflict = m_bindings->GetConflict(context, key, err_level);
644  if (conflict)
645  {
646  ResolveConflict(conflict, err_level, key);
647 
648  return;
649  }
650  }
651 
652  if (binding_index < keys.count())
653  {
654  m_bindings->ReplaceActionKey(context, action, key,
655  keys[binding_index]);
656  }
657  else
658  {
659  m_bindings->AddActionKey(context, action, key);
660  }
661 
663 }
664 
665 void MythControls::AddKeyToAction(const QString& key)
666 {
667  AddKeyToAction(key, false);
668 }
669 
670 void MythControls::customEvent(QEvent *event)
671 {
672  if (event->type() == DialogCompletionEvent::kEventType)
673  {
674  auto *dce = (DialogCompletionEvent*)(event);
675 
676  QString resultid = dce->GetId();
677  int buttonnum = dce->GetResult();
678 
679  if (resultid == "action")
680  {
681  if (buttonnum == 0)
682  GrabKey();
683  else if (buttonnum == 1)
684  DeleteKey();
685  }
686  else if (resultid == "option")
687  {
688  if (buttonnum == 0)
689  Save();
690  else if (buttonnum == 1)
691  ChangeView();
692  else if (buttonnum == 2)
693  GetMythMainWindow()->JumpTo("Reset All Keys");
694  }
695  else if (resultid == "exit")
696  {
697  if (buttonnum == 1)
698  Save();
699  else
700  Teardown();
701 
702  Close();
703  }
704  else if (resultid == "view")
705  {
706  QStringList contents;
707  QString leftcaption;
708  QString rightcaption;
709 
710  if (buttonnum == 0)
711  {
712  leftcaption = tr("Contexts");
713  rightcaption = tr("Actions");
715  contents = m_bindings->GetContexts();
716  }
717  else if (buttonnum == 1)
718  {
719  leftcaption = tr("Contexts");
720  rightcaption = tr("Keys");
722  contents = m_bindings->GetContexts();
723  }
724  else if (buttonnum == 2)
725  {
726  leftcaption = tr("Keys");
727  rightcaption = tr("Contexts");
729  contents = m_bindings->GetKeys();
730  }
731  else
732  return;
733 
734  m_leftDescription->SetText(leftcaption);
735  m_rightDescription->SetText(rightcaption);
736 
737  SetListContents(m_leftList, contents, true);
739  UpdateRightList();
740 
741  if (GetFocusWidget() != m_leftList)
743  }
744  else if (resultid == "conflict")
745  {
746  if (buttonnum == 1)
747  {
748  QString key = dce->GetData().toString();
749  AddKeyToAction(key, true);
750  }
751  }
752 
753  if (m_menuPopup)
754  m_menuPopup = nullptr;
755  }
756 
757 }
758 
759 /* 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:301
MythUIButtonList::GetItemCurrent
MythUIButtonListItem * GetItemCurrent() const
Definition: mythuibuttonlist.cpp:1587
mythuitext.h
MythScreenType::NextPrevWidgetFocus
virtual bool NextPrevWidgetFocus(bool up_or_down)
Definition: mythscreentype.cpp:153
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:82
error
static void error(const char *str,...)
Definition: vbi.cpp:36
MythControls::m_leftListType
ListType m_leftListType
Definition: mythcontrols.h:133
KeyBindings::kKeyBindingError
@ kKeyBindingError
Definition: keybindings.h:47
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:386
MythControls::m_actionButtons
QList< MythUIButton * > m_actionButtons
Definition: mythcontrols.h:126
MythControls::Teardown
void Teardown(void)
Definition: mythcontrols.cpp:52
MythUIType::GetChild
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
Definition: mythuitype.cpp:133
MythMainWindow::JumpTo
void JumpTo(const QString &Destination, bool Pop=true)
Definition: mythmainwindow.cpp:1450
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:44
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:16
MythControls::DeleteKey
void DeleteKey(void)
Delete the currently active key to action mapping.
Definition: mythcontrols.cpp:521
MythControls::ChangeView
void ChangeView(void)
Change the view.
Definition: mythcontrols.cpp:194
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
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:281
MythControls::GetCurrentContext
QString GetCurrentContext(void)
Get the currently selected context string.
Definition: mythcontrols.cpp:359
MythControls::ResolveConflict
void ResolveConflict(ActionID *conflict, int error_level, const QString &key)
Resolve a potential conflict.
Definition: mythcontrols.cpp:561
mythuibuttonlist.h
MythScreenType::GetFocusWidget
MythUIType * GetFocusWidget(void) const
Definition: mythscreentype.cpp:113
MythUIType::TakingFocus
void TakingFocus()
MythControls::ChangeButtonFocus
void ChangeButtonFocus(int direction)
Change button focus in a particular direction.
Definition: mythcontrols.cpp:135
ActionID::GetAction
QString GetAction(void) const
Returns the action name.
Definition: action.h:103
KeyBindings
Encapsulates information about the current keybindings.
Definition: keybindings.h:36
MythControls::GetCurrentKey
QString GetCurrentKey(void)
Get the currently selected key string.
Definition: mythcontrols.cpp:447
MythUIButtonListItem
Definition: mythuibuttonlist.h:41
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:326
MythScreenType::SetFocusWidget
bool SetFocusWidget(MythUIType *widget=nullptr)
Definition: mythscreentype.cpp:118
MythControls::~MythControls
~MythControls() override
Definition: mythcontrols.cpp:47
MythDialogBox::AddButton
void AddButton(const QString &title)
Definition: mythdialogbox.h:198
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:166
MythControls::LeftPressed
void LeftPressed(MythUIButtonListItem *item)
Slot handling a button being pressed in the left list.
Definition: mythcontrols.cpp:147
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:206
MythUIButton
A single button widget.
Definition: mythuibutton.h:21
KeyGrabPopupBox::HaveResult
void HaveResult(QString)
MythControls::kContextList
@ kContextList
Definition: mythcontrols.h:71
uint
unsigned int uint
Definition: compat.h:79
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:54
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:3315
MythControls::AddKeyToAction
void AddKeyToAction(const QString &key, bool ignoreconflict)
Add a key to the currently selected action.
Definition: mythcontrols.cpp:625
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:427
MythControls::m_bindings
KeyBindings * m_bindings
Definition: mythcontrols.h:129
KeyGrabPopupBox
Captures a key.
Definition: keygrabber.h:15
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
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:385
MythConfirmationDialog
Dialog asking for user confirmation. Ok and optional Cancel button.
Definition: mythdialogbox.h:272
MythControls::RightSelected
void RightSelected(MythUIButtonListItem *item)
Refreshes key information when an item in the right list is selected.
Definition: mythcontrols.cpp:269
mythcorecontext.h
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:695
MythControls::GrabKey
void GrabKey(void) const
Definition: mythcontrols.cpp:601
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:41
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:132
MythControls::RightPressed
void RightPressed(MythUIButtonListItem *item)
Slot handling a button being pressed in the left list.
Definition: mythcontrols.cpp:156
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:116
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:102
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:68
mythuibutton.h
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:320
ActionID
A class that uniquely identifies an action.
Definition: action.h:84
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:836
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:298
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:670
MythControls::m_rightList
MythUIButtonList * m_rightList
Definition: mythcontrols.h:122
MythControls::ShowMenu
void ShowMenu(void) override
Definition: mythcontrols.cpp:215
MythControls::LeftSelected
void LeftSelected(MythUIButtonListItem *item)
Refreshes the right list when an item in the left list is selected.
Definition: mythcontrols.cpp:260
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:191
mythmainwindow.h
MythControls::LoadData
void LoadData(const QString &hostname)
Load the settings for a particular host.
Definition: mythcontrols.cpp:492
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:50
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:166
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:235
keygrabber.h