Skip to content
Permalink
Browse files

Add the ability to change the message on an open MythUIBusyDialog.

Add the ability to set and reset the message on an open busy popup
dialog.
  • Loading branch information
cpinkham committed Dec 16, 2010
1 parent 5eac843 commit 2c0bdcfae716cd898690ec932284e5cda5d32de7
@@ -11,7 +11,7 @@
/// Update this whenever the plug-in API changes.
/// Including changes in the libmythdb, libmyth, libmythtv, libmythav* and
/// libmythui class methods used by plug-ins.
#define MYTH_BINARY_VERSION "0.25.20101501-1"
#define MYTH_BINARY_VERSION "0.25.20101601-1"

/** \brief Increment this whenever the MythTV network protocol changes.
*
@@ -13,6 +13,7 @@ MythUIBusyDialog::MythUIBusyDialog(const QString &message,
m_message = message;
else
m_message = tr("Please Wait...");
m_origMessage = m_message;
m_messageText = NULL;
}

@@ -29,6 +30,32 @@ bool MythUIBusyDialog::Create(void)
return true;
}

void MythUIBusyDialog::SetMessage(const QString &message)
{
m_newMessageLock.lock();
m_newMessage = message;
m_haveNewMessage = true;
m_newMessageLock.unlock();
}

void MythUIBusyDialog::Reset(void)
{
SetMessage(m_origMessage);
}

void MythUIBusyDialog::Pulse(void)
{
if (m_haveNewMessage && m_messageText)
{
m_newMessageLock.lock();
m_message = m_newMessage;
m_messageText->SetText(m_message);
m_newMessageLock.unlock();
}

MythUIType::Pulse();
}

bool MythUIBusyDialog::keyPressEvent(QKeyEvent *event)
{
QStringList actions;
@@ -36,9 +36,17 @@ class MPUBLIC MythUIBusyDialog : public MythScreenType

bool Create(void);
bool keyPressEvent(QKeyEvent *event);
void SetMessage(const QString &message);
void Reset(void);

virtual void Pulse(void);

protected:
QString m_origMessage;
QString m_message;
bool m_haveNewMessage;
QString m_newMessage;
QMutex m_newMessageLock;

MythUIText *m_messageText;
};
@@ -317,6 +317,18 @@ void MythScreenType::CloseBusyPopup(void)
m_BusyPopup = NULL;
}

void MythScreenType::SetBusyPopupMessage(const QString &message)
{
if (m_BusyPopup)
m_BusyPopup->SetMessage(message);
}

void MythScreenType::ResetBusyPopup(void)
{
if (m_BusyPopup)
m_BusyPopup->Reset();
}

bool MythScreenType::IsInitialized(void) const
{
return m_IsInitialized;
@@ -103,6 +103,8 @@ class MPUBLIC MythScreenType : public MythUIType

void OpenBusyPopup(QString message = "");
void CloseBusyPopup(void);
void SetBusyPopupMessage(const QString &message);
void ResetBusyPopup(void);

bool m_FullScreen;
bool m_IsDeleting;

0 comments on commit 2c0bdcf

Please sign in to comment.
You can’t perform that action at this time.