screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsrdigitalclockcontainer.cpp
changeset 92 6727c5d0afc7
parent 77 4b195f3bea29
equal deleted inserted replaced
85:35368b604b28 92:6727c5d0afc7
   102     mAmPmLabel->setPlainText(
   102     mAmPmLabel->setPlainText(
   103         HbExtendedLocale().format(QTime::currentTime(), gAmPmFormatStr)
   103         HbExtendedLocale().format(QTime::currentTime(), gAmPmFormatStr)
   104         );
   104         );
   105 
   105 
   106     // date
   106     // date
   107     if (mCurrentOrientation == Qt::Vertical) {
   107     const char *dateFormat = (mCurrentOrientation == Qt::Vertical) ?
   108         mDateLabel->setPlainText(
   108         gDateFormatVerticalStr : gDateFormatHorizontalStr;
   109             HbExtendedLocale().format(
   109     QString dateText = HbExtendedLocale().format( QDate::currentDate(), dateFormat );
   110                 QDate::currentDate(), gDateFormatVerticalStr)
   110     mDateLabel->setPlainText( dateText );
   111             );
       
   112     } else {
       
   113         mDateLabel->setPlainText(
       
   114             HbExtendedLocale().format(
       
   115                 QDate::currentDate(), gDateFormatHorizontalStr)
       
   116             );
       
   117     }
       
   118 
   111 
   119     SCREENSAVER_TEST_FUNC_EXIT("SnsrDigitalClockContainer::update")
   112     SCREENSAVER_TEST_FUNC_EXIT("SnsrDigitalClockContainer::update")
   120 }
   113 }
   121 
   114 
       
   115 /*!
       
   116     @copydoc SnsrBigClockContainer::updateIntervalInMilliseconds()
       
   117  */
   122 int SnsrDigitalClockContainer::updateIntervalInMilliseconds()
   118 int SnsrDigitalClockContainer::updateIntervalInMilliseconds()
   123 {
   119 {
   124     return 1000;
   120     return 1000;
   125 }
   121 }
   126 
   122 
       
   123 /*!
       
   124     @copydoc SnsrBigClockContainer::loadWidgets()
       
   125  */
   127 void SnsrDigitalClockContainer::loadWidgets()
   126 void SnsrDigitalClockContainer::loadWidgets()
   128 {
   127 {
   129     // reset widget pointers, any previous widgets are already deleted by now
   128     // reset widget pointers, any previous widgets are already deleted by now
   130     mMainView = 0;
   129     mMainView = 0;
   131     mDateLabel = 0;
   130     mDateLabel = 0;
   165             mDocumentLoader.load(gDigitalLayoutDocml, gLandscapeSectionName, &ok);
   164             mDocumentLoader.load(gDigitalLayoutDocml, gLandscapeSectionName, &ok);
   166             Q_ASSERT_X(ok, gDigitalLayoutDocml, "Invalid section in DocML file.");
   165             Q_ASSERT_X(ok, gDigitalLayoutDocml, "Invalid section in DocML file.");
   167         }
   166         }
   168 
   167 
   169         mIndicatorWidget->setLayoutType(SnsrIndicatorWidget::IndicatorsCentered);
   168         mIndicatorWidget->setLayoutType(SnsrIndicatorWidget::IndicatorsCentered);
       
   169         mIndicatorWidget->setPowerSaveModeColor(false);
   170         initIndicatorWidget();
   170         initIndicatorWidget();
   171         
   171         
   172         mBackgroundContainerLayout->addItem(mMainView);
   172         mBackgroundContainerLayout->addItem(mMainView);
   173 
   173 
   174         //connect( mSwipeWidget, SIGNAL(swipeDownDetected()), SIGNAL(unlockRequested()) );
   174         //connect( mSwipeWidget, SIGNAL(swipeDownDetected()), SIGNAL(unlockRequested()) );