screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsroleddigitalclockcontainer.cpp
changeset 86 e4f038c420f7
parent 69 87476091b3f5
equal deleted inserted replaced
81:7dd137878ff8 86:e4f038c420f7
   103         }
   103         }
   104         else {
   104         else {
   105             mDestPosition = randomPosition( containerRect );
   105             mDestPosition = randomPosition( containerRect );
   106             mInitialize = true;
   106             mInitialize = true;
   107         }
   107         }
   108         // the active area of power save mode needs to be updated when clock container is moved
       
   109         emit activeAreaMoved();
       
   110     }
   108     }
   111 }
   109 }
   112 
   110 
   113 /*!
   111 /*!
   114     Updates displayed time and date.
   112     Updates displayed time and date.
   126     mAmPmLabel->setPlainText(
   124     mAmPmLabel->setPlainText(
   127         HbExtendedLocale().format(QTime::currentTime(), gAmPmFormatStr)
   125         HbExtendedLocale().format(QTime::currentTime(), gAmPmFormatStr)
   128         );
   126         );
   129 
   127 
   130     // date
   128     // date
   131     if (mCurrentOrientation == Qt::Vertical) {
   129     const char *dateFormat = (mCurrentOrientation == Qt::Vertical) ?
   132         mDateLabel->setPlainText(
   130         gDateFormatVerticalStr : gDateFormatHorizontalStr;
   133             HbExtendedLocale().format(
   131     QString dateText = HbExtendedLocale().format( QDate::currentDate(), dateFormat );
   134                 QDate::currentDate(), gDateFormatVerticalStr)
   132     mDateLabel->setPlainText( dateText );
   135             );
       
   136     } else {
       
   137         mDateLabel->setPlainText(
       
   138             HbExtendedLocale().format(
       
   139                 QDate::currentDate(), gDateFormatHorizontalStr)
       
   140             );
       
   141     }
       
   142 
   133 
   143     updatePosition();
   134     updatePosition();
   144 
   135 
   145     SCREENSAVER_TEST_FUNC_EXIT("SnsrOledDigitalClockContainer::update")
   136     SCREENSAVER_TEST_FUNC_EXIT("SnsrOledDigitalClockContainer::update")
   146 }
   137 }
   147 
   138 
   148 int SnsrOledDigitalClockContainer::updateIntervalInMilliseconds()
   139 int SnsrOledDigitalClockContainer::updateIntervalInMilliseconds()
   149 {
   140 {
   150     return 60*1000;
   141     return 60*1000;
       
   142 }
       
   143 
       
   144 /*!
       
   145     @copydoc Screensaver::DisplayPowerMode()
       
   146  */
       
   147 Screensaver::ScreenPowerMode SnsrOledDigitalClockContainer::displayPowerMode()
       
   148 {
       
   149     return Screensaver::ScreenModeLowPower;
   151 }
   150 }
   152 
   151 
   153 /*!
   152 /*!
   154     @copydoc SnsrBigClockContainer::getActiveScreenRows()
   153     @copydoc SnsrBigClockContainer::getActiveScreenRows()
   155  */
   154  */
   186     mClockContainer = 0;
   185     mClockContainer = 0;
   187     mDateLabel = 0;
   186     mDateLabel = 0;
   188     mTimeLabel = 0;
   187     mTimeLabel = 0;
   189     mAmPmLabel = 0;
   188     mAmPmLabel = 0;
   190     mIndicatorWidget = 0;
   189     mIndicatorWidget = 0;
       
   190     mInitialize = false;
   191     
   191     
   192     // load widgets from docml
   192     // load widgets from docml
   193     bool ok(false);
   193     bool ok(false);
   194     qDebug() << gOledDigitalLayoutDocml;
   194     qDebug() << gOledDigitalLayoutDocml;
   195     mDocumentObjects = mDocumentLoader.load(gOledDigitalLayoutDocml, &ok);
   195     mDocumentObjects = mDocumentLoader.load(gOledDigitalLayoutDocml, &ok);
   220             mDocumentLoader.load(gOledDigitalLayoutDocml, gLandscapeSectionName, &ok);
   220             mDocumentLoader.load(gOledDigitalLayoutDocml, gLandscapeSectionName, &ok);
   221             Q_ASSERT_X(ok, gOledDigitalLayoutDocml, "Invalid section in DocML file.");
   221             Q_ASSERT_X(ok, gOledDigitalLayoutDocml, "Invalid section in DocML file.");
   222         }
   222         }
   223 
   223 
   224         mIndicatorWidget->setLayoutType(SnsrIndicatorWidget::IndicatorsCentered);
   224         mIndicatorWidget->setLayoutType(SnsrIndicatorWidget::IndicatorsCentered);
       
   225         mIndicatorWidget->setPowerSaveModeColor(true);
   225         initIndicatorWidget();
   226         initIndicatorWidget();
   226                
   227 
       
   228         // powersave mode color
       
   229         mDateLabel->setTextColor(Qt::white);
       
   230         mAmPmLabel->setTextColor(Qt::white);
       
   231 
   227         mBackgroundContainerLayout->addItem(mMainView);
   232         mBackgroundContainerLayout->addItem(mMainView);
   228     }
   233     }
   229 }
   234 }
   230 
   235 
   231 // end of file
   236 // end of file