|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 //Includes |
|
20 |
|
21 #include <QDebug> |
|
22 #include <QTimer> |
|
23 #include <e32base.h> |
|
24 #include <hbiconitem.h> |
|
25 #include <hbpushbutton.h> |
|
26 #include <hbmainwindow.h> |
|
27 #include <hbdocumentloader.h> |
|
28 #include <QAbstractItemModel> |
|
29 |
|
30 |
|
31 //User Includes |
|
32 #include "glxmodelparm.h" |
|
33 #include "glxeffectengine.h" |
|
34 #include "glxdocloaderdefs.h" |
|
35 #include "glxslideshowwidget.h" |
|
36 #include <glxlog.h> |
|
37 #include <glxtracer.h> |
|
38 |
|
39 |
|
40 GlxSlideShowWidget::GlxSlideShowWidget( QGraphicsItem *parent ) : HbScrollArea(parent), |
|
41 mEffectEngine(NULL), mContinueButton(NULL), mItemIndex(1), |
|
42 mSelIndex(0), mSlideTimer(NULL), mModel(NULL) |
|
43 { |
|
44 TRACER("GlxSlideShowWidget::GlxSlideShowWidget()"); |
|
45 } |
|
46 |
|
47 void GlxSlideShowWidget::setSlideShowWidget(HbDocumentLoader *DocLoader) |
|
48 { |
|
49 |
|
50 //To:Do error handling |
|
51 TRACER("GlxSlideShowWidget::setSlideShowWidget()"); |
|
52 //create the effect engine |
|
53 mEffectEngine = new GlxSlideShowEffectEngine(); |
|
54 |
|
55 // Now load the view and the contents. |
|
56 mContinueButton = static_cast<HbPushButton*>(DocLoader->findWidget(GLXSLIDESHOW_PB)); |
|
57 mContinueButton->hide(); |
|
58 mIsPause = false; |
|
59 |
|
60 |
|
61 for ( int i = 0; i < NBR_ITEM ; i++) { |
|
62 mIconItems[i] = new HbIconItem(this); |
|
63 mIconItems[i]->setBrush(QBrush(Qt::black)); |
|
64 } |
|
65 |
|
66 mSlideTimer = new QTimer(); |
|
67 mItemList.clear(); |
|
68 |
|
69 //Add the signal-slot for this widget. |
|
70 addConnections(); |
|
71 |
|
72 //Create the settings for the effects |
|
73 mEffectEngine->readSetting(); |
|
74 mEffectEngine->registerEffect(QString("HbIconItem")); |
|
75 |
|
76 //provide the xml info for the effect to take place |
|
77 HbEffect::add( QString("HbIconItem"), QString(":/data/transition.fxml"), QString( "Move" )); |
|
78 HbEffect::add( QString("HbIconItem"), QString(":/data/transitionleft.fxml"), QString( "LeftMove" )); |
|
79 HbEffect::add( QString("HbIconItem"), QString(":/data/transitionright.fxml"), QString( "RightMove" )); |
|
80 } |
|
81 |
|
82 GlxSlideShowWidget::~GlxSlideShowWidget() |
|
83 { |
|
84 TRACER("GlxSlideShowWidget::~GlxSlideShowWidget()"); |
|
85 |
|
86 //Delete the resources allocated |
|
87 cleanUp(); |
|
88 |
|
89 if(mContinueButton) |
|
90 { |
|
91 delete mContinueButton; |
|
92 mContinueButton = NULL; |
|
93 } |
|
94 } |
|
95 |
|
96 |
|
97 void GlxSlideShowWidget::cleanUp() |
|
98 { |
|
99 TRACER("GlxSlideShowWidget::cleanUp()"); |
|
100 removeConnections(); |
|
101 |
|
102 if(mEffectEngine) |
|
103 { |
|
104 mEffectEngine->deRegisterEffect( QString("HbIconItem") ); |
|
105 delete mEffectEngine; |
|
106 mEffectEngine = NULL; |
|
107 } |
|
108 |
|
109 for ( int i = 0; i < NBR_ITEM ; i++) |
|
110 { |
|
111 delete mIconItems[i] ; |
|
112 mIconItems[i] = NULL; |
|
113 } |
|
114 |
|
115 if(mSlideTimer) |
|
116 { |
|
117 delete mSlideTimer; |
|
118 mSlideTimer = NULL; |
|
119 } |
|
120 |
|
121 clearCurrentModel(); |
|
122 HbEffect::remove( QString("HbIconItem"), QString(":/data/transition.fxml"), QString( "Move" )); |
|
123 HbEffect::remove( QString("HbIconItem"), QString(":/data/transitionleft.fxml"), QString( "LeftMove" )); |
|
124 HbEffect::remove( QString("HbIconItem"), QString(":/data/transitionright.fxml"), QString( "RightMove" )); |
|
125 } |
|
126 |
|
127 void GlxSlideShowWidget::setModel (QAbstractItemModel *model) |
|
128 { |
|
129 TRACER("GlxSlideShowWidget::setModel()"); |
|
130 if ( model == mModel ) { |
|
131 return ; |
|
132 } |
|
133 clearCurrentModel(); |
|
134 mModel = model; |
|
135 initializeNewModel(); |
|
136 resetSlideShow(); |
|
137 } |
|
138 |
|
139 void GlxSlideShowWidget::setItemGeometry(QRect screenRect) |
|
140 { |
|
141 TRACER("GlxSlideShowWidget::setItemGeometry()"); |
|
142 int index = mItemIndex; |
|
143 mScreenRect = screenRect; |
|
144 mIconItems[index]->setGeometry(mScreenRect); |
|
145 index = ( mItemIndex + 1) % NBR_ITEM; |
|
146 mIconItems[index]->setGeometry( QRect( mScreenRect.width(), mScreenRect.top(), mScreenRect.width(), mScreenRect.height() ) ); |
|
147 index = mItemIndex ? mItemIndex - 1 : NBR_ITEM - 1; |
|
148 mIconItems[index]->setGeometry( QRect( -mScreenRect.width(), mScreenRect.top(), mScreenRect.width(), mScreenRect.height() ) ); |
|
149 } |
|
150 |
|
151 void GlxSlideShowWidget::triggeredEffect() |
|
152 { |
|
153 TRACER("GlxSlideShowWidget::triggeredEffect()"); |
|
154 int index = mItemIndex; |
|
155 mSlideTimer->stop(); |
|
156 mItemList.clear(); |
|
157 User::ResetInactivityTime(); |
|
158 |
|
159 mItemList.append( mIconItems[index] ); |
|
160 if ( mEffectEngine->slideShowMoveDir() == MOVE_FORWARD ) { |
|
161 index = ( mItemIndex + 1) % NBR_ITEM; |
|
162 } |
|
163 else { |
|
164 index = mItemIndex ? mItemIndex - 1 : NBR_ITEM - 1; |
|
165 } |
|
166 mItemList.append( mIconItems[index] ); |
|
167 |
|
168 GLX_LOG_INFO3("GlxSlideShowWidget::triggeredEffect() image selected index %d array index %d index %d", mSelIndex, mItemIndex, index); |
|
169 mEffectEngine->runEffect( mItemList, QString("HbIconItem") ); |
|
170 } |
|
171 |
|
172 |
|
173 void GlxSlideShowWidget::effectFinshed() |
|
174 { |
|
175 TRACER("GlxSlideShowWidget::effectFinshed()"); |
|
176 //To:Do boundery condition or last item check implemented after behaviour of slide show clear |
|
177 int rowCount = mModel->rowCount(); |
|
178 GLX_LOG_INFO2("GlxSlideShowWidget::effectFinshed() before image selected index %d array index %d", mSelIndex, mItemIndex); |
|
179 |
|
180 if ( mEffectEngine->slideShowMoveDir() == MOVE_FORWARD ) { |
|
181 mSelIndex = ( ++mSelIndex ) % rowCount; |
|
182 mItemIndex = ( ++mItemIndex ) % NBR_ITEM; |
|
183 } |
|
184 else { |
|
185 mSelIndex = mSelIndex ? --mSelIndex : rowCount - 1; |
|
186 mItemIndex = mItemIndex ? mItemIndex - 1 : NBR_ITEM - 1; |
|
187 } |
|
188 |
|
189 mModel->setData( mModel->index(mSelIndex, 0), mSelIndex, GlxFocusIndexRole ); |
|
190 setIconItems(mEffectEngine->slideShowMoveDir()); |
|
191 //setItemPos(mEffectEngine->slideShowMoveDir()); |
|
192 GLX_LOG_INFO2("GlxSlideShowWidget::effectFinshed() after image selected index %d array index %d ", mSelIndex, mItemIndex); |
|
193 if ( mIsPause == false ) { |
|
194 mSlideTimer->start( mEffectEngine->slideDelayTime() ); |
|
195 } |
|
196 mItemList.clear(); |
|
197 emit indexchanged(); // on each item change |
|
198 } |
|
199 |
|
200 void GlxSlideShowWidget::cancelEffect() |
|
201 { |
|
202 TRACER("GlxSlideShowWidget::cancelEffect()"); |
|
203 mEffectEngine->cancelEffect( mItemList ); |
|
204 } |
|
205 |
|
206 void GlxSlideShowWidget::pauseSlideShow() |
|
207 { |
|
208 TRACER("GlxSlideShowWidget::pauseSlideShow()"); |
|
209 GLX_LOG_INFO1("GlxSlideShowWidget::pauseSlideShow() %d", this->zValue()); |
|
210 mIsPause = true; |
|
211 mSlideTimer->stop(); |
|
212 cancelEffect(); |
|
213 mContinueButton->setZValue( this->zValue() + 2); |
|
214 mContinueButton->show() ; |
|
215 emit slideShowEvent(UI_ON_EVENT); |
|
216 } |
|
217 |
|
218 void GlxSlideShowWidget::continueSlideShow(bool checked) |
|
219 { |
|
220 Q_UNUSED( checked ) |
|
221 TRACER("GlxSlideShowWidget::continueSlideShow()"); |
|
222 mIsPause = false; |
|
223 if ( mModel && mModel->rowCount() > 1 ) { |
|
224 mSlideTimer->start( mEffectEngine->slideDelayTime() ); |
|
225 } |
|
226 mContinueButton->hide(); |
|
227 emit slideShowEvent(UI_OFF_EVENT); |
|
228 } |
|
229 |
|
230 void GlxSlideShowWidget::dataChanged(QModelIndex startIndex, QModelIndex endIndex) |
|
231 { |
|
232 Q_UNUSED( endIndex ) |
|
233 TRACER("GlxSlideShowWidget::dataChanged()"); |
|
234 GLX_LOG_INFO2("GlxSlideShowWidget::dataChanged startIndex = %d mSelIndex = %d ", startIndex.row(), mSelIndex ); |
|
235 int deltaIndex = startIndex.row() - mSelIndex; |
|
236 |
|
237 if ( deltaIndex <= 1 && deltaIndex >= -1 ) { |
|
238 int index = ( mItemIndex + deltaIndex + NBR_ITEM ) % NBR_ITEM; //calculated the array index in which data sould be updated |
|
239 GLX_LOG_INFO2("GlxSlideShowWidget::dataChanged index = %d mSelItemIndex = %d ", index, mItemIndex ); |
|
240 |
|
241 QVariant variant = mModel->data( startIndex, GlxFsImageRole ); |
|
242 if ( variant.isValid() && variant.canConvert<HbIcon> () ) { |
|
243 mIconItems[index]->setIcon ( variant.value<HbIcon>() ) ; |
|
244 } |
|
245 else { |
|
246 mIconItems[index]->setIcon ( HbIcon() ) ; |
|
247 } |
|
248 } |
|
249 } |
|
250 |
|
251 void GlxSlideShowWidget::rowsInserted(const QModelIndex &parent, int start, int end) |
|
252 { |
|
253 TRACER("GlxSlideShowWidget::rowsInserted()"); |
|
254 Q_UNUSED(parent); |
|
255 Q_UNUSED(start); |
|
256 Q_UNUSED(end); |
|
257 resetSlideShow(); |
|
258 } |
|
259 |
|
260 void GlxSlideShowWidget::rowsRemoved(const QModelIndex &parent, int start, int end) |
|
261 { |
|
262 TRACER("GlxSlideShowWidget::rowsRemoved()"); |
|
263 Q_UNUSED(parent); |
|
264 Q_UNUSED(start); |
|
265 Q_UNUSED(end); |
|
266 |
|
267 GLX_LOG_INFO1( "GlxSlideShowWidget::rowsRemoved row count = %d ", mModel->rowCount() ); |
|
268 |
|
269 if ( mModel->rowCount() <= 0 ) { |
|
270 clearCurrentModel(); |
|
271 emit slideShowEvent( EMPTY_DATA_EVENT ); |
|
272 } |
|
273 else { |
|
274 resetSlideShow(); |
|
275 } |
|
276 } |
|
277 |
|
278 void GlxSlideShowWidget::modelDestroyed() |
|
279 { |
|
280 TRACER("GlxSlideShowWidget::modelDestroyed()"); |
|
281 clearCurrentModel(); |
|
282 } |
|
283 |
|
284 |
|
285 void GlxSlideShowWidget::orientationChanged(QRect screenRect) |
|
286 { |
|
287 TRACER("GlxSlideShowWidget::orientationChanged()"); |
|
288 cancelEffect(); |
|
289 setItemGeometry( screenRect); |
|
290 resetSlideShow(); |
|
291 } |
|
292 |
|
293 |
|
294 void GlxSlideShowWidget::leftGesture(int value) |
|
295 { |
|
296 Q_UNUSED(value) |
|
297 TRACER("GlxSlideShowWidget::leftGesture()"); |
|
298 |
|
299 int index = ( mItemIndex + 1 ) % NBR_ITEM; |
|
300 moveImage( index, mScreenRect.width(), QString("LeftMove"), "leftMoveEffectFinished"); |
|
301 } |
|
302 |
|
303 void GlxSlideShowWidget::rightGesture(int value) |
|
304 { |
|
305 Q_UNUSED(value) |
|
306 TRACER ("GlxSlideShowWidget::rightGesture()"); |
|
307 |
|
308 int index = mItemIndex ? mItemIndex - 1 : NBR_ITEM - 1; |
|
309 moveImage( index, -mScreenRect.width(), QString("RightMove"), "rightMoveEffectFinished"); |
|
310 } |
|
311 |
|
312 void GlxSlideShowWidget::leftMoveEffectFinished( const HbEffect::EffectStatus &status ) |
|
313 { |
|
314 Q_UNUSED(status) |
|
315 TRACER("GlxSlideShowWidget::leftMoveEffectFinished()"); |
|
316 GLX_LOG_INFO1("GlxSlideShowWidget::leftMoveEffectFinished() %d status", status.reason); |
|
317 |
|
318 int rowCount = mModel->rowCount(); |
|
319 mSelIndex = ( ++mSelIndex ) % rowCount; |
|
320 mItemIndex = ( ++mItemIndex ) % NBR_ITEM; |
|
321 mModel->setData( mModel->index(mSelIndex, 0), mSelIndex, GlxFocusIndexRole ); |
|
322 |
|
323 setIconItems(MOVE_FORWARD); |
|
324 startSlideShow(); |
|
325 emit indexchanged(); // on left swipe |
|
326 } |
|
327 |
|
328 void GlxSlideShowWidget::rightMoveEffectFinished( const HbEffect::EffectStatus &status ) |
|
329 { |
|
330 Q_UNUSED(status) |
|
331 TRACER ( "GlxSlideShowWidget::rightMoveEffectFinished( ) "); |
|
332 GLX_LOG_INFO1("GlxSlideShowWidget::rightMoveEffectFinished() %d status", status.reason); |
|
333 |
|
334 int rowCount = mModel->rowCount(); |
|
335 mSelIndex = mSelIndex ? --mSelIndex : rowCount - 1; |
|
336 mItemIndex = mItemIndex ? mItemIndex - 1 : NBR_ITEM - 1; |
|
337 mModel->setData( mModel->index(mSelIndex, 0), mSelIndex, GlxFocusIndexRole ); |
|
338 |
|
339 setIconItems(MOVE_BACKWARD); |
|
340 startSlideShow(); |
|
341 emit indexchanged(); // on right swipe |
|
342 } |
|
343 |
|
344 void GlxSlideShowWidget::mouseReleaseEvent( QGraphicsSceneMouseEvent *event) |
|
345 { |
|
346 Q_UNUSED( event ) |
|
347 TRACER ( "GlxSlideShowWidget::mouseReleaseEvent( ) "); |
|
348 GLX_LOG_INFO1 ( "GlxSlideShowWidget::mouseReleaseEvent( ) is pause %d", mIsPause); |
|
349 if ( mIsPause == false ) { |
|
350 pauseSlideShow(); |
|
351 } |
|
352 } |
|
353 |
|
354 void GlxSlideShowWidget::mousePressEvent ( QGraphicsSceneMouseEvent * event ) |
|
355 { |
|
356 Q_UNUSED( event ) |
|
357 TRACER ( "GlxSlideShowWidget::mousePressEvent( ) "); |
|
358 GLX_LOG_INFO1 ( "GlxSlideShowWidget::mousePressEvent( ) is pause %d", mIsPause); |
|
359 } |
|
360 |
|
361 void GlxSlideShowWidget::startSlideShow ( ) |
|
362 { |
|
363 TRACER ( "GlxSlideShowWidget::startSlideShow( ) "); |
|
364 GLX_LOG_INFO1 ( "GlxSlideShowWidget::startSlideShow( ) is pause %d", mIsPause); |
|
365 if ( mIsPause == false && mModel && mModel->rowCount() > 1 ) { |
|
366 mSlideTimer->start( mEffectEngine->slideDelayTime() ); |
|
367 } |
|
368 } |
|
369 |
|
370 void GlxSlideShowWidget::stopSlideShow ( ) |
|
371 { |
|
372 TRACER ( "GlxSlideShowWidget::stopSlideShow( ) "); |
|
373 cancelEffect(); |
|
374 mSlideTimer->stop(); |
|
375 } |
|
376 |
|
377 void GlxSlideShowWidget::clearCurrentModel() |
|
378 { |
|
379 TRACER ( "GlxSlideShowWidget::clearCurrentModel( ) "); |
|
380 if ( mModel ) { |
|
381 disconnect( mModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), this, SLOT( dataChanged(QModelIndex,QModelIndex) ) ); |
|
382 disconnect(mModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(rowsInserted(QModelIndex,int,int))); |
|
383 disconnect(mModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(rowsRemoved(QModelIndex,int,int))); |
|
384 disconnect(mModel, SIGNAL(destroyed()), this, SLOT( modelDestroyed())); |
|
385 mModel = NULL ; |
|
386 } |
|
387 /* |
|
388 disconnect(mModel, SIGNAL(destroyed()), this, SLOT(_q_modelDestroyed())); |
|
389 disconnect(mModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int))); |
|
390 */ |
|
391 } |
|
392 |
|
393 void GlxSlideShowWidget::initializeNewModel() |
|
394 { |
|
395 TRACER("GlxSlideShowWidget::initializeNewModel" ); |
|
396 if ( mModel ) { |
|
397 connect( mModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), this, SLOT( dataChanged(QModelIndex,QModelIndex) ) ); |
|
398 connect(mModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(rowsInserted(QModelIndex,int,int))); |
|
399 connect(mModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(rowsRemoved(QModelIndex,int,int))); |
|
400 connect(mModel, SIGNAL(destroyed()), this, SLOT( modelDestroyed())); |
|
401 } |
|
402 } |
|
403 |
|
404 |
|
405 void GlxSlideShowWidget::resetSlideShow() |
|
406 { |
|
407 TRACER("GlxSlideShowWidget::resetSlideShow()" ); |
|
408 QVariant variant = mModel->data( mModel->index( mSelIndex, 0 ), GlxFocusIndexRole ); |
|
409 if ( variant.isValid() && variant.canConvert<int> () ) { |
|
410 mSelIndex = variant.value<int>() ; |
|
411 GLX_LOG_INFO1("GlxSlideShowWidget::resetSlideShow() selected index %d", mSelIndex ); |
|
412 } |
|
413 |
|
414 variant = mModel->data( mModel->index( mSelIndex, 0 ), GlxFsImageRole ); |
|
415 if ( variant.isValid() && variant.canConvert<HbIcon> () ) { |
|
416 mIconItems[mItemIndex]->setIcon ( variant.value<HbIcon>() ) ; |
|
417 } |
|
418 else { |
|
419 mIconItems[mItemIndex]->setIcon ( HbIcon() ) ; |
|
420 } |
|
421 setIconItems(MOVE_FORWARD); |
|
422 setIconItems(MOVE_BACKWARD); |
|
423 if ( mIsPause == false && mModel && mModel->rowCount() > 1 ) { |
|
424 mSlideTimer->start( mEffectEngine->slideDelayTime() ); |
|
425 } |
|
426 } |
|
427 |
|
428 void GlxSlideShowWidget::setIconItems(int moveDir) |
|
429 { |
|
430 TRACER("GlxSlideShowWidget::setIconItems()"); |
|
431 int index = 0, itemIndex = 0; |
|
432 int rowCount = mModel->rowCount(); |
|
433 GLX_LOG_INFO1("GlxSlideShowWidget::setIconItems() rowcount %d ", rowCount); |
|
434 |
|
435 if ( rowCount == 0 ) { |
|
436 return ; |
|
437 } |
|
438 |
|
439 if (moveDir == MOVE_FORWARD) { |
|
440 index = ( mSelIndex + 1) % rowCount; |
|
441 itemIndex = ( mItemIndex + 1) % NBR_ITEM; |
|
442 }else { |
|
443 index = mSelIndex ? mSelIndex - 1 : rowCount - 1; |
|
444 itemIndex = mItemIndex ? mItemIndex - 1 : NBR_ITEM - 1; |
|
445 } |
|
446 |
|
447 GLX_LOG_INFO4("GlxSlideShowWidget::setIconItems() image selected index %d array index %d index %d icon index %d", mSelIndex, mItemIndex, index, itemIndex); |
|
448 |
|
449 QVariant variant = mModel->data( mModel->index( index, 0 ), GlxFsImageRole ); |
|
450 if ( variant.isValid() && variant.canConvert<HbIcon> () ) { |
|
451 mIconItems[itemIndex]->setIcon ( variant.value<HbIcon>() ) ; |
|
452 } |
|
453 else { |
|
454 mIconItems[itemIndex]->setIcon ( HbIcon() ) ; |
|
455 } |
|
456 } |
|
457 |
|
458 //To:DO it is not used so may be remove later |
|
459 void GlxSlideShowWidget::setItemPos(int moveDir) |
|
460 { |
|
461 Q_UNUSED( moveDir) |
|
462 TRACER("GlxSlideShowWidget::setItemPos()"); |
|
463 GLX_LOG_INFO1("GlxSlideShowWidget::setItemPos() array index %d", mItemIndex ); |
|
464 |
|
465 if (moveDir == MOVE_FORWARD) { |
|
466 int index = ( mItemIndex + 1) % NBR_ITEM; |
|
467 mIconItems[index]->setPos( mScreenRect.width(), mScreenRect.top() ); |
|
468 } |
|
469 else { |
|
470 int index = mItemIndex ? mItemIndex - 1 : NBR_ITEM - 1; |
|
471 mIconItems[index]->setPos( -mScreenRect.width(), mScreenRect.top() ); |
|
472 } |
|
473 } |
|
474 |
|
475 void GlxSlideShowWidget::moveImage(int nextIndex, int posX, const QString & move, char * callBack) |
|
476 { |
|
477 TRACER("GlxSlideShowWidget::MoveImage()"); |
|
478 |
|
479 if ( mModel->rowCount() <= 1 || mEffectEngine->isEffectRuning( mItemList ) ) { |
|
480 return ; |
|
481 } |
|
482 |
|
483 mSlideTimer->stop(); |
|
484 HbEffect::start(mIconItems[mItemIndex], QString("HbIconItem"), move ); |
|
485 mIconItems[nextIndex]->setPos( posX, mScreenRect.top()); |
|
486 HbEffect::start(mIconItems[nextIndex], QString("HbIconItem"), QString("Move"), this, callBack ); |
|
487 } |
|
488 |
|
489 void GlxSlideShowWidget::addConnections() |
|
490 { |
|
491 TRACER("GlxSlideShowWidget::addConnections()"); |
|
492 if ( mEffectEngine ) { |
|
493 connect( mEffectEngine, SIGNAL( effectFinished() ), this, SLOT( effectFinshed() ) ); |
|
494 } |
|
495 if ( mSlideTimer ) { |
|
496 connect( mSlideTimer, SIGNAL(timeout()), this, SLOT( triggeredEffect() ) ); |
|
497 } |
|
498 if ( mContinueButton ) { |
|
499 connect( mContinueButton, SIGNAL( clicked(bool) ), this, SLOT( continueSlideShow(bool) ) ); |
|
500 } |
|
501 } |
|
502 |
|
503 void GlxSlideShowWidget::removeConnections() |
|
504 { |
|
505 TRACER("GlxSlideShowWidget::removeConnections()"); |
|
506 if ( mEffectEngine ) { |
|
507 disconnect( mEffectEngine, SIGNAL( effectFinished() ), this, SLOT( effectFinshed() ) ); |
|
508 } |
|
509 if ( mSlideTimer ) { |
|
510 disconnect( mSlideTimer, SIGNAL(timeout()), this, SLOT( triggeredEffect() ) ); |
|
511 } |
|
512 if ( mContinueButton ) { |
|
513 disconnect( mContinueButton, SIGNAL( clicked(bool) ), this, SLOT( continueSlideShow(bool) ) ); |
|
514 } |
|
515 } |