72
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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 "cntdetailpopup.h"
|
|
19 |
|
|
20 |
#include <hblabel.h>
|
|
21 |
#include <QStandardItemModel>
|
|
22 |
|
|
23 |
CntDetailPopup::CntDetailPopup(QGraphicsItem *parent, CntViewIdList aList ):
|
|
24 |
HbSelectionDialog(parent),
|
|
25 |
mListModel(NULL),
|
|
26 |
mViewIdList( aList )
|
|
27 |
{
|
|
28 |
mListModel = new QStandardItemModel(this);
|
|
29 |
|
|
30 |
addListItem("qtg_small_mobile", hbTrId("txt_phob_list_number"), phoneNumberEditorView );
|
|
31 |
addListItem("qtg_small_email", hbTrId("txt_phob_list_email"), emailEditorView );
|
|
32 |
addListItem("qtg_small_url_address", hbTrId("txt_phob_list_url"), urlEditorView);
|
81
|
33 |
addListItem("qtg_small_location", hbTrId("txt_phob_list_address2"), addressEditorView );
|
72
|
34 |
addListItem("qtg_small_note", hbTrId("txt_phob_list_note"), noteEditorView);
|
|
35 |
addListItem("qtg_small_sound", hbTrId("txt_phob_list_personal_ringing_tone"), ringToneFetcherView );
|
|
36 |
addListItem("qtg_small_calendar", hbTrId("txt_phob_list_date"), dateEditorView);
|
|
37 |
addListItem("qtg_small_company_details", hbTrId("txt_phob_list_company_details"), companyEditorView);
|
|
38 |
addListItem("qtg_small_family", hbTrId("txt_phob_list_family"), familyDetailEditorView);
|
|
39 |
|
81
|
40 |
setHeadingText(hbTrId("txt_phob_title_add_field"));
|
72
|
41 |
setTimeout(HbDialog::NoTimeout);
|
|
42 |
setDismissPolicy(HbDialog::NoDismiss);
|
|
43 |
setAttribute(Qt::WA_DeleteOnClose, true);
|
|
44 |
setModal(true);
|
|
45 |
setSelectionMode(HbAbstractItemView::NoSelection);
|
|
46 |
setModel(mListModel);
|
|
47 |
}
|
|
48 |
|
|
49 |
CntDetailPopup::~CntDetailPopup()
|
|
50 |
{
|
|
51 |
|
|
52 |
}
|
|
53 |
|
|
54 |
void CntDetailPopup::selectDetail( CntViewIdList aList, QObject *receiver, const char *member )
|
|
55 |
{
|
|
56 |
CntDetailPopup *popup = new CntDetailPopup( NULL, aList );
|
|
57 |
|
|
58 |
popup->open(receiver, member);
|
|
59 |
}
|
|
60 |
|
|
61 |
void CntDetailPopup::addListItem(QString aIcon, QString label, int aId )
|
|
62 |
{
|
|
63 |
if ( !mViewIdList.contains(aId) )
|
|
64 |
{
|
|
65 |
QStandardItem *labelItem = new QStandardItem(label);
|
|
66 |
labelItem->setData(HbIcon(aIcon), Qt::DecorationRole);
|
|
67 |
labelItem->setData(aId, Qt::UserRole);
|
|
68 |
|
|
69 |
mListModel->appendRow(labelItem);
|
|
70 |
}
|
|
71 |
}
|