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 
91  connect(m_leftList, SIGNAL(itemSelected(MythUIButtonListItem*)),
93  connect(m_leftList, SIGNAL(itemClicked(MythUIButtonListItem*)),
95 
96  connect(m_rightList, SIGNAL(itemSelected(MythUIButtonListItem*)),
98  connect(m_rightList, SIGNAL(itemClicked(MythUIButtonListItem*)),
100  connect(m_rightList, SIGNAL(TakingFocus()),
101  SLOT(RefreshKeyInformation()));
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 
116  connect(button, SIGNAL(Clicked()), SLOT(ActionButtonPressed()));
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 
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, SIGNAL(HaveResult(QString)),
616  SLOT(AddKeyToAction(QString)), Qt::QueuedConnection);
617 }
618 
627 void MythControls::AddKeyToAction(const QString& key, bool ignoreconflict)
628 {
629  QString action = GetCurrentAction();
630  QString context = GetCurrentContext();
631  QStringList keys = m_bindings->GetActionKeys(context, action);
632 
633  // Don't recreating an existing binding...
634  int binding_index = GetCurrentButton();
635  if ((binding_index >= (int)Action::kMaximumNumberOfBindings) ||
636  ((binding_index < keys.size()) && (keys[binding_index] == key)))
637  {
638  return;
639  }
640 
641  if (!ignoreconflict)
642  {
643  // Check for first of the potential conflicts.
644  int err_level = 0;
645  ActionID *conflict = m_bindings->GetConflict(context, key, err_level);
646  if (conflict)
647  {
648  ResolveConflict(conflict, err_level, key);
649 
650  return;
651  }
652  }
653 
654  if (binding_index < keys.count())
655  {
656  m_bindings->ReplaceActionKey(context, action, key,
657  keys[binding_index]);
658  }
659  else
660  {
661  m_bindings->AddActionKey(context, action, key);
662  }
663 
665 }
666 
667 void MythControls::customEvent(QEvent *event)
668 {
669  if (event->type() == DialogCompletionEvent::kEventType)
670  {
671  auto *dce = (DialogCompletionEvent*)(event);
672 
673  QString resultid = dce->GetId();
674  int buttonnum = dce->GetResult();
675 
676  if (resultid == "action")
677  {
678  if (buttonnum == 0)
679  GrabKey();
680  else if (buttonnum == 1)
681  DeleteKey();
682  }
683  else if (resultid == "option")
684  {
685  if (buttonnum == 0)
686  Save();
687  else if (buttonnum == 1)
688  ChangeView();
689  else if (buttonnum == 2)
690  GetMythMainWindow()->JumpTo("Reset All Keys");
691  }
692  else if (resultid == "exit")
693  {
694  if (buttonnum == 1)
695  Save();
696  else
697  Teardown();
698 
699  Close();
700  }
701  else if (resultid == "view")
702  {
703  QStringList contents;
704  QString leftcaption;
705  QString rightcaption;
706 
707  if (buttonnum == 0)
708  {
709  leftcaption = tr("Contexts");
710  rightcaption = tr("Actions");
712  contents = m_bindings->GetContexts();
713  }
714  else if (buttonnum == 1)
715  {
716  leftcaption = tr("Contexts");
717  rightcaption = tr("Keys");
719  contents = m_bindings->GetContexts();
720  }
721  else if (buttonnum == 2)
722  {
723  leftcaption = tr("Keys");
724  rightcaption = tr("Contexts");
726  contents = m_bindings->GetKeys();
727  }
728  else
729  return;
730 
731  m_leftDescription->SetText(leftcaption);
732  m_rightDescription->SetText(rightcaption);
733 
734  SetListContents(m_leftList, contents, true);
736  UpdateRightList();
737 
738  if (GetFocusWidget() != m_leftList)
740  }
741  else if (resultid == "conflict")
742  {
743  if (buttonnum == 1)
744  {
745  QString key = dce->GetData().toString();
746  AddKeyToAction(key, true);
747  }
748  }
749 
750  if (m_menuPopup)
751  m_menuPopup = nullptr;
752  }
753 
754 }
755 
756 /* vim: set expandtab tabstop=4 shiftwidth=4: */
KeyBindings::GetKeys
QStringList GetKeys(void) const
Returns a list of all keys bound to an action.
Definition: keybindings.cpp:48
MythControls::m_rightListType
ListType m_rightListType
Definition: mythcontrols.h:130
MythDialogBox::SetReturnEvent
void SetReturnEvent(QObject *retobject, const QString &resultid)
Definition: mythdialogbox.cpp:275
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:128
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:83
error
static void error(const char *str,...)
Definition: vbi.cpp:42
MythControls::m_leftListType
ListType m_leftListType
Definition: mythcontrols.h:129
KeyBindings::kKeyBindingError
@ kKeyBindingError
Definition: keybindings.h:40
MythMainWindow::JumpTo
void JumpTo(const QString &destination, bool pop=true)
Definition: mythmainwindow.cpp:1450
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:402
MythControls::m_actionButtons
QList< MythUIButton * > m_actionButtons
Definition: mythcontrols.h:122
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:130
build_compdb.content
content
Definition: build_compdb.py:38
DialogCompletionEvent::kEventType
static Type kEventType
Definition: mythdialogbox.h:57
LOC
#define LOC
Definition: mythcontrols.cpp:47
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:15
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:71
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:309
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:36
MythControls::GetCurrentKey
QString GetCurrentKey(void)
Get the currently selected key string.
Definition: mythcontrols.cpp:450
MythUIButtonListItem
Definition: mythuibuttonlist.h:27
MythControls::kKeyList
@ kKeyList
Definition: mythcontrols.h:69
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:221
MythControls::kActionList
@ kActionList
Definition: mythcontrols.h:70
MythControls::m_menuPopup
MythDialogBox * m_menuPopup
Definition: mythcontrols.h:123
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
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:137
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:131
mythcontrols.h
Main header for mythcontrols.
MythDialogBox::AddButton
void AddButton(const QString &title, QVariant data=0, bool newMenu=false, bool setCurrent=false)
Definition: mythdialogbox.cpp:300
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:222
MythUIButton
A single button widget.
Definition: mythuibutton.h:21
MythControls::kContextList
@ kContextList
Definition: mythcontrols.h:68
uint
unsigned int uint
Definition: compat.h:140
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:57
KeyBindings::GetKeyContexts
QStringList GetKeyContexts(const QString &key) const
Get the context names in which a key is bound.
Definition: keybindings.cpp:114
kActionsByContext
@ kActionsByContext
Definition: mythcontrols.h:41
MythControls::m_leftDescription
MythUIText * m_leftDescription
Definition: mythcontrols.h:120
MythControls::Save
void Save(void)
Definition: mythcontrols.h:93
MythControls::m_description
MythUIText * m_description
Definition: mythcontrols.h:119
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:63
MythUIButtonListItem::GetText
QString GetText(const QString &name="") const
Definition: mythuibuttonlist.cpp:3313
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:125
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:241
MythControls::GetCurrentAction
QString GetCurrentAction(void)
Get the currently selected action string.
Definition: mythcontrols.cpp:388
MythConfirmationDialog
Dialog asking for user confirmation. Ok and optional Cancel button.
Definition: mythdialogbox.h:221
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
KeyBindings::GetActionKeys
QStringList GetActionKeys(const QString &context_name, const QString &action_name) const
Get an action's keys.
Definition: keybindings.cpp:94
MythControls::GrabKey
void GrabKey(void)
Definition: mythcontrols.cpp:604
MythControls::m_sortedContexts
QStringList m_sortedContexts
sorted list of contexts
Definition: mythcontrols.h:126
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:135
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:116
MythUIButtonList::Reset
void Reset() override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuibuttonlist.cpp:113
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:107
KeyBindings::GetContexts
QStringList GetContexts(void) const
Returns a list of the context names.
Definition: keybindings.cpp:57
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:105
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:84
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:856
KeyBindings::GetActionDescription
QString GetActionDescription(const QString &context_name, const QString &action_name) const
Get an action's description.
Definition: keybindings.cpp:135
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:151
musicbrainzngs.caa.hostname
string hostname
Definition: caa.py:17
MythControls::customEvent
void customEvent(QEvent *event) override
Definition: mythcontrols.cpp:667
MythControls::m_rightList
MythUIButtonList * m_rightList
Definition: mythcontrols.h:118
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
MythControls::AddKeyToAction
void AddKeyToAction(const QString &key, bool ignoreconflict=false)
Add a key to the currently selected action.
Definition: mythcontrols.cpp:627
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:143
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:49
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:178
MythControls::m_leftList
MythUIButtonList * m_leftList
Definition: mythcontrols.h:117
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:71
MythControls::m_rightDescription
MythUIText * m_rightDescription
Definition: mythcontrols.h:121
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