videocollection/videofiledetailsview/tsrc/testplugin/stub/src/hbmessagebox.cpp
changeset 24 7d93ee07fb27
parent 15 cf5481c2bc0b
child 44 518105d52e45
equal deleted inserted replaced
20:b9e04db066d4 24:7d93ee07fb27
    15 * 
    15 * 
    16 */
    16 */
    17 
    17 
    18 #include "hbmessagebox.h"
    18 #include "hbmessagebox.h"
    19 
    19 
    20 bool HbMessageBox::mQuestionReturnValue = false;
    20 QString HbMessageBox::mLatestTxt = "";
       
    21 int HbMessageBox::mType = -1;
       
    22 int HbMessageBox::mAttribute = -1;
       
    23 int HbMessageBox::mOpenCallCount = 0;
       
    24 int HbMessageBox::mShowCallCount = 0;
    21 
    25 
    22 QString HbMessageBox::mLatestTxt = "";
    26 HbMessageBox::HbMessageBox(MessageBoxType type, QGraphicsItem *parent)
       
    27 {
       
    28     Q_UNUSED(parent);
       
    29     HbMessageBox::mType = type;
       
    30     
       
    31     HbAction *action = new HbAction();
       
    32     mActions.append(action);
       
    33     action = new HbAction();
       
    34     mActions.append(action);   
       
    35 }
    23 
    36 
       
    37 HbMessageBox::HbMessageBox(const QString &text, MessageBoxType type, QGraphicsItem *parent)
       
    38 {
       
    39     Q_UNUSED(parent);
       
    40     HbMessageBox::mLatestTxt = text;
       
    41     HbMessageBox::mType = type;
       
    42     
       
    43     HbAction *action = new HbAction();
       
    44     mActions.append(action);
       
    45     action = new HbAction();
       
    46     mActions.append(action);   
       
    47 }
    24 
    48 
       
    49 HbMessageBox::~HbMessageBox()
       
    50 {
       
    51     while(!mActions.isEmpty())
       
    52     {
       
    53         delete mActions.takeFirst();
       
    54     }
       
    55 }
    25 
    56 
       
    57 void HbMessageBox::show()
       
    58 {
       
    59     HbMessageBox::mShowCallCount++;
       
    60 }
    26 
    61 
       
    62 void HbMessageBox::open( QObject* receiver, const char* member )
       
    63 {
       
    64     Q_UNUSED(receiver);
       
    65     Q_UNUSED(member);
       
    66     HbMessageBox::mOpenCallCount++;
       
    67 }
       
    68 
       
    69 void HbMessageBox::emitDialogFinished( QObject* receiver, const char* member, int actionNum )
       
    70 {
       
    71     if(connect(this, SIGNAL(finished(HbAction *)), receiver, member))
       
    72     {
       
    73         emit finished(mActions.value(actionNum));
       
    74         disconnect(this, SIGNAL(finished(HbAction *)), receiver, member);
       
    75     }
       
    76 }
       
    77 
       
    78 void HbMessageBox::setAttribute(int attribute)
       
    79 {
       
    80     HbMessageBox::mAttribute = attribute;
       
    81 }