MythTV  master
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | Private Attributes | List of all members
MythPopupBox Class Reference

Child of MythDialog used for most popup menus in MythTV. More...

#include <mythdialogs.h>

Inheritance diagram for MythPopupBox:
Inheritance graph
[legend]
Collaboration diagram for MythPopupBox:
Collaboration graph
[legend]

Public Types

enum  LabelSize { Large, Medium, Small }
 

Public Slots

void AcceptItem (int) override
 
void accept (void) override
 
void reject (void) override
 
- Public Slots inherited from MythDialog
DialogCode exec (void)
 
virtual void done (int)
 
virtual void AcceptItem (int)
 
virtual void accept ()
 
virtual void reject ()
 

Signals

void popupDone (int)
 
- Signals inherited from MythDialog
void menuButtonPressed ()
 
void leaveModality ()
 

Public Member Functions

 MythPopupBox (MythMainWindow *parent, const char *name="MythPopupBox") MDEPRECATED
 
 MythPopupBox (MythMainWindow *parent, bool graphicPopup, QColor popupForeground, QColor popupBackground, QColor popupHighlight, const char *name="MythPopupBox") MDEPRECATED
 
void addWidget (QWidget *widget, bool setAppearance=true)
 
void addLayout (QLayout *layout, int stretch=0)
 
MythLabeladdLabel (QString caption, LabelSize size=Medium, bool wrap=false)
 
QAbstractButton * addButton (QString caption, QObject *target=nullptr, const char *slot=nullptr)
 
void ShowPopup (QObject *target=nullptr, const char *slot=nullptr)
 
void ShowPopupAtXY (int destx, int desty, QObject *target=nullptr, const char *slot=nullptr)
 
DialogCode ExecPopup (QObject *target=nullptr, const char *slot=nullptr)
 
DialogCode ExecPopupAtXY (int destx, int desty, QObject *target=nullptr, const char *slot=nullptr)
 
- Public Member Functions inherited from MythDialog
 MythDialog (MythMainWindow *parent, const char *name="MythDialog", bool setsize=true)
 
DialogCode result (void) const
 
virtual void Show (void)
 
void hide (void)
 
void setNoErase (void)
 
virtual bool onMediaEvent (MythMediaDevice *mediadevice)
 
void setResult (DialogCode r)
 
virtual void deleteLater (void)
 

Static Public Member Functions

static bool showOkPopup (MythMainWindow *parent, const QString &title, const QString &message, QString button_msg=QString())
 
static DialogCode Show2ButtonPopup (MythMainWindow *parent, const QString &title, const QString &message, const QString &button1msg, const QString &button2msg, DialogCode default_button)
 
static DialogCode ShowButtonPopup (MythMainWindow *parent, const QString &title, const QString &message, const QStringList &buttonmsgs, DialogCode default_button)
 
static bool showGetTextPopup (MythMainWindow *parent, QString title, QString message, QString &text)
 
- Static Public Member Functions inherited from MythDialog
static int CalcItemIndex (DialogCode code)
 

Protected Slots

void defaultButtonPressedHandler (void)
 

Protected Member Functions

 ~MythPopupBox ()=default
 
bool focusNextPrevChild (bool next) override
 
void keyPressEvent (QKeyEvent *e) override
 
- Protected Member Functions inherited from MythDialog
 ~MythDialog ()
 
void TeardownAll (void)
 
void keyPressEvent (QKeyEvent *e) override
 

Private Attributes

QVBoxLayout * vbox
 
QColor popupForegroundColor
 
int hpadding
 
int wpadding
 

Additional Inherited Members

- Static Public Attributes inherited from MythDialog
static const DialogCode Rejected = kDialogCodeRejected
 
static const DialogCode Accepted = kDialogCodeAccepted
 
static const DialogCode ListStart = kDialogCodeListStart
 
- Protected Attributes inherited from MythDialog
float wmult
 
float hmult
 
int screenwidth
 
int screenheight
 
int xbase
 
int ybase
 
MythMainWindowm_parent
 
DialogCode rescode
 
bool in_loop
 
QFont defaultBigFont
 
QFont defaultMediumFont
 
QFont defaultSmallFont
 

Detailed Description

Child of MythDialog used for most popup menus in MythTV.

Deprecated:
Due for removal, use libmythui's MythScreenType, MythDialogBox or MythConfirmationDialog instead

Most users of this class just call one of the static functions These create a dialog and block until it returns with a DialogCode.

When creating an instance yourself and using ExecPopup() or ShowPopup() you can optionally pass it a target and slot for the popupDone(int) signal. It will be sent with the DialogCode that the exec function returns, except it is cast to an int. This is most useful for ShowPopup() which doesn't block or return the result() when the popup is finished.

Definition at line 117 of file mythdialogs.h.

Member Enumeration Documentation

◆ LabelSize

Enumerator
Large 
Medium 
Small 

Definition at line 130 of file mythdialogs.h.

Constructor & Destructor Documentation

◆ MythPopupBox() [1/2]

MythPopupBox::MythPopupBox ( MythMainWindow parent,
const char *  name = "MythPopupBox" 
)

Definition at line 262 of file mythdialogs.cpp.

Referenced by ShowButtonPopup(), showGetTextPopup(), and showOkPopup().

◆ MythPopupBox() [2/2]

MythPopupBox::MythPopupBox ( MythMainWindow parent,
bool  graphicPopup,
QColor  popupForeground,
QColor  popupBackground,
QColor  popupHighlight,
const char *  name = "MythPopupBox" 
)

Definition at line 287 of file mythdialogs.cpp.

◆ ~MythPopupBox()

MythPopupBox::~MythPopupBox ( )
protecteddefault

Member Function Documentation

◆ addWidget()

void MythPopupBox::addWidget ( QWidget *  widget,
bool  setAppearance = true 
)

Definition at line 414 of file mythdialogs.cpp.

Referenced by addButton(), addLabel(), and showGetTextPopup().

◆ addLayout()

void MythPopupBox::addLayout ( QLayout *  layout,
int  stretch = 0 
)

Definition at line 475 of file mythdialogs.cpp.

◆ addLabel()

MythLabel * MythPopupBox::addLabel ( QString  caption,
LabelSize  size = Medium,
bool  wrap = false 
)

Definition at line 432 of file mythdialogs.cpp.

Referenced by ShowButtonPopup(), showGetTextPopup(), and showOkPopup().

◆ addButton()

QAbstractButton * MythPopupBox::addButton ( QString  caption,
QObject *  target = nullptr,
const char *  slot = nullptr 
)

Definition at line 460 of file mythdialogs.cpp.

Referenced by ShowButtonPopup(), showGetTextPopup(), and showOkPopup().

◆ ShowPopup()

void MythPopupBox::ShowPopup ( QObject *  target = nullptr,
const char *  slot = nullptr 
)

Definition at line 480 of file mythdialogs.cpp.

Referenced by ExecPopup().

◆ ShowPopupAtXY()

void MythPopupBox::ShowPopupAtXY ( int  destx,
int  desty,
QObject *  target = nullptr,
const char *  slot = nullptr 
)

Definition at line 485 of file mythdialogs.cpp.

Referenced by ExecPopupAtXY(), and ShowPopup().

◆ ExecPopup()

DialogCode MythPopupBox::ExecPopup ( QObject *  target = nullptr,
const char *  slot = nullptr 
)

Definition at line 613 of file mythdialogs.cpp.

Referenced by ShowButtonPopup(), showGetTextPopup(), and showOkPopup().

◆ ExecPopupAtXY()

DialogCode MythPopupBox::ExecPopupAtXY ( int  destx,
int  desty,
QObject *  target = nullptr,
const char *  slot = nullptr 
)

Definition at line 623 of file mythdialogs.cpp.

◆ showOkPopup()

bool MythPopupBox::showOkPopup ( MythMainWindow parent,
const QString &  title,
const QString &  message,
QString  button_msg = QString() 
)
static

Definition at line 702 of file mythdialogs.cpp.

Referenced by SchemaUpgradeWizard::PromptForUpgrade().

◆ Show2ButtonPopup()

DialogCode MythPopupBox::Show2ButtonPopup ( MythMainWindow parent,
const QString &  title,
const QString &  message,
const QString &  button1msg,
const QString &  button2msg,
DialogCode  default_button 
)
static

Definition at line 752 of file mythdialogs.cpp.

◆ ShowButtonPopup()

DialogCode MythPopupBox::ShowButtonPopup ( MythMainWindow parent,
const QString &  title,
const QString &  message,
const QStringList &  buttonmsgs,
DialogCode  default_button 
)
static

Definition at line 767 of file mythdialogs.cpp.

Referenced by MediaMonitor::selectDrivePopup(), and Show2ButtonPopup().

◆ showGetTextPopup()

bool MythPopupBox::showGetTextPopup ( MythMainWindow parent,
QString  title,
QString  message,
QString &  text 
)
static

Definition at line 724 of file mythdialogs.cpp.

◆ AcceptItem

void MythPopupBox::AcceptItem ( int  i)
overrideslot

Definition at line 595 of file mythdialogs.cpp.

Referenced by defaultButtonPressedHandler().

◆ accept

void MythPopupBox::accept ( void  )
overrideslot

Definition at line 601 of file mythdialogs.cpp.

Referenced by showGetTextPopup(), and showOkPopup().

◆ reject

void MythPopupBox::reject ( void  )
overrideslot

Definition at line 607 of file mythdialogs.cpp.

Referenced by keyPressEvent(), and showGetTextPopup().

◆ popupDone

void MythPopupBox::popupDone ( int  )
signal

◆ focusNextPrevChild()

bool MythPopupBox::focusNextPrevChild ( bool  next)
overrideprotected

Definition at line 327 of file mythdialogs.cpp.

◆ keyPressEvent()

void MythPopupBox::keyPressEvent ( QKeyEvent *  e)
overrideprotected

Definition at line 574 of file mythdialogs.cpp.

◆ defaultButtonPressedHandler

void MythPopupBox::defaultButtonPressedHandler ( void  )
protectedslot

Definition at line 634 of file mythdialogs.cpp.

Referenced by addButton().

Member Data Documentation

◆ vbox

QVBoxLayout* MythPopupBox::vbox
private

Definition at line 183 of file mythdialogs.h.

Referenced by addLayout(), addWidget(), and MythPopupBox().

◆ popupForegroundColor

QColor MythPopupBox::popupForegroundColor
private

Definition at line 184 of file mythdialogs.h.

Referenced by addWidget(), and MythPopupBox().

◆ hpadding

int MythPopupBox::hpadding
private

Definition at line 185 of file mythdialogs.h.

Referenced by MythPopupBox(), and ShowPopupAtXY().

◆ wpadding

int MythPopupBox::wpadding
private

Definition at line 185 of file mythdialogs.h.

Referenced by MythPopupBox(), and ShowPopupAtXY().


The documentation for this class was generated from the following files: