45
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <hbaction.h>
|
|
19 |
#include <hbdialog.h>
|
|
20 |
|
|
21 |
#include "devicemanagementnotifierwidget_p.h"
|
|
22 |
|
|
23 |
|
|
24 |
// Constructor
|
|
25 |
devicemanagementnotifierwidget::devicemanagementnotifierwidget(const QVariantMap ¶meters):devicemanagementnotifierutils(this, parameters)
|
|
26 |
{
|
|
27 |
// Do translation
|
|
28 |
QTranslator *translator = new QTranslator();
|
|
29 |
QString lang = QLocale::system().name();
|
|
30 |
QString path = "Z:/resource/qt/translations/";
|
|
31 |
bool fine = translator->load("deviceupdates_en.qm", path);
|
|
32 |
if (fine)
|
|
33 |
qApp->installTranslator(translator);
|
|
34 |
|
|
35 |
QTranslator *commontranslator = new QTranslator();
|
|
36 |
|
|
37 |
fine = commontranslator->load("common_" + lang, path);
|
|
38 |
if (fine)
|
|
39 |
qApp->installTranslator(commontranslator);
|
|
40 |
|
|
41 |
}
|
|
42 |
|
|
43 |
// Set parameters
|
|
44 |
bool devicemanagementnotifierwidget::setDeviceDialogParameters(
|
|
45 |
const QVariantMap ¶meters)
|
|
46 |
{
|
|
47 |
|
|
48 |
return true;
|
|
49 |
}
|
|
50 |
|
|
51 |
// Get error
|
|
52 |
int devicemanagementnotifierwidget::deviceDialogError() const
|
|
53 |
{
|
|
54 |
|
|
55 |
return 0;
|
|
56 |
}
|
|
57 |
|
|
58 |
// Close device dialog
|
|
59 |
void devicemanagementnotifierwidget::closeDeviceDialog(bool byClient)
|
|
60 |
{
|
|
61 |
close();
|
|
62 |
//emit deviceDialogClosed();
|
|
63 |
|
|
64 |
}
|
|
65 |
|
|
66 |
// Return display widget
|
|
67 |
HbDialog *devicemanagementnotifierwidget::deviceDialogWidget() const
|
|
68 |
{
|
|
69 |
|
|
70 |
return const_cast<devicemanagementnotifierwidget*>(this);
|
|
71 |
}
|
|
72 |
|
|
73 |
devicemanagementnotifierwidget::~devicemanagementnotifierwidget()
|
|
74 |
{
|
|
75 |
qDebug("devicemanagementnotifierutils::~devicemanagementnotifierutils");
|
|
76 |
}
|
|
77 |
|
|
78 |
|
|
79 |
void devicemanagementnotifierwidget::dmDevdialogDismissed(ENotfierType notifiertype, int response)
|
|
80 |
{
|
|
81 |
QVariantMap resultMap;
|
|
82 |
resultMap.insert("notifiertype",notifiertype);
|
|
83 |
resultMap.insert("keypress", response);
|
|
84 |
emit deviceDialogData(resultMap);
|
|
85 |
}
|