messagingapp/msgsettings/settingsview/src/msgsettingsview.cpp
changeset 27 e4592d119491
parent 25 84d9eb65b26f
child 41 25fe1fe642e3
child 47 5b14749788d7
equal deleted inserted replaced
25:84d9eb65b26f 27:e4592d119491
    13  *
    13  *
    14  * Description:This is the first view for msgsettings plugin 
    14  * Description:This is the first view for msgsettings plugin 
    15  *
    15  *
    16  */
    16  */
    17 #include <hbmainwindow.h>
    17 #include <hbmainwindow.h>
       
    18 #include <hbgroupbox.h>
       
    19 #include <QGraphicsLinearLayout>
    18 
    20 
    19 #include "msgsettingsview.h"
    21 #include "msgsettingsview.h"
    20 #include "msgsettingsform.h"
    22 #include "msgsettingsform.h"
    21 #include "msgsmscenterview.h"
    23 #include "msgsmscenterview.h"
    22 #include "debugtraces.h"
    24 #include "debugtraces.h"
    23 
    25 
    24 MsgSettingsView::MsgSettingsView(QGraphicsItem *parent) :
    26 //LOCALAIZED CONSTANTS 
    25     MsgBaseView(parent), mSMSCenterView(0)
    27 #define LOC_MESSAGE_SETTINGS_HEADING hbTrId("txt_messaging_title_messaging_settings")
       
    28 
       
    29 MsgSettingsView::MsgSettingsView(SettingsView settingsView,
       
    30                                  QGraphicsItem *parent) :
       
    31     MsgBaseView(parent), mSMSCenterView(0), mSettingsForm(0)
    26 {
    32 {
    27     mSettingsForm = new MsgSettingsForm();
    33     mMainWindow = this->mainWindow();
    28 
    34 
    29     setWidget(mSettingsForm);
    35     // Create parent layout.
    30     mMainWindow = this->mainWindow();
    36     QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical);
       
    37     mainLayout->setContentsMargins(0, 0, 0, 0);
       
    38     mainLayout->setSpacing(0);
       
    39 
       
    40     // Create view heading.
       
    41     HbGroupBox *viewHeading = new HbGroupBox();
       
    42     viewHeading->setHeading(LOC_MESSAGE_SETTINGS_HEADING);
       
    43 
       
    44     mSettingsForm = new MsgSettingsForm(settingsView);
    31 
    45 
    32     connect(mSettingsForm,
    46     connect(mSettingsForm,
    33             SIGNAL(newSMSCCenterClicked(int)),
    47             SIGNAL(newSMSCCenterClicked(int)),
    34             this,
    48             this,
    35             SLOT(onNewSMSCCenterClicked(int)));
    49             SLOT(onNewSMSCCenterClicked(int)));
       
    50 
       
    51     mainLayout->addItem(viewHeading);
       
    52     mainLayout->addItem(mSettingsForm);
       
    53 
       
    54     this->setLayout(mainLayout);
    36 }
    55 }
    37 
    56 
    38 MsgSettingsView::~MsgSettingsView()
    57 MsgSettingsView::~MsgSettingsView()
    39 {
    58 {
    40     delete mSMSCenterView;
    59     delete mSMSCenterView;
    48         delete mSMSCenterView;
    67         delete mSMSCenterView;
    49         mSMSCenterView = NULL;
    68         mSMSCenterView = NULL;
    50     }
    69     }
    51 
    70 
    52     mSMSCenterView = new MsgSMSCenterView(index);
    71     mSMSCenterView = new MsgSMSCenterView(index);
    53     
    72 
    54     connect(mSMSCenterView,
    73     connect(mSMSCenterView,
    55             SIGNAL(smsCenterEditViewClosed()),
    74             SIGNAL(smsCenterEditViewClosed()),
    56             this,
    75             this,
    57             SLOT(onSmsCenterEditViewClosed()));
    76             SLOT(onSmsCenterEditViewClosed()));
    58     
    77 
    59     mMainWindow->addView(mSMSCenterView);        
    78     mMainWindow->addView(mSMSCenterView);
    60     mMainWindow->setCurrentView(mSMSCenterView);
    79     mMainWindow->setCurrentView(mSMSCenterView);
    61 }
    80 }
    62 
    81 
    63 void MsgSettingsView::onSmsCenterEditViewClosed()
    82 void MsgSettingsView::onSmsCenterEditViewClosed()
    64 {
    83 {