videocollection/videocollectionview/src/videocollectionviewutils.cpp
changeset 35 3738fe97f027
parent 34 bbb98528c666
child 36 8aed59de29f9
equal deleted inserted replaced
34:bbb98528c666 35:3738fe97f027
    83     }
    83     }
    84     
    84     
    85     mSortRole = role;
    85     mSortRole = role;
    86     mSortOrder = order;
    86     mSortOrder = order;
    87     
    87     
    88     return status;    
    88     return status;
    89 }
    89 }
    90 
    90 
    91 // ---------------------------------------------------------------------------
    91 // ---------------------------------------------------------------------------
    92 // loadSortingValues
    92 // loadSortingValues
    93 // ---------------------------------------------------------------------------
    93 // ---------------------------------------------------------------------------
    97     int err(0);
    97     int err(0);
    98     
    98     
    99     if (mSortRole == -1)
    99     if (mSortRole == -1)
   100     {
   100     {
   101         CRepository *cenRep = 0;
   101         CRepository *cenRep = 0;
   102         TRAP_IGNORE(cenRep = CRepository::NewL(TUid::Uid(KVideoCollectionViewCenrepUid)));
   102         TRAP(err, cenRep = CRepository::NewL(TUid::Uid(KVideoCollectionViewCenrepUid)));
   103         if(cenRep)
   103         if(cenRep)
   104         {
   104         {
   105             int sortRole(-1);
   105             int sortRole(-1);
   106             int sortOrder(-1);
   106             int sortOrder(-1);
   107             err = cenRep->Get(KVideoCollectionViewCenrepSortingRoleKey, sortRole);
   107             err = cenRep->Get(KVideoCollectionViewCenrepSortingRoleKey, sortRole);
   188     {
   188     {
   189         HbListViewItem *prototype = view->listItemPrototype();
   189         HbListViewItem *prototype = view->listItemPrototype();
   190         if(prototype)
   190         if(prototype)
   191         {
   191         {
   192             //Use image layout in prototype
   192             //Use image layout in prototype
   193             prototype->setGraphicsSize(HbListViewItem::Thumbnail);
   193             prototype->setGraphicsSize(HbListViewItem::WideThumbnail);
   194         }
   194         }
   195         view->setItemRecycling(true);
   195         view->setItemRecycling(true);
   196         view->setClampingStyle(HbScrollArea::BounceBackClamping);
   196         view->setClampingStyle(HbScrollArea::BounceBackClamping);
   197         view->setScrollingStyle(HbScrollArea::PanOrFlick);
   197         view->setScrollingStyle(HbScrollArea::PanOrFlick);
   198         view->setFrictionEnabled(true);
   198         view->setFrictionEnabled(true);
   241     QString format("");
   241     QString format("");
   242     bool error(true);
   242     bool error(true);
   243     switch(statusCode)
   243     switch(statusCode)
   244     {
   244     {
   245         case VideoCollectionCommon::statusSingleDeleteFail:
   245         case VideoCollectionCommon::statusSingleDeleteFail:
   246             format = tr("Unable to delete item %1. It is currently open."); //TODO: localisation
   246             format = hbTrId("txt_videos_info_unable_to_delete_1_it_is_current");
   247             if(additional.isValid())
   247             if(additional.isValid())
   248             {
   248             {
   249                 msg = format.arg(additional.toString());
   249                 msg = format.arg(additional.toString());
   250             }
   250             }
   251         break;
   251         break;
   252         case VideoCollectionCommon::statusMultipleDeleteFail:
   252         case VideoCollectionCommon::statusMultipleDeleteFail:
   253             msg = tr("Unable to delete some items which are currently open.");
   253             msg = hbTrId("txt_videos_info_unable_to_delete_some_items_which");
   254         break;
   254         break;
   255         case VideoCollectionCommon::statusSingleRemoveFail:
   255         case VideoCollectionCommon::statusSingleRemoveFail:
   256             format = tr("Unable to remove collection %1."); //TODO: localisation
   256             format = tr("Unable to remove collection %1."); //localisation
   257             if(additional.isValid())
   257             if(additional.isValid())
   258             {
   258             {
   259                 msg = format.arg(additional.toString());
   259                 msg = format.arg(additional.toString());
   260             }
   260             }
   261         break;
   261         break;
   262         case VideoCollectionCommon::statusMultiRemoveFail:
   262         case VideoCollectionCommon::statusMultiRemoveFail:
   263             msg = tr("Unable to remove some collections.");
   263             msg = tr("Unable to remove some collections.");  //localisation
   264         break;
   264         break;
   265         case VideoCollectionCommon::statusVideosAddedToCollection:
   265         case VideoCollectionCommon::statusVideosAddedToCollection:
   266             format = tr("Videos added to %1 collection."); //TODO: localisation
   266             format = hbTrId("txt_videos_dpopinfo_videos_added_to_1");
   267             if(additional.isValid())
   267             if(additional.isValid())
   268             {
   268             {
   269                 msg = format.arg(additional.toString());
   269                 msg = format.arg(additional.toString());
   270             }
   270             }
   271             error = false;
   271             error = false;
   272         break;
   272         break;
   273         case VideoCollectionCommon::statusAllVideosAlreadyInCollection:
   273         case VideoCollectionCommon::statusAllVideosAlreadyInCollection:
   274             msg = tr("All videos already added to this collection.");            
   274             msg = tr("All videos already added to this collection.");   //localisation
   275         break;
   275         break;
   276         case VideoCollectionCommon::statusDeleteInProgress:
   276         case VideoCollectionCommon::statusDeleteInProgress:
   277             format = tr("%1 videos are being deleted."); //TODO: localisation
   277             format = hbTrId("txt_videos_dpopinfo_ln_videos_are_being_deleted");
   278             if(additional.isValid())
   278             if(additional.isValid())
   279             {
   279             {
   280                 msg = format.arg(additional.toString());
   280                 msg = format.arg(additional.toString());
   281             }
   281             }
   282             error = false;
   282             error = false;