32 #include <QStringList>
33 #include <QCoreApplication>
48 #define LOC QString("MythControls: ")
49 #define LOC_ERR QString("MythControls, Error: ")
93 bool foundtheme =
false;
110 LOG(VB_GENERAL, LOG_ERR,
"Theme is missing critical theme elements.");
129 (
GetChild(QString(
"action_%1").arg(i)));
133 LOG(VB_GENERAL, LOG_ERR,
LOC +
134 QString(
"Unable to load action button action_%1").arg(i));
197 QString label = tr(
"Modify Action");
222 QString label = tr(
"Change View");
243 QString label = tr(
"Options");
266 QString label = tr(
"Save changes?");
274 if (confirmPopup->
Create())
315 QStringList::const_iterator it = contents.begin();
316 for (; it != contents.end(); ++it)
318 QString
tmp = *it; tmp.detach();
335 QString rtstr = item->
GetText();
373 for (
int i = 0; (i < keys.count()) &&
374 (i < (
int)Action::kMaximumNumberOfBindings); i++)
397 int loc = desc.indexOf(
" => ");
402 return desc.left(loc);
404 return desc.mid(loc + 4);
441 int loc = desc.indexOf(
" => ");
446 return desc.left(loc);
448 QString rv = desc.mid(loc+4);
465 if (uitype == button)
469 return Action::kMaximumNumberOfBindings;
485 return currentButton->
GetText();
498 if (b < (
uint)keys.count())
507 desc = currentButton->
GetText();
509 int loc = desc.indexOf(
" => ");
515 return desc.left(loc);
517 return desc.mid(loc + 4);
542 QString ctx_name = *it;
562 if (context.isEmpty() || key.isEmpty() || action.isEmpty())
564 LOG(VB_GENERAL, LOG_ERR,
565 "Unable to delete binding, missing information");
575 QString label = tr(
"This action is mandatory and needs at least one key "
576 "bound to it. Instead, try rebinding with another key.");
584 if (confirmPopup->
Create())
608 label = tr(
"This key binding conflicts with %1 in the %2 context. "
609 "Unable to bind key.")
612 label = tr(
"This key binding conflicts with %1 in the %2 context. "
613 "Do you want to bind it anyway?")
624 confirmPopup->
SetData(qVariantFromValue(key));
628 if (confirmPopup->
Create())
642 if (keyGrabPopup->
Create())
643 popupStack->
AddScreen(keyGrabPopup,
false);
645 connect(keyGrabPopup, SIGNAL(HaveResult(QString)),
666 ((binding_index < keys.size()) && (keys[binding_index] == key)))
684 if (binding_index < keys.count())
686 keys[binding_index]);
699 QString resultid = dce->
GetId();
702 if (resultid ==
"action")
706 else if (buttonnum == 1)
709 else if (resultid ==
"option")
713 else if (buttonnum == 1)
715 else if (buttonnum == 2)
718 else if (resultid ==
"exit")
727 else if (resultid ==
"view")
729 QStringList contents;
730 QString leftcaption, rightcaption;
734 leftcaption = tr(
"Contexts");
735 rightcaption = tr(
"Actions");
739 else if (buttonnum == 1)
741 leftcaption = tr(
"Contexts");
742 rightcaption = tr(
"Keys");
746 else if (buttonnum == 2)
748 leftcaption = tr(
"Keys");
749 rightcaption = tr(
"Contexts");
766 else if (resultid ==
"conflict")
770 QString key = dce->
GetData().toString();