40 #include "videocollectioncommon.h" |
43 #include "videocollectioncommon.h" |
41 #include "videocollectionwrapper.h" |
44 #include "videocollectionwrapper.h" |
42 #include "videosortfilterproxymodel.h" |
45 #include "videosortfilterproxymodel.h" |
43 #include "videocollectionuiloader.h" |
46 #include "videocollectionuiloader.h" |
44 #include "mpxhbvideocommondefs.h" |
47 #include "mpxhbvideocommondefs.h" |
45 |
48 #include "videocollectiontrace.h" |
46 // remove these |
|
47 #include <QDebug> |
|
48 |
49 |
49 // --------------------------------------------------------------------------- |
50 // --------------------------------------------------------------------------- |
50 // Constructor |
51 // Constructor |
51 // --------------------------------------------------------------------------- |
52 // --------------------------------------------------------------------------- |
52 // |
53 // |
53 VideoListView::VideoListView(VideoCollectionUiLoader *uiLoader, QGraphicsItem *parent) : |
54 VideoListView::VideoListView( VideoCollectionUiLoader *uiLoader, QGraphicsItem *parent ) |
54 HbView(parent), |
55 : HbView( parent ) |
55 mUiUtils(VideoCollectionViewUtils::instance()), |
56 , mUiUtils( VideoCollectionViewUtils::instance() ) |
56 mWrapper(VideoCollectionWrapper::instance()), |
57 , mWrapper( VideoCollectionWrapper::instance() ) |
57 mUiLoader(uiLoader), |
58 , mUiLoader( uiLoader ) |
58 mIsService(false), |
59 , mIsService( false ) |
59 mHintLoaded(false), |
60 , mModelReady( false ) |
60 mListsLoaded(false), |
61 , mTransitionOngoing( false ) |
61 mMultiselectionLoaded(false), |
62 , mHintLevel( VideoHintWidget::AllVideos ) |
62 mModelReady(false), |
63 , mVideoServices( 0 ) |
63 mTransitionOngoing(false), |
64 , mCurrentList( 0 ) |
64 mHintLevel(VideoHintWidget::AllVideos), |
65 , mToolbarViewsActionGroup( 0 ) |
65 mVideoServices(0), |
66 , mToolbarCollectionActionGroup( 0 ) |
66 mCurrentList(0), |
67 { |
67 mToolbarViewsActionGroup(0), |
68 FUNC_LOG; |
68 mToolbarCollectionActionGroup(0) |
|
69 { |
|
70 // NOP |
|
71 } |
69 } |
72 |
70 |
73 // --------------------------------------------------------------------------- |
71 // --------------------------------------------------------------------------- |
74 // Destructor |
72 // Destructor |
75 // --------------------------------------------------------------------------- |
73 // --------------------------------------------------------------------------- |
76 // |
74 // |
77 VideoListView::~VideoListView() |
75 VideoListView::~VideoListView() |
78 { |
76 { |
79 qDebug() << "VideoListView::~VideoListView()"; |
77 FUNC_LOG; |
80 |
78 |
81 toolBar()->clearActions(); |
79 toolBar()->clearActions(); |
82 |
80 |
83 mToolbarActions.clear(); |
81 mToolbarActions.clear(); |
84 mSortingRoles.clear(); |
82 mSortingRoles.clear(); |
94 // initializeView() |
92 // initializeView() |
95 // --------------------------------------------------------------------------- |
93 // --------------------------------------------------------------------------- |
96 // |
94 // |
97 int VideoListView::initializeView() |
95 int VideoListView::initializeView() |
98 { |
96 { |
|
97 FUNC_LOG; |
99 if(!mUiLoader) |
98 if(!mUiLoader) |
100 { |
99 { |
101 cleanup(); |
100 cleanup(); |
102 return -1; |
101 return -1; |
103 } |
102 } |
104 |
103 |
105 if (XQServiceUtil::isService() && !mVideoServices) |
104 if (XQServiceUtil::isService() && !mVideoServices) |
106 { |
105 { |
107 mIsService = true; |
106 INFO("VideoListView::initializeView() service flag set to true."); |
|
107 mIsService = true; |
108 |
108 |
109 mVideoServices = VideoServices::instance(); |
109 mVideoServices = VideoServices::instance(); |
110 |
110 |
111 if (!mVideoServices) |
111 if (!mVideoServices) |
112 { |
112 { |
|
113 ERROR(-1, "VideoListView::initializeView() getting services instance failed."); |
113 cleanup(); |
114 cleanup(); |
114 return -1; |
115 return -1; |
115 } |
116 } |
116 else |
117 else |
117 { |
118 { |
118 connect(mVideoServices, SIGNAL(titleReady(const QString&)), this, SLOT(titleReadySlot(const QString&))); |
119 connect(mVideoServices, SIGNAL(titleReady(const QString&)), this, SLOT(titleReadySlot(const QString&))); |
119 } |
120 } |
120 } |
121 } |
121 |
122 |
122 // start open all videos model |
123 // start loading objects and widgets |
123 VideoSortFilterProxyModel *model = |
124 QList<VideoCollectionUiLoaderParam> params; |
124 mWrapper.getModel(VideoCollectionWrapper::EAllVideos); |
125 params.append(VideoCollectionUiLoaderParam( |
125 if (model) |
126 DOCML_NAME_VC_VIDEOLISTWIDGET, |
126 { |
127 DOCML_VIDEOCOLLECTIONVIEW_FILE, |
127 model->open(VideoCollectionCommon::ELevelVideos); |
128 true, |
|
129 VideoCollectionUiLoaderParam::LoadPhasePrimary)); |
|
130 params.append(VideoCollectionUiLoaderParam( |
|
131 DOCML_NAME_OPTIONS_MENU, |
|
132 DOCML_VIDEOCOLLECTIONVIEW_FILE, |
|
133 true, |
|
134 VideoCollectionUiLoaderParam::LoadPhasePrimary)); |
|
135 params.append(VideoCollectionUiLoaderParam( |
|
136 DOCML_NAME_ADD_TO_COLLECTION, |
|
137 DOCML_VIDEOCOLLECTIONVIEW_FILE, |
|
138 false, |
|
139 VideoCollectionUiLoaderParam::LoadPhaseSecondary)); |
|
140 params.append(VideoCollectionUiLoaderParam( |
|
141 DOCML_NAME_CREATE_COLLECTION, |
|
142 DOCML_VIDEOCOLLECTIONVIEW_FILE, |
|
143 false, |
|
144 VideoCollectionUiLoaderParam::LoadPhaseSecondary)); |
|
145 params.append(VideoCollectionUiLoaderParam( |
|
146 DOCML_NAME_DELETE_MULTIPLE, |
|
147 DOCML_VIDEOCOLLECTIONVIEW_FILE, |
|
148 false, |
|
149 VideoCollectionUiLoaderParam::LoadPhaseSecondary)); |
|
150 params.append(VideoCollectionUiLoaderParam( |
|
151 DOCML_NAME_VC_HEADINGBANNER, |
|
152 DOCML_VIDEOCOLLECTIONVIEW_FILE, |
|
153 true, |
|
154 VideoCollectionUiLoaderParam::LoadPhaseSecondary)); |
|
155 params.append(VideoCollectionUiLoaderParam( |
|
156 DOCML_NAME_SORT_MENU, |
|
157 DOCML_VIDEOCOLLECTIONVIEW_FILE, |
|
158 true, |
|
159 VideoCollectionUiLoaderParam::LoadPhaseSecondary)); |
|
160 params.append(VideoCollectionUiLoaderParam( |
|
161 DOCML_NAME_SORT_BY_DATE, |
|
162 DOCML_VIDEOCOLLECTIONVIEW_FILE, |
|
163 false, |
|
164 VideoCollectionUiLoaderParam::LoadPhaseSecondary)); |
|
165 params.append(VideoCollectionUiLoaderParam( |
|
166 DOCML_NAME_SORT_BY_NAME, |
|
167 DOCML_VIDEOCOLLECTIONVIEW_FILE, |
|
168 false, |
|
169 VideoCollectionUiLoaderParam::LoadPhaseSecondary)); |
|
170 params.append(VideoCollectionUiLoaderParam( |
|
171 DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS, |
|
172 DOCML_VIDEOCOLLECTIONVIEW_FILE, |
|
173 false, |
|
174 VideoCollectionUiLoaderParam::LoadPhaseSecondary)); |
|
175 params.append(VideoCollectionUiLoaderParam( |
|
176 DOCML_NAME_SORT_BY_SIZE, |
|
177 DOCML_VIDEOCOLLECTIONVIEW_FILE, |
|
178 false, |
|
179 VideoCollectionUiLoaderParam::LoadPhaseSecondary)); |
|
180 params.append(VideoCollectionUiLoaderParam( |
|
181 DOCML_NAME_VC_COLLECTIONWIDGET, |
|
182 DOCML_VIDEOCOLLECTIONVIEW_FILE, |
|
183 DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST, |
|
184 true, |
|
185 VideoCollectionUiLoaderParam::LoadPhaseSecondary)); |
|
186 params.append(VideoCollectionUiLoaderParam( |
|
187 DOCML_NAME_VC_COLLECTIONCONTENTWIDGET, |
|
188 DOCML_VIDEOCOLLECTIONVIEW_FILE, |
|
189 DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST, |
|
190 true, |
|
191 VideoCollectionUiLoaderParam::LoadPhaseSecondary)); // widget |
|
192 params.append(VideoCollectionUiLoaderParam( |
|
193 DOCML_NAME_DIALOG, |
|
194 DOCML_VIDEOSELECTIONDIALOG_FILE, |
|
195 true, |
|
196 VideoCollectionUiLoaderParam::LoadPhaseSecondary)); |
|
197 params.append(VideoCollectionUiLoaderParam( |
|
198 DOCML_NAME_VC_VIDEOHINTWIDGET, |
|
199 DOCML_VIDEOCOLLECTIONVIEW_FILE, |
|
200 DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT, |
|
201 true, |
|
202 VideoCollectionUiLoaderParam::LoadPhaseSecondary)); |
|
203 params.append(VideoCollectionUiLoaderParam( |
|
204 DOCML_NAME_HINT_BUTTON, |
|
205 DOCML_VIDEOCOLLECTIONVIEW_FILE, |
|
206 DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT, |
|
207 true, |
|
208 VideoCollectionUiLoaderParam::LoadPhaseSecondary)); |
|
209 params.append(VideoCollectionUiLoaderParam( |
|
210 DOCML_NAME_NO_VIDEOS_LABEL, |
|
211 DOCML_VIDEOCOLLECTIONVIEW_FILE, |
|
212 DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT, |
|
213 true, |
|
214 VideoCollectionUiLoaderParam::LoadPhaseSecondary)); |
|
215 mUiLoader->addData(params, |
|
216 this, |
|
217 SLOT(objectReadySlot(QObject*, const QString&))); |
|
218 mUiLoader->loadPhase(VideoCollectionUiLoaderParam::LoadPhasePrimary); |
|
219 params.clear(); |
|
220 |
|
221 return 0; |
|
222 } |
|
223 |
|
224 // --------------------------------------------------------------------------- |
|
225 // titleReadySlot() |
|
226 // --------------------------------------------------------------------------- |
|
227 // |
|
228 void VideoListView::titleReadySlot(const QString& title) |
|
229 { |
|
230 FUNC_LOG; |
|
231 setTitle(title); |
|
232 } |
|
233 |
|
234 // --------------------------------------------------------------------------- |
|
235 // activateView() |
|
236 // --------------------------------------------------------------------------- |
|
237 // |
|
238 int VideoListView::activateView(const TMPXItemId &itemId) |
|
239 { |
|
240 FUNC_LOG; |
|
241 |
|
242 int err = 0; |
|
243 |
|
244 // activate collection to correct view |
|
245 if (itemId == TMPXItemId::InvalidId()) |
|
246 { |
|
247 err = activateVideosView(); |
128 } |
248 } |
129 else |
249 else |
130 { |
250 { |
131 cleanup(); |
251 err = activateCollectionContentView(itemId); |
132 return -1; |
252 } |
133 } |
253 |
134 |
254 // connect signals if everything went ok |
135 // start loading widgets |
255 if (err == 0) |
136 QSet<QString> uiItems; |
256 { |
137 uiItems.insert(DOCML_NAME_VC_VIDEOLISTWIDGET); |
257 HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0); |
138 uiItems.insert(DOCML_NAME_VC_HEADINGBANNER); |
258 mainWnd->setOrientation(Qt::Vertical, false); |
139 uiItems.insert(DOCML_NAME_OPTIONS_MENU); |
259 if (!connect( |
140 if(!mIsService) |
260 mainWnd, SIGNAL(aboutToChangeOrientation()), |
141 { |
261 this, SLOT( aboutToChangeOrientationSlot())) || |
142 uiItems.insert(DOCML_NAME_ADD_TO_COLLECTION); |
262 !connect( |
143 uiItems.insert(DOCML_NAME_CREATE_COLLECTION); |
263 mainWnd, SIGNAL(orientationChanged(Qt::Orientation)), |
144 uiItems.insert(DOCML_NAME_DELETE_MULTIPLE); |
264 this, SLOT(orientationChangedSlot(Qt::Orientation))) || |
145 } |
265 !connect( |
146 uiItems.insert(DOCML_NAME_SORT_MENU); |
266 &mWrapper, SIGNAL(asyncStatus(int, QVariant&)), |
147 uiItems.insert(DOCML_NAME_SORT_BY_DATE); |
267 this, SLOT(handleAsyncStatusSlot(int, QVariant&))) || |
148 uiItems.insert(DOCML_NAME_SORT_BY_NAME); |
268 !connect( |
149 uiItems.insert(DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS); |
269 mCurrentList->getModel().sourceModel(), SIGNAL(modelChanged()), |
150 uiItems.insert(DOCML_NAME_SORT_BY_RATING); |
270 this, SLOT(layoutChangedSlot())) || |
151 uiItems.insert(DOCML_NAME_SORT_BY_SIZE); |
271 !connect( |
152 mUiLoader->startLoading(uiItems, |
272 mCurrentList->getModel().sourceModel(), SIGNAL(modelReady()), |
153 this, |
273 this, SLOT(modelReadySlot()))) |
154 SLOT(widgetReadySlot(QGraphicsWidget*, const QString&)), |
274 { |
155 SLOT(objectReadySlot(QObject*, const QString&))); |
275 ERROR(-1, "VideoListView::activateView() failed to connect signals."); |
156 uiItems.clear(); |
276 // deactivate view so we get rid of dangling connections. |
157 |
|
158 // TODO: create toolbar temporarily here until it has been moved to docml |
|
159 if (createToolbar() != 0) |
|
160 { |
|
161 cleanup(); |
|
162 return -1; |
|
163 } |
|
164 |
|
165 return 0; |
|
166 } |
|
167 |
|
168 // --------------------------------------------------------------------------- |
|
169 // titleReadySlot() |
|
170 // --------------------------------------------------------------------------- |
|
171 // |
|
172 void VideoListView::titleReadySlot(const QString& title) |
|
173 { |
|
174 setTitle(title); |
|
175 } |
|
176 |
|
177 // --------------------------------------------------------------------------- |
|
178 // activateView() |
|
179 // --------------------------------------------------------------------------- |
|
180 // |
|
181 int VideoListView::activateView() |
|
182 { |
|
183 VideoListWidget *videoList = |
|
184 mUiLoader->findWidget<VideoListWidget>( |
|
185 DOCML_NAME_VC_VIDEOLISTWIDGET); |
|
186 if (videoList) |
|
187 { |
|
188 VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelVideos; |
|
189 if (mCurrentList) |
|
190 { |
|
191 level = mCurrentList->getLevel(); |
|
192 } |
|
193 else |
|
194 { |
|
195 mCurrentList = videoList; |
|
196 } |
|
197 |
|
198 int result = mCurrentList->activate(level); |
|
199 if(result < 0) |
|
200 { |
|
201 // activate failed, deactivate view so we get rid of dangling connections. |
|
202 deactivateView(); |
277 deactivateView(); |
203 return -1; |
278 err = -1; |
204 } |
279 } |
205 |
280 } |
206 HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0); |
281 |
207 if (mainWnd) |
282 return err; |
208 { |
|
209 mainWnd->setOrientation(Qt::Vertical, false); |
|
210 if(!connect( |
|
211 mainWnd, SIGNAL(aboutToChangeOrientation()), |
|
212 this, SLOT( aboutToChangeOrientationSlot())) || |
|
213 !connect( |
|
214 mainWnd, SIGNAL(orientationChanged(Qt::Orientation)), |
|
215 this, SLOT(orientationChangedSlot(Qt::Orientation))) || |
|
216 !connect( |
|
217 &mWrapper, SIGNAL(asyncStatus(int, QVariant&)), |
|
218 this, SLOT(handleAsyncStatusSlot(int, QVariant&))) || |
|
219 !connect( |
|
220 mCurrentList->getModel().sourceModel(), SIGNAL(modelChanged()), |
|
221 this, SLOT(layoutChangedSlot())) || |
|
222 !connect( |
|
223 mCurrentList->getModel().sourceModel(), SIGNAL(modelReady()), |
|
224 this, SLOT(modelReadySlot()))) |
|
225 { |
|
226 // deactivate view so we get rid of dangling connections. |
|
227 deactivateView(); |
|
228 return -1; |
|
229 } |
|
230 } |
|
231 else |
|
232 { |
|
233 return -1; |
|
234 } |
|
235 } |
|
236 else |
|
237 { |
|
238 return -1; |
|
239 } |
|
240 |
|
241 return 0; |
|
242 } |
|
243 |
|
244 |
|
245 // --------------------------------------------------------------------------- |
|
246 // loadMultiSelection |
|
247 // --------------------------------------------------------------------------- |
|
248 // |
|
249 void VideoListView::loadMultiSelection() |
|
250 { |
|
251 if(!mIsService) |
|
252 { |
|
253 if(!mMultiselectionLoaded) |
|
254 { |
|
255 QSet<QString> uiItems; |
|
256 uiItems.insert(DOCML_NAME_DIALOG); |
|
257 mUiLoader->startLoading(uiItems, |
|
258 this, |
|
259 SLOT(widgetReadySlot(QGraphicsWidget*, const QString&)), |
|
260 SLOT(objectReadySlot(QObject*, const QString&))); |
|
261 uiItems.clear(); |
|
262 mMultiselectionLoaded = true; |
|
263 } |
|
264 } |
|
265 } |
|
266 |
|
267 // --------------------------------------------------------------------------- |
|
268 // loadLists |
|
269 // --------------------------------------------------------------------------- |
|
270 // |
|
271 void VideoListView::loadLists(bool doAsync) |
|
272 { |
|
273 if(!mListsLoaded) |
|
274 { |
|
275 QSet<QString> uiItems; |
|
276 uiItems.insert(DOCML_NAME_VC_COLLECTIONWIDGET); |
|
277 uiItems.insert(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET); |
|
278 mUiLoader->startLoading(uiItems, |
|
279 this, |
|
280 SLOT(widgetReadySlot(QGraphicsWidget*, const QString&)), |
|
281 SLOT(objectReadySlot(QObject*, const QString&))); |
|
282 uiItems.clear(); |
|
283 |
|
284 if(!doAsync) |
|
285 { |
|
286 VideoListWidget* widget(0); |
|
287 widget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONWIDGET); |
|
288 widget->setVisible(false); |
|
289 widget = mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET); |
|
290 widget->setVisible(false); |
|
291 } |
|
292 mListsLoaded = true; |
|
293 } |
|
294 } |
283 } |
295 |
284 |
296 // --------------------------------------------------------------------------- |
285 // --------------------------------------------------------------------------- |
297 // doDelayedsSlot |
286 // doDelayedsSlot |
298 // --------------------------------------------------------------------------- |
287 // --------------------------------------------------------------------------- |
299 // |
288 // |
300 void VideoListView::doDelayedsSlot() |
289 void VideoListView::doDelayedsSlot() |
301 { |
290 { |
302 loadLists(true); |
291 FUNC_LOG; |
303 loadMultiSelection(); |
292 mUiLoader->loadPhase(VideoCollectionUiLoaderParam::LoadPhaseSecondary); |
304 loadHint(true); |
|
305 emit doDelayeds(); |
293 emit doDelayeds(); |
306 } |
294 } |
307 |
295 |
308 // --------------------------------------------------------------------------- |
296 // --------------------------------------------------------------------------- |
309 // modelReadySlot |
297 // modelReadySlot |
310 // --------------------------------------------------------------------------- |
298 // --------------------------------------------------------------------------- |
311 // |
299 // |
312 void VideoListView::modelReadySlot() |
300 void VideoListView::modelReadySlot() |
313 { |
301 { |
|
302 FUNC_LOG; |
314 mModelReady = true; |
303 mModelReady = true; |
315 |
304 |
316 // since the reset signal arrives after |
305 // since the reset signal arrives after |
317 // layout changed, need to make sure that |
306 // layout changed, need to make sure that |
318 // view is updated in case needed |
307 // view is updated in case needed |
512 |
492 |
513 return action; |
493 return action; |
514 } |
494 } |
515 |
495 |
516 // --------------------------------------------------------------------------- |
496 // --------------------------------------------------------------------------- |
517 // loadHint |
|
518 // --------------------------------------------------------------------------- |
|
519 // |
|
520 void VideoListView::loadHint(bool doAsync) |
|
521 { |
|
522 if(!mHintLoaded) |
|
523 { |
|
524 QSet<QString> uiItems; |
|
525 uiItems.insert(DOCML_NAME_VC_VIDEOHINTWIDGET); |
|
526 uiItems.insert(DOCML_NAME_HINT_BUTTON); |
|
527 uiItems.insert(DOCML_NAME_NO_VIDEOS_LABEL); |
|
528 mUiLoader->startLoading(uiItems, |
|
529 this, |
|
530 SLOT(widgetReadySlot(QGraphicsWidget*, const QString&)), |
|
531 SLOT(objectReadySlot(QObject*, const QString&))); |
|
532 uiItems.clear(); |
|
533 |
|
534 if(!doAsync) |
|
535 { |
|
536 HbPushButton* button = mUiLoader->findWidget<HbPushButton>(DOCML_NAME_HINT_BUTTON); |
|
537 } |
|
538 mHintLoaded = true; |
|
539 } |
|
540 } |
|
541 |
|
542 // --------------------------------------------------------------------------- |
|
543 // showHint |
497 // showHint |
544 // --------------------------------------------------------------------------- |
498 // --------------------------------------------------------------------------- |
545 // |
499 // |
546 void VideoListView::showHint(bool show) |
500 void VideoListView::showHint(bool show) |
547 { |
501 { |
|
502 FUNC_LOG; |
548 if(!mCurrentList) |
503 if(!mCurrentList) |
549 { |
504 { |
550 return; |
505 return; |
551 } |
506 } |
552 |
507 |
553 VideoSortFilterProxyModel &model = mCurrentList->getModel(); |
508 VideoSortFilterProxyModel &model = mCurrentList->getModel(); |
554 |
509 |
555 HbGroupBox *subLabel = |
510 // prepare hint widget |
556 mUiLoader->findWidget<HbGroupBox>(DOCML_NAME_VC_HEADINGBANNER); |
|
557 |
|
558 if((!mHintLoaded && !show) || (!mHintLoaded && model.rowCount() != 0)) |
|
559 { |
|
560 if(subLabel) |
|
561 { |
|
562 subLabel->show(); |
|
563 } |
|
564 return; |
|
565 } |
|
566 else if(!mHintLoaded) |
|
567 { |
|
568 loadHint(false); |
|
569 } |
|
570 |
|
571 VideoHintWidget *hintWidget = |
511 VideoHintWidget *hintWidget = |
572 mUiLoader->findWidget<VideoHintWidget>( |
512 mUiLoader->findWidget<VideoHintWidget>( |
573 DOCML_NAME_VC_VIDEOHINTWIDGET); |
513 DOCML_NAME_VC_VIDEOHINTWIDGET); |
574 |
|
575 if (hintWidget) |
514 if (hintWidget) |
576 { |
515 { |
577 hintWidget->setLevel(mHintLevel); |
516 hintWidget->setLevel(mHintLevel); |
578 } |
517 if (mModelReady && |
579 |
518 model.rowCount() == 0) |
580 if (mModelReady && |
519 { |
581 model.rowCount() == 0 && |
520 show ? hintWidget->activate() : hintWidget->deactivate(); |
582 hintWidget) |
521 } |
583 { |
522 else |
584 show ? hintWidget->activate() : hintWidget->deactivate(); |
523 { |
585 } |
524 show = false; |
586 else if (hintWidget) |
525 hintWidget->deactivate(); |
587 { |
526 } |
588 show = false; |
527 if(show) |
589 hintWidget->deactivate(); |
528 { |
590 } |
529 bool showHintBtns = (mCurrentList->getLevel() != VideoCollectionCommon::ELevelDefaultColl); |
591 |
530 hintWidget->setButtonShown(showHintBtns); |
592 if(show && mToolbarViewsActionGroup && mToolbarCollectionActionGroup) |
531 } |
593 { |
532 else |
594 if(!mIsService) |
|
595 { |
|
596 mToolbarActions[ETBActionRemoveVideos]->setVisible(false); |
|
597 } |
|
598 if(mCurrentList->getLevel() == VideoCollectionCommon::ELevelDefaultColl) |
|
599 { |
|
600 if(!mIsService) |
|
601 { |
|
602 mToolbarActions[ETBActionAddVideos]->setVisible(false); |
|
603 } |
|
604 hintWidget->setButtonShown(false); |
|
605 } |
|
606 else |
|
607 { |
533 { |
608 hintWidget->setButtonShown(true); |
534 hintWidget->setButtonShown(true); |
609 } |
535 } |
610 } |
536 } |
611 else if(mToolbarViewsActionGroup && mToolbarCollectionActionGroup) |
537 |
612 { |
538 if (mToolbarViewsActionGroup && mToolbarCollectionActionGroup && !mIsService) |
613 if(!mIsService) |
539 { |
614 { |
540 if (show) |
615 if(mToolbarActions[ETBActionRemoveVideos]->isVisible() == false) |
541 { |
616 { |
542 mToolbarActions[ETBActionRemoveVideos]->setVisible(false); |
617 mToolbarActions[ETBActionRemoveVideos]->setVisible(true); |
543 |
618 } |
544 if(mCurrentList->getLevel() == VideoCollectionCommon::ELevelDefaultColl) |
619 if(mToolbarActions[ETBActionAddVideos]->isVisible() == false) |
545 { |
620 { |
546 mToolbarActions[ETBActionAddVideos]->setVisible(false); |
621 mToolbarActions[ETBActionAddVideos]->setVisible(true); |
547 } |
622 } |
548 } |
623 } |
549 else |
624 hintWidget->setButtonShown(true); |
550 { |
625 } |
551 if(mToolbarActions[ETBActionRemoveVideos]->isVisible() == false) |
626 |
552 { |
|
553 mToolbarActions[ETBActionRemoveVideos]->setVisible(true); |
|
554 } |
|
555 if(mToolbarActions[ETBActionAddVideos]->isVisible() == false) |
|
556 { |
|
557 mToolbarActions[ETBActionAddVideos]->setVisible(true); |
|
558 } |
|
559 } |
|
560 } |
|
561 |
|
562 // prepare sublabel |
|
563 HbGroupBox *subLabel = |
|
564 mUiLoader->findWidget<HbGroupBox>( |
|
565 DOCML_NAME_VC_HEADINGBANNER); |
627 if (subLabel) |
566 if (subLabel) |
628 { |
567 { |
629 if (show && |
568 if (show && |
630 subLabel->isVisible() && |
|
631 mCurrentList->getLevel() == VideoCollectionCommon::ELevelVideos) |
569 mCurrentList->getLevel() == VideoCollectionCommon::ELevelVideos) |
632 { |
570 { |
633 subLabel->hide(); |
571 subLabel->hide(); |
634 } |
572 } |
635 else if (!subLabel->isVisible()) |
573 else |
636 { |
574 { |
637 subLabel->show(); |
575 subLabel->show(); |
638 } |
576 } |
639 } |
577 } |
640 } |
578 } |
720 action->setVisible(show); |
655 action->setVisible(show); |
721 } |
656 } |
722 } |
657 } |
723 |
658 |
724 // --------------------------------------------------------------------------- |
659 // --------------------------------------------------------------------------- |
725 // isActionChecked() |
660 // activateVideosView() |
726 // --------------------------------------------------------------------------- |
661 // --------------------------------------------------------------------------- |
727 // |
662 // |
728 bool VideoListView::isActionChecked(const QString &name) |
663 int VideoListView::activateVideosView() |
729 { |
664 { |
730 bool isChecked = false; |
665 FUNC_LOG; |
731 |
666 VideoListWidget *videoList = |
732 HbAction *action = mUiLoader->findObject<HbAction>(name); |
667 mUiLoader->findWidget<VideoListWidget>( |
733 if (!action) |
668 DOCML_NAME_VC_VIDEOLISTWIDGET); |
734 { |
669 if (videoList) |
735 // must be menu widget |
670 { |
736 HbMenu *menu = mUiLoader->findWidget<HbMenu>(name); |
671 VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelVideos; |
737 if (menu) |
672 if (mCurrentList) |
738 { |
673 { |
739 action = menu->menuAction(); |
674 level = mCurrentList->getLevel(); |
740 } |
675 } |
741 } |
676 else |
742 |
677 { |
743 // check if action is checked |
678 mCurrentList = videoList; |
744 if (action) |
679 } |
745 { |
680 |
746 isChecked = action->isChecked(); |
681 int result = mCurrentList->activate(level); |
747 } |
682 if(result < 0) |
748 |
683 { |
749 return isChecked; |
684 ERROR(result, "VideoListView::activateVideosView() failed to activate."); |
750 } |
685 // activate failed, deactivate view so we get rid of dangling connections. |
751 |
686 deactivateView(); |
752 // --------------------------------------------------------------------------- |
687 return -1; |
753 // isActionChecked() |
688 } |
754 // --------------------------------------------------------------------------- |
689 |
755 // |
690 if (createToolbar() != 0) |
756 void VideoListView::setActionChecked(bool setChecked, const QString &name) |
691 { |
757 { |
692 ERROR(result, "VideoListView::activateVideosView() failed to create toolbar."); |
758 HbAction *action = mUiLoader->findObject<HbAction>(name); |
693 deactivateView(); |
759 if (!action) |
694 return -1; |
760 { |
695 } |
761 // must be menu widget |
696 } |
762 HbMenu *menu = mUiLoader->findWidget<HbMenu>(name); |
697 else |
763 if (menu) |
698 { |
764 { |
699 return -1; |
765 action = menu->menuAction(); |
700 } |
766 } |
701 |
767 } |
702 return 0; |
768 |
703 } |
769 // update action check state |
704 |
770 if (action) |
705 // --------------------------------------------------------------------------- |
771 { |
706 // activateCollectionContentView() |
772 action->setChecked(setChecked); |
707 // --------------------------------------------------------------------------- |
773 } |
708 // |
|
709 int VideoListView::activateCollectionContentView(const TMPXItemId &itemId) |
|
710 { |
|
711 FUNC_LOG; |
|
712 int err = 0; |
|
713 |
|
714 if (itemId.iId2 == KVcxMvcMediaTypeCategory || |
|
715 itemId.iId2 == KVcxMvcMediaTypeAlbum) |
|
716 { |
|
717 // currently only captured and downloaded categories are supported |
|
718 switch (itemId.iId1) |
|
719 { |
|
720 case KVcxMvcCategoryIdDownloads: |
|
721 case KVcxMvcCategoryIdCaptured: |
|
722 { |
|
723 VideoListWidget *collectionContentWidget = |
|
724 mUiLoader->findWidget<VideoListWidget>( |
|
725 DOCML_NAME_VC_COLLECTIONCONTENTWIDGET); |
|
726 if (collectionContentWidget) |
|
727 { |
|
728 // no need to deactivate since there cannot be previous widget |
|
729 mCurrentList = collectionContentWidget; |
|
730 |
|
731 // hide toolbar |
|
732 HbToolBar *toolBar = this->toolBar(); |
|
733 if (toolBar) |
|
734 { |
|
735 toolBar->hide(); |
|
736 } |
|
737 |
|
738 // resolve collection name |
|
739 if (itemId.iId1 == KVcxMvcCategoryIdDownloads) |
|
740 { |
|
741 mCollectionName = hbTrId("txt_videos_dblist_downloaded"); |
|
742 } |
|
743 else if (itemId.iId1 == KVcxMvcCategoryIdCaptured) |
|
744 { |
|
745 mCollectionName = hbTrId("txt_videos_dblist_captured"); |
|
746 } |
|
747 |
|
748 // activate collection content widget |
|
749 mCurrentList->activate(VideoCollectionCommon::ELevelDefaultColl); |
|
750 |
|
751 // open the model |
|
752 VideoSortFilterProxyModel &model = mCurrentList->getModel(); |
|
753 model.openItem(itemId); |
|
754 |
|
755 // sort model |
|
756 model.doSorting(VideoCollectionCommon::KeyDateTime, Qt::AscendingOrder); |
|
757 |
|
758 // set hint level to collections |
|
759 setHintLevel(VideoHintWidget::Collection); |
|
760 } |
|
761 else |
|
762 { |
|
763 ERROR(-1, "VideoListView::activateVideosView() failed to get collection content widget."); |
|
764 err = -1; |
|
765 } |
|
766 break; |
|
767 } |
|
768 default: |
|
769 { |
|
770 // by default open videos view |
|
771 err = activateVideosView(); |
|
772 break; |
|
773 } |
|
774 } |
|
775 |
|
776 } |
|
777 else |
|
778 { |
|
779 // open videos view |
|
780 err = activateVideosView(); |
|
781 } |
|
782 |
|
783 return err; |
774 } |
784 } |
775 |
785 |
776 // --------------------------------------------------------------------------- |
786 // --------------------------------------------------------------------------- |
777 // openAllVideosViewSlot() |
787 // openAllVideosViewSlot() |
778 // --------------------------------------------------------------------------- |
788 // --------------------------------------------------------------------------- |
779 // |
789 // |
780 void VideoListView::openAllVideosViewSlot() |
790 void VideoListView::openAllVideosViewSlot() |
781 { |
791 { |
782 if(!mListsLoaded) |
792 FUNC_LOG; |
783 { |
|
784 loadLists(false); |
|
785 } |
|
786 |
|
787 VideoListWidget *videoListWidget = |
793 VideoListWidget *videoListWidget = |
788 mUiLoader->findWidget<VideoListWidget>( |
794 mUiLoader->findWidget<VideoListWidget>( |
789 DOCML_NAME_VC_VIDEOLISTWIDGET); |
795 DOCML_NAME_VC_VIDEOLISTWIDGET); |
790 |
796 |
791 if (mCurrentList && |
797 if (mCurrentList && |
873 // openservicesViewSlot() |
877 // openservicesViewSlot() |
874 // --------------------------------------------------------------------------- |
878 // --------------------------------------------------------------------------- |
875 // |
879 // |
876 void VideoListView::openServicesViewSlot() |
880 void VideoListView::openServicesViewSlot() |
877 { |
881 { |
|
882 FUNC_LOG; |
878 debugNotImplementedYet(); |
883 debugNotImplementedYet(); |
879 } |
884 } |
880 |
885 |
881 // --------------------------------------------------------------------------- |
886 // --------------------------------------------------------------------------- |
882 // startSorting() |
887 // startSorting() |
883 // --------------------------------------------------------------------------- |
888 // --------------------------------------------------------------------------- |
884 // |
889 // |
885 void VideoListView::startSorting() |
890 void VideoListView::startSorting() |
886 { |
891 { |
|
892 FUNC_LOG; |
887 HbMenu *optionsMenu = |
893 HbMenu *optionsMenu = |
888 mUiLoader->findWidget<HbMenu>( |
894 mUiLoader->findWidget<HbMenu>( |
889 DOCML_NAME_OPTIONS_MENU); |
895 DOCML_NAME_OPTIONS_MENU); |
890 if (optionsMenu) |
896 if (optionsMenu && mCurrentList) |
891 { |
897 { |
892 // get sorting role from active action |
898 // get sorting role from active action |
893 HbAction *action = optionsMenu->activeAction()->menu()->activeAction(); |
899 HbAction* action = optionsMenu->activeAction(); |
894 if(action) |
900 HbMenu* sortMenu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_SORT_MENU); |
895 { |
901 if(action == sortMenu->menuAction()) // make sure that active action is the sort menu. |
896 doSorting(mSortingRoles[action]); |
902 { |
897 } |
903 HbAction* action = sortMenu->activeAction(); |
|
904 if(action) |
|
905 { |
|
906 doSorting(mSortingRoles[action]); |
|
907 } |
|
908 } |
898 } |
909 } |
899 } |
910 } |
900 |
911 |
901 // --------------------------------------------------------------------------- |
912 // --------------------------------------------------------------------------- |
902 // doSorting() |
913 // doSorting() |
903 // --------------------------------------------------------------------------- |
914 // --------------------------------------------------------------------------- |
904 // |
915 // |
905 void VideoListView::doSorting(int role) |
916 void VideoListView::doSorting(int role) |
906 { |
917 { |
|
918 FUNC_LOG; |
907 // sort model |
919 // sort model |
908 Qt::SortOrder order(Qt::AscendingOrder); |
920 Qt::SortOrder order(Qt::AscendingOrder); |
909 VideoSortFilterProxyModel &model = mCurrentList->getModel(); |
921 VideoSortFilterProxyModel &model = mCurrentList->getModel(); |
910 if(model.sortRole() == role && model.sortOrder() == Qt::AscendingOrder) |
922 if(model.sortRole() == role && model.sortOrder() == Qt::AscendingOrder) |
911 { |
923 { |
912 order = Qt::DescendingOrder; |
924 order = Qt::DescendingOrder; |
913 } |
925 } |
914 model.doSorting(role, order); |
926 model.doSorting(role, order); |
915 |
927 |
|
928 if (mCurrentList == mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET)) |
|
929 { |
|
930 mUiLoader->findWidget<VideoListWidget>(DOCML_NAME_VC_VIDEOLISTWIDGET)->getModel().doSorting(role, order); |
|
931 } |
|
932 |
916 // save sorting values |
933 // save sorting values |
917 mUiUtils.saveSortingValues(role, order); |
934 mUiUtils.saveSortingValues(role, order, mCurrentList->getLevel()); |
918 } |
935 } |
919 |
936 |
920 // ------------------------------------------------------------------------------------------------- |
937 // ------------------------------------------------------------------------------------------------- |
921 // aboutToChangeOrientationSlot() |
938 // aboutToChangeOrientationSlot() |
922 // hide all items in the window during orientation change |
939 // hide all items in the window during orientation change |
923 // ------------------------------------------------------------------------------------------------- |
940 // ------------------------------------------------------------------------------------------------- |
924 // |
941 // |
925 void VideoListView::aboutToChangeOrientationSlot() |
942 void VideoListView::aboutToChangeOrientationSlot() |
926 { |
943 { |
|
944 FUNC_LOG; |
927 // this method is required for changing from to mediawall |
945 // this method is required for changing from to mediawall |
928 } |
946 } |
929 |
947 |
930 // ------------------------------------------------------------------------------------------------- |
948 // ------------------------------------------------------------------------------------------------- |
931 // orientationChangedSlot() |
949 // orientationChangedSlot() |
932 // orientation changed, items can be put back to visible after view has handled the change |
950 // orientation changed, items can be put back to visible after view has handled the change |
933 // ------------------------------------------------------------------------------------------------- |
951 // ------------------------------------------------------------------------------------------------- |
934 // |
952 // |
935 void VideoListView::orientationChangedSlot( Qt::Orientation orientation ) |
953 void VideoListView::orientationChangedSlot( Qt::Orientation orientation ) |
936 { |
954 { |
|
955 FUNC_LOG; |
937 // this method is required for changing from to mediawall |
956 // this method is required for changing from to mediawall |
938 |
957 |
939 // in landscape we need to hide the title and the toolbar. (also required for the mediawall?) |
958 // in landscape we need to hide the title and the toolbar. (also required for the mediawall?) |
940 // TODO: how about the feature where the toolbar comes visible if screen is tapped? |
959 // TODO: how about the feature where the toolbar comes visible if screen is tapped? |
941 this->setItemVisible(Hb::AllItems, orientation == Qt::Vertical); |
960 this->setItemVisible(Hb::AllItems, orientation == Qt::Vertical); |
1167 { |
1173 { |
1168 showAction(true, DOCML_NAME_CREATE_COLLECTION); |
1174 showAction(true, DOCML_NAME_CREATE_COLLECTION); |
1169 } |
1175 } |
1170 showAction(true, DOCML_NAME_SORT_MENU); |
1176 showAction(true, DOCML_NAME_SORT_MENU); |
1171 showAction(true, DOCML_NAME_SORT_BY_NAME); |
1177 showAction(true, DOCML_NAME_SORT_BY_NAME); |
|
1178 showAction(true, DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS); |
1172 |
1179 |
1173 if (isActionChecked(DOCML_NAME_SORT_BY_DATE) || |
1180 HbAction* action = mSortingRoles.key(role); |
1174 isActionChecked(DOCML_NAME_SORT_BY_SIZE)) |
1181 if (action) |
1175 { |
1182 { |
1176 //TODO: when changing between videos and categories, sorting order needs to be changed, if new |
1183 action->setChecked(true); |
1177 // view does not have the previously active sorting order supported |
1184 } |
1178 setActionChecked(true, DOCML_NAME_SORT_BY_NAME); |
|
1179 } |
|
1180 else |
|
1181 { |
|
1182 HbAction* action = mSortingRoles.key(role); |
|
1183 if (action) |
|
1184 { |
|
1185 action->setChecked(true); |
|
1186 } |
|
1187 } |
|
1188 |
|
1189 showAction(true, DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS); |
|
1190 } |
1185 } |
1191 else if(firstAction != mToolbarActions[ETBActionAllVideos]) |
1186 else if(firstAction != mToolbarActions[ETBActionAllVideos]) |
1192 { |
1187 { |
1193 showAction(true, DOCML_NAME_SORT_MENU); |
1188 showAction(true, DOCML_NAME_SORT_MENU); |
1194 showAction(true, DOCML_NAME_SORT_BY_DATE); |
1189 showAction(true, DOCML_NAME_SORT_BY_DATE); |
1195 if (isActionChecked(DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS)) |
|
1196 { |
|
1197 //TODO: when changing between videos and categories, sorting order needs to be changed, if new |
|
1198 // view does not have the previously active sorting order supported |
|
1199 showAction(true, DOCML_NAME_SORT_BY_DATE); |
|
1200 } |
|
1201 else |
|
1202 { |
|
1203 HbAction* action = mSortingRoles.key(role); |
|
1204 if (action) |
|
1205 { |
|
1206 action->setChecked(true); |
|
1207 } |
|
1208 } |
|
1209 |
|
1210 showAction(true, DOCML_NAME_SORT_BY_NAME); |
1190 showAction(true, DOCML_NAME_SORT_BY_NAME); |
1211 showAction(true, DOCML_NAME_SORT_BY_SIZE); |
1191 showAction(true, DOCML_NAME_SORT_BY_SIZE); |
1212 |
1192 |
|
1193 HbAction* action = mSortingRoles.key(role); |
|
1194 if (action) |
|
1195 { |
|
1196 action->setChecked(true); |
|
1197 } |
|
1198 |
1213 if (!mIsService) |
1199 if (!mIsService) |
1214 { |
1200 { |
1215 showAction(true, DOCML_NAME_DELETE_MULTIPLE); |
1201 showAction(true, DOCML_NAME_DELETE_MULTIPLE); |
1216 } |
1202 } |
1217 } |
1203 } |
1218 } |
1204 } |
1219 |
1205 |
1220 // ------------------------------------------------------------------------------------------------- |
1206 // ------------------------------------------------------------------------------------------------- |
|
1207 // prepareBrowseServiceMenu |
|
1208 // ------------------------------------------------------------------------------------------------- |
|
1209 // |
|
1210 void VideoListView::prepareBrowseServiceMenu() |
|
1211 { |
|
1212 if (!mCurrentList) |
|
1213 { |
|
1214 return; |
|
1215 } |
|
1216 |
|
1217 // hide all actions by default |
|
1218 showAction(false, DOCML_NAME_ADD_TO_COLLECTION); |
|
1219 showAction(false, DOCML_NAME_CREATE_COLLECTION); |
|
1220 showAction(false, DOCML_NAME_DELETE_MULTIPLE); |
|
1221 showAction(false, DOCML_NAME_SORT_BY_DATE); |
|
1222 showAction(false, DOCML_NAME_SORT_BY_NAME); |
|
1223 showAction(false, DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS); |
|
1224 showAction(false, DOCML_NAME_SORT_BY_SIZE); |
|
1225 showAction(false, DOCML_NAME_SORT_MENU); |
|
1226 |
|
1227 VideoSortFilterProxyModel &model = mCurrentList->getModel(); |
|
1228 if (!model.rowCount()) |
|
1229 { |
|
1230 return; |
|
1231 } |
|
1232 |
|
1233 // show delete action |
|
1234 showAction(true, DOCML_NAME_DELETE_MULTIPLE); |
|
1235 |
|
1236 // show sort actions |
|
1237 showAction(true, DOCML_NAME_SORT_MENU); |
|
1238 showAction(true, DOCML_NAME_SORT_BY_DATE); |
|
1239 showAction(true, DOCML_NAME_SORT_BY_NAME); |
|
1240 showAction(true, DOCML_NAME_SORT_BY_SIZE); |
|
1241 |
|
1242 // set current sort action selected |
|
1243 int role; |
|
1244 Qt::SortOrder order; |
|
1245 model.getSorting(role, order); |
|
1246 HbAction* action = mSortingRoles.key(role); |
|
1247 if (action) |
|
1248 { |
|
1249 action->setChecked(true); |
|
1250 } |
|
1251 } |
|
1252 |
|
1253 // ------------------------------------------------------------------------------------------------- |
1221 // handleAsyncStatusSlot |
1254 // handleAsyncStatusSlot |
1222 // ------------------------------------------------------------------------------------------------- |
1255 // ------------------------------------------------------------------------------------------------- |
1223 // |
1256 // |
1224 void VideoListView::handleAsyncStatusSlot(int statusCode, QVariant &additional) |
1257 void VideoListView::handleAsyncStatusSlot(int statusCode, QVariant &additional) |
1225 { |
1258 { |
|
1259 FUNC_LOG; |
1226 // show msg from status |
1260 // show msg from status |
1227 mUiUtils.showStatusMsgSlot(statusCode, additional); |
1261 mUiUtils.showStatusMsgSlot(statusCode, additional); |
1228 } |
1262 } |
1229 |
1263 |
1230 // ------------------------------------------------------------------------------------------------- |
1264 // ------------------------------------------------------------------------------------------------- |
1375 mToolbarActions[ETBActionCollections]->setChecked(true); |
1417 mToolbarActions[ETBActionCollections]->setChecked(true); |
1376 } |
1418 } |
1377 } |
1419 } |
1378 |
1420 |
1379 // ------------------------------------------------------------------------------------------------- |
1421 // ------------------------------------------------------------------------------------------------- |
1380 // widgetReadySlot |
1422 // objectReadySlot |
1381 // ------------------------------------------------------------------------------------------------- |
1423 // ------------------------------------------------------------------------------------------------- |
1382 // |
1424 // |
1383 void VideoListView::widgetReadySlot(QGraphicsWidget *widget, const QString &name) |
1425 void VideoListView::objectReadySlot(QObject *object, const QString &name) |
1384 { |
1426 { |
|
1427 FUNC_LOG; |
1385 if (name.compare(DOCML_NAME_VC_VIDEOLISTWIDGET) == 0) |
1428 if (name.compare(DOCML_NAME_VC_VIDEOLISTWIDGET) == 0) |
1386 { |
1429 { |
1387 connect(widget, SIGNAL(command(int)), this, SIGNAL(command(int))); |
1430 connect(object, SIGNAL(command(int)), this, SIGNAL(command(int))); |
1388 connect(this, SIGNAL(doDelayeds()), widget, SLOT(doDelayedsSlot())); |
1431 connect(this, SIGNAL(doDelayeds()), object, SLOT(doDelayedsSlot())); |
1389 } |
1432 } |
1390 else if (name.compare(DOCML_NAME_VC_COLLECTIONWIDGET) == 0) |
1433 else if (name.compare(DOCML_NAME_VC_COLLECTIONWIDGET) == 0) |
1391 { |
1434 { |
1392 connect( |
1435 connect( |
1393 widget, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)), |
1436 object, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)), |
1394 this, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&))); |
1437 this, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&))); |
1395 connect(this, SIGNAL(doDelayeds()), widget, SLOT(doDelayedsSlot())); |
1438 connect(this, SIGNAL(doDelayeds()), object, SLOT(doDelayedsSlot())); |
1396 emit(doDelayeds()); |
1439 emit(doDelayeds()); |
1397 } |
1440 } |
1398 else if (name.compare(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET) == 0) |
1441 else if (name.compare(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET) == 0) |
1399 { |
1442 { |
1400 connect(widget, SIGNAL(command(int)), this, SIGNAL(command(int))); |
1443 connect(object, SIGNAL(command(int)), this, SIGNAL(command(int))); |
1401 connect( |
1444 connect( |
1402 widget, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)), |
1445 object, SIGNAL(collectionOpened(bool, const QString&, const QModelIndex&)), |
1403 this, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&))); |
1446 this, SLOT(collectionOpenedSlot(bool, const QString&, const QModelIndex&))); |
1404 connect(this, SIGNAL(doDelayeds()), widget, SLOT(doDelayedsSlot())); |
1447 connect(this, SIGNAL(doDelayeds()), object, SLOT(doDelayedsSlot())); |
1405 emit(doDelayeds()); |
1448 emit(doDelayeds()); |
1406 } |
1449 } |
1407 else if (name.compare(DOCML_NAME_OPTIONS_MENU) == 0) |
1450 else if (name.compare(DOCML_NAME_OPTIONS_MENU) == 0) |
1408 { |
1451 { |
1409 connect( |
1452 connect( |
1410 widget, SIGNAL(aboutToShow()), this, SLOT(aboutToShowMainMenuSlot())); |
1453 object, SIGNAL(aboutToShow()), this, SLOT(aboutToShowMainMenuSlot())); |
1411 } |
1454 } |
1412 else if (name.compare(DOCML_NAME_HINT_BUTTON) == 0) |
1455 else if (name.compare(DOCML_NAME_HINT_BUTTON) == 0) |
1413 { |
1456 { |
1414 connect(widget, SIGNAL(clicked(bool)), this, SLOT(openServicesViewSlot())); |
1457 connect(object, SIGNAL(clicked(bool)), this, SLOT(openServicesViewSlot())); |
1415 } |
1458 } |
1416 } |
1459 else if (name.compare(DOCML_NAME_SORT_BY_DATE) == 0) |
1417 |
|
1418 // ------------------------------------------------------------------------------------------------- |
|
1419 // objectReadySlot |
|
1420 // ------------------------------------------------------------------------------------------------- |
|
1421 // |
|
1422 void VideoListView::objectReadySlot(QObject *object, const QString &name) |
|
1423 { |
|
1424 if (name.compare(DOCML_NAME_SORT_BY_DATE) == 0) |
|
1425 { |
1460 { |
1426 HbAction *action = qobject_cast<HbAction*>(object); |
1461 HbAction *action = qobject_cast<HbAction*>(object); |
1427 if (action) |
1462 if (action) |
1428 { |
1463 { |
1429 connect(action, SIGNAL(triggered()), this, SLOT(startSorting())); |
1464 connect(action, SIGNAL(triggered()), this, SLOT(startSorting())); |