screensaver/screensaverplugins/snsrbigclockscreensaverplugin/src/snsroledanalogclockcontainer.cpp
equal
deleted
inserted
replaced
93 } |
93 } |
94 else { |
94 else { |
95 mDestPosition = randomPosition( containerRect ); |
95 mDestPosition = randomPosition( containerRect ); |
96 mInitialize = true; |
96 mInitialize = true; |
97 } |
97 } |
98 // the active area of power save mode needs to be updated when clock container is moved |
|
99 emit activeAreaMoved(); |
|
100 } |
98 } |
101 } |
99 } |
102 |
100 |
103 /*! |
101 /*! |
104 Updates displayed time. |
102 Updates displayed time. |
109 |
107 |
110 // time |
108 // time |
111 mOledClockWidget->tick(); |
109 mOledClockWidget->tick(); |
112 |
110 |
113 // date |
111 // date |
114 if (mCurrentOrientation == Qt::Vertical) { |
112 const char *dateFormat = (mCurrentOrientation == Qt::Vertical) ? |
115 mDateLabel->setPlainText( |
113 gDateFormatVerticalStr : gDateFormatHorizontalStr; |
116 HbExtendedLocale().format(QDate::currentDate(), gDateFormatVerticalStr) |
114 QString dateText = HbExtendedLocale().format( QDate::currentDate(), dateFormat ); |
117 ); |
115 mDateLabel->setPlainText( dateText ); |
118 } else { |
|
119 mDateLabel->setPlainText( |
|
120 HbExtendedLocale().format(QDate::currentDate(), gDateFormatHorizontalStr) |
|
121 ); |
|
122 } |
|
123 |
116 |
124 // position |
117 // position |
125 updatePosition(); |
118 updatePosition(); |
126 |
119 |
127 SCREENSAVER_TEST_FUNC_EXIT("SnsrOledAnalogClockContainer::update") |
120 SCREENSAVER_TEST_FUNC_EXIT("SnsrOledAnalogClockContainer::update") |
128 } |
121 } |
129 |
122 |
130 int SnsrOledAnalogClockContainer::updateIntervalInMilliseconds() |
123 int SnsrOledAnalogClockContainer::updateIntervalInMilliseconds() |
131 { |
124 { |
132 return 60*1000; |
125 return 60*1000; |
|
126 } |
|
127 |
|
128 /*! |
|
129 @copydoc Screensaver::DisplayPowerMode() |
|
130 */ |
|
131 Screensaver::ScreenPowerMode SnsrOledAnalogClockContainer::displayPowerMode() |
|
132 { |
|
133 return Screensaver::ScreenModeLowPower; |
133 } |
134 } |
134 |
135 |
135 /*! |
136 /*! |
136 @copydoc SnsrBigClockContainer::getActiveScreenRows() |
137 @copydoc SnsrBigClockContainer::getActiveScreenRows() |
137 */ |
138 */ |
169 mMainContainer = 0; |
170 mMainContainer = 0; |
170 mClockContainer = 0; |
171 mClockContainer = 0; |
171 mOledClockWidget = 0; |
172 mOledClockWidget = 0; |
172 mDateLabel = 0; |
173 mDateLabel = 0; |
173 mIndicatorWidget = 0; |
174 mIndicatorWidget = 0; |
|
175 mInitialize = false; |
174 |
176 |
175 // load widgets from docml |
177 // load widgets from docml |
176 qDebug() << gOledAnalogLayoutDocml; |
178 qDebug() << gOledAnalogLayoutDocml; |
177 mDocumentObjects = mDocumentLoader.load(gOledAnalogLayoutDocml, &ok); |
179 mDocumentObjects = mDocumentLoader.load(gOledAnalogLayoutDocml, &ok); |
178 Q_ASSERT_X(ok, gOledAnalogLayoutDocml, "Invalid DocML file."); |
180 Q_ASSERT_X(ok, gOledAnalogLayoutDocml, "Invalid DocML file."); |
198 mDocumentLoader.load(gOledAnalogLayoutDocml, gLandscapeSectionName, &ok); |
200 mDocumentLoader.load(gOledAnalogLayoutDocml, gLandscapeSectionName, &ok); |
199 Q_ASSERT_X(ok, gOledAnalogLayoutDocml, "Invalid section in DocML file."); |
201 Q_ASSERT_X(ok, gOledAnalogLayoutDocml, "Invalid section in DocML file."); |
200 } |
202 } |
201 |
203 |
202 mIndicatorWidget->setLayoutType(SnsrIndicatorWidget::IndicatorsCentered); |
204 mIndicatorWidget->setLayoutType(SnsrIndicatorWidget::IndicatorsCentered); |
|
205 mIndicatorWidget->setPowerSaveModeColor(true); |
203 initIndicatorWidget(); |
206 initIndicatorWidget(); |
204 |
207 |
|
208 // powersave mode color |
|
209 mDateLabel->setTextColor(Qt::white); |
|
210 |
205 mBackgroundContainerLayout->addItem(mMainView); |
211 mBackgroundContainerLayout->addItem(mMainView); |
206 } |
212 } |
207 } |
213 } |
208 |
214 |
209 // end of file |
215 // end of file |