ipsservices/nmipssettings/src/nmipssettingstimeeditor.cpp
changeset 68 83cc6bae1de8
parent 40 2c62ef3caffd
equal deleted inserted replaced
67:459da34cdb45 68:83cc6bae1de8
    20 #include <HbDialog>
    20 #include <HbDialog>
    21 #include <HbLabel>
    21 #include <HbLabel>
    22 #include <HbDateTimePicker>
    22 #include <HbDateTimePicker>
    23 #include <HbAction>
    23 #include <HbAction>
    24 #include <HbExtendedLocale>
    24 #include <HbExtendedLocale>
    25 
    25 #include <HbStringUtil>
    26 #include "nmipssettingstimeeditor.h"
    26 #include "nmipssettingstimeeditor.h"
    27 
    27 
    28 /*!
    28 /*!
    29     \class NmIpsSettingsTimeEditor
    29     \class NmIpsSettingsTimeEditor
    30     \brief The class implements a custom HbDataFormViewItem for selecting time with a tumbler.
    30     \brief The class implements a custom HbDataFormViewItem for selecting time with a tumbler.
    42       mTimePickerDialog(0),
    42       mTimePickerDialog(0),
    43       mPrimaryAction(0)
    43       mPrimaryAction(0)
    44 {
    44 {
    45     // Create widget layout.
    45     // Create widget layout.
    46     QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
    46     QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
       
    47     layout->setContentsMargins(0,0,0,0);
    47     this->setLayout(layout); // Takes ownership
    48     this->setLayout(layout); // Takes ownership
    48 
    49 
    49     // Create label.
    50     // Create label.
    50     mButton = new HbPushButton();
    51     mButton = new HbPushButton();
    51     layout->addItem(mButton); // Takes ownership
    52     layout->addItem(mButton); // Takes ownership
    52 
    53 
    53     connect( mButton, SIGNAL(clicked()),
    54     connect( mButton, SIGNAL(clicked()), this, SLOT(launchTimePicker()));
    54              this, SLOT(launchTimePicker()));
       
    55 }
    55 }
    56 
    56 
    57 /*!
    57 /*!
    58     Destructor of NmIpsSettingsTimeEditor.
    58     Destructor of NmIpsSettingsTimeEditor.
    59 */
    59 */
    76     \param time The time to set.
    76     \param time The time to set.
    77  */
    77  */
    78 void NmIpsSettingsTimeEditor::setTime(QTime time)
    78 void NmIpsSettingsTimeEditor::setTime(QTime time)
    79 {
    79 {
    80     mTime = time;
    80     mTime = time;
    81     mButton->setText(mTime.toString(timeFormat()));
    81     HbExtendedLocale locale(HbExtendedLocale::system());
       
    82     mButton->setText(HbStringUtil::convertDigits(locale.format( mTime, r_qtn_time_usual )));
    82 }
    83 }
    83 
    84 
    84 /*!
    85 /*!
    85     Returns the selection dialog heading label.
    86     Returns the selection dialog heading label.
    86     \return The heading label.
    87     \return The heading label.