30
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: Videolist view class source code
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
63
|
18 |
// Version : %version: 113.1.13 %
|
36
|
19 |
|
|
20 |
// INCLUDE FILES
|
30
|
21 |
#include <hbinstance.h>
|
|
22 |
#include <hbmainwindow.h>
|
|
23 |
#include <hbtoolbar.h>
|
|
24 |
#include <hbaction.h>
|
|
25 |
#include <hbmenu.h>
|
|
26 |
#include <hbgroupbox.h>
|
44
|
27 |
#include <hbparameterlengthlimiter.h>
|
|
28 |
#include <hbtoolbarextension.h>
|
63
|
29 |
#include <xqaiwdecl.h>
|
34
|
30 |
#include <vcxmyvideosdefs.h>
|
30
|
31 |
|
|
32 |
#include "videoservices.h"
|
|
33 |
#include "videocollectionviewutils.h"
|
|
34 |
#include "videolistwidget.h"
|
|
35 |
#include "videohintwidget.h"
|
|
36 |
#include "videolistview.h"
|
63
|
37 |
#include "videolisttoolbar.h"
|
|
38 |
#include "videolistmenu.h"
|
30
|
39 |
#include "videocollectioncommon.h"
|
|
40 |
#include "videocollectionwrapper.h"
|
58
|
41 |
#include "videoproxymodelgeneric.h"
|
30
|
42 |
#include "videocollectionuiloader.h"
|
36
|
43 |
#include "videocollectiontrace.h"
|
30
|
44 |
|
38
|
45 |
// Object names.
|
|
46 |
const char* const LIST_VIEW_OBJECT_NAME_OPTIONS_MENU = "vc::ListViewOptionsMenu";
|
|
47 |
|
30
|
48 |
// ---------------------------------------------------------------------------
|
|
49 |
// Constructor
|
|
50 |
// ---------------------------------------------------------------------------
|
|
51 |
//
|
36
|
52 |
VideoListView::VideoListView( VideoCollectionUiLoader *uiLoader, QGraphicsItem *parent )
|
63
|
53 |
: HbView(parent)
|
|
54 |
, mUiUtils(VideoCollectionViewUtils::instance())
|
|
55 |
, mWrapper(VideoCollectionWrapper::instance())
|
|
56 |
, mUiLoader(uiLoader)
|
|
57 |
, mToolbar(0)
|
|
58 |
, mMenu(0)
|
|
59 |
, mModelReady(false)
|
|
60 |
, mViewReady(false)
|
|
61 |
, mHintLevel(VideoHintWidget::AllVideos)
|
|
62 |
, mVideoServices(0)
|
|
63 |
, mCurrentList(0)
|
30
|
64 |
{
|
36
|
65 |
FUNC_LOG;
|
30
|
66 |
}
|
|
67 |
|
|
68 |
// ---------------------------------------------------------------------------
|
|
69 |
// Destructor
|
|
70 |
// ---------------------------------------------------------------------------
|
|
71 |
//
|
|
72 |
VideoListView::~VideoListView()
|
|
73 |
{
|
36
|
74 |
FUNC_LOG;
|
34
|
75 |
|
35
|
76 |
toolBar()->clearActions();
|
|
77 |
|
30
|
78 |
if(mVideoServices)
|
|
79 |
{
|
|
80 |
mVideoServices->decreaseReferenceCount();
|
|
81 |
mVideoServices = 0;
|
|
82 |
}
|
|
83 |
}
|
|
84 |
|
|
85 |
// ---------------------------------------------------------------------------
|
|
86 |
// initializeView()
|
|
87 |
// ---------------------------------------------------------------------------
|
|
88 |
//
|
|
89 |
int VideoListView::initializeView()
|
|
90 |
{
|
36
|
91 |
FUNC_LOG;
|
30
|
92 |
if(!mUiLoader)
|
|
93 |
{
|
34
|
94 |
cleanup();
|
30
|
95 |
return -1;
|
|
96 |
}
|
41
|
97 |
int videoListPhase = VideoCollectionUiLoaderParam::LoadPhasePrimary;
|
|
98 |
int collectionListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary;
|
|
99 |
int collectionContentListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary;
|
|
100 |
VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelVideos;
|
58
|
101 |
if (mUiUtils.isService())
|
30
|
102 |
{
|
41
|
103 |
INFO("VideoListView::initializeView() initializing service.");
|
30
|
104 |
if (!mVideoServices)
|
|
105 |
{
|
41
|
106 |
mVideoServices = VideoServices::instance();
|
|
107 |
connect(mVideoServices, SIGNAL(titleReady(const QString&)),
|
|
108 |
this, SLOT(titleReadySlot(const QString&)));
|
30
|
109 |
}
|
41
|
110 |
|
30
|
111 |
}
|
41
|
112 |
else
|
39
|
113 |
{
|
41
|
114 |
if(mVideoServices)
|
|
115 |
{
|
|
116 |
disconnect(mVideoServices, SIGNAL(titleReady(const QString&)),
|
|
117 |
this, SLOT(titleReadySlot(const QString&)));
|
|
118 |
mVideoServices->decreaseReferenceCount();
|
|
119 |
mVideoServices = 0;
|
|
120 |
}
|
|
121 |
VideoCollectionViewUtils::getActivityWidgetLevel(level);
|
|
122 |
if(level == VideoCollectionCommon::ELevelCategory)
|
|
123 |
{
|
|
124 |
videoListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary;
|
|
125 |
collectionListPhase = VideoCollectionUiLoaderParam::LoadPhasePrimary;
|
|
126 |
collectionContentListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary;
|
|
127 |
}
|
|
128 |
else if(level == VideoCollectionCommon::ELevelDefaultColl ||
|
|
129 |
level == VideoCollectionCommon::ELevelAlbum)
|
|
130 |
{
|
|
131 |
videoListPhase = VideoCollectionUiLoaderParam::LoadPhaseSecondary;
|
|
132 |
collectionListPhase = VideoCollectionUiLoaderParam::LoadPhasePrimary;
|
|
133 |
collectionContentListPhase = VideoCollectionUiLoaderParam::LoadPhasePrimary;
|
|
134 |
}
|
39
|
135 |
}
|
36
|
136 |
// start loading objects and widgets
|
41
|
137 |
QList<VideoCollectionUiLoaderParam> params;
|
|
138 |
|
36
|
139 |
params.append(VideoCollectionUiLoaderParam(
|
41
|
140 |
DOCML_NAME_VC_VIDEOLISTWIDGET,
|
|
141 |
DOCML_VIDEOCOLLECTIONVIEW_FILE,
|
49
|
142 |
DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
|
41
|
143 |
true,
|
|
144 |
videoListPhase));
|
|
145 |
|
39
|
146 |
params.append(VideoCollectionUiLoaderParam(
|
41
|
147 |
DOCML_NAME_VC_COLLECTIONWIDGET,
|
|
148 |
DOCML_VIDEOCOLLECTIONVIEW_FILE,
|
|
149 |
DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
|
|
150 |
true,
|
|
151 |
collectionListPhase));
|
|
152 |
|
|
153 |
params.append(VideoCollectionUiLoaderParam(
|
|
154 |
DOCML_NAME_VC_COLLECTIONCONTENTWIDGET,
|
|
155 |
DOCML_VIDEOCOLLECTIONVIEW_FILE,
|
|
156 |
DOCML_VIDEOCOLLECTIONVIEW_SECTION_LIST,
|
|
157 |
true,
|
63
|
158 |
collectionContentListPhase));
|
41
|
159 |
|
36
|
160 |
params.append(VideoCollectionUiLoaderParam(
|
|
161 |
DOCML_NAME_VC_HEADINGBANNER,
|
|
162 |
DOCML_VIDEOCOLLECTIONVIEW_FILE,
|
|
163 |
true,
|
|
164 |
VideoCollectionUiLoaderParam::LoadPhaseSecondary));
|
|
165 |
params.append(VideoCollectionUiLoaderParam(
|
|
166 |
DOCML_NAME_DIALOG,
|
|
167 |
DOCML_VIDEOSELECTIONDIALOG_FILE,
|
|
168 |
true,
|
|
169 |
VideoCollectionUiLoaderParam::LoadPhaseSecondary));
|
|
170 |
params.append(VideoCollectionUiLoaderParam(
|
|
171 |
DOCML_NAME_VC_VIDEOHINTWIDGET,
|
|
172 |
DOCML_VIDEOCOLLECTIONVIEW_FILE,
|
|
173 |
DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
|
|
174 |
true,
|
|
175 |
VideoCollectionUiLoaderParam::LoadPhaseSecondary));
|
|
176 |
params.append(VideoCollectionUiLoaderParam(
|
|
177 |
DOCML_NAME_HINT_BUTTON,
|
|
178 |
DOCML_VIDEOCOLLECTIONVIEW_FILE,
|
|
179 |
DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
|
|
180 |
true,
|
|
181 |
VideoCollectionUiLoaderParam::LoadPhaseSecondary));
|
|
182 |
params.append(VideoCollectionUiLoaderParam(
|
|
183 |
DOCML_NAME_NO_VIDEOS_LABEL,
|
|
184 |
DOCML_VIDEOCOLLECTIONVIEW_FILE,
|
|
185 |
DOCML_VIDEOCOLLECTIONVIEW_SECTION_HINT,
|
|
186 |
true,
|
|
187 |
VideoCollectionUiLoaderParam::LoadPhaseSecondary));
|
|
188 |
mUiLoader->addData(params,
|
|
189 |
this,
|
|
190 |
SLOT(objectReadySlot(QObject*, const QString&)));
|
63
|
191 |
params.clear();
|
|
192 |
|
|
193 |
if(!mMenu)
|
|
194 |
{
|
|
195 |
mMenu = new VideoListMenu(mUiLoader, this);
|
|
196 |
int err = mMenu->initializeMenu();
|
|
197 |
if(err)
|
|
198 |
{
|
|
199 |
cleanup();
|
|
200 |
return -1;
|
|
201 |
}
|
|
202 |
}
|
|
203 |
|
36
|
204 |
mUiLoader->loadPhase(VideoCollectionUiLoaderParam::LoadPhasePrimary);
|
34
|
205 |
|
41
|
206 |
// fetch current list right away for main views
|
|
207 |
// for default and user defined collections, currentList
|
|
208 |
// will be setted during activation
|
39
|
209 |
if(videoListPhase == VideoCollectionUiLoaderParam::LoadPhasePrimary)
|
|
210 |
{
|
|
211 |
mCurrentList = mUiLoader->findWidget<VideoListWidget>(
|
41
|
212 |
DOCML_NAME_VC_VIDEOLISTWIDGET );
|
39
|
213 |
}
|
41
|
214 |
else
|
39
|
215 |
{
|
|
216 |
mCurrentList = mUiLoader->findWidget<VideoListWidget>(
|
41
|
217 |
DOCML_NAME_VC_COLLECTIONWIDGET );
|
39
|
218 |
}
|
41
|
219 |
|
30
|
220 |
return 0;
|
|
221 |
}
|
|
222 |
|
|
223 |
// ---------------------------------------------------------------------------
|
|
224 |
// titleReadySlot()
|
|
225 |
// ---------------------------------------------------------------------------
|
|
226 |
//
|
|
227 |
void VideoListView::titleReadySlot(const QString& title)
|
|
228 |
{
|
36
|
229 |
FUNC_LOG;
|
30
|
230 |
setTitle(title);
|
|
231 |
}
|
|
232 |
|
|
233 |
// ---------------------------------------------------------------------------
|
|
234 |
// activateView()
|
|
235 |
// ---------------------------------------------------------------------------
|
|
236 |
//
|
41
|
237 |
int VideoListView::activateView( TMPXItemId &itemId)
|
30
|
238 |
{
|
36
|
239 |
FUNC_LOG;
|
|
240 |
|
41
|
241 |
int err = -1;
|
|
242 |
|
36
|
243 |
// activate collection to correct view
|
|
244 |
if (itemId == TMPXItemId::InvalidId())
|
41
|
245 |
{
|
|
246 |
|
|
247 |
VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelVideos;
|
|
248 |
if(!mVideoServices)
|
|
249 |
{
|
|
250 |
VideoCollectionViewUtils::getActivityWidgetLevel(level);
|
|
251 |
}
|
|
252 |
if(level == VideoCollectionCommon::ELevelCategory ||
|
|
253 |
level == VideoCollectionCommon::ELevelVideos)
|
|
254 |
{
|
|
255 |
err = activateMainView();
|
|
256 |
}
|
|
257 |
else if(level == VideoCollectionCommon::ELevelDefaultColl ||
|
|
258 |
level == VideoCollectionCommon::ELevelAlbum)
|
|
259 |
{
|
|
260 |
// level is default or user defined collection
|
|
261 |
// see if we have item id
|
|
262 |
VideoCollectionViewUtils::getCollectionActivityData(itemId, mCollectionName);
|
|
263 |
}
|
34
|
264 |
}
|
41
|
265 |
if(itemId != TMPXItemId::InvalidId())
|
34
|
266 |
{
|
36
|
267 |
err = activateCollectionContentView(itemId);
|
30
|
268 |
}
|
34
|
269 |
|
41
|
270 |
if(!err)
|
|
271 |
{
|
|
272 |
|
|
273 |
err = createToolbar();
|
|
274 |
}
|
|
275 |
|
36
|
276 |
// connect signals if everything went ok
|
41
|
277 |
if (!err)
|
35
|
278 |
{
|
36
|
279 |
HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
|
|
280 |
mainWnd->setOrientation(Qt::Vertical, false);
|
|
281 |
if (!connect(
|
|
282 |
mainWnd, SIGNAL(aboutToChangeOrientation()),
|
|
283 |
this, SLOT( aboutToChangeOrientationSlot())) ||
|
|
284 |
!connect(
|
|
285 |
mainWnd, SIGNAL(orientationChanged(Qt::Orientation)),
|
|
286 |
this, SLOT(orientationChangedSlot(Qt::Orientation))) ||
|
|
287 |
!connect(
|
|
288 |
&mWrapper, SIGNAL(asyncStatus(int, QVariant&)),
|
|
289 |
this, SLOT(handleAsyncStatusSlot(int, QVariant&))) ||
|
|
290 |
!connect(
|
40
|
291 |
mCurrentList->getModel()->sourceModel(), SIGNAL(modelChanged()),
|
36
|
292 |
this, SLOT(layoutChangedSlot())) ||
|
|
293 |
!connect(
|
40
|
294 |
mCurrentList->getModel()->sourceModel(), SIGNAL(modelReady()),
|
50
|
295 |
this, SLOT(modelReadySlot())) ||
|
|
296 |
!connect(
|
|
297 |
mCurrentList->getModel()->sourceModel(), SIGNAL(albumListReady()),
|
|
298 |
this, SLOT(albumListReadySlot())))
|
36
|
299 |
{
|
|
300 |
ERROR(-1, "VideoListView::activateView() failed to connect signals.");
|
|
301 |
// deactivate view so we get rid of dangling connections.
|
|
302 |
deactivateView();
|
|
303 |
err = -1;
|
|
304 |
}
|
35
|
305 |
}
|
41
|
306 |
else
|
|
307 |
{
|
|
308 |
deactivateView();
|
|
309 |
}
|
36
|
310 |
|
|
311 |
return err;
|
35
|
312 |
}
|
|
313 |
|
|
314 |
// ---------------------------------------------------------------------------
|
|
315 |
// doDelayedsSlot
|
|
316 |
// ---------------------------------------------------------------------------
|
|
317 |
//
|
|
318 |
void VideoListView::doDelayedsSlot()
|
|
319 |
{
|
36
|
320 |
FUNC_LOG;
|
|
321 |
mUiLoader->loadPhase(VideoCollectionUiLoaderParam::LoadPhaseSecondary);
|
39
|
322 |
if(mCurrentList)
|
|
323 |
{
|
|
324 |
mCurrentList->doDelayedsSlot();
|
|
325 |
}
|
35
|
326 |
}
|
|
327 |
|
30
|
328 |
// ---------------------------------------------------------------------------
|
|
329 |
// modelReadySlot
|
|
330 |
// ---------------------------------------------------------------------------
|
|
331 |
//
|
|
332 |
void VideoListView::modelReadySlot()
|
|
333 |
{
|
36
|
334 |
FUNC_LOG;
|
37
|
335 |
|
50
|
336 |
// check that current list is all videos or collection content.
|
|
337 |
VideoCollectionCommon::TCollectionLevels level = mCurrentList->getLevel();
|
|
338 |
if(level != VideoCollectionCommon::ELevelCategory)
|
37
|
339 |
{
|
50
|
340 |
modelReady();
|
37
|
341 |
}
|
50
|
342 |
}
|
|
343 |
|
|
344 |
// ---------------------------------------------------------------------------
|
|
345 |
// albumListReadySlot
|
|
346 |
// ---------------------------------------------------------------------------
|
|
347 |
//
|
|
348 |
void VideoListView::albumListReadySlot()
|
|
349 |
{
|
|
350 |
FUNC_LOG;
|
34
|
351 |
|
50
|
352 |
// check that current list is category list.
|
|
353 |
VideoCollectionCommon::TCollectionLevels level = mCurrentList->getLevel();
|
|
354 |
if(level == VideoCollectionCommon::ELevelCategory)
|
|
355 |
{
|
|
356 |
modelReady();
|
|
357 |
}
|
30
|
358 |
}
|
|
359 |
|
|
360 |
// ---------------------------------------------------------------------------
|
|
361 |
// layoutChangedSlot
|
|
362 |
// ---------------------------------------------------------------------------
|
|
363 |
//
|
|
364 |
void VideoListView::layoutChangedSlot()
|
|
365 |
{
|
36
|
366 |
FUNC_LOG;
|
38
|
367 |
// Note that showHint should be executed before updateSubLabel as it
|
|
368 |
// can modify the mModelReady flag.
|
|
369 |
showHint();
|
30
|
370 |
updateSubLabel();
|
|
371 |
}
|
|
372 |
|
|
373 |
// ---------------------------------------------------------------------------
|
|
374 |
// deactivateView()
|
|
375 |
// ---------------------------------------------------------------------------
|
|
376 |
//
|
|
377 |
void VideoListView::deactivateView()
|
|
378 |
{
|
36
|
379 |
FUNC_LOG;
|
30
|
380 |
HbMainWindow *mainWnd = hbInstance->allMainWindows().value(0);
|
34
|
381 |
|
|
382 |
mainWnd->unsetOrientation();
|
|
383 |
|
30
|
384 |
disconnect(mainWnd, SIGNAL(aboutToChangeOrientation()),
|
|
385 |
this, SLOT(aboutToChangeOrientationSlot()));
|
|
386 |
|
|
387 |
disconnect(mainWnd, SIGNAL(orientationChanged(Qt::Orientation)),
|
|
388 |
this, SLOT(orientationChangedSlot(Qt::Orientation)));
|
|
389 |
|
34
|
390 |
disconnect(&mWrapper, SIGNAL(asyncStatus(int, QVariant&)),
|
30
|
391 |
this, SLOT(handleAsyncStatusSlot(int, QVariant&)));
|
34
|
392 |
|
|
393 |
HbMenu *menu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU);
|
38
|
394 |
if(menu)
|
34
|
395 |
{
|
38
|
396 |
menu->setObjectName(LIST_VIEW_OBJECT_NAME_OPTIONS_MENU);
|
34
|
397 |
menu->hide();
|
|
398 |
}
|
40
|
399 |
|
|
400 |
if(mCurrentList && mCurrentList->getModel() && mCurrentList->getModel()->sourceModel())
|
34
|
401 |
{
|
40
|
402 |
disconnect(mCurrentList->getModel()->sourceModel(),
|
34
|
403 |
SIGNAL(modelChanged()),
|
|
404 |
this, SLOT(layoutChangedSlot()));
|
40
|
405 |
disconnect(mCurrentList->getModel()->sourceModel(),
|
34
|
406 |
SIGNAL(modelReady()),
|
|
407 |
this, SLOT(modelReadySlot()));
|
30
|
408 |
|
34
|
409 |
showHint(false);
|
41
|
410 |
if(!mVideoServices)
|
|
411 |
{
|
|
412 |
VideoCollectionCommon::TCollectionLevels level = mCurrentList->getLevel();
|
|
413 |
VideoCollectionViewUtils::setWidgetActivityLevel(level);
|
|
414 |
}
|
34
|
415 |
mCurrentList->deactivate();
|
30
|
416 |
}
|
|
417 |
}
|
|
418 |
|
|
419 |
// ---------------------------------------------------------------------------
|
|
420 |
// back()
|
|
421 |
// ---------------------------------------------------------------------------
|
|
422 |
//
|
|
423 |
void VideoListView::back()
|
|
424 |
{
|
36
|
425 |
FUNC_LOG;
|
30
|
426 |
}
|
|
427 |
|
|
428 |
// ---------------------------------------------------------------------------
|
63
|
429 |
// getCurrentList()
|
|
430 |
// ---------------------------------------------------------------------------
|
|
431 |
//
|
|
432 |
VideoListWidget* VideoListView::getCurrentList()
|
|
433 |
{
|
|
434 |
FUNC_LOG;
|
|
435 |
|
|
436 |
return mCurrentList;
|
|
437 |
}
|
|
438 |
|
|
439 |
// ---------------------------------------------------------------------------
|
50
|
440 |
// modelReady()
|
|
441 |
// ---------------------------------------------------------------------------
|
|
442 |
//
|
|
443 |
void VideoListView::modelReady()
|
|
444 |
{
|
|
445 |
FUNC_LOG;
|
|
446 |
|
|
447 |
// if mViewReady is false, then it means that this is the first time
|
|
448 |
// modelReady or albumListReady signal fires. Signaling that view is ready.
|
|
449 |
if(!mViewReady)
|
|
450 |
{
|
|
451 |
mViewReady = true;
|
|
452 |
emit viewReady();
|
|
453 |
}
|
|
454 |
|
|
455 |
mModelReady = true;
|
|
456 |
|
|
457 |
// since the reset signal arrives after
|
|
458 |
// layout changed, need to make sure that
|
|
459 |
// view is updated in case needed
|
|
460 |
layoutChangedSlot();
|
|
461 |
}
|
|
462 |
|
|
463 |
// ---------------------------------------------------------------------------
|
30
|
464 |
// cleanup()
|
|
465 |
// ---------------------------------------------------------------------------
|
|
466 |
//
|
|
467 |
void VideoListView::cleanup()
|
|
468 |
{
|
36
|
469 |
FUNC_LOG;
|
63
|
470 |
|
|
471 |
delete mToolbar;
|
|
472 |
mToolbar = 0;
|
|
473 |
|
34
|
474 |
mCurrentList = 0;
|
30
|
475 |
}
|
|
476 |
|
|
477 |
// ---------------------------------------------------------------------------
|
|
478 |
// createToolbar()
|
63
|
479 |
// Creates toolbar
|
30
|
480 |
// ---------------------------------------------------------------------------
|
|
481 |
//
|
|
482 |
int VideoListView::createToolbar()
|
|
483 |
{
|
36
|
484 |
FUNC_LOG;
|
38
|
485 |
|
63
|
486 |
// creates VideoListToolbar and HbToolbar
|
|
487 |
if(!mToolbar)
|
30
|
488 |
{
|
63
|
489 |
mToolbar = new VideoListToolbar(mUiLoader, this);
|
30
|
490 |
|
|
491 |
HbToolBar *bar = toolBar(); // First call to toolBar() creates the object, so on failure it could return 0.
|
63
|
492 |
|
|
493 |
if(!bar || !mToolbar ||
|
|
494 |
!connect(
|
|
495 |
mToolbar, SIGNAL(actionsChanged(QList<QAction*>)),
|
|
496 |
this, SLOT(toolbarActionsChanged(QList<QAction*>))) ||
|
|
497 |
!connect(
|
|
498 |
mToolbar, SIGNAL(toolbarExtensionChanged(HbToolBarExtension*)),
|
|
499 |
this, SLOT(toolbarExtensionChanged(HbToolBarExtension*))) ||
|
|
500 |
!connect(
|
|
501 |
mToolbar, SIGNAL(allVideosActionTriggered()),
|
|
502 |
this, SLOT(openAllVideosViewSlot())) ||
|
|
503 |
!connect(
|
|
504 |
mToolbar, SIGNAL(collectionViewActionTriggered()),
|
|
505 |
this, SLOT(openCollectionViewSlot())))
|
30
|
506 |
{
|
63
|
507 |
ERROR(-1, "VideoListView::createToolbar() failed to create all the toolbar.");
|
|
508 |
delete mToolbar;
|
|
509 |
mToolbar = 0;
|
|
510 |
return -1;
|
41
|
511 |
}
|
63
|
512 |
|
|
513 |
mToolbar->initialize();
|
|
514 |
mToolbar->viewStateChanged(mCurrentList->getLevel(), true, false);
|
|
515 |
|
|
516 |
// make sure that the hint widget's button is connected, and connected only once.
|
|
517 |
QObject *hintButton =
|
|
518 |
mUiLoader->findObject<QObject>(
|
|
519 |
DOCML_NAME_HINT_BUTTON, false);
|
|
520 |
|
|
521 |
if(hintButton)
|
41
|
522 |
{
|
63
|
523 |
connect(hintButton, SIGNAL(clicked(bool)),
|
|
524 |
mToolbar, SLOT(openOperatorServiceSlot()),
|
|
525 |
Qt::UniqueConnection);
|
41
|
526 |
}
|
63
|
527 |
// note that if hintButton is not found, then it's connected in objectReadySlot.
|
30
|
528 |
}
|
|
529 |
|
|
530 |
return 0;
|
|
531 |
}
|
|
532 |
|
|
533 |
// ---------------------------------------------------------------------------
|
|
534 |
// showHint
|
|
535 |
// ---------------------------------------------------------------------------
|
|
536 |
//
|
|
537 |
void VideoListView::showHint(bool show)
|
|
538 |
{
|
36
|
539 |
FUNC_LOG;
|
34
|
540 |
if(!mCurrentList)
|
30
|
541 |
{
|
34
|
542 |
return;
|
30
|
543 |
}
|
34
|
544 |
|
58
|
545 |
VideoProxyModelGeneric *model = mCurrentList->getModel();
|
36
|
546 |
|
40
|
547 |
if(!model || (!mModelReady && model->rowCount() == 0))
|
38
|
548 |
{
|
|
549 |
return;
|
|
550 |
}
|
|
551 |
|
|
552 |
mModelReady = true;
|
|
553 |
|
|
554 |
// decide if the hintwidget needs to be shown or not.
|
40
|
555 |
show = show && model->rowCount() == 0;
|
38
|
556 |
|
|
557 |
// If show is false, then hint widget is fetched only if it exists. If
|
|
558 |
// show is true then hint widget is also created and prepared if it does not exists.
|
34
|
559 |
VideoHintWidget *hintWidget =
|
|
560 |
mUiLoader->findWidget<VideoHintWidget>(
|
38
|
561 |
DOCML_NAME_VC_VIDEOHINTWIDGET, show);
|
|
562 |
|
35
|
563 |
if (hintWidget)
|
|
564 |
{
|
|
565 |
hintWidget->setLevel(mHintLevel);
|
38
|
566 |
if (show)
|
36
|
567 |
{
|
38
|
568 |
hintWidget->activate();
|
36
|
569 |
bool showHintBtns = (mCurrentList->getLevel() != VideoCollectionCommon::ELevelDefaultColl);
|
|
570 |
hintWidget->setButtonShown(showHintBtns);
|
|
571 |
}
|
|
572 |
else
|
34
|
573 |
{
|
38
|
574 |
hintWidget->deactivate();
|
34
|
575 |
hintWidget->setButtonShown(true);
|
|
576 |
}
|
36
|
577 |
}
|
|
578 |
|
63
|
579 |
mToolbar->viewStateChanged(mCurrentList->getLevel(), show, mModelReady);
|
|
580 |
|
36
|
581 |
// prepare sublabel
|
|
582 |
HbGroupBox *subLabel =
|
|
583 |
mUiLoader->findWidget<HbGroupBox>(
|
|
584 |
DOCML_NAME_VC_HEADINGBANNER);
|
34
|
585 |
if (subLabel)
|
|
586 |
{
|
|
587 |
if (show &&
|
|
588 |
mCurrentList->getLevel() == VideoCollectionCommon::ELevelVideos)
|
30
|
589 |
{
|
34
|
590 |
subLabel->hide();
|
|
591 |
}
|
36
|
592 |
else
|
34
|
593 |
{
|
|
594 |
subLabel->show();
|
30
|
595 |
}
|
|
596 |
}
|
|
597 |
}
|
|
598 |
|
|
599 |
// ---------------------------------------------------------------------------
|
34
|
600 |
// setHintLevel
|
|
601 |
// ---------------------------------------------------------------------------
|
|
602 |
//
|
|
603 |
void VideoListView::setHintLevel(VideoHintWidget::HintLevel level)
|
|
604 |
{
|
36
|
605 |
FUNC_LOG;
|
35
|
606 |
mHintLevel = level;
|
34
|
607 |
}
|
|
608 |
|
|
609 |
// ---------------------------------------------------------------------------
|
30
|
610 |
// updateSubLabel
|
|
611 |
// ---------------------------------------------------------------------------
|
|
612 |
//
|
|
613 |
void VideoListView::updateSubLabel()
|
|
614 |
{
|
36
|
615 |
FUNC_LOG;
|
58
|
616 |
VideoProxyModelGeneric *model = 0;
|
34
|
617 |
if(mCurrentList)
|
|
618 |
{
|
40
|
619 |
model = mCurrentList->getModel();
|
34
|
620 |
}
|
|
621 |
|
38
|
622 |
if (model && mModelReady)
|
30
|
623 |
{
|
34
|
624 |
int itemCount = model->rowCount();
|
|
625 |
|
|
626 |
HbGroupBox *subLabel =
|
|
627 |
mUiLoader->findWidget<HbGroupBox>(
|
|
628 |
DOCML_NAME_VC_HEADINGBANNER);
|
35
|
629 |
|
36
|
630 |
if(subLabel && mCurrentList)
|
34
|
631 |
{
|
36
|
632 |
if (mCurrentList->getLevel() == VideoCollectionCommon::ELevelVideos)
|
35
|
633 |
{
|
36
|
634 |
// no need to update sublabel if there are no items in videolist
|
|
635 |
// hint widget is shown instead
|
|
636 |
if (itemCount)
|
|
637 |
{
|
63
|
638 |
subLabel->setHeading(hbTrId("txt_videos_subtitle_all_videos_ln", itemCount));
|
36
|
639 |
}
|
35
|
640 |
}
|
36
|
641 |
else if (mCurrentList->getLevel() == VideoCollectionCommon::ELevelCategory)
|
35
|
642 |
{
|
63
|
643 |
subLabel->setHeading(hbTrId("txt_videos_subtitle_collections_ln", itemCount));
|
35
|
644 |
}
|
36
|
645 |
else
|
35
|
646 |
{
|
44
|
647 |
QString text = HbParameterLengthLimiter(hbTrId("txt_videos_subtitle_1_l2")).arg(mCollectionName).arg(itemCount);
|
|
648 |
subLabel->setHeading(text);
|
35
|
649 |
}
|
34
|
650 |
}
|
|
651 |
}
|
|
652 |
}
|
30
|
653 |
|
34
|
654 |
// ---------------------------------------------------------------------------
|
41
|
655 |
// activateMainView()
|
34
|
656 |
// ---------------------------------------------------------------------------
|
|
657 |
//
|
41
|
658 |
int VideoListView::activateMainView()
|
34
|
659 |
{
|
36
|
660 |
FUNC_LOG;
|
39
|
661 |
|
|
662 |
if(!mCurrentList)
|
|
663 |
{
|
|
664 |
return -1;
|
|
665 |
}
|
|
666 |
|
41
|
667 |
int result = mCurrentList->activate();
|
39
|
668 |
if(result < 0)
|
34
|
669 |
{
|
39
|
670 |
ERROR(result, "VideoListView::activateVideosView() failed to activate.");
|
|
671 |
return -1;
|
34
|
672 |
}
|
41
|
673 |
|
36
|
674 |
return 0;
|
34
|
675 |
}
|
|
676 |
|
|
677 |
// ---------------------------------------------------------------------------
|
36
|
678 |
// activateCollectionContentView()
|
34
|
679 |
// ---------------------------------------------------------------------------
|
|
680 |
//
|
36
|
681 |
int VideoListView::activateCollectionContentView(const TMPXItemId &itemId)
|
34
|
682 |
{
|
36
|
683 |
FUNC_LOG;
|
41
|
684 |
|
|
685 |
// resolve collection name if possible
|
|
686 |
if(itemId.iId2 == KVcxMvcMediaTypeCategory && mCollectionName.isEmpty())
|
34
|
687 |
{
|
41
|
688 |
if (itemId.iId1 == KVcxMvcCategoryIdDownloads)
|
|
689 |
{
|
|
690 |
mCollectionName = hbTrId("txt_videos_dblist_downloaded");
|
|
691 |
}
|
|
692 |
else if(itemId.iId1 == KVcxMvcCategoryIdCaptured)
|
|
693 |
{
|
|
694 |
mCollectionName = hbTrId("txt_videos_dblist_captured");
|
|
695 |
}
|
|
696 |
else
|
30
|
697 |
{
|
41
|
698 |
// only downloads and captured are supported in default collections
|
|
699 |
ERROR(-1, "VideoListView::activateVideosView() invalid defauld collection.");
|
|
700 |
return -1;
|
30
|
701 |
}
|
41
|
702 |
}
|
|
703 |
// at this point activation will fail if there's no collection name available
|
|
704 |
if(mCollectionName.isEmpty())
|
|
705 |
{
|
|
706 |
ERROR(-1, "VideoListView::activateVideosView() no collection name, cannot proceed.");
|
|
707 |
return -1;
|
36
|
708 |
}
|
41
|
709 |
|
|
710 |
// if current list at this point is already collection content,
|
|
711 |
// no need to init again, just activate
|
|
712 |
if(mCurrentList &&
|
|
713 |
(mCurrentList->getLevel() == VideoCollectionCommon::ELevelDefaultColl ||
|
|
714 |
mCurrentList->getLevel() == VideoCollectionCommon::ELevelAlbum))
|
36
|
715 |
{
|
41
|
716 |
|
|
717 |
return mCurrentList->activate();
|
|
718 |
}
|
|
719 |
// no currentlist, or currentlist differs, create and initialize all over
|
|
720 |
collectionOpenedSlot(true, mCollectionName, itemId);
|
|
721 |
|
|
722 |
if((!mCurrentList || !mCurrentList->getModel()) ||
|
|
723 |
(mCurrentList->getLevel() != VideoCollectionCommon::ELevelDefaultColl &&
|
|
724 |
mCurrentList->getLevel() != VideoCollectionCommon::ELevelAlbum ))
|
|
725 |
{
|
|
726 |
ERROR(-1, "VideoListView::activateVideosView() failed to init and activate collection.");
|
|
727 |
return -1;
|
30
|
728 |
}
|
34
|
729 |
|
41
|
730 |
// if we're servicing, need to fetch sorting role from client
|
|
731 |
// in normal use, sorting has set already at uiloader
|
|
732 |
|
|
733 |
if (mVideoServices)
|
|
734 |
{
|
|
735 |
// TODO: service sorting roles needs to be defined somewhere
|
|
736 |
int sortRole = mVideoServices->sortRole();
|
63
|
737 |
if(sortRole == XQService::SortTitle)
|
41
|
738 |
{
|
|
739 |
sortRole = VideoCollectionCommon::KeyTitle;
|
|
740 |
}
|
63
|
741 |
else if(sortRole == XQService::SortSize)
|
41
|
742 |
{
|
|
743 |
sortRole = VideoCollectionCommon::KeySizeValue;
|
|
744 |
}
|
|
745 |
else
|
|
746 |
{
|
|
747 |
// default
|
|
748 |
sortRole = VideoCollectionCommon::KeyDateTime;
|
|
749 |
}
|
|
750 |
mCurrentList->getModel()->doSorting(sortRole, Qt::AscendingOrder);
|
|
751 |
}
|
|
752 |
|
|
753 |
return 0;
|
30
|
754 |
}
|
|
755 |
|
|
756 |
// ---------------------------------------------------------------------------
|
|
757 |
// openAllVideosViewSlot()
|
|
758 |
// ---------------------------------------------------------------------------
|
|
759 |
//
|
|
760 |
void VideoListView::openAllVideosViewSlot()
|
|
761 |
{
|
36
|
762 |
FUNC_LOG;
|
34
|
763 |
VideoListWidget *videoListWidget =
|
|
764 |
mUiLoader->findWidget<VideoListWidget>(
|
|
765 |
DOCML_NAME_VC_VIDEOLISTWIDGET);
|
35
|
766 |
|
34
|
767 |
if (mCurrentList &&
|
|
768 |
videoListWidget &&
|
|
769 |
mCurrentList != videoListWidget)
|
|
770 |
{
|
|
771 |
// deactivate old list
|
|
772 |
mCurrentList->deactivate();
|
|
773 |
|
|
774 |
// activate all videos list
|
|
775 |
mCurrentList = videoListWidget;
|
|
776 |
mCurrentList->activate(VideoCollectionCommon::ELevelVideos);
|
|
777 |
|
|
778 |
setHintLevel(VideoHintWidget::AllVideos);
|
38
|
779 |
|
|
780 |
// update the sublabel, as in most cases the data is already up to date.
|
|
781 |
updateSubLabel();
|
34
|
782 |
}
|
30
|
783 |
}
|
|
784 |
|
|
785 |
// ---------------------------------------------------------------------------
|
|
786 |
// openCollectionViewSlot()
|
|
787 |
// ---------------------------------------------------------------------------
|
|
788 |
//
|
|
789 |
void VideoListView::openCollectionViewSlot()
|
|
790 |
{
|
36
|
791 |
FUNC_LOG;
|
34
|
792 |
VideoListWidget *collectionWidget =
|
|
793 |
mUiLoader->findWidget<VideoListWidget>(
|
|
794 |
DOCML_NAME_VC_COLLECTIONWIDGET);
|
35
|
795 |
|
34
|
796 |
if (mCurrentList &&
|
|
797 |
mCurrentList != collectionWidget)
|
|
798 |
{
|
|
799 |
// deactivate all videos widget
|
|
800 |
mCurrentList->deactivate();
|
|
801 |
|
|
802 |
// activate video collection widget
|
|
803 |
mCurrentList = collectionWidget;
|
39
|
804 |
mCurrentList->activate(VideoCollectionCommon::ELevelCategory);
|
36
|
805 |
|
38
|
806 |
// the collection view is not empty, so we should hide the hint in advance.
|
34
|
807 |
showHint(false);
|
38
|
808 |
|
|
809 |
// also update the sublabel immediatelly, as the data is up to date almost always.
|
|
810 |
updateSubLabel();
|
34
|
811 |
}
|
|
812 |
}
|
|
813 |
|
30
|
814 |
// -------------------------------------------------------------------------------------------------
|
|
815 |
// aboutToChangeOrientationSlot()
|
|
816 |
// hide all items in the window during orientation change
|
|
817 |
// -------------------------------------------------------------------------------------------------
|
|
818 |
//
|
|
819 |
void VideoListView::aboutToChangeOrientationSlot()
|
|
820 |
{
|
36
|
821 |
FUNC_LOG;
|
30
|
822 |
// this method is required for changing from to mediawall
|
|
823 |
}
|
|
824 |
|
|
825 |
// -------------------------------------------------------------------------------------------------
|
|
826 |
// orientationChangedSlot()
|
|
827 |
// orientation changed, items can be put back to visible after view has handled the change
|
|
828 |
// -------------------------------------------------------------------------------------------------
|
|
829 |
//
|
|
830 |
void VideoListView::orientationChangedSlot( Qt::Orientation orientation )
|
|
831 |
{
|
36
|
832 |
FUNC_LOG;
|
30
|
833 |
// this method is required for changing from to mediawall
|
|
834 |
|
|
835 |
// in landscape we need to hide the title and the toolbar. (also required for the mediawall?)
|
|
836 |
// TODO: how about the feature where the toolbar comes visible if screen is tapped?
|
|
837 |
this->setItemVisible(Hb::AllItems, orientation == Qt::Vertical);
|
|
838 |
}
|
|
839 |
|
|
840 |
// -------------------------------------------------------------------------------------------------
|
|
841 |
// handleAsyncStatusSlot
|
|
842 |
// -------------------------------------------------------------------------------------------------
|
|
843 |
//
|
|
844 |
void VideoListView::handleAsyncStatusSlot(int statusCode, QVariant &additional)
|
|
845 |
{
|
36
|
846 |
FUNC_LOG;
|
30
|
847 |
// show msg from status
|
|
848 |
mUiUtils.showStatusMsgSlot(statusCode, additional);
|
|
849 |
}
|
|
850 |
|
|
851 |
// -------------------------------------------------------------------------------------------------
|
|
852 |
// collectionOpenedSlot
|
|
853 |
// -------------------------------------------------------------------------------------------------
|
|
854 |
//
|
41
|
855 |
void VideoListView::collectionOpenedSlot(bool openingCollection,
|
34
|
856 |
const QString& collection,
|
41
|
857 |
const TMPXItemId &collectionId)
|
30
|
858 |
{
|
36
|
859 |
FUNC_LOG;
|
49
|
860 |
|
|
861 |
// update / clear collection name
|
|
862 |
mCollectionName = collection;
|
30
|
863 |
|
41
|
864 |
if(openingCollection)
|
30
|
865 |
{
|
49
|
866 |
VideoListWidget *collectionContentWidget =
|
|
867 |
mUiLoader->findWidget<VideoListWidget>(
|
|
868 |
DOCML_NAME_VC_COLLECTIONCONTENTWIDGET);
|
|
869 |
// open album view, mCurrentList might be NULL at this point
|
|
870 |
if (!collectionContentWidget || mCurrentList == collectionContentWidget)
|
37
|
871 |
{
|
49
|
872 |
// collection widget cannot be loaded or
|
|
873 |
// currentlist is already collection content -list
|
34
|
874 |
return;
|
|
875 |
}
|
41
|
876 |
|
37
|
877 |
// get level from the item to be opened only default
|
|
878 |
// or user defined collections can be activated here
|
|
879 |
VideoCollectionCommon::TCollectionLevels level = VideoCollectionCommon::ELevelInvalid;
|
41
|
880 |
if(collectionId.iId2 == KVcxMvcMediaTypeCategory)
|
36
|
881 |
{
|
37
|
882 |
level = VideoCollectionCommon::ELevelDefaultColl;
|
36
|
883 |
}
|
41
|
884 |
else if(collectionId.iId2 == KVcxMvcMediaTypeAlbum)
|
34
|
885 |
{
|
37
|
886 |
level = VideoCollectionCommon::ELevelAlbum;
|
|
887 |
}
|
|
888 |
else
|
|
889 |
{
|
36
|
890 |
return;
|
|
891 |
}
|
49
|
892 |
|
58
|
893 |
VideoProxyModelGeneric *model = collectionContentWidget->getModel();
|
40
|
894 |
if(!model)
|
|
895 |
{
|
|
896 |
// no model for content widget, cannot activate
|
|
897 |
return;
|
|
898 |
}
|
49
|
899 |
|
|
900 |
// disable collection content animations during widget change
|
|
901 |
HbAbstractItemView::ItemAnimations animationState = collectionContentWidget->enabledAnimations();
|
|
902 |
collectionContentWidget->setEnabledAnimations(HbAbstractItemView::None);
|
|
903 |
|
|
904 |
// Start fetching content before changing list widget
|
41
|
905 |
model->openItem(collectionId);
|
36
|
906 |
|
37
|
907 |
// deactivat current widget.
|
41
|
908 |
if(mCurrentList)
|
|
909 |
{
|
|
910 |
mCurrentList->deactivate();
|
|
911 |
}
|
36
|
912 |
|
37
|
913 |
// activate video collection content widget and set it as current list.
|
|
914 |
mCurrentList = collectionContentWidget;
|
|
915 |
mCurrentList->activate(level);
|
|
916 |
|
|
917 |
updateSubLabel();
|
|
918 |
|
|
919 |
// update hint widget for correct content
|
40
|
920 |
mModelReady = model->rowCount() > 0;
|
37
|
921 |
setHintLevel(VideoHintWidget::Collection);
|
63
|
922 |
|
|
923 |
if(mToolbar)
|
37
|
924 |
{
|
63
|
925 |
// if toolbar not yet created, it means that we're activating
|
|
926 |
// for the startup, toolbar will be updated during modelReady()
|
|
927 |
mToolbar->viewStateChanged(level, false, mModelReady);
|
49
|
928 |
}
|
63
|
929 |
|
49
|
930 |
// restore animations for collection content widget
|
|
931 |
collectionContentWidget->setEnabledAnimations(animationState);
|
30
|
932 |
}
|
|
933 |
else
|
|
934 |
{
|
37
|
935 |
// open collection view
|
63
|
936 |
openCollectionViewSlot();
|
|
937 |
|
|
938 |
mToolbar->viewStateChanged(VideoCollectionCommon::ELevelCategory, false, mModelReady);
|
49
|
939 |
}
|
41
|
940 |
if(!mVideoServices)
|
|
941 |
{
|
|
942 |
// save / clear collection related activity data
|
|
943 |
VideoCollectionViewUtils::setCollectionActivityData(collectionId, collection);
|
|
944 |
}
|
34
|
945 |
}
|
|
946 |
|
|
947 |
// -------------------------------------------------------------------------------------------------
|
36
|
948 |
// objectReadySlot
|
34
|
949 |
// -------------------------------------------------------------------------------------------------
|
|
950 |
//
|
36
|
951 |
void VideoListView::objectReadySlot(QObject *object, const QString &name)
|
34
|
952 |
{
|
36
|
953 |
FUNC_LOG;
|
34
|
954 |
if (name.compare(DOCML_NAME_VC_VIDEOLISTWIDGET) == 0)
|
|
955 |
{
|
36
|
956 |
connect(object, SIGNAL(command(int)), this, SIGNAL(command(int)));
|
39
|
957 |
if(mCurrentList != object)
|
|
958 |
{
|
|
959 |
// this widget not yet activated so it's has been created on the second phase
|
|
960 |
// safe to call doDelayed right away
|
|
961 |
qobject_cast<VideoListWidget*>(object)->doDelayedsSlot();
|
|
962 |
}
|
34
|
963 |
}
|
|
964 |
else if (name.compare(DOCML_NAME_VC_COLLECTIONWIDGET) == 0)
|
|
965 |
{
|
|
966 |
connect(
|
41
|
967 |
object, SIGNAL(collectionOpened(bool, const QString&, const TMPXItemId&)),
|
|
968 |
this, SLOT(collectionOpenedSlot(bool, const QString&, const TMPXItemId&)));
|
39
|
969 |
if(mCurrentList != object)
|
|
970 |
{
|
|
971 |
// this widget not yet activated so it's has been created on the second phase
|
|
972 |
// safe to call doDelayed right away
|
|
973 |
qobject_cast<VideoListWidget*>(object)->doDelayedsSlot();
|
|
974 |
}
|
34
|
975 |
}
|
|
976 |
else if (name.compare(DOCML_NAME_VC_COLLECTIONCONTENTWIDGET) == 0)
|
|
977 |
{
|
36
|
978 |
connect(object, SIGNAL(command(int)), this, SIGNAL(command(int)));
|
34
|
979 |
connect(
|
41
|
980 |
object, SIGNAL(collectionOpened(bool, const QString&, const TMPXItemId&)),
|
|
981 |
this, SLOT(collectionOpenedSlot(bool, const QString&, const TMPXItemId&)));
|
39
|
982 |
if(mCurrentList != object)
|
|
983 |
{
|
|
984 |
// this widget not yet activated so it's has been created on the second phase
|
|
985 |
// safe to call doDelayed right away
|
|
986 |
qobject_cast<VideoListWidget*>(object)->doDelayedsSlot();
|
|
987 |
}
|
34
|
988 |
}
|
|
989 |
else if (name.compare(DOCML_NAME_HINT_BUTTON) == 0)
|
|
990 |
{
|
63
|
991 |
connect(object, SIGNAL(clicked(bool)), mToolbar, SLOT(openOperatorServiceSlot()));
|
34
|
992 |
}
|
30
|
993 |
}
|
|
994 |
|
63
|
995 |
// -------------------------------------------------------------------------------------------------
|
|
996 |
// toolbarActionsChanged
|
|
997 |
// -------------------------------------------------------------------------------------------------
|
|
998 |
//
|
|
999 |
void VideoListView::toolbarActionsChanged(QList<QAction*> newActions)
|
30
|
1000 |
{
|
63
|
1001 |
HbToolBar* bar = toolBar();
|
|
1002 |
|
|
1003 |
bar->clearActions();
|
|
1004 |
|
|
1005 |
if(newActions.count() > 0)
|
|
1006 |
{
|
|
1007 |
bar->addActions(newActions);
|
|
1008 |
setItemVisible(Hb::ToolBarItem, true);
|
|
1009 |
}
|
|
1010 |
else
|
|
1011 |
{
|
|
1012 |
setItemVisible(Hb::ToolBarItem, false);
|
|
1013 |
}
|
|
1014 |
}
|
|
1015 |
|
|
1016 |
// -------------------------------------------------------------------------------------------------
|
|
1017 |
// toolbarExtensionChanged
|
|
1018 |
// -------------------------------------------------------------------------------------------------
|
|
1019 |
//
|
|
1020 |
void VideoListView::toolbarExtensionChanged(HbToolBarExtension* newExtension)
|
|
1021 |
{
|
|
1022 |
if(newExtension)
|
|
1023 |
{
|
|
1024 |
HbAction *action = toolBar()->addExtension(newExtension);
|
|
1025 |
HbIcon icon("qtg_mono_video_services");
|
|
1026 |
action->setIcon(icon);
|
|
1027 |
}
|
30
|
1028 |
}
|
|
1029 |
|
38
|
1030 |
// End of file
|