author | hgs |
Wed, 20 Oct 2010 14:52:56 +0300 | |
changeset 80 | 9dcba1ee99f7 |
parent 77 | d1838696558c |
permissions | -rw-r--r-- |
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
2 |
* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
ba25891c3a9e
Revision: 200949
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". |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
14 |
* Description: This module contains the implementation of IAUpdateMainView |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
15 |
* class member functions. |
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
* |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
*/ |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
19 |
#include <hbaction.h> |
44 | 20 |
#include <QGraphicsWidget> |
21 |
#include <QGraphicsLayout> |
|
22 |
#include <QGraphicsLayoutItem> |
|
23 |
#include <QGraphicsLinearLayout> |
|
77 | 24 |
#include <QSizeF> |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
25 |
|
44 | 26 |
#include <hbdockwidget.h> |
77 | 27 |
#include <HbListView> |
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
28 |
#include <hblistviewitem.h> |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
29 |
#include <hblistwidgetitem.h> |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
30 |
#include <hbtoolbar.h> |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
31 |
#include <hbmenu.h> |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
32 |
#include <hbdocumentloader.h> |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
33 |
#include <xqconversions.h> |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
34 |
#include <hbmessagebox.h> |
44 | 35 |
#include <hblabel.h> |
36 |
#include <hbgroupbox.h> |
|
77 | 37 |
#include <HbDataForm> |
38 |
#include <HbLabel> |
|
64 | 39 |
#include <hbtranslator.h> |
77 | 40 |
#include <HbStyleLoader> |
41 |
#include <HbIconItem> |
|
42 |
#include <HbIconAnimationManager> |
|
43 |
#include <HbIconAnimator> |
|
44 |
#include <hbparameterlengthlimiter.h> |
|
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
|
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
#include "iaupdatemainview.h" |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
47 |
#include "iaupdateengine.h" |
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
48 |
#include "iaupdateagreement.h" |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
49 |
#include "iaupdatedeputils.h" |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
50 |
#include "iaupdatedialogutil.h" |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
51 |
#include "iaupdateversion.h" |
77 | 52 |
#include "iaupdateapplistmodel.h" |
53 |
#include "iaupdateapplistitem.h" |
|
54 |
#include "iaupdateuicontroller.h" |
|
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
55 |
|
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
#include "iaupdatedebug.h" |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
58 |
|
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
59 |
|
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
60 |
const int KKiloByte = 1024; |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
61 |
const int KMegaByte = 1024 * 1024; |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
62 |
const int KMaxShownInKiloBytes = 10 * KMegaByte; |
64 | 63 |
const QString KTranslationsPath = "/resource/qt/translations/"; |
64 |
const QString KTranslationsFile = "swupdate"; |
|
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
|
77 | 66 |
const QString ANIMATION_ICON("qtg_anim_loading"); |
67 |
const QString ANIMATION_FILE("qtg_anim_loading.axml"); |
|
68 |
||
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
69 |
|
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
70 |
IAUpdateMainView::IAUpdateMainView(IAUpdateEngine *engine): |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
71 |
mEngine(engine) |
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
72 |
{ |
44 | 73 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::IAUpdateMainView() begin"); |
74 |
mFwListView = NULL; |
|
75 |
mApplicationUpdatesGroupBox = NULL;; |
|
76 |
mFwNSUGroupBox = NULL; |
|
77 |
mContentDataForm = NULL; |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
78 |
mDialogUtil = NULL; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
79 |
mDialogState = NoDialog; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
80 |
mPrimaryAction = NULL; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
81 |
mNode = NULL; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
82 |
mSelectionUpdate = false; |
44 | 83 |
mSelectionConnect = false; |
64 | 84 |
mTranslator = NULL; |
77 | 85 |
mAnimationIconItem = NULL; |
86 |
mLabel = NULL; |
|
87 |
mMark = false; |
|
88 |
mUpdating = false; |
|
64 | 89 |
|
77 | 90 |
mTranslator = new HbTranslator(KTranslationsPath, KTranslationsFile); |
91 |
||
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
92 |
HbDocumentLoader loader; |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
93 |
bool ok = false; |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
94 |
loader.load(":/xml/iaupdate_mainview.docml", &ok); |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
95 |
|
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
96 |
// Exit if the file format is invalid |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
97 |
Q_ASSERT_X(ok, "Software update", "Invalid docml file"); |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
98 |
// Create the view from DocML |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
99 |
|
44 | 100 |
HbView* loadedWidget = qobject_cast<HbView*>(loader.findWidget("view")); |
101 |
Q_ASSERT_X(loadedWidget != 0, "Software update", "View not found"); |
|
102 |
QString viewTitle(loadedWidget->title()); |
|
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
103 |
// Set the IAUpdateMainView view to be the widget that was loaded from the xml |
44 | 104 |
setWidget(loadedWidget); |
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
105 |
setTitle(viewTitle); |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
106 |
|
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
107 |
HbToolBar *toolBar = qobject_cast< HbToolBar*>( loader.findWidget("viewToolbar") ); |
44 | 108 |
//setToolBar(toolBar); |
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
109 |
|
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
110 |
HbMenu *menu = qobject_cast< HbMenu*>( loader.findWidget("viewMenu") ); |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
111 |
setMenu(menu); |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
112 |
|
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
113 |
//Get the Action objects from the docml file |
77 | 114 |
mActionStartUpdate = qobject_cast<HbAction*>(loader.findObject("action")); |
115 |
mActionSettings = qobject_cast<HbAction*>(loader.findObject("action_1")); |
|
116 |
mActionDisclaimer = qobject_cast<HbAction*>(loader.findObject("action_2")); |
|
117 |
mActionCancelRefresh = qobject_cast<HbAction*>(loader.findObject("action_3")); |
|
118 |
mActionCancelUpdate = qobject_cast<HbAction*>(loader.findObject("action_4")); |
|
119 |
||
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
120 |
|
77 | 121 |
connect(mActionStartUpdate, SIGNAL(triggered()), this, SLOT(handleStartUpdate())); |
122 |
connect(mActionSettings, SIGNAL(triggered()), this, SLOT(handleSettings())); |
|
123 |
connect(mActionDisclaimer, SIGNAL(triggered()), this, SLOT(handleDisclaimer())); |
|
124 |
connect(mActionCancelRefresh, SIGNAL(triggered()), this, SLOT(handleCancelRefresh())); |
|
125 |
connect(mActionCancelUpdate, SIGNAL(triggered()), this, SLOT(handleCancelUpdate())); |
|
126 |
||
127 |
mActionStartUpdate->setDisabled(true); |
|
128 |
||
129 |
mActionCancelRefresh->setVisible(false); |
|
130 |
mActionCancelUpdate->setVisible(false); |
|
44 | 131 |
|
132 |
mContent = qobject_cast< HbWidget*>( loader.findWidget("content") ); |
|
133 |
||
77 | 134 |
//mListView = qobject_cast<HbListView*>( loader.findWidget("listWidget") ); |
135 |
mListView = new HbListView(mContent); |
|
136 |
mListView->setSelectionMode(HbAbstractItemView::MultiSelection); |
|
137 |
||
138 |
//mListView->setLayoutName("iaupdate_progress"); |
|
139 |
HbStyleLoader::registerFilePath(":/layout/"); |
|
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
140 |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
141 |
connect( mListView, SIGNAL( longPressed( HbAbstractViewItem *, const QPointF & ) ), |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
142 |
this, SLOT( handleDetails( HbAbstractViewItem *, const QPointF & ) ) ); |
77 | 143 |
|
144 |
IAUpdateAppListModel *model = new IAUpdateAppListModel(); |
|
145 |
||
146 |
//HbListViewItem *prototype = mListView->listItemPrototype(); |
|
147 |
||
148 |
HbListViewItem *prototype = new IAUpdateAppListItem(mListView); |
|
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
149 |
prototype->setGraphicsSize(HbListViewItem::LargeIcon); |
77 | 150 |
prototype->setStretchingStyle(HbListViewItem::NoStretching); |
151 |
||
152 |
mListView->setModel(model, prototype); |
|
44 | 153 |
|
154 |
HbDockWidget *dock = new HbDockWidget(this); |
|
155 |
HbWidget *dockContainer = new HbWidget(dock); |
|
156 |
QGraphicsLinearLayout *dockLayout = new QGraphicsLinearLayout(dockContainer); |
|
157 |
dockLayout->setOrientation(Qt::Vertical); |
|
158 |
dockContainer->setLayout(dockLayout); |
|
159 |
||
160 |
mSelections = new HbGroupBox(dockContainer); |
|
77 | 161 |
|
162 |
QString selectedString = |
|
163 |
QString(hbTrId("txt_software_subhead_selected_1l_2l_3l_kb")).arg(0).arg(0).arg(0); |
|
164 |
mSelections->setHeading(selectedString); |
|
44 | 165 |
|
77 | 166 |
dockLayout->addItem(mSelections); |
44 | 167 |
|
168 |
dockLayout->addItem(toolBar); |
|
169 |
||
170 |
dock->setWidget(dockContainer); |
|
171 |
||
172 |
setDockWidget(dock); |
|
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
173 |
|
44 | 174 |
|
175 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::IAUpdateMainView() end"); |
|
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
176 |
} |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
177 |
|
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
178 |
IAUpdateMainView::~IAUpdateMainView() |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
179 |
{ |
44 | 180 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::~IAUpdateMainView() begin"); |
77 | 181 |
delete mTranslator; |
44 | 182 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::~IAUpdateMainView() end"); |
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
183 |
} |
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
184 |
|
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
185 |
// ----------------------------------------------------------------------------- |
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
186 |
// IAUpdateMainView::refresh |
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
187 |
// Refreshes update list |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
188 |
// ----------------------------------------------------------------------------- |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
189 |
// |
44 | 190 |
void IAUpdateMainView::refresh(const RPointerArray<MIAUpdateNode> &nodes, |
191 |
const RPointerArray<MIAUpdateFwNode> &fwNodes, |
|
192 |
int error) |
|
193 |
{ |
|
194 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refresh() begin"); |
|
195 |
removeCurrentContentLayout(); |
|
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
196 |
|
44 | 197 |
refreshFirmwareUpdates(fwNodes); |
198 |
||
199 |
refreshApplicationUpdates(nodes); |
|
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
200 |
|
44 | 201 |
if (nodes.Count() == 0 && fwNodes.Count() == 0 && |
202 |
error != KErrCancel && error != KErrAbort) |
|
203 |
{ |
|
204 |
if (!mContentDataForm) |
|
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
205 |
{ |
44 | 206 |
mContentDataForm = new HbDataForm(mContent); |
207 |
} |
|
77 | 208 |
else |
209 |
{ |
|
210 |
mContentDataForm->setVisible(true); |
|
211 |
} |
|
44 | 212 |
QGraphicsLinearLayout *linearLayout = (QGraphicsLinearLayout*) mContent->layout(); |
213 |
linearLayout->addItem(mContentDataForm); |
|
214 |
QString formText; |
|
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
215 |
|
44 | 216 |
if (error == KErrNone) |
217 |
{ |
|
77 | 218 |
formText = |
219 |
hbTrId("txt_software_formlabel_applications_are_up_to_date"); |
|
44 | 220 |
} |
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
221 |
else |
44 | 222 |
{ |
77 | 223 |
formText = |
224 |
hbTrId("txt_software_formlabel_refreshing_failed_try_agai"); |
|
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
225 |
} |
44 | 226 |
mContentDataForm->setDescription(formText); |
227 |
} |
|
77 | 228 |
updateSelectionInfoInDock(); |
229 |
||
230 |
if (!mUpdating) |
|
231 |
{ |
|
232 |
mActionStartUpdate->setEnabled(countOfSelections() > 0); |
|
233 |
} |
|
44 | 234 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refresh() end"); |
235 |
} |
|
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
236 |
|
77 | 237 |
void IAUpdateMainView::refreshProgress() |
238 |
{ |
|
239 |
IAUpdateAppListModel *model = NULL; |
|
240 |
model = (IAUpdateAppListModel*) mListView->model(); |
|
241 |
if (model) |
|
242 |
{ |
|
243 |
model->refreshProgress(); |
|
244 |
} |
|
245 |
} |
|
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
246 |
|
77 | 247 |
void IAUpdateMainView::startRefreshingAnimation() |
248 |
{ |
|
249 |
removeCurrentContentLayout(); |
|
250 |
||
251 |
mActionDisclaimer->setVisible(false); |
|
252 |
mActionSettings->setVisible(false); |
|
253 |
mActionCancelRefresh->setVisible(true); |
|
254 |
||
255 |
||
256 |
if (!mLabel) |
|
257 |
{ |
|
258 |
mLabel = new HbLabel(mContent); |
|
259 |
} |
|
260 |
else |
|
261 |
{ |
|
262 |
mLabel->setVisible(true); |
|
263 |
} |
|
264 |
||
265 |
QString formText; |
|
266 |
formText = hbTrId("txt_software_formlabel_refreshing_updates_list"); |
|
267 |
mLabel->setPlainText(formText); |
|
268 |
mLabel->setAlignment(Qt::AlignHCenter); |
|
269 |
||
270 |
||
271 |
QGraphicsLinearLayout *linearLayout = (QGraphicsLinearLayout*) mContent->layout(); |
|
272 |
linearLayout->addStretch(); |
|
273 |
linearLayout->addItem(mLabel); |
|
274 |
||
275 |
||
276 |
if (!mAnimationIconItem) |
|
277 |
{ |
|
278 |
mAnimationIconItem = new HbIconItem(ANIMATION_ICON,mContent); |
|
279 |
} |
|
280 |
else |
|
281 |
{ |
|
282 |
mAnimationIconItem->setVisible(true); |
|
283 |
} |
|
284 |
mAnimationIconItem->setAlignment(Qt::AlignHCenter ); |
|
285 |
linearLayout->addItem(mAnimationIconItem); |
|
286 |
linearLayout->addStretch(); |
|
287 |
||
288 |
HbIconAnimationManager::global()->addDefinitionFile(ANIMATION_FILE); |
|
289 |
||
290 |
mAnimationIconItem->animator().startAnimation(); |
|
291 |
} |
|
292 |
||
293 |
void IAUpdateMainView::stopRefreshingAnimation() |
|
294 |
{ |
|
295 |
mActionDisclaimer->setVisible(true); |
|
296 |
mActionSettings->setVisible(true); |
|
297 |
mActionCancelRefresh->setVisible(false); |
|
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
298 |
|
77 | 299 |
mAnimationIconItem->animator().stopAnimation(); |
300 |
} |
|
301 |
||
302 |
void IAUpdateMainView::updateCompleted() |
|
303 |
{ |
|
304 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::updateCompleted() begin"); |
|
305 |
mUpdating = false; |
|
306 |
mActionStartUpdate->setEnabled(countOfSelections() > 0); |
|
307 |
mActionDisclaimer->setVisible(true); |
|
308 |
mActionSettings->setVisible(true); |
|
309 |
mActionCancelUpdate->setVisible(false); |
|
310 |
connect( mListView, SIGNAL( longPressed( HbAbstractViewItem *, const QPointF & ) ), |
|
311 |
this, SLOT( handleDetails( HbAbstractViewItem *, const QPointF & ) ) ); |
|
312 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::updateCompleted() end"); |
|
313 |
} |
|
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
314 |
|
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
315 |
void IAUpdateMainView::handleStartUpdate() |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
316 |
{ |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
317 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleStartUpdate() begin"); |
77 | 318 |
|
319 |
mActionStartUpdate->setEnabled(false); |
|
320 |
mActionDisclaimer->setVisible(false); |
|
321 |
mActionSettings->setVisible(false); |
|
322 |
mActionCancelUpdate->setVisible(true); |
|
323 |
disconnect( mListView, SIGNAL( longPressed( HbAbstractViewItem *, const QPointF & ) ), |
|
324 |
this, SLOT( handleDetails( HbAbstractViewItem *, const QPointF & ) ) ); |
|
325 |
mUpdating = true; |
|
44 | 326 |
mEngine->StartUpdate(fotaSelected()); |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
327 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleStartUpdate() end"); |
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
328 |
} |
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
329 |
|
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
330 |
|
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
331 |
void IAUpdateMainView::handleSettings() |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
332 |
{ |
44 | 333 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleSettings() begin"); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
334 |
emit toSettingView(); |
44 | 335 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleSettings() end"); |
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
336 |
} |
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
337 |
|
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
338 |
void IAUpdateMainView::handleDisclaimer() |
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
339 |
{ |
44 | 340 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleDisclaimer() begin"); |
77 | 341 |
int counter = mListView->model()->rowCount(); |
342 |
||
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
343 |
if (!mDialogUtil) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
344 |
{ |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
345 |
mDialogUtil = new IAUpdateDialogUtil(this); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
346 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
347 |
if (mDialogUtil) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
348 |
{ |
64 | 349 |
HbAction *primaryAction = new HbAction(hbTrId("txt_common_button_ok")); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
350 |
mDialogUtil->showAgreement(primaryAction); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
351 |
} |
44 | 352 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleDisclaimer() end"); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
353 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
354 |
|
77 | 355 |
void IAUpdateMainView::handleCancelRefresh() |
356 |
{ |
|
357 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleCancelRefresh() begin"); |
|
358 |
mEngine->Controller()->HandleUserCancelL(); |
|
359 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleCancelRefresh() end"); |
|
360 |
} |
|
361 |
||
362 |
void IAUpdateMainView::handleCancelUpdate() |
|
363 |
{ |
|
364 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleCancelUpdate() begin"); |
|
365 |
mEngine->Controller()->HandleUserCancelL(); |
|
366 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleCancelUpdate() end"); |
|
367 |
} |
|
368 |
||
369 |
||
370 |
||
44 | 371 |
void IAUpdateMainView::handleDetails(HbAbstractViewItem * item, const QPointF &) |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
372 |
{ |
44 | 373 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleDetails() begin"); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
374 |
int ind = item->modelIndex().row(); |
44 | 375 |
if (getApplicationNode(ind) != NULL) |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
376 |
{ |
44 | 377 |
showDetails(*getApplicationNode(ind)); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
378 |
} |
44 | 379 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleDetails() end"); |
380 |
} |
|
381 |
||
382 |
void IAUpdateMainView::handleFotaDetails(HbAbstractViewItem *, const QPointF &) |
|
383 |
{ |
|
384 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleFotaDetails begin"); |
|
385 |
//only one FOTA item in a list, just use it |
|
386 |
for (int i = 0; i < mFwNodes.Count(); i++) |
|
387 |
{ |
|
388 |
if (mFwNodes[i]->FwType() == MIAUpdateFwNode::EFotaDp2) |
|
389 |
{ |
|
390 |
showDetails(*mFwNodes[i]); |
|
391 |
} |
|
392 |
} |
|
393 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleFotaDetails end"); |
|
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
394 |
} |
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
395 |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
396 |
|
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
397 |
void IAUpdateMainView::handleSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected) |
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
398 |
{ |
44 | 399 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleSelectionChanged begin"); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
400 |
if (!mSelectionUpdate) |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
401 |
{ |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
402 |
bool changedItemFound = false; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
403 |
QModelIndexList indexList = selected.indexes(); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
404 |
for (int i = 0; !changedItemFound && i < indexList.count(); ++i) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
405 |
{ |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
406 |
changedItemFound = true; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
407 |
markListItem(true, indexList.at(i).row()); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
408 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
409 |
if (!changedItemFound) |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
410 |
{ |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
411 |
indexList = deselected.indexes(); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
412 |
for (int i = 0; !changedItemFound && i < indexList.count(); ++i) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
413 |
{ |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
414 |
changedItemFound = true; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
415 |
markListItem(false, indexList.at(i).row()); |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
416 |
} |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
417 |
} |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
418 |
} |
44 | 419 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleSelectionChanged end"); |
420 |
} |
|
421 |
||
422 |
void IAUpdateMainView::handleFwSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected) |
|
423 |
{ |
|
424 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleFwSelectionChanged begin"); |
|
425 |
if (!mSelectionUpdate) |
|
426 |
{ |
|
427 |
bool changedItemFound = false; |
|
428 |
QModelIndexList indexList = selected.indexes(); |
|
429 |
for (int i = 0; !changedItemFound && i < indexList.count(); ++i) |
|
430 |
{ |
|
431 |
changedItemFound = true; |
|
432 |
markFotaItem(true); |
|
433 |
} |
|
434 |
if (!changedItemFound) |
|
435 |
{ |
|
436 |
indexList = deselected.indexes(); |
|
437 |
for (int i = 0; !changedItemFound && i < indexList.count(); ++i) |
|
438 |
{ |
|
439 |
changedItemFound = true; |
|
440 |
markFotaItem(false); |
|
441 |
} |
|
442 |
} |
|
443 |
} |
|
444 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleFwSelectionChanged end"); |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
445 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
446 |
|
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
447 |
|
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
448 |
void IAUpdateMainView::dialogFinished(HbAction *action) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
449 |
{ |
44 | 450 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::dialogFinished begin"); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
451 |
DialogState dialogState = mDialogState; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
452 |
mDialogState = NoDialog; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
453 |
|
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
454 |
switch ( dialogState ) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
455 |
{ |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
456 |
case Dependencies: |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
457 |
if (action == mPrimaryAction) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
458 |
{ |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
459 |
updateSelectionsToNodeArray(*mNode,mMark); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
460 |
} |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
461 |
updateSelectionsToList(); |
44 | 462 |
updateSelectionInfoInDock(); |
77 | 463 |
mActionStartUpdate->setEnabled(countOfSelections() > 0); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
464 |
break; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
465 |
case CannotOmit: |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
466 |
break; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
467 |
case Details: |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
468 |
break; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
469 |
default: |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
470 |
break; |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
471 |
} |
44 | 472 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::dialogFinished end"); |
473 |
} |
|
474 |
||
475 |
bool IAUpdateMainView::fotaSelected() const |
|
476 |
{ |
|
477 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::fotaSelected() begin"); |
|
478 |
bool selected = false; |
|
479 |
for (int i = 0; i < mFwNodes.Count() && !selected; ++i) |
|
480 |
{ |
|
481 |
if ( mFwNodes[i]->FwType() == MIAUpdateFwNode::EFotaDp2 && mFwNodes[i]->Base().IsSelected() ) |
|
482 |
{ |
|
483 |
selected = true; |
|
484 |
} |
|
485 |
} |
|
486 |
if (selected) |
|
487 |
{ |
|
488 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::fotaSelected() Fota item is selected"); |
|
489 |
} |
|
490 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::fotaSelected() end"); |
|
491 |
return selected; |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
492 |
} |
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
493 |
|
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
494 |
|
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
495 |
|
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
496 |
void IAUpdateMainView::markListItem(bool mark, int index) |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
497 |
{ |
44 | 498 |
IAUPDATE_TRACE_2("[IAUPDATE] IAUpdateMainView::markListItem() begin mark: %d index %d", mark, index); |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
499 |
if (mark) |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
500 |
{ |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
501 |
//It's Mark Command |
44 | 502 |
if (fotaSelected()) |
503 |
{ |
|
504 |
//FOTA item is selected, unmark FOTA item |
|
505 |
//FOTA item and application update items can't be selected at the same time |
|
506 |
markFotaItem(false); |
|
507 |
} |
|
508 |
} |
|
509 |
||
510 |
bool accepted = false; |
|
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
511 |
|
44 | 512 |
if(index > -1) |
513 |
{ |
|
514 |
accepted = true; |
|
515 |
MIAUpdateNode* node = mNodes[index]; |
|
516 |
RPointerArray<MIAUpdateNode> mands; |
|
517 |
RPointerArray<MIAUpdateNode> deps; |
|
518 |
||
519 |
if (mark) |
|
520 |
{ |
|
521 |
TRAPD(err,IAUpdateDepUtils::GetDependenciesL(*node, mNodes, deps)); |
|
522 |
if (err != KErrNone) |
|
523 |
{ |
|
524 |
deps.Close(); |
|
525 |
updateSelectionsToList(); |
|
526 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::markListItem() return end"); |
|
527 |
return; |
|
528 |
} |
|
529 |
if (!getMandatoryNodes(mands)) |
|
530 |
{ |
|
531 |
// error when creating mandatory node list |
|
532 |
mands.Close(); |
|
533 |
updateSelectionsToList(); |
|
534 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::markListItem() return end"); |
|
535 |
return; |
|
536 |
} |
|
537 |
} |
|
538 |
else |
|
539 |
{ |
|
540 |
//mandatory item is not allowed to be unmarked |
|
541 |
if (mNodes[index]->Base().Importance() == MIAUpdateBaseNode::EMandatory) |
|
542 |
{ |
|
543 |
//show dialog |
|
544 |
showUpdateCannotOmitDialog(); |
|
545 |
updateSelectionsToList(); |
|
546 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::markListItem() return end"); |
|
547 |
return; |
|
548 |
} |
|
549 |
TRAPD(err,IAUpdateDepUtils::GetDependantsL(*node, mNodes, deps)); |
|
550 |
if (err != KErrNone) |
|
551 |
{ |
|
552 |
deps.Close(); |
|
553 |
updateSelectionsToList(); |
|
554 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::markListItem() return end"); |
|
555 |
return; |
|
556 |
} |
|
557 |
// item is not allowed to be unmarked if its dependant is mandatory |
|
558 |
bool mandatoryDependantFound = false; |
|
559 |
for(int i = 0; i < deps.Count() && !mandatoryDependantFound; i++) |
|
560 |
{ |
|
561 |
if (deps[i]->Base().Importance() == MIAUpdateBaseNode::EMandatory) |
|
562 |
{ |
|
563 |
mandatoryDependantFound = true; |
|
564 |
} |
|
565 |
} |
|
566 |
if (mandatoryDependantFound) |
|
567 |
{ |
|
568 |
showUpdateCannotOmitDialog(); |
|
569 |
deps.Close(); |
|
570 |
updateSelectionsToList(); |
|
571 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::markListItem() return end"); |
|
572 |
return; |
|
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
573 |
} |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
574 |
} |
44 | 575 |
|
576 |
int depCount = deps.Count(); |
|
577 |
||
578 |
if (depCount > 0) |
|
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
579 |
{ |
44 | 580 |
QString text; |
581 |
QString names; |
|
582 |
MIAUpdateNode* depNode = NULL; |
|
583 |
QString separator(","); |
|
584 |
||
585 |
for(int i = 0; i < depCount; i++) |
|
586 |
{ |
|
587 |
depNode = deps[i]; |
|
588 |
if (i > 0) |
|
589 |
{ |
|
590 |
names.append(separator); |
|
591 |
names.append(QString(" ")); |
|
592 |
} |
|
593 |
names.append(XQConversions::s60DescToQString(depNode->Base().Name())); |
|
594 |
} |
|
595 |
||
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
596 |
if (mark) |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
597 |
{ |
44 | 598 |
if (depCount > 1) |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
599 |
{ |
77 | 600 |
text.append(hbTrId("txt_software_info_selected_update_also_needs_updat").arg(names)); |
44 | 601 |
} |
602 |
else |
|
603 |
{ |
|
77 | 604 |
text.append(hbTrId("txt_software_info_selected_update_also_needs_1").arg(names)); |
605 |
||
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
606 |
} |
77 | 607 |
} |
44 | 608 |
else |
609 |
{ |
|
610 |
if (depCount > 1) |
|
611 |
{ |
|
80 | 612 |
HbParameterLengthLimiter limiter(hbTrId("txt_software_info_updates_1_need_deselected_upd")); |
77 | 613 |
text.append(limiter.arg("names")); |
44 | 614 |
} |
615 |
else |
|
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
616 |
{ |
77 | 617 |
HbParameterLengthLimiter limiter(hbTrId("txt_software_info_update_1_needs_deselected_upd")); |
618 |
text.append(limiter.arg("names")); |
|
44 | 619 |
} |
620 |
} |
|
621 |
||
622 |
if (mark && mNodes[index]->Base().Importance() == MIAUpdateBaseNode::EMandatory) |
|
623 |
{ |
|
624 |
// depencencies of mandatory update are also selected without showing dialog |
|
625 |
accepted = true; |
|
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
626 |
} |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
627 |
else |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
628 |
{ |
44 | 629 |
mNode = node; |
630 |
mMark = mark; |
|
631 |
accepted = false; |
|
632 |
showDependenciesFoundDialog(text); |
|
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
633 |
} |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
634 |
} |
44 | 635 |
if (accepted) |
636 |
{ |
|
637 |
updateSelectionsToNodeArray(*node, mark); |
|
638 |
} |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
639 |
} |
44 | 640 |
if (accepted) |
641 |
{ |
|
642 |
updateSelectionsToList(); |
|
643 |
updateSelectionInfoInDock(); |
|
77 | 644 |
if (!mUpdating) |
645 |
{ |
|
646 |
mActionStartUpdate->setEnabled(countOfSelections() > 0); |
|
647 |
} |
|
44 | 648 |
} |
649 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::markListItem() end"); |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
650 |
} |
44 | 651 |
|
652 |
||
653 |
void IAUpdateMainView::markFotaItem(bool mark) |
|
654 |
{ |
|
655 |
IAUPDATE_TRACE_1("[IAUPDATE] IAUpdateMainView::markFotaItem() begin mark: %d", mark); |
|
656 |
if (mark) |
|
657 |
{ |
|
658 |
//It's Mark Command |
|
659 |
||
660 |
//if some of application update item(s) are selected, unmark them |
|
661 |
//FOTA item and application update items can't be selected at the same time |
|
662 |
bool deselected = false; |
|
663 |
for (int i = 0; i < mNodes.Count(); ++i) |
|
664 |
{ |
|
665 |
if (mNodes[i]->Base().IsSelected()) |
|
666 |
{ |
|
667 |
mNodes[i]->Base().SetSelected(false); |
|
77 | 668 |
deselected = true; |
44 | 669 |
} |
670 |
} |
|
671 |
if (deselected) |
|
672 |
{ |
|
673 |
// umnmarked items to be updated also to UI |
|
674 |
updateSelectionsToList(); |
|
675 |
} |
|
676 |
} |
|
677 |
for (int j = 0; j < mFwNodes.Count(); ++j) |
|
678 |
{ |
|
679 |
if (mFwNodes[j]->FwType() == MIAUpdateFwNode::EFotaDp2) |
|
680 |
{ |
|
681 |
mFwNodes[j]->Base().SetSelected(mark); |
|
682 |
if (mark) |
|
683 |
{ |
|
684 |
mFwListView->selectionModel()->select(mFwListView->model()->index(0,0),QItemSelectionModel::Select); |
|
685 |
} |
|
686 |
else |
|
687 |
{ |
|
688 |
mFwListView->selectionModel()->select(mFwListView->model()->index(0,0),QItemSelectionModel::Deselect); |
|
689 |
} |
|
690 |
} |
|
691 |
} |
|
692 |
updateSelectionInfoInDock(); |
|
77 | 693 |
mActionStartUpdate->setEnabled(countOfSelections() > 0); |
44 | 694 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::markFotaItem() end"); |
695 |
} |
|
696 |
||
697 |
||
698 |
||
699 |
||
700 |
||
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
701 |
void IAUpdateMainView::updateSelectionsToNodeArray(MIAUpdateNode &node, bool mark) |
44 | 702 |
{ |
703 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::updateSelectionsToNodeArray() begin"); |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
704 |
RPointerArray<MIAUpdateNode> deps; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
705 |
TInt err = KErrNone; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
706 |
if (mark) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
707 |
{ |
44 | 708 |
TRAP(err,IAUpdateDepUtils::GetDependenciesL(node, mNodes, deps)); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
709 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
710 |
else |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
711 |
{ |
44 | 712 |
TRAP(err,IAUpdateDepUtils::GetDependantsL(node, mNodes, deps)); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
713 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
714 |
if (err == KErrNone ) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
715 |
{ |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
716 |
int depCount = deps.Count(); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
717 |
for(int i = 0; i < depCount; i++) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
718 |
{ |
44 | 719 |
int depNodeInd = mNodes.Find(deps[i]); |
720 |
mNodes[depNodeInd]->Base().SetSelected(mark); |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
721 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
722 |
deps.Close(); |
44 | 723 |
int nodeInd = mNodes.Find(&node); |
724 |
mNodes[nodeInd]->Base().SetSelected(mark); |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
725 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
726 |
|
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
727 |
//mark all of the mandatory items |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
728 |
if ( mark ) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
729 |
{ |
44 | 730 |
RPointerArray<MIAUpdateNode> mands; |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
731 |
if (getMandatoryNodes(mands)) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
732 |
{ |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
733 |
int mandCount = mands.Count(); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
734 |
if (mandCount > 0) |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
735 |
{ |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
736 |
for(int i = 0; i < mandCount; i++) |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
737 |
{ |
44 | 738 |
int mandNodeInd = mNodes.Find(mands[i]); |
739 |
mNodes[mandNodeInd]->Base().SetSelected(mark); |
|
740 |
if (mNodes[mandNodeInd]->NodeType() == MIAUpdateAnyNode::ENodeTypeNormal) |
|
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
741 |
{ |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
742 |
// mark also all dependencies of a mandatory item |
44 | 743 |
MIAUpdateNode* dependencyNode = mNodes[mandNodeInd]; |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
744 |
RPointerArray<MIAUpdateNode> dependencies; |
44 | 745 |
TRAPD(err,IAUpdateDepUtils::GetDependenciesL(*dependencyNode, mNodes, dependencies)); |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
746 |
if (err) |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
747 |
{ |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
748 |
dependencies.Close(); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
749 |
mands.Close(); |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
750 |
return; |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
751 |
} |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
752 |
for(int j = 0; j < dependencies.Count(); j++) |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
753 |
{ |
44 | 754 |
int depNodeInd = mNodes.Find(dependencies[j]); |
755 |
mNodes[depNodeInd]->Base().SetSelected(true); |
|
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
756 |
} |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
757 |
dependencies.Close(); |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
758 |
} |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
759 |
} |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
760 |
} |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
761 |
} |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
762 |
mands.Close(); |
44 | 763 |
} |
764 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::updateSelectionsToNodeArray() end"); |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
765 |
} |
29
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
766 |
|
26b6f0522fd8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
767 |
|
44 | 768 |
bool IAUpdateMainView::getMandatoryNodes(RPointerArray<MIAUpdateNode> &mandNodes) const |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
769 |
{ |
44 | 770 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::getMandatoryNodes() begin"); |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
771 |
bool ret = true; |
44 | 772 |
for(int i = 0; i < mNodes.Count(); ++i) |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
773 |
{ |
44 | 774 |
if (mNodes[i]->Base().Importance() == MIAUpdateBaseNode::EMandatory) |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
775 |
{ |
44 | 776 |
if (mandNodes.Append(mNodes[i]) != KErrNone) |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
777 |
{ |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
778 |
ret = false; |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
779 |
} |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
780 |
} |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
781 |
} |
44 | 782 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::getMandatoryNodes() end"); |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
783 |
return ret; |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
784 |
} |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
785 |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
786 |
void IAUpdateMainView::showUpdateCannotOmitDialog() |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
787 |
{ |
44 | 788 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::showUpdateCannotOmitDialog() begin"); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
789 |
HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); |
77 | 790 |
messageBox->setText(hbTrId("txt_software_info_this_required_update_cannot_be_o")); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
791 |
int actionCount = messageBox->actions().count(); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
792 |
for (int i=actionCount-1; i >= 0; i--) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
793 |
{ |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
794 |
messageBox->removeAction(messageBox->actions().at(i)); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
795 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
796 |
HbAction *okAction = NULL; |
77 | 797 |
okAction = new HbAction(hbTrId("txt_common_button_ok")); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
798 |
messageBox->addAction(okAction); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
799 |
messageBox->setTimeout(HbPopup::StandardTimeout); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
800 |
messageBox->setAttribute(Qt::WA_DeleteOnClose); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
801 |
mDialogState = CannotOmit; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
802 |
messageBox->open(this, SLOT(dialogFinished(HbAction*))); |
44 | 803 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::showUpdateCannotOmitDialog() end"); |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
804 |
} |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
805 |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
806 |
void IAUpdateMainView::showDependenciesFoundDialog(QString &text) |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
807 |
{ |
44 | 808 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::showDependenciesFoundDialog() begin"); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
809 |
HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion); |
44 | 810 |
HbLabel *label = new HbLabel(messageBox); |
77 | 811 |
label->setHtml(hbTrId("txt_software_title_dependencies")); |
44 | 812 |
messageBox->setHeadingWidget(label); |
813 |
//messageBox->setIconVisible(false); |
|
814 |
||
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
815 |
messageBox->setText(text); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
816 |
int actionCount = messageBox->actions().count(); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
817 |
for (int i=actionCount-1; i >= 0; i--) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
818 |
{ |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
819 |
messageBox->removeAction(messageBox->actions().at(i)); |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
820 |
} |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
821 |
mPrimaryAction = NULL; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
822 |
mPrimaryAction = new HbAction("Continue"); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
823 |
HbAction *secondaryAction = NULL; |
77 | 824 |
secondaryAction = new HbAction(hbTrId("txt_common_button_cancel")); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
825 |
messageBox->addAction(mPrimaryAction); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
826 |
messageBox->addAction(secondaryAction); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
827 |
messageBox->setTimeout(HbPopup::NoTimeout); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
828 |
messageBox->setAttribute(Qt::WA_DeleteOnClose); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
829 |
mDialogState = Dependencies; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
830 |
messageBox->open(this, SLOT(dialogFinished(HbAction*))); |
44 | 831 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::showDependenciesFoundDialog() end"); |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
832 |
} |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
833 |
|
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
834 |
void IAUpdateMainView::updateSelectionsToList() |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
835 |
{ |
44 | 836 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::updateSelectionsToList() begin"); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
837 |
mSelectionUpdate = true; |
44 | 838 |
for(int i = 0; i < mNodes.Count(); ++i) |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
839 |
{ |
44 | 840 |
if ( mNodes[i]->Base().IsSelected() != mListView->selectionModel()->isSelected(mListView->model()->index(i,0))) |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
841 |
{ |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
842 |
QItemSelectionModel::SelectionFlag selectionFlag; |
44 | 843 |
if ( mNodes[i]->Base().IsSelected()) |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
844 |
{ |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
845 |
selectionFlag = QItemSelectionModel::Select; |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
846 |
} |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
847 |
else |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
848 |
{ |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
849 |
selectionFlag = QItemSelectionModel::Deselect; |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
850 |
} |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
851 |
mListView->selectionModel()->select(mListView->model()->index(i,0),selectionFlag); |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
852 |
} |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
853 |
} |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
854 |
mSelectionUpdate = false; |
44 | 855 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::updateSelectionsToList() end"); |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
856 |
} |
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
857 |
|
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
858 |
|
44 | 859 |
MIAUpdateNode* IAUpdateMainView::getApplicationNode(int index) const |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
860 |
{ |
44 | 861 |
IAUPDATE_TRACE_1("[IAUPDATE] IAUpdateMainView::getApplicationNode() begin index: %d", index); |
862 |
MIAUpdateNode *currentNode = NULL; |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
863 |
|
44 | 864 |
if (index >= 0 && index < mNodes.Count()) |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
865 |
{ |
44 | 866 |
currentNode = mNodes[index]; |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
867 |
} |
44 | 868 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::getApplicationNode() end"); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
869 |
return currentNode; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
870 |
} |
33
8110bf1194d1
Revision: 201017
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
29
diff
changeset
|
871 |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
872 |
void IAUpdateMainView::showDetails(MIAUpdateAnyNode& node) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
873 |
{ |
44 | 874 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::showDetails() begin"); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
875 |
HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); |
44 | 876 |
HbLabel *label = new HbLabel(messageBox); |
80 | 877 |
label->setHtml(hbTrId("txt_software_title_details")); |
44 | 878 |
messageBox->setHeadingWidget(label); |
879 |
||
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
880 |
messageBox->setIconVisible(false); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
881 |
|
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
882 |
QString text; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
883 |
constructDetailsText(node,text); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
884 |
messageBox->setText(text); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
885 |
messageBox->setTimeout(HbPopup::NoTimeout); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
886 |
messageBox->setAttribute(Qt::WA_DeleteOnClose); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
887 |
mDialogState = Details; |
44 | 888 |
messageBox->open(this, SLOT(dialogFinished(HbAction*))); |
889 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::showDetails() end"); |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
890 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
891 |
|
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
892 |
|
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
893 |
void IAUpdateMainView::constructDetailsText(MIAUpdateAnyNode &node, QString &text) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
894 |
{ |
44 | 895 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::constructDetailsText() begin"); |
77 | 896 |
text.append(hbTrId("txt_software_dialog_name")); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
897 |
text.append(QString("<br />")); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
898 |
if (node.NodeType() == MIAUpdateAnyNode::ENodeTypeFw) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
899 |
{ |
80 | 900 |
text.append(hbTrId("txt_swupdate_dialog_device_software")); |
77 | 901 |
} |
902 |
else |
|
903 |
{ |
|
904 |
QString name = XQConversions::s60DescToQString(node.Base().Name()); |
|
905 |
text.append(name); |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
906 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
907 |
|
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
908 |
text.append(QString("<br />")); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
909 |
text.append(QString("<br />")); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
910 |
|
77 | 911 |
text.append(hbTrId("txt_software_dialog_description")); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
912 |
text.append(QString("<br />")); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
913 |
QString description; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
914 |
if (node.NodeType() == MIAUpdateAnyNode::ENodeTypeFw) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
915 |
{ |
77 | 916 |
description = |
917 |
hbTrId("txt_software_info_this_update_improves_your_device"); |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
918 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
919 |
else |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
920 |
{ |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
921 |
description = XQConversions::s60DescToQString(node.Base().Description()); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
922 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
923 |
text.append(description); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
924 |
text.append(QString("<br />")); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
925 |
text.append(QString("<br />")); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
926 |
|
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
927 |
|
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
928 |
if (node.NodeType() == MIAUpdateAnyNode::ENodeTypeNormal) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
929 |
{ |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
930 |
MIAUpdateNode *iaupdateNode = static_cast<MIAUpdateNode*> (&node); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
931 |
if (iaupdateNode->Type()!= MIAUpdateNode::EPackageTypeServicePack) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
932 |
{ |
77 | 933 |
text.append(hbTrId("txt_software_dialog_version")); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
934 |
text.append(QString("<br />")); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
935 |
QString textVersion; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
936 |
versionText(node.Base().Version(), textVersion); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
937 |
text.append(textVersion); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
938 |
text.append(QString("<br />")); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
939 |
text.append(QString("<br />")); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
940 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
941 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
942 |
if (node.NodeType() == MIAUpdateAnyNode::ENodeTypeFw) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
943 |
{ |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
944 |
MIAUpdateFwNode *fwNode = static_cast<MIAUpdateFwNode*> (&node); |
77 | 945 |
text.append(hbTrId("txt_software_dialog_version")); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
946 |
text.append(QString("<br />")); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
947 |
QString textVersion = XQConversions::s60DescToQString(fwNode->FwVersion1()); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
948 |
text.append(textVersion); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
949 |
text.append(QString("<br />")); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
950 |
text.append(QString("<br />")); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
951 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
952 |
|
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
953 |
int contentSize = node.Base().ContentSizeL(); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
954 |
if (contentSize > 0) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
955 |
{ |
77 | 956 |
text.append(hbTrId("txt_software_dialog_size")); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
957 |
text.append(QString("<br />")); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
958 |
QString textFileSize; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
959 |
fileSizeText(contentSize, textFileSize); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
960 |
text.append(textFileSize); |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
961 |
} |
44 | 962 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::constructDetailsText() end"); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
963 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
964 |
|
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
965 |
void IAUpdateMainView::versionText(const TIAUpdateVersion &version, QString &versionText) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
966 |
{ |
44 | 967 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::versionText() begin"); |
77 | 968 |
versionText.append |
969 |
(hbTrId("txt_software_info_version_1l_2l_3l").arg(version.iMajor).arg(version.iMinor).arg(version.iBuild)); |
|
44 | 970 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::versionText() end"); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
971 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
972 |
|
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
973 |
void IAUpdateMainView::fileSizeText(int fileSize, QString &text) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
974 |
{ |
44 | 975 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::fileSizeText() begin"); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
976 |
int size = 0; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
977 |
|
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
978 |
if (fileSize >= KMaxShownInKiloBytes ) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
979 |
{ |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
980 |
size = fileSize / KMegaByte; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
981 |
if ( fileSize % KMegaByte != 0 ) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
982 |
{ |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
983 |
size++; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
984 |
} |
77 | 985 |
text.append(hbTrId("txt_software_dialog_l_kb").arg(size)); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
986 |
} |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
987 |
else |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
988 |
{ |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
989 |
size = fileSize / KKiloByte; |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
990 |
if ( fileSize % KKiloByte != 0 ) |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
991 |
{ |
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
992 |
size++; |
77 | 993 |
} |
994 |
text.append(hbTrId("txt_software_dialog_l_mb").arg(size)); |
|
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
995 |
} |
77 | 996 |
|
44 | 997 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::fileSizeText() end"); |
42
d17dc5398051
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
998 |
} |
44 | 999 |
|
1000 |
||
1001 |
void IAUpdateMainView::removeCurrentContentLayout() |
|
1002 |
{ |
|
1003 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::removeCurrentContentLayout() begin"); |
|
1004 |
int itemCount = mContent->layout()->count(); |
|
1005 |
for (int i = 0; i < itemCount; i++) |
|
1006 |
{ |
|
1007 |
mContent->layout()->removeAt(i); |
|
1008 |
} |
|
77 | 1009 |
if (mContentDataForm) |
1010 |
{ |
|
1011 |
mContentDataForm->setVisible(false); |
|
1012 |
} |
|
1013 |
if (mLabel) |
|
1014 |
{ |
|
1015 |
mLabel->setVisible(false); |
|
1016 |
} |
|
1017 |
if (mAnimationIconItem) |
|
1018 |
{ |
|
1019 |
delete mAnimationIconItem; |
|
1020 |
mAnimationIconItem = NULL; |
|
1021 |
} |
|
44 | 1022 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::removeCurrentContentLayout() end"); |
1023 |
} |
|
1024 |
||
1025 |
void IAUpdateMainView::refreshFirmwareUpdates(const RPointerArray<MIAUpdateFwNode> &fwNodes) |
|
1026 |
{ |
|
1027 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refreshFirmwareUpdates() begin"); |
|
1028 |
mFwNodes.Reset(); |
|
1029 |
||
1030 |
for (int i = 0; i < fwNodes.Count(); i++) |
|
1031 |
{ |
|
1032 |
MIAUpdateFwNode *fwnode = (fwNodes[i]); |
|
1033 |
mFwNodes.Append(fwnode); |
|
1034 |
fwnode->Base().SetImportance(MIAUpdateBaseNode::ECritical); |
|
1035 |
if (fwnode->FwType() == MIAUpdateFwNode::EFotaDp2) |
|
1036 |
{ |
|
1037 |
refreshFotaUpdate(*fwnode ); |
|
1038 |
} |
|
1039 |
else if (fwNodes.Count() == 1 && fwnode->FwType() == MIAUpdateFwNode::EFotiNsu) |
|
1040 |
{ |
|
77 | 1041 |
refreshNsuUpdate(*fwnode); |
44 | 1042 |
} |
1043 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refreshFirmwareUpdates() end"); |
|
1044 |
} |
|
1045 |
} |
|
1046 |
||
1047 |
void IAUpdateMainView::refreshFotaUpdate(MIAUpdateFwNode& fwNode) |
|
1048 |
{ |
|
1049 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refreshFotaUpdate() begin"); |
|
1050 |
if (!mFwListView) |
|
1051 |
{ |
|
77 | 1052 |
mFwListView = new HbListView(mContent); |
44 | 1053 |
mFwListView->setSelectionMode( HbAbstractItemView::MultiSelection ); |
1054 |
connect( mFwListView, SIGNAL( longPressed( HbAbstractViewItem *, const QPointF & ) ), |
|
1055 |
this, SLOT( handleFotaDetails( HbAbstractViewItem *, const QPointF & ) ) ); |
|
77 | 1056 |
|
1057 |
IAUpdateAppListModel *model = new IAUpdateAppListModel(); |
|
1058 |
HbListViewItem *prototype = new IAUpdateAppListItem(mListView); |
|
1059 |
prototype->setGraphicsSize(HbListViewItem::LargeIcon); |
|
1060 |
prototype->setStretchingStyle(HbListViewItem::NoStretching); |
|
1061 |
mListView->setModel(model, prototype); |
|
1062 |
||
44 | 1063 |
mFwListView->listItemPrototype()->setGraphicsSize(HbListViewItem::LargeIcon); |
1064 |
mFwListView->listItemPrototype()->setStretchingStyle(HbListViewItem::NoStretching); |
|
1065 |
connect(mFwListView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), |
|
1066 |
this, SLOT(handleFwSelectionChanged(QItemSelection,QItemSelection))); |
|
1067 |
} |
|
1068 |
QGraphicsLinearLayout *linearLayout = (QGraphicsLinearLayout*) mContent->layout(); |
|
1069 |
linearLayout->addItem(mFwListView); |
|
77 | 1070 |
IAUpdateAppListModel *model = (IAUpdateAppListModel*) mListView->model(); |
44 | 1071 |
QItemSelectionModel *selectionModel = mFwListView->selectionModel(); |
77 | 1072 |
mSelectionUpdate = true; |
44 | 1073 |
selectionModel->clear(); |
77 | 1074 |
mSelectionUpdate = false; |
1075 |
model->setFwNode(&fwNode); |
|
1076 |
||
44 | 1077 |
if (fwNode.Base().IsSelected()) |
1078 |
{ |
|
1079 |
QModelIndex modelIndex = mFwListView->model()->index(0,0); |
|
1080 |
selectionModel->select(modelIndex, QItemSelectionModel::Select); |
|
1081 |
} |
|
77 | 1082 |
model->refresh(); |
44 | 1083 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refreshFotaUpdate() end"); |
1084 |
} |
|
1085 |
||
77 | 1086 |
void IAUpdateMainView::refreshNsuUpdate(MIAUpdateFwNode& fwNode) |
44 | 1087 |
{ |
1088 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refreshNsuUpdate() begin"); |
|
1089 |
if (!mFwNSUGroupBox) |
|
1090 |
{ |
|
1091 |
mFwNSUGroupBox = new HbGroupBox(mContent); |
|
77 | 1092 |
mFwNSUGroupBox->setHeading(hbTrId("txt_software_subhead_device_software_available")); |
44 | 1093 |
HbDataForm *dataForm = new HbDataForm(mFwNSUGroupBox); |
1094 |
mFwNSUGroupBox->setContentWidget(dataForm); |
|
77 | 1095 |
QString textVersion = XQConversions::s60DescToQString(fwNode.FwVersion1()); |
1096 |
dataForm->setDescription |
|
1097 |
(hbTrId("txt_software_info_please_use_your_pc_to_update_the").arg(textVersion)); |
|
44 | 1098 |
} |
1099 |
QGraphicsLinearLayout *linearLayout = (QGraphicsLinearLayout*) mContent->layout(); |
|
1100 |
linearLayout->addItem(mFwNSUGroupBox); |
|
1101 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refreshNsuUpdate() end"); |
|
1102 |
} |
|
1103 |
||
1104 |
void IAUpdateMainView::refreshApplicationUpdates(const RPointerArray<MIAUpdateNode> &nodes) |
|
1105 |
{ |
|
1106 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refreshApplicationUpdates() begin"); |
|
1107 |
if (nodes.Count() > 0) |
|
1108 |
{ |
|
1109 |
if (!mApplicationUpdatesGroupBox) |
|
1110 |
{ |
|
1111 |
mApplicationUpdatesGroupBox = new HbGroupBox(mContent); |
|
77 | 1112 |
mApplicationUpdatesGroupBox->setHeading(hbTrId("txt_software_subhead_application_updates")); |
44 | 1113 |
} |
1114 |
QGraphicsLinearLayout *linearLayout = (QGraphicsLinearLayout*) mContent->layout(); |
|
1115 |
linearLayout->addItem(mApplicationUpdatesGroupBox); |
|
1116 |
linearLayout->addItem(mListView); |
|
1117 |
} |
|
77 | 1118 |
IAUpdateAppListModel *model = (IAUpdateAppListModel*) mListView->model(); |
44 | 1119 |
QItemSelectionModel *selectionModel = mListView->selectionModel(); |
77 | 1120 |
mSelectionUpdate = true; |
44 | 1121 |
selectionModel->clear(); |
77 | 1122 |
mSelectionUpdate = false; |
1123 |
||
1124 |
//HbIcon icon(QString(":/icons/qgn_menu_swupdate")); |
|
44 | 1125 |
mNodes.Reset(); |
77 | 1126 |
|
44 | 1127 |
for(int i = 0; i < nodes.Count(); ++i) |
1128 |
{ |
|
1129 |
MIAUpdateNode *node = nodes[i]; |
|
1130 |
mNodes.Append(node); |
|
77 | 1131 |
} |
1132 |
model->setNodeArray(mNodes); |
|
1133 |
for(int j = 0; j < mNodes.Count(); ++j) |
|
1134 |
{ |
|
1135 |
if (mNodes[j]->Base().IsSelected()) |
|
44 | 1136 |
{ |
77 | 1137 |
QModelIndex modelIndex = mListView->model()->index(j,0); |
44 | 1138 |
selectionModel->select(modelIndex, QItemSelectionModel::Select); |
1139 |
} |
|
1140 |
} |
|
1141 |
if (!mSelectionConnect) |
|
1142 |
{ |
|
1143 |
mSelectionConnect = connect(selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), |
|
1144 |
this, SLOT(handleSelectionChanged(QItemSelection,QItemSelection))); |
|
1145 |
} |
|
77 | 1146 |
model->refresh(); |
1147 |
||
44 | 1148 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refreshApplicationUpdates() end"); |
1149 |
} |
|
1150 |
||
1151 |
void IAUpdateMainView::updateSelectionInfoInDock() |
|
1152 |
{ |
|
1153 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::updateSelectionInfoInDock() begin"); |
|
1154 |
int countOfSelectedItems = 0; |
|
1155 |
int countOfAllItems = 0; |
|
1156 |
int selectedSizeInBytes = 0; |
|
1157 |
for (int i = 0; i < mFwNodes.Count(); ++i) |
|
1158 |
{ |
|
1159 |
if (mFwNodes[i]->FwType() == MIAUpdateFwNode::EFotaDp2) |
|
1160 |
{ |
|
1161 |
countOfAllItems++; |
|
1162 |
if (mFwNodes[i]->Base().IsSelected()) |
|
1163 |
{ |
|
1164 |
countOfSelectedItems++; |
|
1165 |
selectedSizeInBytes += mFwNodes[i]->Base().ContentSizeL(); |
|
1166 |
} |
|
1167 |
} |
|
1168 |
} |
|
1169 |
countOfAllItems += mNodes.Count(); |
|
1170 |
for (int j = 0; j < mNodes.Count(); ++j) |
|
1171 |
{ |
|
1172 |
if (mNodes[j]->Base().IsSelected()) |
|
1173 |
{ |
|
1174 |
countOfSelectedItems++; |
|
1175 |
selectedSizeInBytes += mNodes[j]->Base().ContentSizeL(); |
|
1176 |
} |
|
1177 |
} |
|
1178 |
||
1179 |
int selectedSize = 0; |
|
1180 |
QString unit; |
|
1181 |
if (selectedSizeInBytes >= KMaxShownInKiloBytes) |
|
1182 |
{ |
|
1183 |
unit = "MB"; |
|
1184 |
selectedSize = selectedSizeInBytes / KMegaByte; |
|
1185 |
if (selectedSizeInBytes % KMegaByte != 0) |
|
1186 |
{ |
|
1187 |
selectedSize++; |
|
1188 |
} |
|
1189 |
} |
|
1190 |
else |
|
1191 |
{ |
|
1192 |
unit = "kB"; |
|
1193 |
selectedSize = selectedSizeInBytes / KKiloByte; |
|
1194 |
if (selectedSizeInBytes % KKiloByte != 0) |
|
1195 |
{ |
|
1196 |
selectedSize++; |
|
1197 |
} |
|
1198 |
} |
|
1199 |
QString selectionString; |
|
1200 |
selectionString.append("Selected "); |
|
1201 |
QString numText; |
|
1202 |
numText.setNum(countOfSelectedItems); |
|
1203 |
selectionString.append(numText); |
|
1204 |
selectionString.append("/"); |
|
1205 |
numText.setNum(countOfAllItems); |
|
1206 |
selectionString.append(numText); |
|
1207 |
if (selectedSize > 0) |
|
1208 |
{ |
|
1209 |
selectionString.append(" ("); |
|
1210 |
numText.setNum(selectedSize); |
|
1211 |
selectionString.append(numText); |
|
1212 |
selectionString.append(" "); |
|
1213 |
selectionString.append(unit); |
|
1214 |
selectionString.append(")"); |
|
1215 |
} |
|
1216 |
mSelections->setHeading(selectionString); |
|
1217 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::updateSelectionInfoInDock() end"); |
|
1218 |
} |
|
77 | 1219 |
|
1220 |
int IAUpdateMainView::countOfSelections() const |
|
1221 |
{ |
|
1222 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::countOfSelections() begin"); |
|
1223 |
int countOfSelectedItems = 0; |
|
1224 |
for (int i = 0; i < mFwNodes.Count(); ++i) |
|
1225 |
{ |
|
1226 |
if (mFwNodes[i]->FwType() == MIAUpdateFwNode::EFotaDp2) |
|
1227 |
{ |
|
1228 |
if (mFwNodes[i]->Base().IsSelected()) |
|
1229 |
{ |
|
1230 |
countOfSelectedItems++; |
|
1231 |
} |
|
1232 |
} |
|
1233 |
} |
|
1234 |
for (int j = 0; j < mNodes.Count(); ++j) |
|
1235 |
{ |
|
1236 |
if (mNodes[j]->Base().IsSelected()) |
|
1237 |
{ |
|
1238 |
countOfSelectedItems++; |
|
1239 |
} |
|
1240 |
} |
|
1241 |
IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::countOfSelections() end"); |
|
1242 |
return countOfSelectedItems; |
|
1243 |
} |