satui/satapp/src/satapppopupprovider.cpp
author hgs
Wed, 21 Jul 2010 18:26:52 +0300
changeset 33 8d5d7fcf9b59
child 35 6aefa3341fcc
permissions -rw-r--r--
201027
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description: 
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
// qt
hgs
parents:
diff changeset
    19
#include <QAction>
hgs
parents:
diff changeset
    20
#include <QTimer>
hgs
parents:
diff changeset
    21
#include <QtDebug>
hgs
parents:
diff changeset
    22
// hb
hgs
parents:
diff changeset
    23
#include <hbmessagebox.h>
hgs
parents:
diff changeset
    24
#include <hbprogressdialog.h>
hgs
parents:
diff changeset
    25
#include <hbdevicemessagebox.h>
hgs
parents:
diff changeset
    26
#include <hblabel.h>
hgs
parents:
diff changeset
    27
#include <hbaction.h>
hgs
parents:
diff changeset
    28
// satapp
hgs
parents:
diff changeset
    29
#include "satapppopupprovider.h"
hgs
parents:
diff changeset
    30
#include "satappconstant.h"
hgs
parents:
diff changeset
    31
#include "satappaction.h"
hgs
parents:
diff changeset
    32
hgs
parents:
diff changeset
    33
hgs
parents:
diff changeset
    34
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
    35
// SatAppPopupProvider::SatAppPopupProvider
hgs
parents:
diff changeset
    36
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
    37
//
hgs
parents:
diff changeset
    38
SatAppPopupProvider::SatAppPopupProvider( QObject *parent)
hgs
parents:
diff changeset
    39
    : QObject(parent), mDisplayText(0), mWaitDialog(0),
hgs
parents:
diff changeset
    40
      mWaitDeviceDialog(0), mAction(0)
hgs
parents:
diff changeset
    41
{
hgs
parents:
diff changeset
    42
    qDebug("SATAPP: SatAppPopupProvider::SatAppPopupProvider");
hgs
parents:
diff changeset
    43
}
hgs
parents:
diff changeset
    44
hgs
parents:
diff changeset
    45
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
    46
// SatAppPopupProvider::~SatAppPopupProvider
hgs
parents:
diff changeset
    47
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
    48
//
hgs
parents:
diff changeset
    49
SatAppPopupProvider::~SatAppPopupProvider()
hgs
parents:
diff changeset
    50
{
hgs
parents:
diff changeset
    51
    qDebug("SATAPP: SatAppPopupProvider::~SatAppPopupProvider >");
hgs
parents:
diff changeset
    52
    clearScreen();
hgs
parents:
diff changeset
    53
    qDebug("SATAPP: SatAppPopupProvider::~SatAppPopupProvider <");
hgs
parents:
diff changeset
    54
}
hgs
parents:
diff changeset
    55
hgs
parents:
diff changeset
    56
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
    57
// SatAppPopupProvider::displayText
hgs
parents:
diff changeset
    58
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
    59
//
hgs
parents:
diff changeset
    60
void SatAppPopupProvider::displayText(SatAppAction& action)
hgs
parents:
diff changeset
    61
{
hgs
parents:
diff changeset
    62
    qDebug("SATAPP: SatAppPopupProvider::displayText >");
hgs
parents:
diff changeset
    63
    mAction = &action;
hgs
parents:
diff changeset
    64
    delete mDisplayText;
hgs
parents:
diff changeset
    65
    mDisplayText = 0;
hgs
parents:
diff changeset
    66
    QString heading = action.value(KeyApplicationName).toString();
hgs
parents:
diff changeset
    67
    if (heading.isEmpty()) {
hgs
parents:
diff changeset
    68
        heading = hbTrId("txt_simatk_dialog_sim_services");
hgs
parents:
diff changeset
    69
    }
hgs
parents:
diff changeset
    70
    qDebug() << "SATAPP: displayText: heading=" << heading;
hgs
parents:
diff changeset
    71
hgs
parents:
diff changeset
    72
    // text
hgs
parents:
diff changeset
    73
    QString text = action.value(KeyText).toString();
hgs
parents:
diff changeset
    74
hgs
parents:
diff changeset
    75
    // some flags
hgs
parents:
diff changeset
    76
    bool sustainedText = action.value(KeySustainedText).toBool();
hgs
parents:
diff changeset
    77
    bool waitUserToClear = action.value(KeyWaitUserToClear).toBool();
hgs
parents:
diff changeset
    78
hgs
parents:
diff changeset
    79
    // duration
hgs
parents:
diff changeset
    80
    int duration = action.value(KeyDuration).toInt();
hgs
parents:
diff changeset
    81
    if (duration==0) {
hgs
parents:
diff changeset
    82
        duration = KDisplayTxtDefaultduration;
hgs
parents:
diff changeset
    83
        if (waitUserToClear) {
hgs
parents:
diff changeset
    84
            duration = KDisplayTxtUserClearTimeout;
hgs
parents:
diff changeset
    85
        }
hgs
parents:
diff changeset
    86
    }
hgs
parents:
diff changeset
    87
    if ( !(!sustainedText || 
hgs
parents:
diff changeset
    88
           action.value(KeyDuration).toInt() || 
hgs
parents:
diff changeset
    89
           !waitUserToClear) ) {
hgs
parents:
diff changeset
    90
        duration = 0;
hgs
parents:
diff changeset
    91
    }
hgs
parents:
diff changeset
    92
    qDebug("SATAPP: displayText: duration=%d",duration);
hgs
parents:
diff changeset
    93
hgs
parents:
diff changeset
    94
    // Show DisplayText dialog
hgs
parents:
diff changeset
    95
    mDisplayText = new HbMessageBox(HbMessageBox::MessageTypeInformation);
hgs
parents:
diff changeset
    96
hgs
parents:
diff changeset
    97
    // Set the label as heading widget
hgs
parents:
diff changeset
    98
    HbLabel *label = new HbLabel(heading, mDisplayText);
hgs
parents:
diff changeset
    99
    mDisplayText->setHeadingWidget(label);
hgs
parents:
diff changeset
   100
    mDisplayText->setText(text);
hgs
parents:
diff changeset
   101
    mDisplayText->setIconVisible(false);
hgs
parents:
diff changeset
   102
    mDisplayText->setStandardButtons(HbMessageBox::Ok | HbMessageBox::Cancel);
hgs
parents:
diff changeset
   103
    // ok pressed -> complete action with KSatSuccess
hgs
parents:
diff changeset
   104
    SAT_ASSERT(connect(mDisplayText->actions().at(0), SIGNAL(triggered()),
hgs
parents:
diff changeset
   105
        &action, SLOT(completeWithSuccess())));
hgs
parents:
diff changeset
   106
    // cancel pressed -> complete action with ESatBackwardModeRequestedByUser
hgs
parents:
diff changeset
   107
    SAT_ASSERT(connect(mDisplayText->actions().at(1), SIGNAL(triggered()),
hgs
parents:
diff changeset
   108
        &action, SLOT(completeWithBackRequested())));
hgs
parents:
diff changeset
   109
    SAT_ASSERT(connect(mAction, SIGNAL(actionCompleted(SatAppAction *)),
hgs
parents:
diff changeset
   110
        this, SLOT(resetState())));
hgs
parents:
diff changeset
   111
    if (duration) {
hgs
parents:
diff changeset
   112
        if (waitUserToClear && !sustainedText) {
hgs
parents:
diff changeset
   113
           // in timeout, complete action with ESatNoResponseFromUser
hgs
parents:
diff changeset
   114
            QTimer::singleShot(duration,
hgs
parents:
diff changeset
   115
                &action, SLOT(completeWithNoResponse()));
hgs
parents:
diff changeset
   116
        } else {
hgs
parents:
diff changeset
   117
            QTimer::singleShot(duration,
hgs
parents:
diff changeset
   118
                &action, SLOT(completeWithSuccess()));
hgs
parents:
diff changeset
   119
        }
hgs
parents:
diff changeset
   120
        mDisplayText->setTimeout(duration); 
hgs
parents:
diff changeset
   121
    }
hgs
parents:
diff changeset
   122
hgs
parents:
diff changeset
   123
    // open the popup.
hgs
parents:
diff changeset
   124
    mDisplayText->open();
hgs
parents:
diff changeset
   125
    
hgs
parents:
diff changeset
   126
    qDebug("SATAPP: SatAppPopupProvider::displayText <");
hgs
parents:
diff changeset
   127
}
hgs
parents:
diff changeset
   128
hgs
parents:
diff changeset
   129
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   130
// SatAppPopupProvider::notification
hgs
parents:
diff changeset
   131
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   132
//
hgs
parents:
diff changeset
   133
void SatAppPopupProvider::notification(SatAppAction& action)
hgs
parents:
diff changeset
   134
{
hgs
parents:
diff changeset
   135
    qDebug("SATAPP: SatAppPopupProvider::notification >");
hgs
parents:
diff changeset
   136
    // some flags
hgs
parents:
diff changeset
   137
    int commandId = action.value(KeyCommandId).toInt();
hgs
parents:
diff changeset
   138
    int alphaIdStatus = action.value(KeyAlphaIdStatus).toInt();
hgs
parents:
diff changeset
   139
    // reset mAction
hgs
parents:
diff changeset
   140
    mAction = 0;
hgs
parents:
diff changeset
   141
    qDebug("SATAPP: notification id=%d alphaSt=%d",
hgs
parents:
diff changeset
   142
        commandId, alphaIdStatus);
hgs
parents:
diff changeset
   143
hgs
parents:
diff changeset
   144
    switch (commandId)
hgs
parents:
diff changeset
   145
    {
hgs
parents:
diff changeset
   146
        case ESatSSendDataNotify:
hgs
parents:
diff changeset
   147
        case ESatSReceiveDataNotify:
hgs
parents:
diff changeset
   148
        {
hgs
parents:
diff changeset
   149
            qDebug("SATAPP: Notifying BIP Send/Receive");
hgs
parents:
diff changeset
   150
            // need to complete action with success when use don't prees cancel
hgs
parents:
diff changeset
   151
            mAction = &action;
hgs
parents:
diff changeset
   152
            showBIPWaitNote(action);
hgs
parents:
diff changeset
   153
            break;
hgs
parents:
diff changeset
   154
        }
hgs
parents:
diff changeset
   155
        case ESatSCloseChannelNotify:
hgs
parents:
diff changeset
   156
        {
hgs
parents:
diff changeset
   157
            qDebug("SATAPP: Notifying BIP CloseChannel");
hgs
parents:
diff changeset
   158
            showCloseChannelWaitNote(action);
hgs
parents:
diff changeset
   159
            break;
hgs
parents:
diff changeset
   160
        }
hgs
parents:
diff changeset
   161
        case ESatSMoSmControlNotify:
hgs
parents:
diff changeset
   162
        {
hgs
parents:
diff changeset
   163
            qDebug("SATAPP: Notifying MoSmControl");
hgs
parents:
diff changeset
   164
            if (ESatAlphaIdNotNull == alphaIdStatus) {
hgs
parents:
diff changeset
   165
                showMoSmControlNote(action);
hgs
parents:
diff changeset
   166
            } else {
hgs
parents:
diff changeset
   167
                showSatInfoNote(action);
hgs
parents:
diff changeset
   168
            }
hgs
parents:
diff changeset
   169
            break;
hgs
parents:
diff changeset
   170
        }
hgs
parents:
diff changeset
   171
        case ESatSCallControlNotify:
hgs
parents:
diff changeset
   172
        {
hgs
parents:
diff changeset
   173
            qDebug("SATAPP: Notifying CallControl");
hgs
parents:
diff changeset
   174
            showCallControlNote(action);
hgs
parents:
diff changeset
   175
            break;
hgs
parents:
diff changeset
   176
        }
hgs
parents:
diff changeset
   177
        case ESatSSendUssdNotify:   // fall through
hgs
parents:
diff changeset
   178
        case ESatSSendSsNotify:
hgs
parents:
diff changeset
   179
        {
hgs
parents:
diff changeset
   180
            qDebug("SATAPP: Notifying SendSs / SendUssd");
hgs
parents:
diff changeset
   181
            showSsWaitNote(action);
hgs
parents:
diff changeset
   182
            break;
hgs
parents:
diff changeset
   183
        }
hgs
parents:
diff changeset
   184
        case ESatSSendDtmfNotify:
hgs
parents:
diff changeset
   185
        {
hgs
parents:
diff changeset
   186
            qDebug("SATAPP: Notifying SendDtmf");
hgs
parents:
diff changeset
   187
            // need to complete action with success when use don't prees cancel
hgs
parents:
diff changeset
   188
            mAction = &action;
hgs
parents:
diff changeset
   189
            showDtmfWaitNote(action);
hgs
parents:
diff changeset
   190
            break;
hgs
parents:
diff changeset
   191
        }
hgs
parents:
diff changeset
   192
        case ESatSSendSmsNotify:
hgs
parents:
diff changeset
   193
        {
hgs
parents:
diff changeset
   194
            qDebug("SATAPP: Notifying SendSms");
hgs
parents:
diff changeset
   195
            showSmsWaitNote(action);
hgs
parents:
diff changeset
   196
            break;
hgs
parents:
diff changeset
   197
        }
hgs
parents:
diff changeset
   198
        default:
hgs
parents:
diff changeset
   199
        {
hgs
parents:
diff changeset
   200
            qDebug("SATAPP: Unkown notification");
hgs
parents:
diff changeset
   201
            action.completeWithFailure();
hgs
parents:
diff changeset
   202
            break;
hgs
parents:
diff changeset
   203
        }
hgs
parents:
diff changeset
   204
    }
hgs
parents:
diff changeset
   205
    qDebug("SATAPP: SatAppPopupProvider::notification <");
hgs
parents:
diff changeset
   206
}
hgs
parents:
diff changeset
   207
hgs
parents:
diff changeset
   208
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   209
// SatAppPopupProvider::stopShowWaitNote
hgs
parents:
diff changeset
   210
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   211
//
hgs
parents:
diff changeset
   212
void SatAppPopupProvider::stopShowWaitNote()
hgs
parents:
diff changeset
   213
{
hgs
parents:
diff changeset
   214
    qDebug("SATAPP:SatAppPopupProvider::stopShowWaitNote: >mWaitDialog = %x", 
hgs
parents:
diff changeset
   215
        mWaitDialog );
hgs
parents:
diff changeset
   216
    if (mWaitDialog) {
hgs
parents:
diff changeset
   217
        mWaitDialog->close();
hgs
parents:
diff changeset
   218
        delete mWaitDialog;
hgs
parents:
diff changeset
   219
        mWaitDialog = NULL;
hgs
parents:
diff changeset
   220
        if (mAction) {
hgs
parents:
diff changeset
   221
            qDebug("SATAPP: stopShowWaitNote: mAction");
hgs
parents:
diff changeset
   222
            int commandId = mAction->value(KeyCommandId).toInt();
hgs
parents:
diff changeset
   223
            if (ESatSSendDataNotify == commandId 
hgs
parents:
diff changeset
   224
                || ESatSReceiveDataNotify == commandId 
hgs
parents:
diff changeset
   225
                || ESatSSendDtmfNotify == commandId) {
hgs
parents:
diff changeset
   226
                 mAction->completeWithSuccess();
hgs
parents:
diff changeset
   227
            }
hgs
parents:
diff changeset
   228
        }
hgs
parents:
diff changeset
   229
    }
hgs
parents:
diff changeset
   230
hgs
parents:
diff changeset
   231
    qDebug("SATAPP: stopShowWaitNote: mWaitDeviceDialog=%x",
hgs
parents:
diff changeset
   232
        mWaitDeviceDialog);
hgs
parents:
diff changeset
   233
    if (mWaitDeviceDialog) {
hgs
parents:
diff changeset
   234
        mWaitDeviceDialog->close();
hgs
parents:
diff changeset
   235
        delete mWaitDeviceDialog;
hgs
parents:
diff changeset
   236
        mWaitDeviceDialog = NULL;            
hgs
parents:
diff changeset
   237
    }
hgs
parents:
diff changeset
   238
hgs
parents:
diff changeset
   239
    qDebug("SATAPP:SatAppPopupProvider::stopShowWaitNote: <mWaitDialog = %x", 
hgs
parents:
diff changeset
   240
        mWaitDialog );
hgs
parents:
diff changeset
   241
}
hgs
parents:
diff changeset
   242
hgs
parents:
diff changeset
   243
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   244
// SatAppPopupProvider::defaultAlphaId
hgs
parents:
diff changeset
   245
// provides a default text in case it is empty
hgs
parents:
diff changeset
   246
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   247
//
hgs
parents:
diff changeset
   248
QString SatAppPopupProvider::alphaId(SatAppAction& action)
hgs
parents:
diff changeset
   249
{
hgs
parents:
diff changeset
   250
    QString alpha = action.value(KeyText).toString();
hgs
parents:
diff changeset
   251
    qDebug() << "SATAPP: SatAppPopupProvider::alphaId" << alpha;
hgs
parents:
diff changeset
   252
hgs
parents:
diff changeset
   253
    int commandId = action.value(KeyCommandId).toInt();
hgs
parents:
diff changeset
   254
    int controlResult = action.value(KeyControlResult).toInt();
hgs
parents:
diff changeset
   255
hgs
parents:
diff changeset
   256
    if (!alpha.isEmpty()) {
hgs
parents:
diff changeset
   257
        return alpha;
hgs
parents:
diff changeset
   258
    }
hgs
parents:
diff changeset
   259
    switch (commandId)
hgs
parents:
diff changeset
   260
    {
hgs
parents:
diff changeset
   261
    case ESatSSendDataNotify: // SendData
hgs
parents:
diff changeset
   262
        {
hgs
parents:
diff changeset
   263
        alpha = hbTrId("txt_simatk_dialog_sendingdata");
hgs
parents:
diff changeset
   264
        break;
hgs
parents:
diff changeset
   265
        }
hgs
parents:
diff changeset
   266
    case ESatSReceiveDataNotify: // ReceiveData
hgs
parents:
diff changeset
   267
        {
hgs
parents:
diff changeset
   268
        alpha = hbTrId("txt_simatk_dialog_receivingdata");
hgs
parents:
diff changeset
   269
        break;
hgs
parents:
diff changeset
   270
        }
hgs
parents:
diff changeset
   271
    case ESatSCloseChannelNotify: // CloseChannel
hgs
parents:
diff changeset
   272
        {
hgs
parents:
diff changeset
   273
        alpha = hbTrId("txt_simatk_dialog_connectionclosed");
hgs
parents:
diff changeset
   274
        break;
hgs
parents:
diff changeset
   275
        }
hgs
parents:
diff changeset
   276
    case ESatSMoSmControlNotify: // MoSmControl
hgs
parents:
diff changeset
   277
        {
hgs
parents:
diff changeset
   278
        if (ESatNotAllowed == controlResult) {
hgs
parents:
diff changeset
   279
        alpha = hbTrId("txt_simatk_dpopinfo_request_not_allowed");
hgs
parents:
diff changeset
   280
        } else if (ESatAllowedWithModifications == controlResult) {
hgs
parents:
diff changeset
   281
            alpha = hbTrId("txt_simatk_dpopinfo_request_modified");
hgs
parents:
diff changeset
   282
        } else {
hgs
parents:
diff changeset
   283
            alpha =  hbTrId(""); // Allowed, default alpha -> no info
hgs
parents:
diff changeset
   284
        }
hgs
parents:
diff changeset
   285
        break;
hgs
parents:
diff changeset
   286
        }
hgs
parents:
diff changeset
   287
    case ESatSCallControlNotify: // CallControl
hgs
parents:
diff changeset
   288
       {
hgs
parents:
diff changeset
   289
        if (ESatNotAllowed == controlResult) {
hgs
parents:
diff changeset
   290
            alpha= hbTrId("txt_simatk_dpopinfo_request_not_allowed");
hgs
parents:
diff changeset
   291
        } else if (ESatAllowedWithModifications == controlResult) {
hgs
parents:
diff changeset
   292
            alpha = hbTrId("txt_simatk_dpopinfo_request_modified");
hgs
parents:
diff changeset
   293
        } else {
hgs
parents:
diff changeset
   294
            alpha = hbTrId(""); // Allowed, default alpha -> no info
hgs
parents:
diff changeset
   295
        }
hgs
parents:
diff changeset
   296
        break;
hgs
parents:
diff changeset
   297
        }
hgs
parents:
diff changeset
   298
    case ESatSSendSmsNotify: // fall through
hgs
parents:
diff changeset
   299
    case ESatSSendDtmfNotify: // fall through
hgs
parents:
diff changeset
   300
    case ESatSSendUssdNotify: // fall through
hgs
parents:
diff changeset
   301
    case ESatSSendSsNotify: // fall through
hgs
parents:
diff changeset
   302
        {
hgs
parents:
diff changeset
   303
        // alpha id is empty, set a default string
hgs
parents:
diff changeset
   304
        alpha = hbTrId("txt_common_info_processing");
hgs
parents:
diff changeset
   305
        break;
hgs
parents:
diff changeset
   306
        }
hgs
parents:
diff changeset
   307
    default:
hgs
parents:
diff changeset
   308
        break;
hgs
parents:
diff changeset
   309
    }
hgs
parents:
diff changeset
   310
    qDebug("SATAPP:SatAppPopupProvider::alphaId <");
hgs
parents:
diff changeset
   311
    return alpha;
hgs
parents:
diff changeset
   312
}
hgs
parents:
diff changeset
   313
hgs
parents:
diff changeset
   314
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   315
// SatAppPopupProvider::showBIPWaitNote
hgs
parents:
diff changeset
   316
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   317
//
hgs
parents:
diff changeset
   318
void SatAppPopupProvider::showBIPWaitNote(SatAppAction& action)
hgs
parents:
diff changeset
   319
{
hgs
parents:
diff changeset
   320
    qDebug("SATAPP: SatAppPopupProvider::showBIPWaitNote >");
hgs
parents:
diff changeset
   321
hgs
parents:
diff changeset
   322
    QString text = alphaId(action);
hgs
parents:
diff changeset
   323
    // this is a new SEND DATA action
hgs
parents:
diff changeset
   324
    delete mWaitDialog;
hgs
parents:
diff changeset
   325
    mWaitDialog = 0;
hgs
parents:
diff changeset
   326
    HbProgressDialog *pd = new HbProgressDialog(HbProgressDialog::WaitDialog);
hgs
parents:
diff changeset
   327
    pd->setText(text);
hgs
parents:
diff changeset
   328
    // cancel -> complete with ESatBackwardModeRequestedByUser
hgs
parents:
diff changeset
   329
    SAT_ASSERT(connect(pd->actions().at(0),SIGNAL(triggered()),
hgs
parents:
diff changeset
   330
        &action,SLOT(completeWithBackRequested())));
hgs
parents:
diff changeset
   331
hgs
parents:
diff changeset
   332
    // open dialog
hgs
parents:
diff changeset
   333
    pd->open();
hgs
parents:
diff changeset
   334
    mWaitDialog = pd;
hgs
parents:
diff changeset
   335
hgs
parents:
diff changeset
   336
    qDebug("SATAPP: SatAppPopupProvider::showBIPWaitNote <");
hgs
parents:
diff changeset
   337
}
hgs
parents:
diff changeset
   338
hgs
parents:
diff changeset
   339
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   340
// SatAppPopupProvider::showCloseChannelWaitNote
hgs
parents:
diff changeset
   341
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   342
//
hgs
parents:
diff changeset
   343
void SatAppPopupProvider::showCloseChannelWaitNote(SatAppAction& action)
hgs
parents:
diff changeset
   344
{
hgs
parents:
diff changeset
   345
    qDebug("SATAPP: SatAppPopupProvider::showCloseChannelWaitNote >");
hgs
parents:
diff changeset
   346
    HbProgressDialog *pd = new HbProgressDialog(HbProgressDialog::WaitDialog);
hgs
parents:
diff changeset
   347
    pd->clearActions();
hgs
parents:
diff changeset
   348
    pd->setText(alphaId(action));
hgs
parents:
diff changeset
   349
    pd->open();
hgs
parents:
diff changeset
   350
    mWaitDialog = pd;
hgs
parents:
diff changeset
   351
    qDebug("SATAPP: SatAppPopupProvider::showCloseChannelWaitNote <");
hgs
parents:
diff changeset
   352
}
hgs
parents:
diff changeset
   353
hgs
parents:
diff changeset
   354
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   355
// SatAppPopupProvider::showMoSmControlNote
hgs
parents:
diff changeset
   356
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   357
//
hgs
parents:
diff changeset
   358
void SatAppPopupProvider::showMoSmControlNote(SatAppAction& action)
hgs
parents:
diff changeset
   359
{
hgs
parents:
diff changeset
   360
    qDebug("SATAPP: SatAppPopupProvider::showMoSmControlNote >");
hgs
parents:
diff changeset
   361
    HbMessageBox *mb = new HbMessageBox(HbMessageBox::MessageTypeInformation);
hgs
parents:
diff changeset
   362
    mb->clearActions();
hgs
parents:
diff changeset
   363
    mb->setText(alphaId(action));
hgs
parents:
diff changeset
   364
    mb->open();
hgs
parents:
diff changeset
   365
    mWaitDialog = mb;
hgs
parents:
diff changeset
   366
    qDebug("SATAPP: SatAppPopupProvider::showMoSmControlNote <");
hgs
parents:
diff changeset
   367
}
hgs
parents:
diff changeset
   368
hgs
parents:
diff changeset
   369
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   370
// SatAppPopupProvider::showSatInfoNote
hgs
parents:
diff changeset
   371
//
hgs
parents:
diff changeset
   372
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   373
//
hgs
parents:
diff changeset
   374
void SatAppPopupProvider::showSatInfoNote(SatAppAction& action)
hgs
parents:
diff changeset
   375
{
hgs
parents:
diff changeset
   376
    qDebug("SATAPP: SatAppPopupProvider::showSatInfoNote >");
hgs
parents:
diff changeset
   377
    HbMessageBox *mb = new HbMessageBox(HbMessageBox::MessageTypeInformation);
hgs
parents:
diff changeset
   378
    mb->setText(alphaId(action));
hgs
parents:
diff changeset
   379
    mb->open();
hgs
parents:
diff changeset
   380
    mWaitDialog = mb;
hgs
parents:
diff changeset
   381
    qDebug("SATAPP: SatAppPopupProvider::showSatInfoNote <");
hgs
parents:
diff changeset
   382
}
hgs
parents:
diff changeset
   383
hgs
parents:
diff changeset
   384
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   385
// SatAppPopupProvider::showCallControlNote
hgs
parents:
diff changeset
   386
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   387
//
hgs
parents:
diff changeset
   388
void SatAppPopupProvider::showCallControlNote(SatAppAction& action)
hgs
parents:
diff changeset
   389
{
hgs
parents:
diff changeset
   390
    qDebug("SATAPP: SatAppPopupProvider::showCallControlNote >");
hgs
parents:
diff changeset
   391
    HbDeviceMessageBox *dmb = new HbDeviceMessageBox(HbMessageBox::MessageTypeInformation);
hgs
parents:
diff changeset
   392
    // No cancel key
hgs
parents:
diff changeset
   393
    dmb->setText(alphaId(action));
hgs
parents:
diff changeset
   394
    dmb->show();
hgs
parents:
diff changeset
   395
    mWaitDeviceDialog = dmb;
hgs
parents:
diff changeset
   396
hgs
parents:
diff changeset
   397
    qDebug("SATAPP: SatAppPopupProvider::showCallControlNote <");
hgs
parents:
diff changeset
   398
}
hgs
parents:
diff changeset
   399
hgs
parents:
diff changeset
   400
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   401
// SatAppPopupProvider::showSsWaitNote
hgs
parents:
diff changeset
   402
// Displays a wait note to indicate SS sending.
hgs
parents:
diff changeset
   403
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   404
//
hgs
parents:
diff changeset
   405
void SatAppPopupProvider::showSsWaitNote(SatAppAction& action)
hgs
parents:
diff changeset
   406
{
hgs
parents:
diff changeset
   407
    qDebug("SATAPP: SatAppPopupProvider::showSsWaitNote >");
hgs
parents:
diff changeset
   408
    HbProgressDialog *pd = new HbProgressDialog(HbProgressDialog::WaitDialog);
hgs
parents:
diff changeset
   409
    pd->clearActions();
hgs
parents:
diff changeset
   410
    pd->setText(alphaId(action));
hgs
parents:
diff changeset
   411
    pd->show();
hgs
parents:
diff changeset
   412
    mWaitDialog = pd;
hgs
parents:
diff changeset
   413
    qDebug("SATAPP: SatAppPopupProvider::showSsWaitNote <");
hgs
parents:
diff changeset
   414
}
hgs
parents:
diff changeset
   415
hgs
parents:
diff changeset
   416
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   417
// SatAppPopupProvider::showDtmfWaitNote
hgs
parents:
diff changeset
   418
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   419
//
hgs
parents:
diff changeset
   420
void SatAppPopupProvider::showDtmfWaitNote(SatAppAction& action)
hgs
parents:
diff changeset
   421
{
hgs
parents:
diff changeset
   422
    qDebug("SATAPP: SatAppPopupProvider::showDtmfWaitNote >");
hgs
parents:
diff changeset
   423
    HbProgressDialog *pd = new HbProgressDialog(HbProgressDialog::WaitDialog);
hgs
parents:
diff changeset
   424
    // cancel -> complete action with ESatBackwardModeRequestedByUser
hgs
parents:
diff changeset
   425
    SAT_ASSERT(connect(pd->actions().at(0), SIGNAL(triggered()),
hgs
parents:
diff changeset
   426
        &action, SLOT(completeWithBackRequested())));
hgs
parents:
diff changeset
   427
    pd->setText(alphaId(action));
hgs
parents:
diff changeset
   428
    pd->open();
hgs
parents:
diff changeset
   429
    mWaitDialog = pd;
hgs
parents:
diff changeset
   430
    qDebug("SATAPP: SatAppPopupProvider::showDtmfWaitNote <");
hgs
parents:
diff changeset
   431
 }
hgs
parents:
diff changeset
   432
hgs
parents:
diff changeset
   433
hgs
parents:
diff changeset
   434
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   435
// SatAppPopupProvider::showDtmfWaitNote
hgs
parents:
diff changeset
   436
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   437
//
hgs
parents:
diff changeset
   438
void SatAppPopupProvider::showSmsWaitNote(SatAppAction& action)
hgs
parents:
diff changeset
   439
{
hgs
parents:
diff changeset
   440
    qDebug("SATAPP: SatAppPopupProvider::showSmsWaitNote >");
hgs
parents:
diff changeset
   441
    HbProgressDialog *pd = new HbProgressDialog(HbProgressDialog::WaitDialog);
hgs
parents:
diff changeset
   442
    //remove the default cancel softkey
hgs
parents:
diff changeset
   443
    pd->clearActions();
hgs
parents:
diff changeset
   444
    pd->setText(alphaId(action));
hgs
parents:
diff changeset
   445
    pd->open();
hgs
parents:
diff changeset
   446
    mWaitDialog = pd;
hgs
parents:
diff changeset
   447
    qDebug("SATAPP: SatAppPopupProvider::showSmsWaitNote <");
hgs
parents:
diff changeset
   448
 }
hgs
parents:
diff changeset
   449
hgs
parents:
diff changeset
   450
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   451
// SatAppPopupProvider::stopShowWaitNote
hgs
parents:
diff changeset
   452
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   453
//
hgs
parents:
diff changeset
   454
void SatAppPopupProvider::showSsErrorNote()
hgs
parents:
diff changeset
   455
{
hgs
parents:
diff changeset
   456
    qDebug("SATAPP: SatAppPopupProvider::showSsErrorNote >");
hgs
parents:
diff changeset
   457
    HbMessageBox *mb = new HbMessageBox(HbMessageBox::MessageTypeWarning);
hgs
parents:
diff changeset
   458
    mb->setText(hbTrId("txt_sat_sendss_error_note"));
hgs
parents:
diff changeset
   459
    mb->open();
hgs
parents:
diff changeset
   460
    mWaitDialog = mb;
hgs
parents:
diff changeset
   461
    qDebug("SATAPP: SatAppPopupProvider::showSsErrorNote <");
hgs
parents:
diff changeset
   462
}
hgs
parents:
diff changeset
   463
hgs
parents:
diff changeset
   464
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   465
// SatAppPopupProvider::clearScreen
hgs
parents:
diff changeset
   466
// terminates all ongoing UI actions
hgs
parents:
diff changeset
   467
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   468
//
hgs
parents:
diff changeset
   469
void SatAppPopupProvider::clearScreen()
hgs
parents:
diff changeset
   470
{
hgs
parents:
diff changeset
   471
    qDebug( "SATAPP: SatAppPopupProvider::clearScreen >" );
hgs
parents:
diff changeset
   472
    stopShowWaitNote();
hgs
parents:
diff changeset
   473
    if (mDisplayText){
hgs
parents:
diff changeset
   474
        qDebug( "SatAppPopupProvider::clearScreen DisplayText" );
hgs
parents:
diff changeset
   475
        delete mDisplayText;
hgs
parents:
diff changeset
   476
        mDisplayText = 0;
hgs
parents:
diff changeset
   477
        if (mAction) {
hgs
parents:
diff changeset
   478
            qDebug( "SatAppPopupProvider::clearScreen mAction" );
hgs
parents:
diff changeset
   479
            SAT_ASSERT(disconnect(mAction, SIGNAL(actionCompleted(SatAppAction *)),
hgs
parents:
diff changeset
   480
                this, SLOT(resetState())));
hgs
parents:
diff changeset
   481
            mAction->completeWithNoResponse();
hgs
parents:
diff changeset
   482
            mAction = 0;
hgs
parents:
diff changeset
   483
        }
hgs
parents:
diff changeset
   484
        qDebug( "SatAppPopupProvider::clearScreen DisplayText <" );
hgs
parents:
diff changeset
   485
    }
hgs
parents:
diff changeset
   486
    qDebug( "SATAPP: SatAppToneProvider::clearScreen <" );
hgs
parents:
diff changeset
   487
}
hgs
parents:
diff changeset
   488
hgs
parents:
diff changeset
   489
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   490
// SatAppPopupProvider::resetState
hgs
parents:
diff changeset
   491
// reset
hgs
parents:
diff changeset
   492
// ----------------------------------------------------------------------------
hgs
parents:
diff changeset
   493
//
hgs
parents:
diff changeset
   494
void SatAppPopupProvider::resetState()
hgs
parents:
diff changeset
   495
{
hgs
parents:
diff changeset
   496
    qDebug( "SATAPP: SatAppPopupProvider::resetState >" );
hgs
parents:
diff changeset
   497
    mAction = 0;
hgs
parents:
diff changeset
   498
    qDebug( "SATAPP: SatAppPopupProvider::resetState <" );
hgs
parents:
diff changeset
   499
}
hgs
parents:
diff changeset
   500
hgs
parents:
diff changeset
   501
//End of file