securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationdialog.cpp
author hgs
Fri, 06 Aug 2010 10:55:57 +0300
changeset 42 82671cd8994b
parent 35 f1030a78d563
child 66 67b3e3c1fc87
permissions -rw-r--r--
201031
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description: SecUi notification plugin class.
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    18
#include "secuinotificationdebug.h"
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#include "secuinotificationdialog.h"
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include "secuinotificationdialogpluginkeys.h"
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include "secuinotificationcontentwidget.h"
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
// #include <hbpopupbase.h>        // HbPopupBase::NoTimeout
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include <hblabel.h>
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include <hbaction.h>
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include <QDebug>
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    26
#include <e32debug.h>
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
    27
#include <hbtranslator.h>
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
    28
#include <cphcltemergencycall.h>
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    29
#include <SCPServerInterface.h>	// for TARM error codes while validating new lock code
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    30
#include <QString>
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    31
#include <QDialogButtonBox>
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    32
#include <HbEditorInterface>
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
    33
#include <e32property.h>
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
    34
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
    35
QTM_USE_NAMESPACE
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
    36
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
    37
const QString KTranslationsPath = "/resource/qt/translations/";
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
    38
const QString KSecUiNotificationTranslationsFile = "secui";
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
    39
const QString KCommonTranslationsFile = "common";
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
    40
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
    41
#include <qvaluespacesubscriber.h>
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
    42
#include <qvaluespacepublisher.h>
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    43
#define ESecUiBasicTypeText    0x0000000
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    44
#define ESecUiBasicTypeCheck   0x0010000
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    45
#define ESecUiBasicTypeCheckMulti   0x0020000
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    46
#define ESecUiBasicTypeMask    0x00F0000
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
#define ESecUiCancelSupported  0x1000000
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
#define ESecUiCancelNotSupported  0x0000000
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
#define ESecUiEmergencySupported  0x2000000
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
#define ESecUiEmergencyNotSupported  0x0000000
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    54
#define ESecUiAlphaSupported  0x4000000
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    55
#define ESecUiAlphaNotSupported  0x0000000
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    56
19
098e361762d2 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
    57
#define ESecUiSecretSupported  0x8000000
098e361762d2 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
    58
#define ESecUiSecretNotSupported  0x0000000
098e361762d2 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
    59
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    60
#define ESecUiMaskFlags  0xFF000000
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    61
#define ESecUiMaskType   0x00FFFFFF
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    62
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    63
#define ESecUiTypeDeviceLock		0x00100000
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    64
#define ESecUiTypeKeyguard			0x00200000
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    65
#define ESecUiTypeClock  				0x00300000
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    66
#define ESecUiTypeScreensaver		0x00400000
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    67
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    68
#define ESecUiTypeMaskLock			0x00F00000
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    69
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
    70
const TUid KPSUidSecurityUIs = { 0x100059b5 };
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
    71
const TUint32 KSecurityUIsDismissDialog  = 0x00000309;
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
    72
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    73
enum TSecurityUIsDismissDialogValues
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    74
    {
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    75
    ESecurityUIsDismissDialogUninitialized = 0,
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    76
    ESecurityUIsDismissDialogOn,
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    77
    ESecurityUIsDismissDialogProcessing,
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    78
    ESecurityUIsDismissDialogDone,
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    79
    ESecurityUIsDismissDialogLastValue
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    80
    };
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    81
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
// SecUiNotificationDialog::SecUiNotificationDialog()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
SecUiNotificationDialog::SecUiNotificationDialog(
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
    87
        const QVariantMap &parameters) : HbDialog(), mCommonTranslator(0), mSecUiNotificationTranslator(0), mLastError(KNoError)
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    89
		RDEBUG("0", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    90
		TTime myTime;
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    91
    myTime.HomeTime();
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
    92
		mMyId = I64LOW( myTime.Int64() );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
    93
    mCommonTranslator = new HbTranslator(KTranslationsPath, KCommonTranslationsFile);
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
    94
    mSecUiNotificationTranslator = new HbTranslator(KTranslationsPath, KSecUiNotificationTranslationsFile);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
    constructDialog(parameters);
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    96
}
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    97
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
// SecUiNotificationDialog::~SecUiNotificationDialog()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   100
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
SecUiNotificationDialog::~SecUiNotificationDialog()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
{
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   104
		RDEBUG("0", 0);
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   105
    delete mSecUiNotificationTranslator;
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   106
    delete mCommonTranslator;
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   107
		RDEBUG("0", 0);
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   108
    // TODO what about subscriberKSecurityUIsDismissDialog
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   109
    // and codeTop
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   110
		RDEBUG("1", 1);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
}
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   113
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   114
// SecUiNotificationDialog::setDeviceDialogParameters()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   115
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   116
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
bool SecUiNotificationDialog::setDeviceDialogParameters(const QVariantMap &parameters)
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   119
	 RDEBUG("0", 0);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
   return constructDialog(parameters);
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
}
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   123
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
// SecUiNotificationDialog::deviceDialogError()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   127
int SecUiNotificationDialog::deviceDialogError() const
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   128
{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   129
		RDEBUG("mLastError", mLastError);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   130
		RDEBUG("mMyId", mMyId);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
    return mLastError;
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
}
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   133
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
// SecUiNotificationDialog::closeDeviceDialog
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
void SecUiNotificationDialog::closeDeviceDialog(bool byClient)
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
{
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
    Q_UNUSED(byClient);
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   141
		RDEBUG("mMyId", mMyId);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   142
		RDEBUG("calling close()", 0);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   143
    close();
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   144
		RDEBUG("mShowEventReceived", mShowEventReceived);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   145
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
    // If show event has been received, close is signalled from hide event.
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   147
    // If not, hide event does not come and close is signalled from here.
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
    if (!mShowEventReceived) {
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   149
    		RDEBUG("emitting deviceDialogClosed", 0);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   150
        emit deviceDialogClosed();
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   151
				if(1==0 && subscriberKSecurityUIsDismissDialog)
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   152
					{
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   153
						RDEBUG("disconnect subscriberKSecurityUIsDismissDialog", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   154
						disconnect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged()));
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   155
						RDEBUG("disconnected subscriberKSecurityUIsDismissDialog", 1);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   156
						if(1==1)
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   157
							{
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   158
							RDEBUG("deleting subscriberKSecurityUIsDismissDialog", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   159
							delete subscriberKSecurityUIsDismissDialog;
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   160
							subscriberKSecurityUIsDismissDialog = NULL;
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   161
							RDEBUG("deleted subscriberKSecurityUIsDismissDialog", 1);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   162
							}
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   163
				 }
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   164
    }
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   165
    RDEBUG("0", 0);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   166
}
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   167
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   168
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   169
// SecUiNotificationDialog::deviceDialogWidget
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   170
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   171
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   172
HbDialog *SecUiNotificationDialog::deviceDialogWidget() const
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   173
{
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
    return const_cast<SecUiNotificationDialog*>(this);
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   175
}
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   176
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   177
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
// SecUiNotificationDialog::hideEvent
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   180
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   181
void SecUiNotificationDialog::hideEvent(QHideEvent *event)
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   182
{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   183
		RDEBUG("0", 0);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   184
    HbDialog::hideEvent(event);
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   185
		RDEBUG("mMyId", mMyId);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   186
		RDEBUG("calling close()", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   187
		close();
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   188
		RDEBUG("emitting deviceDialogClosed", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   189
		emit deviceDialogClosed();
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   190
		RDEBUG("deviceDialogClosed", 1);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   191
		if(1==0 && subscriberKSecurityUIsDismissDialog)
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   192
			{
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   193
				RDEBUG("disconnect subscriberKSecurityUIsDismissDialog", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   194
				disconnect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged()));
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   195
				RDEBUG("disconnected subscriberKSecurityUIsDismissDialog", 1);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   196
				if(1==1)
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   197
					{ 
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   198
					RDEBUG("deleting subscriberKSecurityUIsDismissDialog", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   199
					delete subscriberKSecurityUIsDismissDialog;
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   200
					subscriberKSecurityUIsDismissDialog = NULL;
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   201
					RDEBUG("deleted subscriberKSecurityUIsDismissDialog", 1);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   202
					}
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   203
			}
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   204
    // old method was   emit deviceDialogClosed();
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   205
   RDEBUG("0", 0);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
}
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   207
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   208
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   209
// SecUiNotificationDialog::showEvent
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   211
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   212
void SecUiNotificationDialog::showEvent(QShowEvent *event)
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   213
{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   214
		RDEBUG("0", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   215
		RDEBUG("mMyId", mMyId);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   216
    HbDialog::showEvent(event);
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   217
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   218
		if(!(queryType & ESecUiTypeMaskLock))
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   219
			{	// not for the "lock icon"
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   220
			RDEBUG("check default.1", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   221
			if(codeTop!=NULL)
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   222
            {
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   223
            RDEBUG("check default.2", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   224
            if(codeTop->text().length()>0)	// there's a default value. Verify it and (might) enable OK
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   225
                {
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   226
                RDEBUG("check default.3", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   227
                handleCodeTopChanged(codeTop->text());
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   228
                }
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   229
            RDEBUG("setFocus", 0);
42
hgs
parents: 35
diff changeset
   230
        		// remove setFocus from PIN query because Orbit can't handle it
hgs
parents: 35
diff changeset
   231
      			// codeTop->setFocus();	// this should open the VKB . Doesn't seem to work when it's done on the widget, so it's done here.
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   232
            }	// codeTop!=NULL
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   233
            
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   234
			const TUint32 KSecurityUIsTestCode  = 0x00000307;
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   235
			TInt value = 0;
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   236
			TInt err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsTestCode, value );
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   237
			RDEBUG("KSecurityUIsTestCode err", err);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   238
			RDEBUG("faking value", value);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   239
			RDEBUG("mShowEventReceived", mShowEventReceived);
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   240
			if(value>0 && value<1000000 && mShowEventReceived==true)	// show happens 2 times. Dialog can be closed only the second.
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   241
				{
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   242
				QString myString = "";
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   243
				myString += QString("%1").arg(value);
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   244
				RDEBUGQT("myString", myString);
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   245
		    codeTop->setText( myString );
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   246
		    TInt err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsTestCode, 0 );	// clear after using it
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   247
		    RDEBUGQT("calling handleAccepted myString", myString);
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   248
		    emit handleAccepted();
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   249
				// handleAccepted already   emit closeDeviceDialog(false);	// false means "not by client", although it's not really used
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   250
				}
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   251
			}
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   252
    mShowEventReceived = true;
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   253
    RDEBUG("1", 1);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   254
}
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   255
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   256
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   257
// SecUiNotificationDialog::constructDialog()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   258
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   259
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   260
bool SecUiNotificationDialog::constructDialog(const QVariantMap &parameters)
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   261
    {
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   262
		RDEBUG("0", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   263
		RDEBUG("mMyId", mMyId);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   264
    setTimeout(HbPopup::NoTimeout);
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   265
    setDismissPolicy(HbPopup::NoDismiss);
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   266
    setModal(true);
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   267
    mShowEventReceived = false;
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   268
    subscriberKSecurityUIsDismissDialog = NULL;
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   269
    titleWidget = NULL;
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   270
		RDEBUG("subscriberKSecurityUIsDismissDialog NULL", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   271
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   272
    subscriberKSecurityUIsDismissDialog = new QValueSpaceSubscriber("/KPSUidSecurityUIs/KSecurityUIsDismissDialog", this);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   273
    if(subscriberKSecurityUIsDismissDialog)
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   274
    	{
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   275
    	RDEBUG("subscriberKSecurityUIsDismissDialog created", 1);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   276
    	}
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   277
    else
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   278
    	{
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   279
    	RDEBUG("subscriberKSecurityUIsDismissDialog not created", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   280
    	}
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   281
    connect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged()));
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   282
		RDEBUG("subscriberKSecurityUIsDismissDialog", 1);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   283
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   284
    // Title
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   285
    // this is also done later in the widget
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   286
    // For now, it only says "Security"
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   287
    if (parameters.contains(KDialogTitle)) {
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   288
        QString titleText = parameters.value(KDialogTitle).toString();
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   289
        QString titleAttempts = "";
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   290
   			if(titleText.indexOf('|')>0)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   291
    				{	// if separator, take only first part
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   292
    				titleText = titleText.left(titleText.indexOf('|'));
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   293
    				}
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   294
   			if(titleText.indexOf('$')>0)
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   295
    				{	// if separator, take only first part
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   296
    				titleAttempts = titleText.right(titleText.length()-titleText.indexOf('$')-1);
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   297
    				RDEBUGQT("titleAttempts", titleAttempts);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   298
    				int nAttempts = titleAttempts.toInt();
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   299
    				RDEBUG("nAttempts", nAttempts);
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   300
    				titleText = titleText.left(titleText.indexOf('$'));
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   301
    				if(nAttempts>0)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   302
    					titleText = titleText + " attempts=" + QString::number(nAttempts);
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   303
    				}
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   304
    		titleText = hbTrId("Security Query");	// this is the header, for any potential later error which needs to be displayed
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   305
        // This is created only if needed (i.e. errors for NewLockCode)
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   306
        // titleWidget = new HbLabel(titleText);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   307
        // setHeadingWidget(titleWidget);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   308
    }
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   309
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   310
	    if (parameters.contains(KEmergency)) {
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   311
					RDEBUG("KEmergency", 1);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   312
	        QString emergencyText = parameters.value(KEmergency).toString();
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   313
	        RDEBUGQT("emergencyText", emergencyText);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   314
	        if(!emergencyText.compare("emergencyYes"))
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   315
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   316
	        	RDEBUG("emergencyYes", 1);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   317
	        	isEmergency = 1;
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   318
	        	okAction->setEnabled(true);
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   319
	        	okAction->setText(hbTrId("Call"));
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   320
    				return true;
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   321
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   322
	        if(!emergencyText.compare("emergencyNo"))
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   323
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   324
	        	RDEBUG("emergencyNo", 1);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   325
	        	isEmergency = 0;
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   326
	        	okAction->setEnabled(false);	// 112 -> 1122 (=password) . This is handled by   < lMinLength 
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   327
	        	okAction->setText(hbTrId("Ok"));
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   328
    				return true;
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   329
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   330
	    }
26
aad866c37519 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 22
diff changeset
   331
	    // after TARM validation.
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   332
	    if (parameters.contains(KInvalidNewLockCode)) {
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   333
					RDEBUG("KInvalidNewLockCode", 0);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   334
	        QString invalidText = parameters.value(KInvalidNewLockCode).toString();
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   335
	        RDEBUGQT("invalidText", invalidText);
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   336
	        QString newTitleText = "Lock Code";	// TODO take from the original one
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   337
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   338
	        QString invalidStr = invalidText.right(invalidText.length()-invalidText.indexOf('$')-1);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   339
	        int invalidNumber = invalidStr.toInt();
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   340
	        RDEBUG("invalidNumber", invalidNumber);
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   341
	        if(invalidNumber<0)	// that is, -1
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   342
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   343
	        	RDEBUG("invalidNumber<0", invalidNumber );
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   344
	        	// nothing to do
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   345
	        	}
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   346
				if(invalidNumber==EDeviceLockAutolockperiod)
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   347
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   348
	        	RDEBUG("EDeviceLockAutolockperiod", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   349
	        	newTitleText+=hbTrId("EDeviceLockAutolockperiod");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   350
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   351
	        if(invalidNumber==EDeviceLockMaxAutolockPeriod)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   352
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   353
	        	RDEBUG("EDeviceLockAutolockperiod", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   354
	        	newTitleText+=hbTrId("EDeviceLockMaxAutolockPeriod");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   355
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   356
	        if(invalidNumber==EDeviceLockMinlength)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   357
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   358
	        	RDEBUG("EDeviceLockMinlength", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   359
	        	newTitleText+=hbTrId("EDeviceLockMinlength");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   360
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   361
	        if(invalidNumber==EDeviceLockMaxlength)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   362
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   363
	        	RDEBUG("EDeviceLockMaxlength", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   364
	        	newTitleText+=hbTrId("EDeviceLockMaxlength");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   365
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   366
	        if(invalidNumber==EDeviceLockRequireUpperAndLower)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   367
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   368
	        	RDEBUG("EDeviceLockRequireUpperAndLower", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   369
	        	newTitleText+=hbTrId("EDeviceLockRequireUpperAndLower");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   370
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   371
	        if(invalidNumber==EDeviceLockRequireCharsAndNumbers)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   372
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   373
	        	RDEBUG("EDeviceLockMaxlength", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   374
	        	newTitleText+=hbTrId("EDeviceLockMaxlength");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   375
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   376
	        if(invalidNumber==EDeviceLockAllowedMaxRepeatedChars)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   377
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   378
	        	RDEBUG("EDeviceLockAllowedMaxRepeatedChars", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   379
	        	newTitleText+=hbTrId("EDeviceLockAllowedMaxRepeatedChars");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   380
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   381
	        if(invalidNumber==EDeviceLockHistoryBuffer)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   382
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   383
	        	RDEBUG("EDeviceLockHistoryBuffer", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   384
	        	newTitleText+=hbTrId("EDeviceLockHistoryBuffer");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   385
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   386
	        if(invalidNumber==EDeviceLockPasscodeExpiration)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   387
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   388
	        	RDEBUG("EDeviceLockPasscodeExpiration", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   389
	        	newTitleText+=hbTrId("EDeviceLockPasscodeExpiration");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   390
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   391
	        if(invalidNumber==EDeviceLockMinChangeTolerance)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   392
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   393
	        	RDEBUG("EDeviceLockMinChangeTolerance", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   394
	        	newTitleText+=hbTrId("EDeviceLockMinChangeTolerance");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   395
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   396
	        if(invalidNumber==EDeviceLockMinChangeInterval)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   397
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   398
	        	RDEBUG("EDeviceLockMinChangeInterval", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   399
	        	newTitleText+=hbTrId("EDeviceLockMinChangeInterval");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   400
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   401
	        if(invalidNumber==EDeviceLockDisallowSpecificStrings)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   402
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   403
	        	RDEBUG("EDeviceLockDisallowSpecificStrings", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   404
	        	newTitleText+=hbTrId("EDeviceLockDisallowSpecificStrings");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   405
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   406
	        if(invalidNumber==EDeviceLockAllowedMaxAtempts)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   407
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   408
	        	RDEBUG("EDeviceLockAllowedMaxAtempts", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   409
	        	newTitleText+=hbTrId("EDeviceLockAllowedMaxAtempts");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   410
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   411
	        if(invalidNumber==EDeviceLockConsecutiveNumbers)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   412
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   413
	        	RDEBUG("EDeviceLockConsecutiveNumbers", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   414
	        	newTitleText+=hbTrId("EDeviceLockConsecutiveNumbers");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   415
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   416
	        if(invalidNumber==EDeviceLockMinSpecialCharacters)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   417
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   418
	        	RDEBUG("EDeviceLockMinSpecialCharacters", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   419
	        	newTitleText+=hbTrId("EDeviceLockMinSpecialCharacters");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   420
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   421
	        if(invalidNumber==EDeviceLockSingleCharRepeatNotAllowed)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   422
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   423
	        	RDEBUG("EDeviceLockSingleCharRepeatNotAllowed", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   424
	        	newTitleText+=hbTrId("EDeviceLockSingleCharRepeatNotAllowed");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   425
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   426
	        if(invalidNumber==EDevicelockConsecutiveCharsNotAllowed)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   427
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   428
	        	RDEBUG("EDevicelockConsecutiveCharsNotAllowed", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   429
	        	newTitleText+=hbTrId("EDevicelockConsecutiveCharsNotAllowed");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   430
	        	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   431
	        if(invalidNumber>=EDevicelockTotalPolicies)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   432
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   433
	        	RDEBUG("EDevicelockTotalPolicies", invalidNumber );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   434
	        	newTitleText+=hbTrId("EDevicelockTotalPolicies");
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   435
	        	}
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   436
	        if( !titleWidget )
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   437
	        	{
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   438
	        	RDEBUG("creating titleWidget", 0 );
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   439
	        	titleWidget = new HbLabel(hbTrId("New lock code"));	// it will be changed later
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   440
          	setHeadingWidget(titleWidget);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   441
          	}
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   442
          RDEBUG("setPlainText", 0 );
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   443
	        titleWidget->setPlainText(newTitleText);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   444
	        
26
aad866c37519 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 22
diff changeset
   445
	        if(invalidNumber<0)	// everything is ok
aad866c37519 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 22
diff changeset
   446
	        	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   447
	        	okAction->setEnabled(true);	// this might fail in the scenario: check this : invalid -> valid. This allows verif ?
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   448
	        	okAction->setText(hbTrId("Ok"));
26
aad866c37519 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 22
diff changeset
   449
	        	codeBottom->setEnabled(true);
aad866c37519 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 22
diff changeset
   450
	        	}
aad866c37519 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 22
diff changeset
   451
	        else
aad866c37519 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 22
diff changeset
   452
	        	{
aad866c37519 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 22
diff changeset
   453
	        	okAction->setEnabled(false);
aad866c37519 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 22
diff changeset
   454
	        	codeBottom->setEnabled(false);
aad866c37519 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 22
diff changeset
   455
	        	codeBottom->setText("");
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   456
	        	okAction->setText(hbTrId("Ok"));
26
aad866c37519 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 22
diff changeset
   457
	        	}
aad866c37519 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 22
diff changeset
   458
	        // need to return because all objects are already created
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   459
   				return true;
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   460
	    }
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   461
	
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   462
    // Content
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   463
    SecUiNotificationContentWidget *content = new SecUiNotificationContentWidget();
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   464
    content->constructFromParameters(parameters);
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   465
    setContentWidget(content);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   466
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   467
		queryType = content->queryType;
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   468
		queryDual = content->queryDual;
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   469
		isEmergency = content->isEmergency;
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   470
    codeTop=NULL;
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   471
		codeTop = content->codeTop;
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   472
    checkBox = content->checkbox;
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   473
    listWidget = content->listWidget;
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   474
		codeBottom = content->codeBottom;
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   475
		lMinLength = content->lMinLength;
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   476
		lMaxLength = content->lMaxLength;
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   477
		lEmergencySupported = content->lEmergencySupported;
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   478
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   479
    connect(content, SIGNAL(codeTopChanged(const QString &)), this, SLOT(handleCodeTopChanged(const QString &)));
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   480
    connect(content, SIGNAL(codeBottomChanged(const QString &)), this, SLOT(handleCodeBottomChanged(const QString &)));
19
098e361762d2 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   481
    connect(content, SIGNAL(codeTopContentChanged()), this, SLOT(handleCodeTopContentChanged()));
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   482
    connect(content, SIGNAL(but1Changed()), this, SLOT(handlebut1Changed()));
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   483
    connect(content, SIGNAL(but2Changed()), this, SLOT(handlebut2Changed()));
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   484
    connect(content, SIGNAL(but3Changed()), this, SLOT(handlebut3Changed()));
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   485
		RDEBUG("queryType", queryType);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   486
    // Buttons
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   487
    if( (queryType & ESecUiTypeMaskLock))
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   488
    	{
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   489
    	// no need to create OK or Cancel
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   490
    	return true;
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   491
    	}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   492
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   493
    okAction = new HbAction(hbTrId("Ok"));
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   494
    RDEBUG("created HbAction okAction", 1);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   495
    okAction->setEnabled(false);	// initially the OK is disabled because codeTop is empty
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   496
    if((queryType & ESecUiBasicTypeMask) ==ESecUiBasicTypeCheck) {
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   497
        okAction->setEnabled(true);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   498
        setHeadingWidget(0); // had to remove this no multiline
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   499
    }
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   500
    else if ((queryType & ESecUiBasicTypeMask) ==ESecUiBasicTypeCheckMulti){
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   501
        okAction->setEnabled(true);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   502
    }
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   503
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   504
    // setAction(okAction, QDialogButtonBox::AcceptRole);	// it's supposed to use this, when deprecated
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   505
    // setPrimaryAction(okAction);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   506
    addAction(okAction);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   507
    disconnect(okAction, SIGNAL(triggered()), this, SLOT(close()));	// the close will be done in handleAccepted
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   508
    connect(okAction, SIGNAL(triggered()), this, SLOT(handleAccepted()));
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   509
    
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   510
    cancelAction = new HbAction(hbTrId("Cancel"));    // qtTrId("txt_common_button_cancel")
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   511
    addAction(cancelAction);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   512
    disconnect(cancelAction, SIGNAL(triggered()), this, SLOT(close()));	// the close will be done in handleCancelled
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   513
    connect(cancelAction, SIGNAL(triggered()), this, SLOT(handleCancelled()));
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   514
    // setAction(cancelAction, QDialogButtonBox::RejectRole);		// it's supposed to use this, when deprecated
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   515
    // setSecondaryAction(cancelAction);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   516
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   517
		// this should had been set by Autolock, but just to be sure
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   518
    TInt ret = RProperty::Define(KPSUidSecurityUIs, KSecurityUIsDismissDialog,
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   519
            RProperty::EInt, TSecurityPolicy(TSecurityPolicy::EAlwaysPass),
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   520
            TSecurityPolicy(TSecurityPolicy::EAlwaysPass));
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   521
    RDEBUG("defined KSecurityUIsDismissDialog", ret);
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   522
    TInt aDismissDialog = -1;
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   523
    ret = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsDismissDialog, aDismissDialog );
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   524
    RDEBUG("ret", ret);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   525
    RDEBUG("aDismissDialog", aDismissDialog);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   526
    if(aDismissDialog==ESecurityUIsDismissDialogOn || aDismissDialog==ESecurityUIsDismissDialogProcessing)
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   527
    	{
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   528
    	RDebug::Printf( "potential error: %s %s (%u) aDismissDialog=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aDismissDialog );
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   529
    	}
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   530
	
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   531
		RDEBUG("check cancel", 0);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   532
    if ((queryType & ESecUiCancelSupported)==ESecUiCancelSupported)
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   533
    	{
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   534
    		// nothing to do. Cancel is enabled by default
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   535
    	}
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   536
  	else
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   537
  		{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   538
				RDEBUG("disable Cancel", 1);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   539
  			cancelAction->setEnabled(false);
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   540
  			cancelAction->setText("");
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   541
  			cancelAction->setVisible(false);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   542
  		}
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   543
    
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   544
    return true;
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   545
}
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   546
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   547
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   548
// SecUiNotificationDialog::sendResult()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   549
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   550
//
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   551
void SecUiNotificationDialog::sendResult(int accepted)
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   552
{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   553
		RDEBUG("0", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   554
		RDEBUG("mMyId", mMyId);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   555
    QVariant acceptedValue(accepted);
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   556
		RDEBUG("0", 0);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   557
    mResultMap.insert(KResultAccepted, acceptedValue);
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   558
		RDEBUG("0", 0);
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   559
		RDEBUGQT("mResultMap", mResultMap);
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   560
		RDEBUG("queryType", queryType);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   561
		if(!(queryType & ESecUiTypeMaskLock))
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   562
			{	// the lock-icon should not reply
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   563
			RDEBUG("emit deviceDialogData", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   564
    	emit deviceDialogData(mResultMap);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   565
    	}
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   566
		RDEBUG("1", 1);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   567
}
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   568
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   569
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   570
// SecUiNotificationDialog::handleAccepted()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   571
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   572
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   573
void SecUiNotificationDialog::handleAccepted()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   574
{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   575
		RDEBUG("0", 0);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   576
		// okAction
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   577
		RDEBUG("mMyId", mMyId);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   578
		QString codeTopText="";
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   579
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   580
		if( (queryType & ESecUiTypeMaskLock))
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   581
    	{
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   582
    	codeTopText = "Unlock-Request";
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   583
    	}
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   584
    else if( (queryType & ESecUiBasicTypeMask)==ESecUiBasicTypeCheck)
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   585
    	{
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   586
        codeTopText=(checkBox->isChecked() ?  "1":"0");
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   587
        mResultMap.insert(KCodeTopIndex,  codeTopText);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   588
    	}
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   589
    else if( (queryType & ESecUiBasicTypeMask)==ESecUiBasicTypeCheckMulti)
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   590
    	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   591
        QItemSelectionModel *selectionModel = listWidget->selectionModel();
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   592
        QModelIndexList selectedItems = selectionModel->selectedIndexes();
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   593
        QModelIndex index;
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   594
        codeTopText="";
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   595
         foreach(index, selectedItems) { 
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   596
		 		 codeTopText+=QString::number(index.row());
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   597
                // could also use  if(index.row()!=selectedItems.count()-1) codeTopText+= "|";
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   598
                codeTopText+= "|";
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   599
                }
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   600
         mResultMap.insert(KCodeTopIndex,  codeTopText);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   601
    	}
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   602
    else
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   603
        codeTopText = codeTop->text();
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   604
    // no need to check last time for codeBottom
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   605
   	RDEBUGQT("codeTopText", codeTopText);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   606
    sendResult(KErrNone);
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   607
    RDEBUG("calling close()", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   608
    close();	// this is needed because Cancel doesn't automatically closes the dialog
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   609
		RDEBUG("emitting deviceDialogClosed", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   610
		emit deviceDialogClosed();
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   611
}
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   612
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   613
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   614
// SecUiNotificationDialog::handleCancelled()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   615
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   616
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   617
void SecUiNotificationDialog::handleCancelled()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   618
{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   619
		RDEBUG("0", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   620
		RDEBUG("mMyId", mMyId);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   621
    sendResult(KErrCancel);
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   622
		RDEBUG("callingclose()", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   623
    close();	// this is needed because Cancel doesn't automatically closes the dialog
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   624
		RDEBUG("emitting deviceDialogClosed", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   625
		emit deviceDialogClosed();
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   626
}
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   627
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   628
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   629
// SecUiNotificationDialog::handleMemorySelectionChanged()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   630
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   631
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   632
void SecUiNotificationDialog::handleMemorySelectionChanged(const QString &text)
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   633
    {
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   634
		RDEBUG("0", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   635
		RDEBUG("mMyId", mMyId);
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   636
    RDEBUGQT("text", text);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   637
    QVariant memorySelection(text);
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   638
    mResultMap.insert(KSelectedMemoryIndex, memorySelection);
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   639
    }
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   640
19
098e361762d2 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   641
void SecUiNotificationDialog::handleCodeTopContentChanged()
098e361762d2 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   642
    {
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   643
		RDEBUG("0", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   644
		RDEBUG("mMyId", mMyId);
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   645
    	RDEBUGQT("codeTop->text()", codeTop->text());
19
098e361762d2 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   646
    	handleCodeTopChanged(codeTop->text());
098e361762d2 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   647
    }
098e361762d2 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   648
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   649
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   650
// SecUiNotificationDialog::handleCodeTopChanged()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   651
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   652
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   653
void SecUiNotificationDialog::handleCodeTopChanged(const QString &text)
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   654
    {
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   655
		RDEBUG("0", 0);
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   656
    	RDEBUGQT("text", text);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   657
    	if(queryDual)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   658
    		{
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   659
    		codeBottom->setText("");	// any change resets the verification.
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   660
	    	if( (queryType & ESecUiMaskType) == 0x000004  )	// new codeLock
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   661
	    		{	// ChangeSecCodeParamsL change RMobilePhone::ESecurityCodePhonePassword
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   662
				    QVariant codeTopVar(text);
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   663
				    mResultMap.insert(KCodeTopIndex, codeTopVar);
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   664
						sendResult(KErrCompletion);	// send the current password back to the client for further TARM validation. This is done on any key-press, not in the OK
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   665
	    		}
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   666
    		}
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   667
    	else if(text.length() < lMinLength )
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   668
    		{
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   669
    		RDEBUGQT("too short text", text);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   670
    		okAction->setEnabled(false);
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   671
				RDEBUG("lEmergencySupported", lEmergencySupported);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   672
				if( lEmergencySupported && text.length() > 2 )	// emergency numbers need at least 3 digits
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   673
					{	// check whether it's a emergency number
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   674
					QVariant codeTopVar(text);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   675
  				mResultMap.insert(KCodeTopIndex, codeTopVar);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   676
					sendResult(KErrAbort);	// send the current password back to the client. Perhaps it's an emergency number and decides to Ok->Call
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   677
					}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   678
    		}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   679
    	else if (text.length() >= lMinLength)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   680
    		{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   681
    		// might use a flag to avoid re-setting. But this complicates things if there's another initial verification
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   682
    		RDEBUGQT("long enough text", text);
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   683
    		okAction->setText(hbTrId("Ok"));
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   684
    		if(queryDual==0)	// only if Bottom is not used
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   685
    			okAction->setEnabled(true);
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   686
    		}
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   687
    QVariant codeTopVar(text);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   688
    mResultMap.insert(KCodeTopIndex, codeTopVar);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   689
    }
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   690
// ----------------------------------------------------------------------------
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   691
// SecUiNotificationDialog::handleCodeBottomChanged()
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   692
// ----------------------------------------------------------------------------
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   693
//
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   694
void SecUiNotificationDialog::handleCodeBottomChanged(const QString &text)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   695
    {
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   696
		RDEBUG("0", 0);
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   697
    	RDEBUGQT("text", text);
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   698
    	RDEBUGQT("codeTop->text()", codeTop->text());
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   699
    	if(text.length() < lMinLength )
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   700
    		{
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   701
    		RDEBUGQT("too short text", text);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   702
    		okAction->setEnabled(false);
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   703
    		}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   704
    	else
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   705
    		{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   706
    		// might use a flag to avoid re-setting. But it just complicates things.
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   707
    		RDEBUGQT("long enough text", text);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   708
    		if(codeTop->text()==text)
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   709
    			{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   710
    			// unless both codes match, don't allow OK. Note that the first field doesn't allow exit until the validations (i.e. NewLockCode) as succesfull
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   711
    			RDEBUGQT("codes match", text);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   712
	    		okAction->setEnabled(true);
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   713
	    		}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   714
	    	else
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   715
	    		{
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   716
    			RDEBUGQT("codes don't match", text);
17
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   717
					okAction->setEnabled(false);
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   718
	    		}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   719
    		}
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   720
		// verification is not sent
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   721
    }
8957df7b0072 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   722
// ----------------------------------------------------------------------------
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   723
// SecUiNotificationDialog::handlebut1Changed()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   724
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   725
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   726
void SecUiNotificationDialog::handlebut1Changed()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   727
    {
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   728
		RDEBUG("0", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   729
    codeTop->setText("1234");
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   730
    }
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   731
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   732
// SecUiNotificationDialog::handlebut2Changed()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   733
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   734
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   735
void SecUiNotificationDialog::handlebut2Changed()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   736
    {
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   737
		RDEBUG("0", 0);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   738
    	QString codeTopText = codeTop->text();
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   739
    	RDEBUGQT("codeTopText", codeTopText);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   740
    	codeTopText = codeTopText + "1" ;
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   741
    	RDEBUGQT("codeTopText+1", codeTopText);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   742
    	codeTop->setText(codeTopText);
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   743
    	
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   744
    	      RDEBUG("editorInterface", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   745
      			HbEditorInterface editorInterface(codeTop);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   746
      			RDEBUG("actions", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   747
      			QList<HbAction *> vkbList = editorInterface.actions();
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   748
      			RDEBUG("count", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   749
      			int count = vkbList.count();
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   750
      			RDEBUG("got count", count);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   751
		        for (int i = 0; i < count; i++)
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   752
		        		{
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   753
		        		RDEBUG("i", i);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   754
		            HbAction *action = static_cast<HbAction *>(vkbList[i]);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   755
		            RDEBUG("action", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   756
		          	}
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   757
		          	
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   758
		        RDEBUG("okVKBAction", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   759
		        okVKBAction = new HbAction(tr("Ok"));
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   760
		        RDEBUG("addAction", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   761
		        editorInterface.addAction(okVKBAction);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   762
		        RDEBUG("addAction", 1);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   763
		        connect(okVKBAction, SIGNAL(triggered()), this, SLOT(handleAccepted()));
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   764
		        RDEBUG("connect", 1);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   765
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   766
      			QList<HbAction *> vkbList2 = editorInterface.actions();
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   767
      			RDEBUG("count", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   768
      			int count2 = vkbList2.count();
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   769
      			RDEBUG("got count2", count2);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   770
		        for (int i = 0; i < count2; i++)
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   771
		        		{
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   772
		        		RDEBUG("i", i);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   773
		            HbAction *action2 = static_cast<HbAction *>(vkbList2[i]);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   774
		            RDEBUG("action2", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   775
		          	}
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   776
    
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   777
    }
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   778
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   779
// SecUiNotificationDialog::handlebut3Changed()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   780
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   781
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   782
void SecUiNotificationDialog::handlebut3Changed()
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   783
    {
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   784
    	RDEBUG("0", 0);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   785
    	QString codeTopText = codeTop->text();
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   786
    	RDEBUG("codeTopText", 0);
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   787
    	RDEBUGQT("codeTopText", codeTopText);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   788
    	codeTopText = codeTopText + "5" ;
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   789
    	RDEBUGQT("codeTopText+5", codeTopText);
19
098e361762d2 Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
   790
    	codeTop->setEchoMode(HbLineEdit::PasswordEchoOnEdit);
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   791
    	RDEBUGQT("codeTopText", codeTopText);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   792
    	codeTop->setText(codeTopText);
35
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   793
    	RDEBUG("setFocus", 0);
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   794
    	codeTop->setFocus();
f1030a78d563 201027_01
hgs
parents: 30
diff changeset
   795
    	RDEBUG("1", 1);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   796
    }
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   797
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   798
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   799
// SecUiNotificationDialog::saveFocusWidget(QWidget*,QWidget*)
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   800
// ----------------------------------------------------------------------------
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   801
//
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   802
void SecUiNotificationDialog::saveFocusWidget(QWidget*,QWidget*)
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   803
{
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   804
		RDEBUG("0", 0);
15
318c4eab2439 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   805
}
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   806
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   807
// ----------------------------------------------------------------------------
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   808
// SecUiNotificationDialog::subscriberKSecurityUIsDismissDialogChanged()
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   809
// A way for Autolock to dismiss any possible PIN dialog
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   810
// This doesn't dismiss the lockIcon because P&S is not connected
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   811
// Note: if this changes itself, then it becomes recursive
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   812
// ----------------------------------------------------------------------------
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   813
//
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   814
void SecUiNotificationDialog::subscriberKSecurityUIsDismissDialogChanged()
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   815
    {
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   816
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   817
    RDEBUG("0", 0);
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   818
		RDEBUG("mMyId", mMyId);
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   819
    TInt aDismissDialog = ESecurityUIsDismissDialogUninitialized;
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   820
    TInt err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsDismissDialog, aDismissDialog );
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   821
    RDEBUG("err", err);
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   822
		RDEBUG("aDismissDialog", aDismissDialog);
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   823
    if( aDismissDialog == ESecurityUIsDismissDialogOn )
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   824
    	{
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   825
    	if(subscriberKSecurityUIsDismissDialog)
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   826
    		{
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   827
    		RDEBUG("subscriberKSecurityUIsDismissDialog", 1);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   828
    		}
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   829
    	else
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   830
    		{
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   831
    		RDEBUG("! subscriberKSecurityUIsDismissDialog", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   832
    		}
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   833
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   834
    	if(this)
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   835
    		{
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   836
    		RDEBUG("this", 1);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   837
    		}
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   838
    	else
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   839
    		{
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   840
    		RDEBUG("! this", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   841
    		}
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   842
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   843
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   844
			RDEBUG("disconnect subscriberKSecurityUIsDismissDialog", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   845
			disconnect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged()));
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   846
			// this doesn't really disconnect, because somehow the events are still queued. This is a QtMobility error
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   847
			RDEBUG("disconnected subscriberKSecurityUIsDismissDialog", 1);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   848
			
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   849
			RDEBUG("not set KSecurityUIsDismissDialog", ESecurityUIsDismissDialogProcessing);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   850
			// can't set it because it does recursion
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   851
			// err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsDismissDialog, ESecurityUIsDismissDialogProcessing );
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   852
			RDEBUG("err", err);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   853
			// only if Cancel is allowed
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   854
			if ((queryType & ESecUiCancelSupported)==ESecUiCancelSupported)
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   855
				{
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   856
				RDEBUG("sendResult(KErrCancel)", KErrCancel);	// another option is KErrDied
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   857
				sendResult(KErrCancel);	// similar to     emit handleCancelled();
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   858
				RDEBUG("calling close()", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   859
				err = close();
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   860
				RDEBUG("err", err);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   861
				RDEBUG("emitting deviceDialogClosed", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   862
				emit deviceDialogClosed();
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   863
				// RDEBUG("emit closeDeviceDialog", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   864
				// this is old method    emit closeDeviceDialog(false);	// false means "not by client", although it's not really used
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   865
				RDEBUG("all emited", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   866
				}
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   867
			RDEBUG("not set KSecurityUIsDismissDialog", ESecurityUIsDismissDialogDone);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   868
			// can't set it because it does recursion
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   869
			// err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsDismissDialog, ESecurityUIsDismissDialogDone );	// clear after using it
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   870
			RDEBUG("err", err);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   871
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   872
			RDEBUG("reconnect subscriberKSecurityUIsDismissDialog", 0);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   873
			connect(subscriberKSecurityUIsDismissDialog, SIGNAL(contentsChanged()), this, SLOT(subscriberKSecurityUIsDismissDialogChanged()));
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   874
			RDEBUG("reconnected subscriberKSecurityUIsDismissDialog", 1);
22
6b63ca65093a Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   875
    	}
30
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   876
    RDEBUG("1", 1);
cc1cea6aabaf 201025_01
hgs
parents: 26
diff changeset
   877
	}