equal
deleted
inserted
replaced
16 */ |
16 */ |
17 |
17 |
18 #include "videocollectiontrace.h" |
18 #include "videocollectiontrace.h" |
19 #include "videolistwidget.h" |
19 #include "videolistwidget.h" |
20 |
20 |
|
21 #include <xqserviceutil.h> |
21 #include <qcoreapplication.h> |
22 #include <qcoreapplication.h> |
22 #include <qtimer.h> |
23 #include <qtimer.h> |
23 #include <hbscrollbar.h> |
24 #include <hbscrollbar.h> |
24 #include <xqserviceutil.h> |
25 #include <xqserviceutil.h> |
25 #include <hbmenu.h> |
26 #include <hbmenu.h> |
32 #include <vcxmyvideosdefs.h> |
33 #include <vcxmyvideosdefs.h> |
33 |
34 |
34 #include "videocollectionviewutils.h" |
35 #include "videocollectionviewutils.h" |
35 #include "videocollectionuiloader.h" |
36 #include "videocollectionuiloader.h" |
36 #include "videolistselectiondialog.h" |
37 #include "videolistselectiondialog.h" |
37 #include "videoservices.h" |
|
38 #include "videothumbnaildata.h" |
38 #include "videothumbnaildata.h" |
39 #include "videosortfilterproxymodel.h" |
39 #include "videosortfilterproxymodel.h" |
40 #include "videocollectioncommon.h" |
40 #include "videocollectioncommon.h" |
41 #include "mpxhbvideocommondefs.h" |
41 #include "mpxhbvideocommondefs.h" |
42 |
42 |
73 mIsService(false), |
73 mIsService(false), |
74 mNavKeyAction(0), |
74 mNavKeyAction(0), |
75 mContextMenu(0), |
75 mContextMenu(0), |
76 mSelectionMode(HbAbstractItemView::NoSelection), |
76 mSelectionMode(HbAbstractItemView::NoSelection), |
77 mScrollPositionTimer(0), |
77 mScrollPositionTimer(0), |
78 mUiLoader(uiLoader) |
78 mUiLoader(uiLoader), |
|
79 mService(VideoServices::ENoService) |
79 { |
80 { |
80 FUNC_LOG_ADDR(this); |
81 FUNC_LOG_ADDR(this); |
81 } |
82 } |
82 |
83 |
83 // --------------------------------------------------------------------------- |
84 // --------------------------------------------------------------------------- |
99 |
100 |
100 // --------------------------------------------------------------------------- |
101 // --------------------------------------------------------------------------- |
101 // initialize |
102 // initialize |
102 // --------------------------------------------------------------------------- |
103 // --------------------------------------------------------------------------- |
103 // |
104 // |
104 int VideoListWidget::initialize(VideoSortFilterProxyModel &model, VideoServices* videoServices) |
105 int VideoListWidget::initialize(VideoSortFilterProxyModel &model, |
105 { |
106 VideoServices* videoServices, |
106 FUNC_LOG_ADDR(this); |
107 VideoCollectionCommon::TCollectionLevels level) |
107 mModel = &model; |
108 { |
108 |
109 FUNC_LOG_ADDR(this); |
|
110 mModel = &model; |
109 mVideoServices = videoServices; |
111 mVideoServices = videoServices; |
|
112 mCurrentLevel = level; |
110 |
113 |
111 if(mVideoServices) |
114 if(mVideoServices) |
112 { |
115 { |
113 mIsService = true; |
116 mIsService = true; |
|
117 |
|
118 if(XQServiceUtil::interfaceName().contains("IVideoFetch")) |
|
119 { |
|
120 mService = VideoServices::EUriFetcher; |
|
121 } |
|
122 else if (XQServiceUtil::interfaceName().contains("IVideoBrowse")) |
|
123 { |
|
124 mService = VideoServices::EBrowse; |
|
125 } |
114 } |
126 } |
115 |
127 |
116 // init list view |
128 // init list view |
117 VideoCollectionViewUtils::initListView(this); |
129 VideoCollectionViewUtils::initListView(this); |
118 |
130 |
322 |
334 |
323 bool isBrowsingService = false; |
335 bool isBrowsingService = false; |
324 |
336 |
325 if (mIsService && |
337 if (mIsService && |
326 mVideoServices && |
338 mVideoServices && |
327 mVideoServices->currentService() == VideoServices::EBrowse) |
339 mService == VideoServices::EBrowse) |
328 { |
340 { |
329 isBrowsingService = true; |
341 isBrowsingService = true; |
330 } |
342 } |
331 |
343 |
332 return isBrowsingService; |
344 return isBrowsingService; |
437 |
449 |
438 mContextMenu = new HbMenu(); |
450 mContextMenu = new HbMenu(); |
439 mContextMenu->setDismissPolicy(HbPopup::TapAnywhere); |
451 mContextMenu->setDismissPolicy(HbPopup::TapAnywhere); |
440 mContextMenu->setObjectName(LIST_WIDGET_OBJECT_NAME_CONTEXT_MENU); |
452 mContextMenu->setObjectName(LIST_WIDGET_OBJECT_NAME_CONTEXT_MENU); |
441 |
453 |
442 VideoServices::TVideoService service = VideoServices::ENoService; |
454 if (mService == VideoServices::EUriFetcher) |
443 if (mIsService && |
|
444 mVideoServices) |
|
445 { |
|
446 service = mVideoServices->currentService(); |
|
447 } |
|
448 |
|
449 if (service == VideoServices::EUriFetcher) |
|
450 { |
455 { |
451 mContextMenuActions[EActionAttach] = |
456 mContextMenuActions[EActionAttach] = |
452 mContextMenu->addAction(hbTrId("txt_videos_menu_attach"), this, SLOT(openItemSlot())); |
457 mContextMenu->addAction(hbTrId("txt_videos_menu_attach"), this, SLOT(openItemSlot())); |
453 mContextMenuActions[EActionAttach]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_ATTACH); |
458 mContextMenuActions[EActionAttach]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_ATTACH); |
454 |
459 |
458 |
463 |
459 mContextMenuActions[EActionDetails] = |
464 mContextMenuActions[EActionDetails] = |
460 mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot())); |
465 mContextMenu->addAction(hbTrId("txt_common_menu_details"), this, SLOT(openDetailsSlot())); |
461 mContextMenuActions[EActionDetails]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DETAILS); |
466 mContextMenuActions[EActionDetails]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_DETAILS); |
462 } |
467 } |
463 else if (service == VideoServices::EBrowse) |
468 else if (mService == VideoServices::EBrowse) |
464 { |
469 { |
465 mContextMenuActions[EActionPlay] = |
470 mContextMenuActions[EActionPlay] = |
466 mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot())); |
471 mContextMenu->addAction(hbTrId("txt_videos_menu_play"), this, SLOT(playItemSlot())); |
467 mContextMenuActions[EActionPlay]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_PLAY); |
472 mContextMenuActions[EActionPlay]->setObjectName(LIST_WIDGET_OBJECT_NAME_ACTION_PLAY); |
468 |
473 |
559 { |
564 { |
560 if (!mIsService) |
565 if (!mIsService) |
561 { |
566 { |
562 mContextMenuActions[EActionAddToCollection]->setVisible(true); |
567 mContextMenuActions[EActionAddToCollection]->setVisible(true); |
563 mContextMenuActions[EActionDelete]->setVisible(true); |
568 mContextMenuActions[EActionDelete]->setVisible(true); |
564 } else { |
569 } |
|
570 else |
|
571 { |
565 mContextMenuActions[EActionAttach]->setVisible(true); |
572 mContextMenuActions[EActionAttach]->setVisible(true); |
566 } |
573 } |
567 mContextMenuActions[EActionPlay]->setVisible(true); |
574 mContextMenuActions[EActionPlay]->setVisible(true); |
568 mContextMenuActions[EActionDetails]->setVisible(true); |
575 mContextMenuActions[EActionDetails]->setVisible(true); |
569 } |
576 } |
646 // |
653 // |
647 void VideoListWidget::doEmitActivated (const QModelIndex &index) |
654 void VideoListWidget::doEmitActivated (const QModelIndex &index) |
648 { |
655 { |
649 if(mIsService && |
656 if(mIsService && |
650 mVideoServices && |
657 mVideoServices && |
651 mVideoServices->currentService() == VideoServices::EUriFetcher && |
658 mService == VideoServices::EUriFetcher && |
652 mCurrentLevel != VideoCollectionCommon::ELevelCategory) |
659 mCurrentLevel != VideoCollectionCommon::ELevelCategory) |
653 { |
660 { |
654 QVariant variant = mModel->data(index, VideoCollectionCommon::KeyFilePath); |
661 QVariant variant = mModel->data(index, VideoCollectionCommon::KeyFilePath); |
655 if ( variant.isValid() ) |
662 if ( variant.isValid() ) |
656 { |
663 { |