13 * |
13 * |
14 * Description: Videolist view class source code |
14 * Description: Videolist view class source code |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 // Version : %version: 113.1.5 % |
18 // Version : %version: 113.1.8 % |
19 |
19 |
20 // INCLUDE FILES |
20 // INCLUDE FILES |
21 #include <xqserviceutil.h> |
|
22 #include <qactiongroup.h> |
21 #include <qactiongroup.h> |
23 #include <hbinstance.h> |
22 #include <hbinstance.h> |
24 #include <hbmainwindow.h> |
23 #include <hbmainwindow.h> |
25 #include <hbmessagebox.h> |
24 #include <hbmessagebox.h> |
26 #include <hbstackedwidget.h> |
25 #include <hbstackedwidget.h> |
42 #include "videolistwidget.h" |
41 #include "videolistwidget.h" |
43 #include "videohintwidget.h" |
42 #include "videohintwidget.h" |
44 #include "videolistview.h" |
43 #include "videolistview.h" |
45 #include "videocollectioncommon.h" |
44 #include "videocollectioncommon.h" |
46 #include "videocollectionwrapper.h" |
45 #include "videocollectionwrapper.h" |
47 #include "videosortfilterproxymodel.h" |
46 #include "videoproxymodelgeneric.h" |
48 #include "videocollectionuiloader.h" |
47 #include "videocollectionuiloader.h" |
49 #include "mpxhbvideocommondefs.h" |
48 #include "mpxhbvideocommondefs.h" |
50 #include "videooperatorservice.h" |
49 #include "videooperatorservice.h" |
51 #include "videocollectioncenrepdefs.h" |
50 #include "videocollectioncenrepdefs.h" |
52 #include "videocollectiontrace.h" |
51 #include "videocollectiontrace.h" |
121 } |
120 } |
122 int videoListPhase = VideoCollectionUiLoaderParam::LoadPhasePrimary; |
121 int videoListPhase = VideoCollectionUiLoaderParam::LoadPhasePrimary; |
123 int collectionListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary; |
122 int collectionListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary; |
124 int collectionContentListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary; |
123 int collectionContentListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary; |
125 VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelVideos; |
124 VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelVideos; |
126 if (XQServiceUtil::isService()) |
125 if (mUiUtils.isService()) |
127 { |
126 { |
128 INFO("VideoListView::initializeView() initializing service."); |
127 INFO("VideoListView::initializeView() initializing service."); |
129 if (!mVideoServices) |
128 if (!mVideoServices) |
130 { |
129 { |
131 mVideoServices = VideoServices::instance(); |
130 mVideoServices = VideoServices::instance(); |
606 bar->addActions(mToolbarViewsActionGroup->actions()); |
605 bar->addActions(mToolbarViewsActionGroup->actions()); |
607 } |
606 } |
608 else if(level == VideoCollectionCommon::ELevelAlbum) |
607 else if(level == VideoCollectionCommon::ELevelAlbum) |
609 { |
608 { |
610 bar->addActions(mToolbarCollectionActionGroup->actions()); |
609 bar->addActions(mToolbarCollectionActionGroup->actions()); |
|
610 if(!mModelReady) |
|
611 { |
|
612 // if model not ready yet toolbuttons should not be |
|
613 // visible, after model responds visibility will be updated |
|
614 mToolbarActions[ETBActionAddVideos]->setVisible(false); |
|
615 mToolbarActions[ETBActionRemoveVideos]->setVisible(false); |
|
616 } |
611 } |
617 } |
612 |
618 |
613 if(mToolbarServiceExtension && (level == VideoCollectionCommon::ELevelCategory |
619 if(mToolbarServiceExtension && (level == VideoCollectionCommon::ELevelCategory |
614 || level == VideoCollectionCommon::ELevelVideos)) |
620 || level == VideoCollectionCommon::ELevelVideos)) |
615 { |
621 { |
1094 // no list or model, cannot sort |
1101 // no list or model, cannot sort |
1095 return; |
1102 return; |
1096 } |
1103 } |
1097 // sort model |
1104 // sort model |
1098 Qt::SortOrder order(Qt::AscendingOrder); |
1105 Qt::SortOrder order(Qt::AscendingOrder); |
1099 VideoSortFilterProxyModel *model = mCurrentList->getModel(); |
1106 VideoProxyModelGeneric *model = mCurrentList->getModel(); |
1100 if(model->sortRole() == role && model->sortOrder() == Qt::AscendingOrder) |
1107 if(model->sortRole() == role && model->sortOrder() == Qt::AscendingOrder) |
1101 { |
1108 { |
1102 order = Qt::DescendingOrder; |
1109 order = Qt::DescendingOrder; |
1103 } |
1110 } |
1104 model->doSorting(role, order); |
1111 model->doSorting(role, order); |
1401 showAction(false, DOCML_NAME_SORT_BY_NAME); |
1408 showAction(false, DOCML_NAME_SORT_BY_NAME); |
1402 showAction(false, DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS); |
1409 showAction(false, DOCML_NAME_SORT_BY_NUMBER_OF_ITEMS); |
1403 showAction(false, DOCML_NAME_SORT_BY_SIZE); |
1410 showAction(false, DOCML_NAME_SORT_BY_SIZE); |
1404 showAction(false, DOCML_NAME_SORT_MENU); |
1411 showAction(false, DOCML_NAME_SORT_MENU); |
1405 |
1412 |
1406 VideoSortFilterProxyModel *model = mCurrentList->getModel(); |
1413 VideoProxyModelGeneric *model = mCurrentList->getModel(); |
1407 if (!model || !model->rowCount()) |
1414 if (!model || !model->rowCount()) |
1408 { |
1415 { |
1409 return; |
1416 return; |
1410 } |
1417 } |
1411 |
1418 |
1510 |
1517 |
1511 // update hint widget for correct content |
1518 // update hint widget for correct content |
1512 mModelReady = model->rowCount() > 0; |
1519 mModelReady = model->rowCount() > 0; |
1513 setHintLevel(VideoHintWidget::Collection); |
1520 setHintLevel(VideoHintWidget::Collection); |
1514 |
1521 |
1515 // update toolbar for albums, default categories don't have one. Neither does services. |
1522 if(mToolbarCollectionActionGroup) |
1516 toolBar()->clearActions(); |
1523 { |
1517 if(!mVideoServices && level == VideoCollectionCommon::ELevelAlbum && |
1524 // update toolbar for albums, default categories don't have one. Neither does services. |
1518 mToolbarCollectionActionGroup && mToolbarActions.contains(ETBActionCollections)) |
1525 toolBar()->clearActions(); |
1519 { |
1526 if(!mVideoServices && level == VideoCollectionCommon::ELevelAlbum && |
1520 mToolbarActions[ETBActionCollections]->setChecked(false); |
1527 mToolbarActions.contains(ETBActionCollections)) |
1521 toolBar()->addActions(mToolbarCollectionActionGroup->actions()); |
1528 { |
1522 setItemVisible(Hb::ToolBarItem, true); |
1529 mToolbarActions[ETBActionCollections]->setChecked(false); |
1523 } |
1530 toolBar()->addActions(mToolbarCollectionActionGroup->actions()); |
1524 else |
1531 setItemVisible(Hb::ToolBarItem, true); |
1525 { |
1532 } |
1526 setItemVisible(Hb::ToolBarItem, false); |
1533 else |
|
1534 { |
|
1535 setItemVisible(Hb::ToolBarItem, false); |
|
1536 } |
1527 } |
1537 } |
1528 // restore animations for collection content widget |
1538 // restore animations for collection content widget |
1529 collectionContentWidget->setEnabledAnimations(animationState); |
1539 collectionContentWidget->setEnabledAnimations(animationState); |
1530 } |
1540 } |
1531 else |
1541 else |