homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionitemstate.cpp
changeset 62 341166945d65
parent 55 03646e8da489
child 63 52b0f64eeb51
equal deleted inserted replaced
57:2e2dc3d30ca8 62:341166945d65
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 #include <hbmessagebox.h>
    18 #include <hbmessagebox.h>
    19 #include <hbaction.h>
    19 #include <hbaction.h>
       
    20 #include <HbParameterLengthLimiter>
    20 #include <hsmenuservice.h>
    21 #include <hsmenuservice.h>
    21 #include <hsmenueventfactory.h>
    22 #include <hsmenueventfactory.h>
    22 
    23 
    23 #include "hsdeletecollectionitemstate.h"
    24 #include "hsdeletecollectionitemstate.h"
    24 #include "hsmenuevent.h"
    25 #include "hsmenuevent.h"
    30  Deletes app from collection.
    31  Deletes app from collection.
    31  */
    32  */
    32 
    33 
    33 /*!
    34 /*!
    34  Constructor.
    35  Constructor.
    35  \param parent Owner.
    36  \param parent Parent state. 
    36  */
    37  */
    37 HsDeleteCollectionItemState::HsDeleteCollectionItemState(QState *parent) :
    38 HsDeleteCollectionItemState::HsDeleteCollectionItemState(QState *parent) :
    38     QState(parent),
    39     QState(parent),
    39     mItemId(0),
    40     mItemId(0),
    40     mCollectionId(0),
    41     mCollectionId(0),
    55 /*!
    56 /*!
    56  Constructs contained objects.
    57  Constructs contained objects.
    57  */
    58  */
    58 void HsDeleteCollectionItemState::construct()
    59 void HsDeleteCollectionItemState::construct()
    59 {
    60 {
    60     setObjectName(this->parent()->objectName()
    61     setObjectName("/DeleteCollectionItemState");
    61                   + "/DeleteCollectionItemState");
    62     if (this->parent()) {
       
    63         setObjectName(this->parent()->objectName() + objectName());
       
    64     }
    62     connect(this, SIGNAL(exited()), SLOT(cleanUp()));
    65     connect(this, SIGNAL(exited()), SLOT(cleanUp()));
    63 }
    66 }
    64 
    67 
    65 /*!
    68 /*!
    66  Sets entry event.
    69  Sets entry event.
    77     mItemId = data.value(itemIdKey()).toInt();
    80     mItemId = data.value(itemIdKey()).toInt();
    78     mCollectionId = data.value(collectionIdKey()).toInt();
    81     mCollectionId = data.value(collectionIdKey()).toInt();
    79 
    82 
    80     QString message;
    83     QString message;
    81     message.append(
    84     message.append(
    82         hbTrId("txt_applib_dialog_remove_1_from_collection").arg(
    85         HbParameterLengthLimiter("txt_applib_dialog_remove_1_from_collection").arg(
    83             HsMenuService::getName(mItemId)));
    86             HsMenuService::getName(mItemId)));
    84 
    87 
    85     // create and show message box
    88     // create and show message box
    86     mDeleteMessage = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
    89     mDeleteMessage = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
    87     mDeleteMessage->setAttribute(Qt::WA_DeleteOnClose);
    90     mDeleteMessage->setAttribute(Qt::WA_DeleteOnClose);