appinstaller/AppinstUi/sifuidevicedialogplugin/src/sifuidialog.cpp
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
child 27 e8965914fac7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Software install notification plugin class.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "sifuidialog.h"                    // SifUiDialog
       
    19 #include "sifuidialogtitlewidget.h"         // SifUiDialogTitleWidget
       
    20 #include "sifuidialogcontentwidget.h"       // SifUiDialogContentWidget
       
    21 #include "sifuidialoggrantcapabilities.h"   // SifUiDialogGrantCapabilities
       
    22 #include "sifuidialogselectlanguage.h"      // SifUiDialogSelectLanguage
       
    23 #include "sifuiinstallindicatorparams.h"    // KSifUiInstallIndicatorType
       
    24 #include <QFile>
       
    25 #include <HbLabel>
       
    26 #include <HbAction>
       
    27 #include <HbIndicator>
       
    28 #include <HbTranslator>
       
    29 #include <HbMessageBox>
       
    30 #include <HbSelectionDialog>
       
    31 #include <QValueSpaceSubscriber>
       
    32 #include <xqappmgr.h>                       // XQApplicationManager
       
    33 
       
    34 QTM_USE_NAMESPACE
       
    35 
       
    36 const QString KTranslationsPath = "/resource/qt/translations/";
       
    37 const QString KSifUiTranslationsFile = "sifuidevicedialogplugin";
       
    38 const QString KCommonTranslationsFile = "common";
       
    39 const QString KSwiErrorsFile = "c:\\temp\\swierrors.txt";
       
    40 const QString KSwiErrorFormat = " (%1)";
       
    41 
       
    42 #ifdef Q_OS_SYMBIAN
       
    43 QByteArray ConvertOptionalComponentIndexesL( const QList<QVariant> &aIndexes );
       
    44 #endif // Q_OS_SYMBIAN
       
    45 
       
    46 
       
    47 // ======== LOCAL FUNCTIONS ========
       
    48 
       
    49 // ----------------------------------------------------------------------------
       
    50 // convertOptionalComponentIndexes()
       
    51 // ----------------------------------------------------------------------------
       
    52 //
       
    53 QVariant convertOptionalComponentIndexes(const QList<QVariant> &selections)
       
    54 {
       
    55 #ifdef Q_OS_SYMBIAN
       
    56     QByteArray byteArray;
       
    57     QT_TRAP_THROWING( byteArray = ConvertOptionalComponentIndexesL( selections ) );
       
    58     return QVariant( byteArray );
       
    59 #else
       
    60     return QVariant();
       
    61 #endif
       
    62 }
       
    63 
       
    64 
       
    65 // ======== MEMBER FUNCTIONS ========
       
    66 
       
    67 // ----------------------------------------------------------------------------
       
    68 // SifUiDialog::SifUiDialog()
       
    69 // ----------------------------------------------------------------------------
       
    70 //
       
    71 SifUiDialog::SifUiDialog(const QVariantMap &parameters) : HbDialog(),
       
    72     mCommonTranslator(0), mSifUITranslator(0), mLastDialogError(KErrNone),
       
    73     mShowEventReceived(false), mDialogType(SifUiUnspecifiedDialog),
       
    74     mTitle(0), mContent(0), mErrorDetails(), mErrorCode(KErrNone),
       
    75     mExtendedErrorCode(KErrNone), mPrimaryAction(0), mSecondaryAction(0),
       
    76     mResultMap(), mIndicator(0), mSubscriber(0)
       
    77 {
       
    78     mCommonTranslator = new HbTranslator(KTranslationsPath, KCommonTranslationsFile);
       
    79     mSifUITranslator = new HbTranslator(KTranslationsPath, KSifUiTranslationsFile);
       
    80     constructDialog(parameters);
       
    81 }
       
    82 
       
    83 // ----------------------------------------------------------------------------
       
    84 // SifUiDialog::~SifUiDialog()
       
    85 // ----------------------------------------------------------------------------
       
    86 //
       
    87 SifUiDialog::~SifUiDialog()
       
    88 {
       
    89     delete mSubscriber;
       
    90     delete mPrimaryAction;
       
    91     delete mSecondaryAction;
       
    92     delete mSifUITranslator;
       
    93     delete mCommonTranslator;
       
    94 }
       
    95 
       
    96 // ----------------------------------------------------------------------------
       
    97 // SifUiDialog::dialogType()
       
    98 // ----------------------------------------------------------------------------
       
    99 //
       
   100 SifUiDeviceDialogType SifUiDialog::dialogType(const QVariantMap &parameters)
       
   101 {
       
   102     SifUiDeviceDialogType type = SifUiUnspecifiedDialog;
       
   103     if (parameters.contains(KSifUiDialogType)) {
       
   104         type = static_cast<SifUiDeviceDialogType>(parameters.value(KSifUiDialogType).toInt());
       
   105         Q_ASSERT(type == SifUiConfirmationQuery || type == SifUiProgressNote ||
       
   106             type == SifUiCompleteNote || type == SifUiErrorNote);
       
   107     }
       
   108     return type;
       
   109 }
       
   110 
       
   111 // ----------------------------------------------------------------------------
       
   112 // SifUiDialog::setDeviceDialogParameters()
       
   113 // ----------------------------------------------------------------------------
       
   114 //
       
   115 bool SifUiDialog::setDeviceDialogParameters(const QVariantMap &parameters)
       
   116 {
       
   117     setVisible(!isInstallIndicatorActive());
       
   118     return updateFromParameters(parameters);
       
   119 }
       
   120 
       
   121 // ----------------------------------------------------------------------------
       
   122 // SifUiDialog::deviceDialogError()
       
   123 // ----------------------------------------------------------------------------
       
   124 //
       
   125 int SifUiDialog::deviceDialogError() const
       
   126 {
       
   127     return mLastDialogError;
       
   128 }
       
   129 
       
   130 // ----------------------------------------------------------------------------
       
   131 // SifUiDialog::closeDeviceDialog()
       
   132 // ----------------------------------------------------------------------------
       
   133 //
       
   134 void SifUiDialog::closeDeviceDialog(bool byClient)
       
   135 {
       
   136     Q_UNUSED(byClient);
       
   137     close();
       
   138 
       
   139     // If show event has been received, close is signalled from hide event.
       
   140     // If not, hide event does not come and close is signalled from here.
       
   141     if (!mShowEventReceived) {
       
   142         emit deviceDialogClosed();
       
   143     }
       
   144 }
       
   145 
       
   146 // ----------------------------------------------------------------------------
       
   147 // SifUiDialog::deviceDialogWidget()
       
   148 // ----------------------------------------------------------------------------
       
   149 //
       
   150 HbDialog *SifUiDialog::deviceDialogWidget() const
       
   151 {
       
   152     return const_cast<SifUiDialog*>(this);
       
   153 }
       
   154 
       
   155 // ----------------------------------------------------------------------------
       
   156 // SifUiDialog::hideEvent()
       
   157 // ----------------------------------------------------------------------------
       
   158 //
       
   159 void SifUiDialog::hideEvent(QHideEvent *event)
       
   160 {
       
   161     HbDialog::hideEvent(event);
       
   162     emit deviceDialogClosed();
       
   163 }
       
   164 
       
   165 // ----------------------------------------------------------------------------
       
   166 // SifUiDialog::showEvent()
       
   167 // ----------------------------------------------------------------------------
       
   168 //
       
   169 void SifUiDialog::showEvent(QShowEvent *event)
       
   170 {
       
   171     HbDialog::showEvent(event);
       
   172     mShowEventReceived = true;
       
   173 }
       
   174 
       
   175 // ----------------------------------------------------------------------------
       
   176 // SifUiDialog::isInstallIndicatorActive()
       
   177 // ----------------------------------------------------------------------------
       
   178 //
       
   179 bool SifUiDialog::isInstallIndicatorActive()
       
   180 {
       
   181     bool isActive = false;
       
   182     if (!mSubscriber) {
       
   183         mSubscriber = new QTM_PREPEND_NAMESPACE(QValueSpaceSubscriber(
       
   184             KSifUiInstallIndicatorStatusPath));
       
   185     }
       
   186     QVariant variant = mSubscriber->value();
       
   187     bool valueOk = false;
       
   188     int intValue = variant.toInt(&valueOk);
       
   189     if (valueOk && intValue) {
       
   190         isActive = true;
       
   191     }
       
   192     return isActive;
       
   193 }
       
   194 
       
   195 // ----------------------------------------------------------------------------
       
   196 // SifUiDialog::constructDialog()
       
   197 // ----------------------------------------------------------------------------
       
   198 //
       
   199 bool SifUiDialog::constructDialog(const QVariantMap &parameters)
       
   200     {
       
   201     setTimeout(HbPopup::NoTimeout);
       
   202     setDismissPolicy(HbPopup::NoDismiss);
       
   203     setModal(true);
       
   204 
       
   205     mDialogType = dialogType(parameters);
       
   206 
       
   207     Q_ASSERT(mTitle == 0);
       
   208     mTitle = new SifUiDialogTitleWidget(this);
       
   209     mTitle->constructFromParameters(parameters);
       
   210     setHeadingWidget(mTitle);
       
   211 
       
   212     Q_ASSERT(mContent == 0);
       
   213     mContent = new SifUiDialogContentWidget(this);
       
   214     connect(mContent, SIGNAL(memorySelectionChanged(const QChar &)),
       
   215             this, SLOT(handleMemorySelectionChanged(const QChar &)));
       
   216     mContent->constructFromParameters(parameters);
       
   217     setContentWidget(mContent);
       
   218 
       
   219     updateButtons(parameters);
       
   220 
       
   221     return true;
       
   222 }
       
   223 
       
   224 // ----------------------------------------------------------------------------
       
   225 // SifUiDialog::updateFromParameters()
       
   226 // ----------------------------------------------------------------------------
       
   227 //
       
   228 bool SifUiDialog::updateFromParameters(const QVariantMap &parameters)
       
   229 {
       
   230     SifUiDeviceDialogType prevDialogType = mDialogType;
       
   231     if (!displayAdditionalQuery(parameters)) {
       
   232         mDialogType = dialogType(parameters);
       
   233         if (mTitle)
       
   234             {
       
   235             mTitle->updateFromParameters(parameters);
       
   236             }
       
   237         if (mContent)
       
   238             {
       
   239             mContent->updateFromParameters(parameters);
       
   240             }
       
   241         if (prevDialogType != mDialogType) {
       
   242             updateButtons(parameters);
       
   243         }
       
   244         prepareForErrorDetails(parameters);
       
   245     }
       
   246     return true;
       
   247 }
       
   248 
       
   249 // ----------------------------------------------------------------------------
       
   250 // SifUiDialog::updateButtons()
       
   251 // ----------------------------------------------------------------------------
       
   252 //
       
   253 void SifUiDialog::updateButtons(const QVariantMap &parameters)
       
   254 {
       
   255     if (mPrimaryAction) {
       
   256         removeAction(mPrimaryAction);
       
   257         delete mPrimaryAction;
       
   258         mPrimaryAction = 0;
       
   259     }
       
   260     switch (mDialogType) {
       
   261         case SifUiConfirmationQuery:
       
   262             //: Accepts the SW install confirmation query and starts installation.
       
   263             mPrimaryAction = new HbAction(hbTrId("txt_common_button_ok"));
       
   264             addAction(mPrimaryAction);
       
   265             disconnect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(close()));
       
   266             connect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(handleInstallAccepted()));
       
   267             break;
       
   268         case SifUiProgressNote:
       
   269             if (!parameters.contains(KSifUiProgressNoteIsHideButtonHidden)) {
       
   270                 //: Hides the progress dialog. Progress note moves into universal indicator.
       
   271                 mPrimaryAction = new HbAction(hbTrId("txt_common_button_hide"));
       
   272                 addAction(mPrimaryAction);
       
   273                 disconnect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(close()));
       
   274                 connect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(handleHidePressed()));
       
   275             }
       
   276             break;
       
   277         case SifUiCompleteNote:
       
   278             if (!parameters.contains(KSifUiCompleteNoteIsShowButtonHidden)) {
       
   279                 //: Opens Application Library to view the installed application.
       
   280                 mPrimaryAction = new HbAction(hbTrId("txt_installer_button_show"));
       
   281                 addAction(mPrimaryAction);
       
   282                 disconnect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(close()));
       
   283                 connect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(handleShowInstalled()));
       
   284             }
       
   285             break;
       
   286         case SifUiErrorNote:
       
   287             if (!parameters.contains(KSifUiErrorNoteIsDetailsButtonHidden)) {
       
   288                 //: Shows a dialog with further info about the failure (i.e. why installation failed).
       
   289                 mPrimaryAction = new HbAction(hbTrId("txt_installer_button_details"));
       
   290                 addAction(mPrimaryAction);
       
   291                 disconnect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(close()));
       
   292                 connect(mPrimaryAction, SIGNAL(triggered()), this, SLOT(handleErrorDetails()));
       
   293             }
       
   294             break;
       
   295         default:
       
   296             break;
       
   297     }
       
   298 
       
   299     if (mSecondaryAction) {
       
   300         removeAction(mSecondaryAction);
       
   301         delete mSecondaryAction;
       
   302         mSecondaryAction = 0;
       
   303     }
       
   304     switch (mDialogType) {
       
   305         case SifUiConfirmationQuery:
       
   306         case SifUiProgressNote:
       
   307             if (!parameters.contains(KSifUiProgressNoteIsCancelButtonHidden)) {
       
   308                 //: Cancels the SW install confirmation query and closes the dialog.
       
   309                 mSecondaryAction = new HbAction(hbTrId("txt_common_button_cancel"));
       
   310                 addAction(mSecondaryAction);
       
   311                 disconnect(mSecondaryAction, SIGNAL(triggered()), this, SLOT(close()));
       
   312                 connect(mSecondaryAction, SIGNAL(triggered()),
       
   313                     this, SLOT(handleInstallCancelled()));
       
   314             }
       
   315             break;
       
   316         case SifUiCompleteNote:
       
   317         case SifUiErrorNote:
       
   318             //: Closes the dialog. Control returns back to where the installation was started.
       
   319             mSecondaryAction = new HbAction(hbTrId("txt_common_button_close"));
       
   320             addAction(mSecondaryAction);
       
   321             break;
       
   322         default:
       
   323             break;
       
   324     }
       
   325 }
       
   326 
       
   327 // ----------------------------------------------------------------------------
       
   328 // SifUiDialog::prepareForErrorDetails()
       
   329 // ----------------------------------------------------------------------------
       
   330 //
       
   331 void SifUiDialog::prepareForErrorDetails(const QVariantMap &parameters)
       
   332 {
       
   333     if (parameters.contains(KSifUiErrorDetails)) {
       
   334         mErrorDetails = parameters.value(KSifUiErrorDetails).toString();
       
   335     }
       
   336     if (parameters.contains(KSifUiErrorCode)) {
       
   337         bool ok = false;
       
   338         int errorCode = parameters.value(KSifUiErrorCode).toInt(&ok);
       
   339         if (ok) {
       
   340             mErrorCode = errorCode;
       
   341         }
       
   342     }
       
   343     if (parameters.contains(KSifUiErrorCodeExtended)) {
       
   344         bool ok = false;
       
   345         int errorCode = parameters.value(KSifUiErrorCodeExtended).toInt(&ok);
       
   346         if (ok) {
       
   347             mExtendedErrorCode = errorCode;
       
   348         }
       
   349     }
       
   350 }
       
   351 
       
   352 // ----------------------------------------------------------------------------
       
   353 // SifUiDialog::displayAdditionalQuery()
       
   354 // ----------------------------------------------------------------------------
       
   355 //
       
   356 bool SifUiDialog::displayAdditionalQuery(const QVariantMap &parameters)
       
   357 {
       
   358     if (displayGrantCapabilitiesQuery(parameters) ||
       
   359         displaySelectLanguageQuery(parameters) ||
       
   360         displaySelectOptionsQuery(parameters)) {
       
   361         return true;
       
   362     }
       
   363     return false;
       
   364 }
       
   365 
       
   366 // ----------------------------------------------------------------------------
       
   367 // SifUiDialog::displayGrantCapabilitiesQuery()
       
   368 // ----------------------------------------------------------------------------
       
   369 //
       
   370 bool SifUiDialog::displayGrantCapabilitiesQuery(const QVariantMap &parameters)
       
   371 {
       
   372     if (parameters.contains(KSifUiGrantCapabilities)) {
       
   373         SifUiDialogGrantCapabilities *dlg = new SifUiDialogGrantCapabilities(
       
   374             mContent->applicationName(), parameters.value(KSifUiGrantCapabilities));
       
   375         dlg->setAttribute(Qt::WA_DeleteOnClose, true);
       
   376         connect(dlg, SIGNAL(accepted()), this, SLOT(handleCapabilitiesGranted()));
       
   377         connect(dlg, SIGNAL(rejected()), this, SLOT(handleAdditionalDialogClosed()));
       
   378         dlg->open();
       
   379         return true;
       
   380     }
       
   381     return false;
       
   382 }
       
   383 
       
   384 // ----------------------------------------------------------------------------
       
   385 // SifUiDialog::displaySelectLanguageQuery()
       
   386 // ----------------------------------------------------------------------------
       
   387 //
       
   388 bool SifUiDialog::displaySelectLanguageQuery(const QVariantMap &parameters)
       
   389 {
       
   390     if (parameters.contains(KSifUiSelectableLanguages)) {
       
   391         SifUiDialogSelectLanguage *dlg = new SifUiDialogSelectLanguage(
       
   392                 parameters.value(KSifUiSelectableLanguages));
       
   393         dlg->setAttribute(Qt::WA_DeleteOnClose, true);
       
   394         connect(dlg, SIGNAL(languageSelected(int)),
       
   395             this, SLOT(handleLanguageSelected(int)));
       
   396         connect(dlg, SIGNAL(languageSelectionCancelled()),
       
   397             this, SLOT(handleAdditionalDialogClosed()));
       
   398         dlg->open();
       
   399         return true;
       
   400     }
       
   401     return false;
       
   402 }
       
   403 
       
   404 // ----------------------------------------------------------------------------
       
   405 // SifUiDialog::displaySelectOptionsQuery()
       
   406 // ----------------------------------------------------------------------------
       
   407 //
       
   408 bool SifUiDialog::displaySelectOptionsQuery(const QVariantMap &parameters)
       
   409 {
       
   410     if (parameters.contains(KSifUiSelectableOptions)) {
       
   411         HbSelectionDialog *dlg = new HbSelectionDialog;
       
   412         dlg->setAttribute(Qt::WA_DeleteOnClose, true);
       
   413 
       
   414         // TODO: localized UI string needed
       
   415         HbLabel *title = new HbLabel("Items to install:");
       
   416         dlg->setHeadingWidget(title);
       
   417 
       
   418         dlg->setStringItems(parameters.value(KSifUiSelectableOptions).toStringList());
       
   419         dlg->setSelectionMode(HbAbstractItemView::MultiSelection);
       
   420 
       
   421         dlg->open(this, SLOT(handleOptionsDialogClosed(int)));
       
   422         return true;
       
   423     }
       
   424     return false;
       
   425 }
       
   426 
       
   427 // ----------------------------------------------------------------------------
       
   428 // SifUiDialog::sendResult()
       
   429 // ----------------------------------------------------------------------------
       
   430 //
       
   431 void SifUiDialog::sendResult(SifUiDeviceDialogReturnValue value)
       
   432 {
       
   433     mResultMap[KSifUiQueryReturnValue] = QVariant(value);
       
   434     emit deviceDialogData(mResultMap);
       
   435 }
       
   436 
       
   437 // ----------------------------------------------------------------------------
       
   438 // SifUiDialog::handleInstallAccepted()
       
   439 // ----------------------------------------------------------------------------
       
   440 //
       
   441 void SifUiDialog::handleInstallAccepted()
       
   442 {
       
   443     mContent->changeType(SifUiProgressNote);
       
   444     sendResult(SifUiContinue);
       
   445 }
       
   446 
       
   447 // ----------------------------------------------------------------------------
       
   448 // SifUiDialog::handleInstallCancelled()
       
   449 // ----------------------------------------------------------------------------
       
   450 //
       
   451 void SifUiDialog::handleInstallCancelled()
       
   452 {
       
   453     sendResult(SifUiCancel);
       
   454     close();
       
   455 }
       
   456 
       
   457 // ----------------------------------------------------------------------------
       
   458 // SifUiDialog::handleMemorySelectionChanged()
       
   459 // ----------------------------------------------------------------------------
       
   460 //
       
   461 void SifUiDialog::handleMemorySelectionChanged(const QChar &driveLetter)
       
   462 {
       
   463     mResultMap[KSifUiSelectedMemory] = QVariant(driveLetter);
       
   464     emit deviceDialogData(mResultMap);
       
   465 }
       
   466 
       
   467 // ----------------------------------------------------------------------------
       
   468 // SifUiDialog::handleHidePressed()
       
   469 // ----------------------------------------------------------------------------
       
   470 //
       
   471 void SifUiDialog::handleHidePressed()
       
   472 {
       
   473     sendResult(SifUiIndicator);
       
   474     hide();
       
   475 }
       
   476 
       
   477 // ----------------------------------------------------------------------------
       
   478 // SifUiDialog::handleShowInstalled()
       
   479 // ----------------------------------------------------------------------------
       
   480 //
       
   481 void SifUiDialog::handleShowInstalled()
       
   482 {
       
   483     QUrl openRecentView("appto://20022F35?activityname=AppLibRecentView");
       
   484 
       
   485     XQApplicationManager applicationManager;
       
   486     XQAiwRequest *request = applicationManager.create(openRecentView);
       
   487     if (request) {
       
   488         bool result = request->send();
       
   489         if (result) {
       
   490             closeDeviceDialog(false);
       
   491         } // else error silently ignored
       
   492         delete request;
       
   493     }
       
   494 
       
   495     close();
       
   496 }
       
   497 
       
   498 // ----------------------------------------------------------------------------
       
   499 // SifUiDialog::handleErrorDetails()
       
   500 // ----------------------------------------------------------------------------
       
   501 //
       
   502 void SifUiDialog::handleErrorDetails()
       
   503 {
       
   504     QString messageText = mErrorDetails;
       
   505 
       
   506     if (QFile::exists(KSwiErrorsFile)) {
       
   507         messageText.append(KSwiErrorFormat.arg(mErrorCode));
       
   508         if (mExtendedErrorCode) {
       
   509             messageText.append(KSwiErrorFormat.arg(mExtendedErrorCode));
       
   510         }
       
   511     }
       
   512 
       
   513     HbMessageBox::warning(messageText);
       
   514 }
       
   515 
       
   516 // ----------------------------------------------------------------------------
       
   517 // SifUiDialog::handleCapabilitiesGranted()
       
   518 // ----------------------------------------------------------------------------
       
   519 //
       
   520 void SifUiDialog::handleCapabilitiesGranted()
       
   521 {
       
   522     sendResult(SifUiContinue);
       
   523 }
       
   524 
       
   525 // ----------------------------------------------------------------------------
       
   526 // SifUiDialog::handleAdditionalDialogClosed()
       
   527 // ----------------------------------------------------------------------------
       
   528 //
       
   529 void SifUiDialog::handleAdditionalDialogClosed()
       
   530 {
       
   531     sendResult(SifUiCancel);
       
   532 }
       
   533 
       
   534 // ----------------------------------------------------------------------------
       
   535 // SifUiDialog::handleLanguageSelected()
       
   536 // ----------------------------------------------------------------------------
       
   537 //
       
   538 void SifUiDialog::handleLanguageSelected(int index)
       
   539 {
       
   540     mResultMap[KSifUiSelectedLanguageIndex] = QVariant(index);
       
   541     sendResult(SifUiContinue);
       
   542 }
       
   543 
       
   544 // ----------------------------------------------------------------------------
       
   545 // SifUiDialog::handleOptionsDialogClosed()
       
   546 // ----------------------------------------------------------------------------
       
   547 //
       
   548 void SifUiDialog::handleOptionsDialogClosed(int code)
       
   549 {
       
   550     if (code == HbDialog::Accepted) {
       
   551         HbSelectionDialog *dlg = reinterpret_cast<HbSelectionDialog*>(sender());
       
   552         QList<QVariant> selections = dlg->selectedItems();
       
   553         mResultMap[KSifUiSelectedOptions] = convertOptionalComponentIndexes(selections);
       
   554         sendResult(SifUiContinue);
       
   555     } else {
       
   556         sendResult(SifUiCancel);
       
   557     }
       
   558 }
       
   559