mpviewplugins/mpcollectionviewplugin/src/mpcollectionview.cpp
changeset 37 eb79a7c355bf
parent 36 a0afa279b8fe
child 38 b93f525c9244
equal deleted inserted replaced
36:a0afa279b8fe 37:eb79a7c355bf
    25 #include <hbaction.h>
    25 #include <hbaction.h>
    26 #include <hbtoolbar.h>
    26 #include <hbtoolbar.h>
    27 #include <hbmenu.h>
    27 #include <hbmenu.h>
    28 #include <hbmessagebox.h>
    28 #include <hbmessagebox.h>
    29 #include <hblabel.h>
    29 #include <hblabel.h>
    30 #include <QTranslator>
       
    31 #include <QLocale>
       
    32 #include <hblistview.h>
    30 #include <hblistview.h>
    33 #include <hbscrollbar.h>
    31 #include <hbscrollbar.h>
    34 
    32 
    35 #include "mpcollectionview.h"
    33 #include "mpcollectionview.h"
    36 #include "mpcollectiondocumentloader.h"
    34 #include "mpcollectiondocumentloader.h"
    47 #include "mpcollectionlistcontainer.h"
    45 #include "mpcollectionlistcontainer.h"
    48 #include "mpcollectionpopuphandler.h"
    46 #include "mpcollectionpopuphandler.h"
    49 
    47 
    50 
    48 
    51 const char*MUSIC_COLLECTION_DOCML = ":/docml/musiccollection.docml";
    49 const char*MUSIC_COLLECTION_DOCML = ":/docml/musiccollection.docml";
    52 const char*EFFECT_SELECT = ":/effects/select.fxml";
    50 
    53 const char*EFFECT_SELECT_END = ":/effects/select_end.fxml";
    51 const char*CONTAINER_EFFECT_GROUP = "mpcontainer";
       
    52 
       
    53 const char*SHOW_EFFECT = "show";
       
    54 const char*HIDE_EFFECT = "hide";
       
    55 const char*SHOW_BACK_EFFECT = "show_back";
       
    56 const char*HIDE_BACK_EFFECT = "hide_back";
       
    57 
       
    58 const char*SHOW_EFFECT_RESOURCE_NAME = "view_show_normal";
       
    59 const char*HIDE_EFFECT_RESOURCE_NAME = "view_hide_normal";
       
    60 const char*SHOW_BACK_EFFECT_RESOURCE_NAME = "view_show_back";
       
    61 const char*HIDE_BACK_EFFECT_RESOURCE_NAME = "view_hide_back";
       
    62 
       
    63 const char*EFFECT_TARGET_SNAPSHOT = "snapshot";
       
    64 const char*EFFECT_TARGET_CONTAINER = "container";
    54 
    65 
    55 const int KMainToolBarAll = 0;
    66 const int KMainToolBarAll = 0;
    56 const int KMainToolBarArtists = 1;
    67 const int KMainToolBarArtists = 1;
    57 const int KMainToolBarAlbums = 2;
    68 const int KMainToolBarAlbums = 2;
    58 const int KMainToolBarPlaylists = 3;
    69 const int KMainToolBarPlaylists = 3;
    97       mDocumentLoader( 0 ),
   108       mDocumentLoader( 0 ),
    98       mMainContainer( 0 ),
   109       mMainContainer( 0 ),
    99       mMainToolBar( 0 ),
   110       mMainToolBar( 0 ),
   100       mPlaylistToolBar( 0 ),
   111       mPlaylistToolBar( 0 ),
   101       mSnapshot( 0 ),
   112       mSnapshot( 0 ),
   102       mMpTranslator( 0 ),
       
   103       mCommonTranslator( 0 ),
       
   104       mActivationWaiting( false ),
   113       mActivationWaiting( false ),
   105       mMpPopupHandler( 0 ),
   114       mMpPopupHandler( 0 ),
   106       mUsbBlocked( false )
   115       mUsbBlocked( false )
   107 {
   116 {
   108     TX_LOG
   117     TX_LOG
   131 
   140 
   132     delete mCollectionContainer;
   141     delete mCollectionContainer;
   133     delete mContainerFactory;
   142     delete mContainerFactory;
   134     delete mCollectionDataModel;
   143     delete mCollectionDataModel;
   135     delete mDocumentLoader;
   144     delete mDocumentLoader;
   136     delete mMpTranslator;
       
   137     delete mCommonTranslator;
       
   138     TX_EXIT
   145     TX_EXIT
   139 }
   146 }
   140 
   147 
   141 /*!
   148 /*!
   142  Initializes the collection view. Allocates all resources needed by the view.
   149  Initializes the collection view. Allocates all resources needed by the view.
   143  */
   150  */
   144 void MpCollectionView::initializeView()
   151 void MpCollectionView::initializeView()
   145 {
   152 {
   146     TX_ENTRY
   153     TX_ENTRY
   147 
       
   148     //Load musicplayer and common translators
       
   149     QString lang = QLocale::system().name();
       
   150     QString path = QString( "z:/resource/qt/translations/" );
       
   151     bool translatorLoaded = false;
       
   152 
       
   153     mMpTranslator = new QTranslator( this );
       
   154     translatorLoaded = mMpTranslator->load( path + "musicplayer_" + lang );
       
   155     TX_LOG_ARGS( "Loading translator ok=" << translatorLoaded );
       
   156     if ( translatorLoaded ) {
       
   157         qApp->installTranslator( mMpTranslator );
       
   158     }
       
   159 
       
   160     mCommonTranslator = new QTranslator( this );
       
   161     translatorLoaded = mCommonTranslator->load( path + "common_" + lang );
       
   162     TX_LOG_ARGS( "Loading common translator ok=" << translatorLoaded );
       
   163     if ( translatorLoaded ) {
       
   164         qApp->installTranslator( mCommonTranslator );
       
   165     }
       
   166 
   154 
   167     mWindow = mainWindow();
   155     mWindow = mainWindow();
   168 
   156 
   169     // Create softkey actions
   157     // Create softkey actions
   170     mSoftKeyQuit = new HbAction( Hb::QuitNaviAction, this );
   158     mSoftKeyQuit = new HbAction( Hb::QuitNaviAction, this );
   217         widget = mDocumentLoader->findWidget( QString( "mainContainer" ) );
   205         widget = mDocumentLoader->findWidget( QString( "mainContainer" ) );
   218         mMainContainer = qobject_cast<HbWidget*>( widget );
   206         mMainContainer = qobject_cast<HbWidget*>( widget );
   219 
   207 
   220         setWidget( mMainContainer );
   208         setWidget( mMainContainer );
   221 
   209 
   222         HbEffect::add( QString( "container" ),
   210         HbEffect::add(
   223                 QString( ":/effects/slide_out_to_left.fxml" ),
   211             QStringList() << CONTAINER_EFFECT_GROUP << CONTAINER_EFFECT_GROUP << CONTAINER_EFFECT_GROUP << CONTAINER_EFFECT_GROUP,
   224                 QString( "slide_out_to_left" ) );
   212             QStringList() << SHOW_EFFECT_RESOURCE_NAME <<  HIDE_EFFECT_RESOURCE_NAME << SHOW_BACK_EFFECT_RESOURCE_NAME << HIDE_BACK_EFFECT_RESOURCE_NAME,
   225 
   213             QStringList() << SHOW_EFFECT << HIDE_EFFECT << SHOW_BACK_EFFECT << HIDE_BACK_EFFECT);
   226         HbEffect::add( QString( "container" ),
   214 
   227                 QString( ":/effects/slide_out_to_right.fxml" ),
   215 
   228                 QString( "slide_out_to_right" ) );
       
   229 
       
   230         HbEffect::add( QString( "container" ),
       
   231                 QString( ":/effects/slide_out_to_top.fxml" ),
       
   232                 QString( "slide_out_to_top" ) );
       
   233 
       
   234         HbEffect::add( QString( "container" ),
       
   235                 QString( ":/effects/slide_in_to_right_and_fade_in.fxml" ),
       
   236                 QString( "slide_in_to_right_and_fade_in" ) );
       
   237 
       
   238         HbEffect::add( QString( "container" ),
       
   239                 QString( ":/effects/slide_in_to_left_and_fade_in.fxml" ),
       
   240                 QString( "slide_in_to_left_and_fade_in" ) );
       
   241 
       
   242         HbEffect::add( QString( "container" ),
       
   243                 QString( ":/effects/slide_in_to_top_and_fade_in.fxml" ),
       
   244                 QString( "slide_in_to_top_and_fade_in" ) );
       
   245     }
   216     }
   246     else {
   217     else {
   247         TX_LOG_ARGS( "Error: invalid xml file." );
   218         TX_LOG_ARGS( "Error: invalid xml file." );
   248         Q_ASSERT_X( ok, "MpCollectionView::initializeView", "invalid xml file" );
   219         Q_ASSERT_X( ok, "MpCollectionView::initializeView", "invalid xml file" );
   249     }
   220     }
   260              this, SLOT( handleLibraryUpdated() ) );
   231              this, SLOT( handleLibraryUpdated() ) );
   261     mUsbBlocked = mMpEngine->verifyUsbBlocking();
   232     mUsbBlocked = mMpEngine->verifyUsbBlocking();
   262 
   233 
   263     if ( MpSettingsManager::firstStartup() ) {
   234     if ( MpSettingsManager::firstStartup() ) {
   264         mActivationWaiting = true;
   235         mActivationWaiting = true;
   265         mMpEngine->refreshLibrary();
   236         mMpEngine->refreshLibrary( true );
   266     }
   237     }
   267 
   238 
   268     TX_EXIT
   239     TX_EXIT
   269 }
   240 }
   270 
   241 
   299  */
   270  */
   300 void MpCollectionView::deactivateView()
   271 void MpCollectionView::deactivateView()
   301 {
   272 {
   302     TX_ENTRY
   273     TX_ENTRY
   303     mActivated = false;
   274     mActivated = false;
   304 	
   275 
   305     cancelOngoingOperation();
   276     closeActiveDialog( true );
   306 
   277 
   307     setNavigationAction( 0 );
   278     setNavigationAction( 0 );
   308     TX_EXIT
   279     TX_EXIT
   309 }
   280 }
   310 
   281 
   358     mCollectionContext = context;
   329     mCollectionContext = context;
   359     // Reset softkey and the menu
   330     // Reset softkey and the menu
   360     if ( mActivated ) {
   331     if ( mActivated ) {
   361         setSoftkey();
   332         setSoftkey();
   362     }
   333     }
       
   334 
       
   335     // Close any possible popup already launched with previous context
       
   336     closeActiveDialog();
       
   337 
   363     updateToolBar();
   338     updateToolBar();
   364     updateMenu();
   339     updateMenu();
   365 
   340 
   366     mCollectionContainer = mContainerFactory->createContainer( context );
   341     mCollectionContainer = mContainerFactory->createContainer( context );
   367     mCollectionContainer->setViewMode( mViewMode );
   342     mCollectionContainer->setViewMode( mViewMode );
   469                 break;
   444                 break;
   470             default:
   445             default:
   471                 break;
   446                 break;
   472         }
   447         }
   473     }
   448     }
   474     // TODO: "showingPopup()" used as workaround for HbListView multiple events: longPress and activated.
   449 
   475     //       Remove once HbListView get fixed (wk16)
   450     if ( doOpen ) {
   476     if ( doOpen && !mMpPopupHandler->showingPopup() ) {
       
   477         if ( mCollectionContext == ECollectionContextArtistAlbums ) {
   451         if ( mCollectionContext == ECollectionContextArtistAlbums ) {
   478             if ( (mCollectionData->count() > 1) && (index == 0) ) {
   452             if ( (mCollectionData->count() > 1) && (index == 0) ) {
   479                 mMpEngine->openCollectionItem( index );
   453                 mMpEngine->openCollectionItem( index );
   480             }
   454             }
   481             else {
   455             else {
   513  play album with \a albumIndex starting with the songs with \a songIndex.
   487  play album with \a albumIndex starting with the songs with \a songIndex.
   514  */
   488  */
   515 void MpCollectionView::playAlbumSongs( int albumIndex, int songIndex )
   489 void MpCollectionView::playAlbumSongs( int albumIndex, int songIndex )
   516 {
   490 {
   517     TX_ENTRY_ARGS( "albumIndex=" << albumIndex << "songIndex=" << songIndex );
   491     TX_ENTRY_ARGS( "albumIndex=" << albumIndex << "songIndex=" << songIndex );
   518     // TODO: "showingPopup()" used as workaround for HbListView multiple events: longPress and activated.
   492     mMpEngine->playAlbumSongs(albumIndex, songIndex);
   519     //       Remove once HbListView get fixed (wk16)
       
   520     if ( !mMpPopupHandler->showingPopup() ) {
       
   521         mMpEngine->playAlbumSongs(albumIndex, songIndex);
       
   522     }
       
   523     TX_EXIT
   493     TX_EXIT
   524 }
   494 }
   525 
   495 
   526 /*!
   496 /*!
   527  Slot to be called when back/quit softkey is pressed.
   497  Slot to be called when back/quit softkey is pressed.
   611 /*!
   581 /*!
   612  Slot for container transition end.
   582  Slot for container transition end.
   613  */
   583  */
   614 void MpCollectionView::containerTransitionComplete( const HbEffect::EffectStatus &status )
   584 void MpCollectionView::containerTransitionComplete( const HbEffect::EffectStatus &status )
   615 {    
   585 {    
   616     if ( status.userData == "snapshot_effect" ) {
   586     if ( status.userData == EFFECT_TARGET_SNAPSHOT ) {
   617         qobject_cast<QGraphicsView *>( mWindow )->scene()->removeItem( mSnapshot );
   587         qobject_cast<QGraphicsView *>( mWindow )->scene()->removeItem( mSnapshot );
   618         mSnapshot->deleteLater();
   588         mSnapshot->deleteLater();
   619         mSnapshot = 0;
   589         mSnapshot = 0;
   620     }
   590     }
   621 }
   591 }
   638             break;
   608             break;
   639     }
   609     }
   640 }
   610 }
   641 
   611 
   642 /*!
   612 /*!
   643  Slot to be called when 'Refresh Library' is clicked by the user from the menu.
       
   644  */
       
   645 void MpCollectionView::refreshLibrary()
       
   646 {
       
   647     mMpEngine->refreshLibrary();
       
   648 }
       
   649 
       
   650 /*!
       
   651  Slot to be called when 'Add to playlist' is clicked by the user from the menu.
   613  Slot to be called when 'Add to playlist' is clicked by the user from the menu.
   652  */
   614  */
   653 void MpCollectionView::addToPlaylist()
   615 void MpCollectionView::addToPlaylist()
   654 {
   616 {
   655     switch ( mCollectionContext ) {
   617     switch ( mCollectionContext ) {
   775 void MpCollectionView::handleUsbBlocked( bool blocked )
   737 void MpCollectionView::handleUsbBlocked( bool blocked )
   776 {
   738 {
   777     TX_ENTRY_ARGS( "blocked=" << blocked );
   739     TX_ENTRY_ARGS( "blocked=" << blocked );
   778     mUsbBlocked = blocked;
   740     mUsbBlocked = blocked;
   779         
   741         
   780     cancelOngoingOperation();
   742     closeActiveDialog();
   781     
   743     
   782     updateMenu();
   744     updateMenu();
   783     if ( mCollectionContext == ECollectionContextPlaylistSongs ) {
   745     if ( mCollectionContext == ECollectionContextPlaylistSongs ) {
   784          updateToolBar();
   746          updateToolBar();
   785     }
   747     }
   790  Slot to be called when library is going to be updated.
   752  Slot to be called when library is going to be updated.
   791  */
   753  */
   792 void MpCollectionView::handleLibraryAboutToUpdate()
   754 void MpCollectionView::handleLibraryAboutToUpdate()
   793 {
   755 {
   794     TX_ENTRY
   756     TX_ENTRY
   795     cancelOngoingOperation();
   757     closeActiveDialog();
   796     TX_EXIT
   758     TX_EXIT
   797 }
   759 }
   798 
   760 
   799 /*!
   761 /*!
   800  Slot to be called when refreshing completes or library has been updated.
   762  Slot to be called when refreshing completes or library has been updated.
   805     if ( mActivationWaiting ) {
   767     if ( mActivationWaiting ) {
   806         mActivationWaiting = false;
   768         mActivationWaiting = false;
   807         activateView();
   769         activateView();
   808     }
   770     }
   809     else {
   771     else {
   810         cancelOngoingOperation();
   772         closeActiveDialog();
   811         
   773         
   812         //Update cache, even if collection is in background.
   774         //Update cache, even if collection is in background.
   813         //Library refreshing could be triggered at any point due USB/MMC events.
   775         //Library refreshing could be triggered at any point due USB/MMC events.
   814         mMpEngine->reopenCollection();
   776         mMpEngine->reopenCollection();
   815     }
   777     }
   995                 else {
   957                 else {
   996                     menuAction->setDisabled( true );
   958                     menuAction->setDisabled( true );
   997                 }
   959                 }
   998                 menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_refresh_library" ) );
   960                 menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_refresh_library" ) );
   999                 if ( !mUsbBlocked ) {
   961                 if ( !mUsbBlocked ) {
  1000                     connect( menuAction, SIGNAL( triggered() ), this, SLOT( refreshLibrary() ) );
   962                     connect( menuAction, SIGNAL( triggered() ), mMpEngine, SLOT( refreshLibrary() ) );
  1001                 }
   963                 }
  1002                 else {
   964                 else {
  1003                     menuAction->setDisabled( true );
   965                     menuAction->setDisabled( true );
  1004                 }
   966                 }
  1005                 connect( myMenu->addAction(hbTrId("txt_common_opt_exit")), SIGNAL(triggered()), this, SLOT(exit()) );
   967                 connect( myMenu->addAction(hbTrId("txt_common_opt_exit")), SIGNAL(triggered()), this, SLOT(exit()) );
  1006                 break;
   968                 break;
  1007             case ECollectionContextArtists:
   969             case ECollectionContextArtists:
  1008             case ECollectionContextAlbums:
   970             case ECollectionContextAlbums:
  1009                 menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_refresh_library" ) );
   971                 menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_refresh_library" ) );
  1010                 if ( !mUsbBlocked ) {
   972                 if ( !mUsbBlocked ) {
  1011                     connect( menuAction, SIGNAL( triggered() ), this, SLOT( refreshLibrary() ) );
   973                     connect( menuAction, SIGNAL( triggered() ), mMpEngine, SLOT( refreshLibrary() ) );                
  1012                 }
   974                 }
  1013                 else {
   975                 else {
  1014                     menuAction->setDisabled( true );
   976                     menuAction->setDisabled( true );
  1015                 }
   977                 }
  1016                 connect( myMenu->addAction(hbTrId("txt_common_opt_exit")), SIGNAL(triggered()), this, SLOT(exit()) );
   978                 connect( myMenu->addAction(hbTrId("txt_common_opt_exit")), SIGNAL(triggered()), this, SLOT(exit()) );
  1079             case ECollectionContextAllSongs:
  1041             case ECollectionContextAllSongs:
  1080             case ECollectionContextArtists:
  1042             case ECollectionContextArtists:
  1081             case ECollectionContextAlbums:
  1043             case ECollectionContextAlbums:
  1082                 menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_refresh_library" ) );
  1044                 menuAction = myMenu->addAction( hbTrId( "txt_mus_opt_refresh_library" ) );
  1083                 if ( !mUsbBlocked ) {
  1045                 if ( !mUsbBlocked ) {
  1084                     connect( menuAction, SIGNAL( triggered() ), this, SLOT( refreshLibrary() ) );
  1046                     connect( menuAction, SIGNAL( triggered() ), mMpEngine, SLOT( refreshLibrary() ) );
  1085                 }
  1047                 }
  1086                 else {
  1048                 else {
  1087                     menuAction->setDisabled( true );
  1049                     menuAction->setDisabled( true );
  1088                 }
  1050                 }
  1089                 break;
  1051                 break;
  1219     }
  1181     }
  1220     mSnapshot->capture( mWindow, mMainContainer );
  1182     mSnapshot->capture( mWindow, mMainContainer );
  1221     mWindow->scene()->addItem( mSnapshot );
  1183     mWindow->scene()->addItem( mSnapshot );
  1222 
  1184 
  1223 
  1185 
  1224     if ( ( contextFrom == ECollectionContextAlbums && contextTo == ECollectionContextAlbumsTBone ) ||
  1186     if( ( contextFrom == ECollectionContextAlbumsTBone && contextTo == ECollectionContextAlbums ) ||
  1225          ( contextFrom == ECollectionContextArtists && contextTo == ECollectionContextArtistAlbums ) ||
       
  1226          ( contextFrom == ECollectionContextArtistAlbums && contextTo == ECollectionContextArtistAlbumsTBone ) ||
       
  1227          ( contextFrom == ECollectionContextArtistAlbums && contextTo == ECollectionContextArtistAllSongs ) ||
       
  1228          ( contextFrom == ECollectionContextPlaylists && contextTo == ECollectionContextPlaylistSongs ) ) {
       
  1229         HbEffect::start( mSnapshot,
       
  1230                 QString( "container" ),
       
  1231                 QString( "slide_out_to_left" ),
       
  1232                 this,
       
  1233                 "containerTransitionComplete",
       
  1234                 QString( "snapshot_effect") );
       
  1235 
       
  1236         HbEffect::start( mMainContainer,
       
  1237                 QString( "container" ),
       
  1238                 QString( "slide_in_to_left_and_fade_in" ),
       
  1239                 this,
       
  1240                 "containerTransitionComplete",
       
  1241                 QString( "mainContainer_effect") );
       
  1242     }
       
  1243     else if( ( contextFrom == ECollectionContextAlbumsTBone && contextTo == ECollectionContextAlbums ) ||
       
  1244              ( contextFrom == ECollectionContextArtistAlbums && contextTo == ECollectionContextArtists ) ||
  1187              ( contextFrom == ECollectionContextArtistAlbums && contextTo == ECollectionContextArtists ) ||
  1245              ( contextFrom == ECollectionContextArtistAlbumsTBone && contextTo == ECollectionContextArtistAlbums ) ||
  1188              ( contextFrom == ECollectionContextArtistAlbumsTBone && contextTo == ECollectionContextArtistAlbums ) ||
       
  1189              ( contextFrom == ECollectionContextArtistAlbumsTBone && contextTo == ECollectionContextArtists ) ||
  1246              ( contextFrom == ECollectionContextArtistAllSongs && contextTo == ECollectionContextArtistAlbums ) ||
  1190              ( contextFrom == ECollectionContextArtistAllSongs && contextTo == ECollectionContextArtistAlbums ) ||
  1247              ( contextFrom == ECollectionContextPlaylistSongs && contextTo == ECollectionContextPlaylists ) ) {
  1191              ( contextFrom == ECollectionContextPlaylistSongs && contextTo == ECollectionContextPlaylists ) ) {
  1248         HbEffect::start( mSnapshot,
  1192         HbEffect::start( mSnapshot,
  1249                 QString( "container" ),
  1193                 QString( CONTAINER_EFFECT_GROUP ),
  1250                 QString( "slide_out_to_right" ),
  1194                 QString( HIDE_BACK_EFFECT ),
  1251                 this,
  1195                 this,
  1252                 "containerTransitionComplete",
  1196                 "containerTransitionComplete",
  1253                 QString( "snapshot_effect") );
  1197                 QString( EFFECT_TARGET_SNAPSHOT) );
  1254 
  1198 
  1255         HbEffect::start( mMainContainer,
  1199         HbEffect::start( mMainContainer,
  1256                 QString( "container" ),
  1200                 QString( CONTAINER_EFFECT_GROUP ),
  1257                 QString( "slide_in_to_right_and_fade_in" ),
  1201                 QString( SHOW_BACK_EFFECT ),
  1258                 this,
  1202                 this,
  1259                 "containerTransitionComplete",
  1203                 "containerTransitionComplete",
  1260                 QString( "mainContainer_effect") );
  1204                 QString( EFFECT_TARGET_CONTAINER) );
  1261     }
  1205     }
  1262     else {
  1206     else {
  1263         HbEffect::start( mSnapshot,
  1207         HbEffect::start( mSnapshot,
  1264                 QString( "container" ),
  1208                 QString( CONTAINER_EFFECT_GROUP ),
  1265                 QString( "slide_out_to_top" ),
  1209                 QString( HIDE_EFFECT ),
  1266                 this,
  1210                 this,
  1267                 "containerTransitionComplete",
  1211                 "containerTransitionComplete",
  1268                 QString( "snapshot_effect") );
  1212                 QString( EFFECT_TARGET_SNAPSHOT) );
  1269 
  1213 
  1270         HbEffect::start( mMainContainer,
  1214         HbEffect::start( mMainContainer,
  1271                 QString( "container" ),
  1215                 QString( CONTAINER_EFFECT_GROUP ),
  1272                 QString( "slide_in_to_top_and_fade_in" ),
  1216                 QString( SHOW_EFFECT ),
  1273                 this,
  1217                 this,
  1274                 "containerTransitionComplete",
  1218                 "containerTransitionComplete",
  1275                 QString( "mainContainer_effect") );
  1219                 QString( EFFECT_TARGET_CONTAINER ) );
  1276     }
  1220     }
  1277 }
  1221 }
  1278 
  1222 
  1279 /*!
  1223 /*!
  1280  \internal
  1224  \internal
  1281  Closes any active dialog or menu.
  1225  Closes any active dialog or menu.
  1282  */
  1226  */
  1283 void MpCollectionView::cancelOngoingOperation()
  1227 void MpCollectionView::closeActiveDialog( bool onlyContextMenu )
  1284 {
  1228 {
  1285     if ( mActivated ) {
  1229     mMpPopupHandler->cancelOngoingPopup( onlyContextMenu );
  1286         mMpPopupHandler->cancelOngoingPopup();
  1230     menu()->close();
  1287         menu()->close();
  1231 }
  1288     }
  1232 
  1289 }
       
  1290