radioapp/radiowidgets/src/radioviewbase.cpp
changeset 54 a8ba0c289b44
parent 36 ba22309243a1
--- a/radioapp/radiowidgets/src/radioviewbase.cpp	Mon Sep 20 18:04:48 2010 +0300
+++ b/radioapp/radiowidgets/src/radioviewbase.cpp	Tue Oct 05 09:31:22 2010 +0300
@@ -19,6 +19,7 @@
 #include <HbAction>
 #include <HbEffect>
 #include <QCoreApplication>
+#include <HbSelectionDialog>
 #include <HbMessageBox>
 
 #include "radioviewbase.h"
@@ -147,7 +148,7 @@
  */
 void RadioViewBase::handleUserAnswer( HbAction* answer )
 {
-    HbMessageBox* dlg = static_cast<HbMessageBox*>( sender() );
+    HbDialog* dlg = static_cast<HbDialog*>( sender() );
     if( dlg->actions().first() == answer ) {
         userAccepted();
     }
@@ -233,6 +234,26 @@
 /*!
  *
  */
+void RadioViewBase::showSelectionDialog( QAbstractItemModel* model, 
+                                         const QString& titleTxt, 
+                                         const QString& confirmBtnTxt )
+{
+   HbSelectionDialog* selectionDlg = new HbSelectionDialog;
+   selectionDlg->setModel( model );
+   selectionDlg->setAttribute( Qt::WA_DeleteOnClose );
+   selectionDlg->setSelectionMode( HbAbstractItemView::MultiSelection );
+   selectionDlg->setHeadingText( titleTxt );
+
+   if( selectionDlg->actions().count() ) {       
+       selectionDlg->actions().first()->setText( confirmBtnTxt );
+   }
+  
+   selectionDlg->open( this, SLOT(handleUserAnswer( HbAction* ) ) );     
+}
+
+/*!
+ *
+ */
 void RadioViewBase::setOrientation()
 {
     // Default implementation does nothing