MythTV  master
mythdialogs.cpp
Go to the documentation of this file.
1 
2 #include <iostream>
3 #include <algorithm>
4 using namespace std;
5 
6 #include <QApplication>
7 #include <QCursor>
8 #include <QDialog>
9 #include <QDir>
10 #include <QLayout>
11 #include <QRegExp>
12 #include <QPixmap>
13 #include <QKeyEvent>
14 #include <QFrame>
15 #include <QPaintEvent>
16 #include <QPainter>
17 #include <QProgressBar>
18 #include <QAbstractButton>
19 
20 #ifdef QWS
21 #include <qwindowsystem_qws.h>
22 #endif
23 
24 #include "mythdialogs.h"
25 #include "mythwidgets.h"
26 #include "lcddevice.h"
27 #include "mythdbcon.h"
28 #include "mythfontproperties.h"
29 #include "mythuihelper.h"
30 #include "mythlogging.h"
31 #include "mythcorecontext.h"
32 #include "mythmainwindow.h"
33 
34 #ifdef _WIN32
35 #undef LoadImage
36 #endif
37 
38 static bool inline IsEGLFS()
39 {
40  return qApp->platformName().contains("egl");
41 }
42 
47 MythDialog::MythDialog(MythMainWindow *parent, const char *name, bool setsize)
48  : QFrame(IsEGLFS() ? nullptr : parent), wmult(0.0), hmult(0.0),
49  screenwidth(0), screenheight(0), xbase(0), ybase(0),
50  m_parent(nullptr), rescode(kDialogCodeAccepted), in_loop(false)
51 {
52  setObjectName(name);
53  if (!parent)
54  {
55  LOG(VB_GENERAL, LOG_ALERT,
56  "Trying to create a dialog without a parent.");
57  return;
58  }
59 
60  MythUIHelper *ui = GetMythUI();
61 
64 
65  defaultBigFont = ui->GetBigFont();
68 
69  setFont(defaultMediumFont);
70 
71  if (setsize)
72  {
73  move(0, 0);
74  setFixedSize(QSize(screenwidth, screenheight));
75  }
76 
77  setAutoFillBackground(true);
78 
79  parent->attach(this);
80  m_parent = parent;
81 }
82 
84 {
85  TeardownAll();
86 }
87 
89 {
90  hide();
91  TeardownAll();
92  QFrame::deleteLater();
93 }
94 
96 {
97  if (m_parent)
98  {
99  m_parent->detach(this);
100  m_parent = nullptr;
101  }
102 }
103 
105 {
106 }
107 
109 {
110  return false;
111 }
112 
113 
114 
116 {
117  show();
118 }
119 
121 {
122  if ((r < kDialogCodeRejected) ||
124  {
125  LOG(VB_GENERAL, LOG_ALERT,
126  QString("MythDialog::setResult(%1) "
127  "called with invalid DialogCode").arg(r));
128  }
129 
130  rescode = r;
131 }
132 
134 {
135  hide();
137  close();
138 }
139 
141 {
142  if (i < 0)
143  {
144  LOG(VB_GENERAL, LOG_ALERT,
145  QString("MythDialog::AcceptItem(%1) "
146  "called with negative index").arg(i));
147  reject();
148  return;
149  }
150 
151  done((DialogCode)((int)kDialogCodeListStart + i));
152 }
153 
155 {
156  return (int)code - (int)kDialogCodeListStart;
157 }
158 
160 {
161  done(Accepted);
162 }
163 
165 {
166  done(Rejected);
167 }
168 
170 {
171  if (in_loop)
172  {
173  LOG(VB_GENERAL, LOG_ALERT,
174  "MythDialog::exec: Recursive call detected.");
175  return kDialogCodeRejected;
176  }
177 
179 
180  Show();
181 
182  in_loop = true;
183 
184  QEventLoop eventLoop;
185  connect(this, SIGNAL(leaveModality()), &eventLoop, SLOT(quit()));
186  eventLoop.exec();
187 
188  DialogCode res = result();
189 
190  return res;
191 }
192 
194 {
195  if (isHidden())
196  return;
197 
198  // Reimplemented to exit a modal when the dialog is hidden.
199  QWidget::hide();
200  if (in_loop)
201  {
202  in_loop = false;
203  emit leaveModality();
204  }
205 }
206 
207 void MythDialog::keyPressEvent( QKeyEvent *e )
208 {
209  bool handled = false;
210  QStringList actions;
211 
212  handled = GetMythMainWindow()->TranslateKeyPress("qt", e, actions);
213 
214  for (int i = 0; i < actions.size() && !handled; i++)
215  {
216  QString action = actions[i];
217  handled = true;
218 
219  if (action == "ESCAPE")
220  reject();
221  else if (action == "UP" || action == "LEFT")
222  {
223  if (focusWidget() &&
224  (focusWidget()->focusPolicy() == Qt::StrongFocus ||
225  focusWidget()->focusPolicy() == Qt::WheelFocus))
226  {
227  }
228  else
229  focusNextPrevChild(false);
230  }
231  else if (action == "DOWN" || action == "RIGHT")
232  {
233  if (focusWidget() &&
234  (focusWidget()->focusPolicy() == Qt::StrongFocus ||
235  focusWidget()->focusPolicy() == Qt::WheelFocus))
236  {
237  }
238  else
239  focusNextPrevChild(true);
240  }
241  else if (action == "MENU")
242  emit menuButtonPressed();
243  else
244  handled = false;
245  }
246 }
247 
263  : MythDialog(parent, name, false)
264 {
265  float wmult, hmult;
266 
268 
269  setLineWidth(3);
270  setMidLineWidth(3);
271  setFrameShape(QFrame::Panel);
272  setFrameShadow(QFrame::Raised);
273  setPalette(parent->palette());
274  popupForegroundColor = palette().color(foregroundRole());
275  setFont(parent->font());
276 
277  hpadding = gCoreContext->GetNumSetting("PopupHeightPadding", 120);
278  wpadding = gCoreContext->GetNumSetting("PopupWidthPadding", 80);
279 
280  vbox = new QVBoxLayout(this);
281  vbox->setMargin((int)(10 * hmult));
282 
283  setAutoFillBackground(true);
284  setWindowFlags(Qt::FramelessWindowHint);
285 }
286 
287 MythPopupBox::MythPopupBox(MythMainWindow *parent, bool graphicPopup,
288  QColor popupForeground, QColor popupBackground,
289  QColor popupHighlight, const char *name)
290  : MythDialog(parent, name, false)
291 {
292  float wmult, hmult;
293 
295 
296  setLineWidth(3);
297  setMidLineWidth(3);
298  setFrameShape(QFrame::Panel);
299  setFrameShadow(QFrame::Raised);
300  setFrameStyle(QFrame::Box | QFrame::Plain);
301  setPalette(parent->palette());
302  setFont(parent->font());
303 
304  hpadding = gCoreContext->GetNumSetting("PopupHeightPadding", 120);
305  wpadding = gCoreContext->GetNumSetting("PopupWidthPadding", 80);
306 
307  vbox = new QVBoxLayout(this);
308  vbox->setMargin((int)(10 * hmult));
309 
310  if (!graphicPopup)
311  {
312  QPalette palette;
313  palette.setColor(backgroundRole(), popupBackground);
314  setPalette(palette);
315  }
316 
317  QPalette palette;
318  palette.setColor(foregroundRole(), popupHighlight);
319  setPalette(palette);
320 
321  popupForegroundColor = popupForeground;
322  setAutoFillBackground(true);
323  setWindowFlags(Qt::FramelessWindowHint);
324 }
325 
326 
328 {
329  // -=>TODO: Temp fix... should re-evalutate/re-code.
330 
331  QList<QWidget *> objList = this->findChildren<QWidget *>();
332 
333  QWidget *pCurr = focusWidget();
334  QWidget *pNew = nullptr;
335  int nCurrIdx = -1;
336  int nIdx;
337 
338  for (nIdx = 0; nIdx < objList.size(); ++nIdx )
339  {
340  if (objList[ nIdx ] == pCurr)
341  {
342  nCurrIdx = nIdx;
343  break;
344  }
345  }
346 
347  if (nCurrIdx == -1)
348  return false;
349 
350  nIdx = nCurrIdx;
351 
352  do
353  {
354  if (next)
355  {
356  ++nIdx;
357 
358  if (nIdx == objList.size())
359  nIdx = 0;
360  }
361  else
362  {
363  --nIdx;
364 
365  if (nIdx < 0)
366  nIdx = objList.size() -1;
367  }
368 
369  pNew = objList[ nIdx ];
370 
371  if (pNew && !pNew->focusProxy() && pNew->isVisibleTo( this ) &&
372  pNew->isEnabled() && (pNew->focusPolicy() != Qt::NoFocus))
373  {
374  pNew->setFocus();
375  return true;
376  }
377  }
378  while (nIdx != nCurrIdx);
379 
380  return false;
381 
382 #if 0
383  QFocusData *focusList = focusData();
384  QObjectList *objList = queryList(nullptr,nullptr,false,true);
385 
386  QWidget *startingPoint = focusList->home();
387  QWidget *candidate = nullptr;
388 
389  QWidget *w = (next) ? focusList->prev() : focusList->next();
390 
391  int countdown = focusList->count();
392 
393  do
394  {
395  if (w && w != startingPoint && !w->focusProxy() &&
396  w->isVisibleTo(this) && w->isEnabled() &&
397  (objList->find((QObject *)w) != -1))
398  {
399  candidate = w;
400  }
401 
402  w = (next) ? focusList->prev() : focusList->next();
403  }
404  while (w && !(candidate && w == startingPoint) && (countdown-- > 0));
405 
406  if (!candidate)
407  return false;
408 
409  candidate->setFocus();
410  return true;
411 #endif
412 }
413 
414 void MythPopupBox::addWidget(QWidget *widget, bool setAppearance)
415 {
416  if (setAppearance == true)
417  {
418  widget->setPalette(palette());
419  widget->setFont(font());
420  }
421 
422  if (widget->metaObject()->className() == QString("MythLabel"))
423  {
424  QPalette palette;
425  palette.setColor(widget->foregroundRole(), popupForegroundColor);
426  widget->setPalette(palette);
427  }
428 
429  vbox->addWidget(widget);
430 }
431 
432 MythLabel *MythPopupBox::addLabel(QString caption, LabelSize size, bool wrap)
433 {
434  MythLabel *label = new MythLabel(caption, this);
435  switch (size)
436  {
437  case Large: label->setFont(defaultBigFont); break;
438  case Medium: label->setFont(defaultMediumFont); break;
439  case Small: label->setFont(defaultSmallFont); break;
440  }
441 
442  label->setMaximumWidth(m_parent->width() / 2);
443  if (wrap)
444  {
445  QChar::Direction text_dir = QChar::DirL;
446  // Get a char from within the string to determine direction.
447  if (caption.length())
448  text_dir = caption[0].direction();
449  Qt::Alignment align = (QChar::DirAL == text_dir) ?
450  Qt::AlignRight : Qt::AlignLeft;
451  label->setAlignment(align);
452  label->setWordWrap(true);
453  }
454 
455  label->setWordWrap(true);
456  addWidget(label, false);
457  return label;
458 }
459 
460 QAbstractButton *MythPopupBox::addButton(QString caption, QObject *target,
461  const char *slot)
462 {
463  if (!target)
464  {
465  target = this;
466  slot = SLOT(defaultButtonPressedHandler());
467  }
468 
469  MythPushButton *button = new MythPushButton(caption, this);
470  m_parent->connect(button, SIGNAL(pressed()), target, slot);
471  addWidget(button, false);
472  return button;
473 }
474 
475 void MythPopupBox::addLayout(QLayout *layout, int stretch)
476 {
477  vbox->addLayout(layout, stretch);
478 }
479 
480 void MythPopupBox::ShowPopup(QObject *target, const char *slot)
481 {
482  ShowPopupAtXY(-1, -1, target, slot);
483 }
484 
485 void MythPopupBox::ShowPopupAtXY(int destx, int desty,
486  QObject *target, const char *slot)
487 {
488  QList< QObject* > objlist = children();
489 
490  for (QList< QObject* >::Iterator it = objlist.begin();
491  it != objlist.end();
492  ++it )
493  {
494  QObject *objs = *it;
495 
496  if (objs->isWidgetType())
497  {
498  QWidget *widget = (QWidget *)objs;
499  widget->adjustSize();
500  }
501  }
502 
503  ensurePolished();
504 
505  int x = 0, y = 0, maxw = 0, poph = 0;
506 
507  for (QList< QObject* >::Iterator it = objlist.begin();
508  it != objlist.end();
509  ++it )
510  {
511  QObject *objs = *it;
512 
513  if (objs->isWidgetType())
514  {
515  QString objname = objs->objectName();
516  if (objname != "nopopsize")
517  {
518  // little extra padding for these guys
519  if (objs->metaObject()->className() ==
520  QString("MythListBox"))
521  {
522  poph += (int)(25 * hmult);
523  }
524 
525  QWidget *widget = (QWidget *)objs;
526  poph += widget->height();
527  if (widget->width() > maxw)
528  maxw = widget->width();
529  }
530  }
531  }
532 
533  poph += (int)(hpadding * hmult);
534  setMinimumHeight(poph);
535 
536  maxw += (int)(wpadding * wmult);
537 
538  int width = (int)(800 * wmult);
539  int height = (int)(600 * hmult);
540 
541  if (parentWidget())
542  {
543  width = parentWidget()->width();
544  height = parentWidget()->height();
545  }
546  else if (m_parent)
547  {
548  width = m_parent->width();
549  height = m_parent->height();
550  }
551 
552  if (destx == -1)
553  x = (width / 2) - (maxw / 2);
554  else
555  x = destx;
556 
557  if (desty == -1)
558  y = (height / 2) - (poph / 2);
559  else
560  y = desty;
561 
562  if (poph + y > height)
563  y = height - poph - (int)(8 * hmult);
564 
565  setFixedSize(maxw, poph);
566  setGeometry(x, y, maxw, poph);
567 
568  if (target && slot)
569  connect(this, SIGNAL(popupDone(int)), target, slot);
570 
571  Show();
572 }
573 
574 void MythPopupBox::keyPressEvent(QKeyEvent *e)
575 {
576  bool handled = false;
577  QStringList actions;
578  handled = GetMythMainWindow()->TranslateKeyPress("qt", e, actions);
579 
580  for (int i = 0; i < actions.size() && !handled; i++)
581  {
582  QString action = actions[i];
583 
584  if (action == "ESCAPE")
585  {
586  reject();
587  handled = true;
588  }
589  }
590 
591  if (!handled)
593 }
594 
596 {
598  emit popupDone(rescode);
599 }
600 
602 {
605 }
606 
608 {
611 }
612 
613 DialogCode MythPopupBox::ExecPopup(QObject *target, const char *slot)
614 {
615  if (!target)
616  ShowPopup(this, SLOT(done(int)));
617  else
618  ShowPopup(target, slot);
619 
620  return exec();
621 }
622 
624  QObject *target, const char *slot)
625 {
626  if (!target)
627  ShowPopupAtXY(destx, desty, this, SLOT(done(int)));
628  else
629  ShowPopupAtXY(destx, desty, target, slot);
630 
631  return exec();
632 }
633 
635 {
636  QList< QObject* > objlist = children();
637 
638  int i = 0;
639  bool foundbutton = false;
640 
641  for (QList< QObject* >::Iterator it = objlist.begin();
642  it != objlist.end();
643  ++it )
644  {
645  QObject *objs = *it;
646 
647  if (objs->isWidgetType())
648  {
649  QWidget *widget = (QWidget *)objs;
650  if (widget->metaObject()->className() ==
651  QString("MythPushButton"))
652  {
653  if (widget->hasFocus())
654  {
655  foundbutton = true;
656  break;
657  }
658  i++;
659  }
660  }
661  }
662  if (foundbutton)
663  {
664  AcceptItem(i);
665  return;
666  }
667 
668  // this bit of code should always work but requires a cast
669  i = 0;
670  for (QList< QObject* >::Iterator it = objlist.begin();
671  it != objlist.end();
672  ++it )
673  {
674  QObject *objs = *it;
675 
676  if (objs->isWidgetType())
677  {
678  QWidget *widget = (QWidget *)objs;
679  if (widget->metaObject()->className() ==
680  QString("MythPushButton"))
681  {
682  MythPushButton *button = dynamic_cast<MythPushButton*>(widget);
683  if (button && button->isDown())
684  {
685  foundbutton = true;
686  break;
687  }
688  i++;
689  }
690  }
691  }
692  if (foundbutton)
693  {
694  AcceptItem(i);
695  return;
696  }
697 
698  LOG(VB_GENERAL, LOG_ALERT, "We should never get here!");
700 }
701 
703  MythMainWindow *parent,
704  const QString &title,
705  const QString &message,
706  QString button_msg)
707 {
708  if (button_msg.isEmpty())
709  button_msg = QObject::tr("OK");
710 
711  MythPopupBox *popup = new MythPopupBox(parent, title.toLatin1().constData());
712 
713  popup->addLabel(message, MythPopupBox::Medium, true);
714  QAbstractButton *okButton = popup->addButton(button_msg, popup, SLOT(accept()));
715  okButton->setFocus();
716  bool ret = (kDialogCodeAccepted == popup->ExecPopup());
717 
718  popup->hide();
719  popup->deleteLater();
720 
721  return ret;
722 }
723 
724 bool MythPopupBox::showGetTextPopup(MythMainWindow *parent, QString title,
725  QString message, QString& text)
726 {
727  MythPopupBox *popup = new MythPopupBox(parent, title.toLatin1().constData());
728 
729  popup->addLabel(message, Medium, true);
730 
731  MythRemoteLineEdit *textEdit =
732  new MythRemoteLineEdit(popup, "chooseEdit");
733 
734  textEdit->setText(text);
735  popup->addWidget(textEdit);
736 
737  popup->addButton(tr("OK"), popup, SLOT(accept()));
738  popup->addButton(tr("Cancel"), popup, SLOT(reject()));
739 
740  textEdit->setFocus();
741 
742  bool ok = (Accepted == popup->ExecPopup());
743  if (ok)
744  text = textEdit->text();
745 
746  popup->hide();
747  popup->deleteLater();
748 
749  return ok;
750 }
751 
753  MythMainWindow *parent,
754  const QString &title, const QString &message,
755  const QString &button1msg, const QString &button2msg,
756  DialogCode default_button)
757 {
758  QStringList buttonmsgs;
759  buttonmsgs += (button1msg.isEmpty()) ?
760  QString("Button 1") : button1msg;
761  buttonmsgs += (button2msg.isEmpty()) ?
762  QString("Button 2") : button2msg;
763  return ShowButtonPopup(
764  parent, title, message, buttonmsgs, default_button);
765 }
766 
768  MythMainWindow *parent,
769  const QString &title,
770  const QString &message,
771  const QStringList &buttonmsgs,
772  DialogCode default_button)
773 {
774  MythPopupBox *popup = new MythPopupBox(parent, title.toLatin1().constData());
775 
776  popup->addLabel(message, Medium, true);
777  popup->addLabel("");
778 
779  const int def = CalcItemIndex(default_button);
780  for (int i = 0; i < buttonmsgs.size(); i++ )
781  {
782  QAbstractButton *but = popup->addButton(buttonmsgs[i]);
783  if (def == i)
784  but->setFocus();
785  }
786 
787  DialogCode ret = popup->ExecPopup();
788 
789  popup->hide();
790  popup->deleteLater();
791 
792  return ret;
793 }
794 
796  const QString &message, int totalSteps,
797  bool cancelButton, const QObject *target, const char *slot)
798  : MythDialog(GetMythMainWindow(), "progress", false)
799 {
800  setObjectName("MythProgressDialog");
802  float wmult, hmult;
803 
805 
806  setFont(GetMythUI()->GetMediumFont());
807 
808  int yoff = screenheight / 3;
809  int xoff = screenwidth / 10;
810  setGeometry(xoff, yoff, screenwidth - xoff * 2, yoff);
811  setFixedSize(QSize(screenwidth - xoff * 2, yoff));
812 
813  msglabel = new MythLabel();
814  msglabel->setText(message);
815 
816  QVBoxLayout *vlayout = new QVBoxLayout();
817  vlayout->addWidget(msglabel);
818 
819  progress = new QProgressBar();
820  progress->setRange(0, totalSteps);
821 
822  QHBoxLayout *hlayout = new QHBoxLayout();
823  hlayout->addWidget(progress);
824 
825  if (cancelButton && slot && target)
826  {
827  MythPushButton *button = new MythPushButton(
828  QObject::tr("Cancel"), nullptr);
829  button->setFocus();
830  hlayout->addWidget(button);
831  connect(button, SIGNAL(pressed()), target, slot);
832  }
833 
834  setTotalSteps(totalSteps);
835 
836  if (LCD *lcddev = LCD::Get())
837  {
838  QList<LCDTextItem> textItems;
839 
840  textItems.append(LCDTextItem(1, ALIGN_CENTERED, message, "Generic",
841  false));
842  lcddev->switchToGeneric(textItems);
843  }
844 
845  hlayout->setSpacing(5);
846 
847  vlayout->setMargin((int)(15 * wmult));
848  vlayout->setStretchFactor(msglabel, 5);
849 
850  QWidget *hbox = new QWidget();
851  hbox->setLayout(hlayout);
852  vlayout->addWidget(hbox);
853 
854  QFrame *vbox = new QFrame(this);
855  vbox->setObjectName(objectName() + "_vbox");
856  vbox->setLineWidth(3);
857  vbox->setMidLineWidth(3);
858  vbox->setFrameShape(QFrame::Panel);
859  vbox->setFrameShadow(QFrame::Raised);
860  vbox->setLayout(vlayout);
861 
862  QVBoxLayout *lay = new QVBoxLayout();
863  lay->addWidget(vbox);
864  setLayout(lay);
865 
866  show();
867 
868  qApp->processEvents();
869 }
870 
872 {
873  hide();
875 }
876 
878 {
879  accept();
880 
881  LCD *lcddev = LCD::Get();
882  if (lcddev)
883  {
884  lcddev->switchToNothing();
885  lcddev->switchToTime();
886  }
887 }
888 
889 void MythProgressDialog::setProgress(int curprogress)
890 {
891  progress->setValue(curprogress);
892  if (curprogress % steps == 0)
893  {
894  qApp->processEvents();
895  if (LCD *lcddev = LCD::Get())
896  {
897  float fProgress = (float)curprogress / m_totalSteps;
898  lcddev->setGenericProgress(fProgress);
899  }
900  }
901 }
902 
903 void MythProgressDialog::setLabel(QString newlabel)
904 {
905  msglabel->setText(newlabel);
906 }
907 
909 {
910  bool handled = false;
911  QStringList actions;
912  handled = GetMythMainWindow()->TranslateKeyPress("qt", e, actions);
913 
914  for (int i = 0; i < actions.size() && !handled; i++)
915  {
916  QString action = actions[i];
917  if (action == "ESCAPE")
918  handled = true;
919  }
920 
921  if (!handled)
923 }
924 
926 {
927  m_totalSteps = totalSteps;
928  progress->setRange(0, totalSteps);
929  steps = totalSteps / 1000;
930  if (steps == 0)
931  steps = 1;
932 }
MythLabel * msglabel
Definition: mythdialogs.h:244
QAbstractButton * addButton(QString caption, QObject *target=nullptr, const char *slot=nullptr)
QColor popupForegroundColor
Definition: mythdialogs.h:184
virtual bool onMediaEvent(MythMediaDevice *mediadevice)
DialogCode ExecPopupAtXY(int destx, int desty, QObject *target=nullptr, const char *slot=nullptr)
void addWidget(QWidget *widget, bool setAppearance=true)
bool TranslateKeyPress(const QString &context, QKeyEvent *e, QStringList &actions, bool allowJumps=true)
Get a list of actions for a keypress in the given context.
void setProgress(int curprogress)
QFont GetMediumFont(void)
static int CalcItemIndex(DialogCode code)
static DialogCode Show2ButtonPopup(MythMainWindow *parent, const QString &title, const QString &message, const QString &button1msg, const QString &button2msg, DialogCode default_button)
MythDialog(MythMainWindow *parent, const char *name="MythDialog", bool setsize=true)
Definition: mythdialogs.cpp:47
int screenwidth
Definition: mythdialogs.h:101
void AcceptItem(int) override
void keyPressEvent(QKeyEvent *e) override
QVBoxLayout * vbox
Definition: mythdialogs.h:183
void popupDone(int)
bool in_loop
Definition: mythdialogs.h:108
void addLayout(QLayout *layout, int stretch=0)
void setResult(DialogCode r)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
MythLabel * addLabel(QString caption, LabelSize size=Medium, bool wrap=false)
void setNoErase(void)
QFont GetSmallFont(void)
DialogCode result(void) const
Definition: mythdialogs.h:63
static bool IsEGLFS()
Definition: mythdialogs.cpp:38
int screenheight
Definition: mythdialogs.h:101
QFont defaultBigFont
Definition: mythdialogs.h:110
QProgressBar * progress
Definition: mythdialogs.h:243
bool focusNextPrevChild(bool next) override
static const DialogCode Accepted
Definition: mythdialogs.h:60
unsigned char r
Definition: ParseText.cpp:340
static LCD * Get(void)
Definition: lcddevice.cpp:86
static bool showGetTextPopup(MythMainWindow *parent, QString title, QString message, QString &text)
void TeardownAll(void)
Definition: mythdialogs.cpp:95
void ShowPopup(QObject *target=nullptr, const char *slot=nullptr)
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:85
DialogCode
Definition: mythdialogs.h:21
#define close
Definition: compat.h:16
static void show(uint8_t *buf, int length)
Definition: ringbuffer.c:335
void setTotalSteps(int totalSteps)
void menuButtonPressed()
virtual void deleteLater(void)
Definition: mythdialogs.cpp:88
virtual void reject()
virtual void setText(const QString &text)
virtual void done(int)
virtual void accept()
const char * name
Definition: ParseText.cpp:339
QFont GetBigFont(void)
DialogCode exec(void)
Child of MythDialog used for most popup menus in MythTV.
Definition: mythdialogs.h:117
MythUIHelper * GetMythUI()
virtual QString text()
Base dialog for most dialogs in MythTV using the old UI.
Definition: mythdialogs.h:50
void switchToTime()
Definition: lcddevice.cpp:578
MythMainWindow * GetMythMainWindow(void)
static bool showOkPopup(MythMainWindow *parent, const QString &title, const QString &message, QString button_msg=QString())
void switchToNothing()
Definition: lcddevice.cpp:701
PictureAttribute next(PictureAttributeSupported supported, PictureAttribute attribute)
int GetNumSetting(const QString &key, int defaultval=0)
virtual void AcceptItem(int)
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
static DialogCode ShowButtonPopup(MythMainWindow *parent, const QString &title, const QString &message, const QStringList &buttonmsgs, DialogCode default_button)
DialogCode rescode
Definition: mythdialogs.h:106
void keyPressEvent(QKeyEvent *) override
void accept(void) override
DialogCode ExecPopup(QObject *target=nullptr, const char *slot=nullptr)
QFont defaultMediumFont
Definition: mythdialogs.h:110
void hide(void)
void reject(void) override
float hmult
Definition: mythdialogs.h:100
void detach(QWidget *child)
Definition: lcddevice.h:165
void setLabel(QString newlabel)
MythProgressDialog(const QString &message, int totalSteps=0, bool cancelButton=false, const QObject *target=nullptr, const char *slot=nullptr) MDEPRECATED
Create a progress bar dialog.
void leaveModality()
QFont defaultSmallFont
Definition: mythdialogs.h:110
void keyPressEvent(QKeyEvent *e) override
virtual void Show(void)
void attach(QWidget *child)
void defaultButtonPressedHandler(void)
void ShowPopupAtXY(int destx, int desty, QObject *target=nullptr, const char *slot=nullptr)
A LineEdit that does special things when you press number keys (enter letters with multiple presses,...
Definition: mythwidgets.h:163
MythMainWindow * m_parent
Definition: mythdialogs.h:104
void GetScreenSettings(float &wmult, float &hmult)
float wmult
Definition: mythdialogs.h:100
static const DialogCode Rejected
Definition: mythdialogs.h:59
void deleteLater(void) override
MythPopupBox(MythMainWindow *parent, const char *name="MythPopupBox") MDEPRECATED