videocollection/videocollectionview/src/videolistselectiondialog.cpp
changeset 55 4bfa887905cf
parent 50 21fe8338c6bf
child 58 d2b028fd1f7d
equal deleted inserted replaced
50:21fe8338c6bf 55:4bfa887905cf
    13 *
    13 *
    14 * Description:   videolist selection dialog implementation
    14 * Description:   videolist selection dialog implementation
    15 * 
    15 * 
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 30.1.2 %
    18 // Version : %version: 30.1.3 %
    19 
    19 
    20 // INCLUDE FILES
    20 // INCLUDE FILES
    21 #include <qgraphicsitem.h>
    21 #include <qgraphicsitem.h>
    22 #include <hblabel.h>
    22 #include <hblabel.h>
    23 #include <hbcheckbox.h>
    23 #include <hbcheckbox.h>
   351     // scroll list back to top
   351     // scroll list back to top
   352     mListWidget->scrollTo(mModel->index(0, 0));
   352     mListWidget->scrollTo(mModel->index(0, 0));
   353     
   353     
   354     connectSignals();
   354     connectSignals();
   355 
   355 
   356     if(mModel->rowCount())
   356     if(mTypeOfSelection == ECreateCollection)
   357     {
   357     {
   358         if(mTypeOfSelection == ECreateCollection)
   358         // note this does not leak memory as the dialog will destroy itself upon close.
   359         {
   359         HbInputDialog *dialog = gCreateNewAlbumNameDialog(LIST_VIEW_OBJECT_NAME_CREATE_COLLECTION);
   360             // note this does not leak memory as the dialog will destroy itself upon close.
   360         dialog->open(this, SLOT(newAlbumNameDialogFinished(HbAction *)));
   361             HbInputDialog *dialog = gCreateNewAlbumNameDialog(LIST_VIEW_OBJECT_NAME_CREATE_COLLECTION);
   361     }
   362             dialog->open(this, SLOT(newAlbumNameDialogFinished(HbAction *)));
   362     else if(mModel->rowCount())
   363         }
   363     {
   364         else
   364         // show dialog
   365         {
   365         HbDialog::open();
   366             // show dialog
       
   367             HbDialog::open();
       
   368         }
       
   369     }
   366     }
   370     else if((mModelReady && mTypeOfSelection != ESelectCollection) || 
   367     else if((mModelReady && mTypeOfSelection != ESelectCollection) || 
   371             (mAlbumListReady && mTypeOfSelection == ESelectCollection))
   368             (mAlbumListReady && mTypeOfSelection == ESelectCollection))
   372     {
   369     {
   373         INFO("VideoListSelectionDialog::exec(): nothing to show, finishing.")
   370         INFO("VideoListSelectionDialog::exec(): nothing to show, finishing.")
   428     if(dialog->actions().first() == action && variant.isValid())
   425     if(dialog->actions().first() == action && variant.isValid())
   429     {
   426     {
   430         QString text = mModel->resolveAlbumName(variant.toString());
   427         QString text = mModel->resolveAlbumName(variant.toString());
   431         if(!text.isEmpty())
   428         if(!text.isEmpty())
   432         {
   429         {
   433             if(mSelectedVideos.count() == 0)
   430             if(mSelectedVideos.count() == 0 && mModel->rowCount())
   434             {
   431             {
   435                 mNewAlbumText = text;
   432                 mNewAlbumText = text;
   436                 // show video selection dialog
   433                 // show video selection dialog
   437                 HbDialog::open();
   434                 HbDialog::open();
   438             }
   435             }