src/hbwidgets/devicedialogs/hbdevicemessagebox.cpp
changeset 30 80e4d18b72f5
parent 28 b7da29130b0e
equal deleted inserted replaced
28:b7da29130b0e 30:80e4d18b72f5
    47 }
    47 }
    48 
    48 
    49 HbDeviceMessageBoxPrivate::~HbDeviceMessageBoxPrivate()
    49 HbDeviceMessageBoxPrivate::~HbDeviceMessageBoxPrivate()
    50 {
    50 {
    51     TRACE_ENTRY
    51     TRACE_ENTRY
    52     // information/warning dialogs may be left at server when client is deleted. If there are no connected
    52     // Dialogs may be left at server when client is deleted. If there are no connected
    53     // signals, device dialog widget is not deleted but runs at server and is closed by a timeout.
    53     // signals, device dialog widget is not deleted but runs at server and is closed by a timeout.
    54     if (mProperties[Type].mValue.toInt() != HbMessageBox::MessageTypeQuestion &&
    54     if (q_ptr->receivers(SIGNAL(aboutToClose())) <= 0) {
    55         q_ptr->receivers(SIGNAL(aboutToClose())) <= 0) {
       
    56         mDeviceDialog->disconnect(q_ptr, SLOT(aboutToClose()));
    55         mDeviceDialog->disconnect(q_ptr, SLOT(aboutToClose()));
    57         mDeviceDialog->disconnect(this, SLOT(triggerAction(QVariantMap)));
    56         mDeviceDialog->disconnect(this, SLOT(triggerAction(QVariantMap)));
    58         if (mUpdateTimerId != 0) {
    57         if (mUpdateTimerId != 0) {
    59             // There's a pending update
    58             // There's a pending update
    60             sendToServer(false); // this also kills the timer
    59             sendToServer(false); // this also kills the timer
   534     msg->setAnimationDefinition(animationDefinitionXML);
   533     msg->setAnimationDefinition(animationDefinitionXML);
   535     msg->setIconName(logicalIconName);
   534     msg->setIconName(logicalIconName);
   536     msg->show();
   535     msg->show();
   537     \endcode
   536     \endcode
   538 
   537 
   539     \sa HbMessageBox, HbDialog, HbDeviceDialog
   538     \sa HbMessageBox, HbDialog, HbDeviceDialog, CHbDeviceMessageBoxSymbian
   540 */
   539 */
   541 
   540 
   542 /*!
   541 /*!
   543     \fn void HbDeviceMessageBox::aboutToClose();
   542     \fn void HbDeviceMessageBox::aboutToClose();
   544 
   543 
   562     \var HbDeviceMessageBox::ActionRole HbDeviceMessageBox::RejectButtonRole
   561     \var HbDeviceMessageBox::ActionRole HbDeviceMessageBox::RejectButtonRole
   563     Reject button action.
   562     Reject button action.
   564 */
   563 */
   565 
   564 
   566 /*!
   565 /*!
   567     Constructor.
   566     Constructs HbDeviceMessageBox.
   568 
   567 
   569     \param type Type of the message box.
   568     \param type Type of the message box.
   570     \param parent An optional parameter.
   569     \param parent Parent pointer or 0.
   571 */
   570 */
   572 HbDeviceMessageBox::HbDeviceMessageBox(HbMessageBox::MessageBoxType type, QObject *parent) :
   571 HbDeviceMessageBox::HbDeviceMessageBox(HbMessageBox::MessageBoxType type, QObject *parent) :
   573     QObject(parent), d_ptr(new HbDeviceMessageBoxPrivate)
   572     QObject(parent), d_ptr(new HbDeviceMessageBoxPrivate)
   574 {
   573 {
   575     TRACE_ENTRY
   574     TRACE_ENTRY
   578     d_ptr->init();
   577     d_ptr->init();
   579     TRACE_EXIT
   578     TRACE_EXIT
   580 }
   579 }
   581 
   580 
   582 /*!
   581 /*!
   583     Constructor.
   582     Constructs HbDeviceMessageBox.
   584 
   583 
   585     \param text Message box text.
   584     \param text Message box text.
   586     \param type Type of the message box.
   585     \param type Type of the message box.
   587     \param parent An optional parameter.
   586     \param parent Parent pointer or 0.
   588 */
   587 */
   589 HbDeviceMessageBox::HbDeviceMessageBox(const QString &text, HbMessageBox::MessageBoxType type,
   588 HbDeviceMessageBox::HbDeviceMessageBox(const QString &text, HbMessageBox::MessageBoxType type,
   590     QObject *parent) : QObject(parent), d_ptr(new HbDeviceMessageBoxPrivate)
   589     QObject *parent) : QObject(parent), d_ptr(new HbDeviceMessageBoxPrivate)
   591 {
   590 {
   592     TRACE_ENTRY
   591     TRACE_ENTRY
   596     setText(text);
   595     setText(text);
   597     TRACE_EXIT
   596     TRACE_EXIT
   598 }
   597 }
   599 
   598 
   600 /*!
   599 /*!
   601     Destructs the class.
   600     Destructs HbDeviceMessageBox. The message box launched by show() is closed if aboutToClose()
       
   601     signal is connected to by an application. Otherwise the box is left executing
       
   602     and should close itself by a timeout.
   602 */
   603 */
   603 HbDeviceMessageBox::~HbDeviceMessageBox()
   604 HbDeviceMessageBox::~HbDeviceMessageBox()
   604 {
   605 {
   605     TRACE_ENTRY
   606     TRACE_ENTRY
   606     delete d_ptr;
   607     delete d_ptr;