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