messagingapp/msgsettings/settingsview/src/msgsmscenterview.cpp
changeset 37 518b245aa84c
parent 25 84d9eb65b26f
child 47 5b14749788d7
equal deleted inserted replaced
25:84d9eb65b26f 37:518b245aa84c
    13  *
    13  *
    14  * Description:This class is for sms message center view 
    14  * Description:This class is for sms message center view 
    15  *
    15  *
    16  */
    16  */
    17 #include <hbaction.h>
    17 #include <hbaction.h>
       
    18 #include <hbgroupbox.h>
       
    19 #include <QGraphicsLinearLayout>
    18 
    20 
    19 #include "msgsmscenterview.h"
    21 #include "msgsmscenterview.h"
    20 #include "msgsmscentersettingsform.h"
    22 #include "msgsmscentersettingsform.h"
    21 #include "debugtraces.h"
    23 #include "debugtraces.h"
    22 
    24 
       
    25 #define LOC_NEW_SMS_CENTRE hbTrId("txt_messaging_title_new_sms_message_centre")
       
    26 #define LOC_EDIT_SMS_CENTRE hbTrId("txt_messaging_title_edit_sms_message_centre")
       
    27 
    23 MsgSMSCenterView::MsgSMSCenterView(int view, QGraphicsItem *parent) :
    28 MsgSMSCenterView::MsgSMSCenterView(int view, QGraphicsItem *parent) :
    24     MsgBaseView(parent)
    29     MsgBaseView(parent)
    25 {
    30 {
       
    31     // Create parent layout.
       
    32     QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical);
       
    33     mainLayout->setContentsMargins(0, 0, 0, 0);
       
    34     mainLayout->setSpacing(0);
       
    35 
       
    36     // Create view heading.
       
    37     HbGroupBox *viewHeading = new HbGroupBox();
       
    38     if (view == -1)
       
    39     {
       
    40         viewHeading->setHeading(LOC_NEW_SMS_CENTRE);
       
    41     }
       
    42     else
       
    43     {
       
    44         viewHeading->setHeading(LOC_EDIT_SMS_CENTRE);
       
    45     }
       
    46 
    26     mSMSCenterSettingsForm = new MsgSMSCenterSettingsForm(view);
    47     mSMSCenterSettingsForm = new MsgSMSCenterSettingsForm(view);
    27 
    48 
    28     setWidget(mSMSCenterSettingsForm);
    49     HbAction* backAction = new HbAction(Hb::BackNaviAction, this);
    29 
       
    30     HbAction* backAction = new HbAction(Hb::BackAction, this);
       
    31     setNavigationAction(backAction);
    50     setNavigationAction(backAction);
    32 
    51 
    33     connect(mSMSCenterSettingsForm,
    52     connect(mSMSCenterSettingsForm,
    34             SIGNAL(deleteMessageCentreAndClose()),
    53             SIGNAL(deleteMessageCentreAndClose()),
    35             this,
    54             this,
    36             SLOT(onCloseMessageCenterView()));
    55             SLOT(onCloseMessageCenterView()));
       
    56 
       
    57     connect(backAction, SIGNAL(triggered()), this, SLOT(onBackAction()));
    37     
    58     
    38     connect(backAction, SIGNAL(triggered()), this, SLOT(onBackAction()));
    59     mainLayout->addItem(viewHeading);
       
    60     mainLayout->addItem(mSMSCenterSettingsForm);
       
    61     this->setLayout(mainLayout);
    39 }
    62 }
    40 
    63 
    41 MsgSMSCenterView::~MsgSMSCenterView()
    64 MsgSMSCenterView::~MsgSMSCenterView()
    42 {
    65 {
    43     setParent(NULL);
    66     setParent(NULL);