author | hgs |
Thu, 14 Oct 2010 17:54:23 +0530 | |
changeset 72 | 0a8e959402e5 |
parent 71 | 27f2d7aec52a |
permissions | -rw-r--r-- |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
74c9f037fd5d
Revision: 201007
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". |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: ?Description |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
//Includes |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#include <hbmainwindow.h> |
40 | 22 |
#include <hggrid.h> |
23 |
#include <glxmodelwrapper.h> |
|
24 |
#include <hbpushbutton.h> |
|
65 | 25 |
#include <HbToolBar> |
26 |
#include <HbAction> |
|
40 | 27 |
#include <hbiconitem.h> |
28 |
#include <hbicon.h> |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
#include <xqserviceutil.h> |
42 | 30 |
#include <hbcheckbox.h> |
31 |
#include <hblabel.h> |
|
32 |
#include <QString> |
|
33 |
#include <hbframeitem.h> |
|
54 | 34 |
#include <hbgroupbox.h> |
35 |
#include <hbparameterlengthlimiter.h> |
|
36 |
#include <QGraphicsLinearLayout> |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
//User Includes |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
#include "glxviewids.h" |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
#include "glxgridview.h" |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
#include "glxmodelparm.h" |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
#include "glxcommandhandlers.hrh" |
42 | 43 |
#include "glxicondefs.h" |
44 |
#include "glxlocalisationstrings.h" |
|
50 | 45 |
#include "glxsettinginterface.h" |
40 | 46 |
|
54 | 47 |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
#include "OstTraceDefinitions.h" |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
#ifdef OST_TRACE_COMPILER_IN_USE |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
#include "glxgridviewTraces.h" |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
#endif |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
|
72 | 53 |
GlxGridView::GlxGridView( HbMainWindow *window ) |
44 | 54 |
: GlxView ( GLX_GRIDVIEW_ID ), |
72 | 55 |
mWindow( window ), |
56 |
mModel ( NULL ), |
|
57 |
mWidget( NULL ), |
|
58 |
mSelectionModel( NULL ), |
|
59 |
mModelWrapper( NULL ), |
|
60 |
mUiOnButton( NULL ), |
|
61 |
mScrolling( FALSE ), |
|
62 |
mIconItem( NULL ), |
|
63 |
mBackGroundItem( NULL ), |
|
64 |
mMarkCheckBox( NULL ), |
|
65 |
mTotalImagesCountGrpBox( NULL ), |
|
66 |
mMarkSelectHeading( NULL ), |
|
67 |
mMarkCountLabel( NULL ), |
|
68 |
mZeroItemLabel( NULL ), |
|
69 |
mMarkContainer( NULL ), |
|
70 |
mMarkingWidget( NULL ), |
|
65 | 71 |
mToolBar( NULL ), |
72 |
mCurrentToolBar( NULL ) |
|
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
73 |
{ |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
OstTraceFunctionEntry0( GLXGRIDVIEW_GLXGRIDVIEW_ENTRY ); |
40 | 75 |
mModelWrapper = new GlxModelWrapper(); |
76 |
mModelWrapper->setRoles(GlxQImageSmall); |
|
77 |
mIconItem = new HbIconItem(this); |
|
50 | 78 |
mSettings = GlxSettingInterface::instance() ; |
54 | 79 |
|
80 |
mUiOnButton = new HbPushButton(this); |
|
81 |
connect(mUiOnButton, SIGNAL(clicked(bool)), this, SLOT(uiButtonClicked(bool))); |
|
82 |
mUiOnButton->setGeometry(QRectF(590,0,40,40)); |
|
83 |
mUiOnButton->setZValue(1); |
|
84 |
mUiOnButton->setIcon(HbIcon(GLXICON_WALL_UI_ON)); |
|
85 |
mUiOnButton->setObjectName( "UiOn Button" ); |
|
86 |
||
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
OstTraceFunctionExit0( GLXGRIDVIEW_GLXGRIDVIEW_EXIT ); |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
88 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
void GlxGridView::activate() |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
91 |
{ |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
92 |
OstTraceFunctionEntry0( GLXGRIDVIEW_ACTIVATE_ENTRY ); |
40 | 93 |
loadGridView(); |
42 | 94 |
connect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationchanged(Qt::Orientation)),Qt::UniqueConnection); |
72 | 95 |
if(mTotalImagesCountGrpBox == NULL) { |
96 |
mTotalImagesCountGrpBox = new HbGroupBox(this); |
|
97 |
mTotalImagesCountGrpBox->setObjectName( "Count" ); |
|
98 |
mTotalImagesCountGrpBox->hide(); |
|
42 | 99 |
} |
72 | 100 |
resetTransform(); |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
101 |
OstTraceFunctionExit0( GLXGRIDVIEW_ACTIVATE_EXIT ); |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
102 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
104 |
void GlxGridView::deActivate() |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
105 |
{ |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
106 |
OstTraceFunctionEntry0( GLXGRIDVIEW_DEACTIVATE_ENTRY ); |
42 | 107 |
mScrolling = FALSE; |
43 | 108 |
if (mUiOnButton){ |
40 | 109 |
mUiOnButton->hide(); |
44 | 110 |
} |
43 | 111 |
if(mIconItem) { |
40 | 112 |
mIconItem->hide(); |
113 |
mIconItem->resetTransform(); |
|
114 |
mIconItem->setOpacity(0); |
|
115 |
mIconItem->setZValue(mIconItem->zValue()-20); |
|
43 | 116 |
} |
72 | 117 |
if (mTotalImagesCountGrpBox) { |
118 |
mTotalImagesCountGrpBox->hide(); |
|
43 | 119 |
} |
120 |
if(mZeroItemLabel) { |
|
42 | 121 |
mZeroItemLabel->hide(); |
43 | 122 |
} |
54 | 123 |
|
42 | 124 |
disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationchanged(Qt::Orientation))); |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
125 |
OstTraceFunctionExit0( GLXGRIDVIEW_DEACTIVATE_EXIT ); |
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
126 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
|
50 | 128 |
void GlxGridView::initializeView( QAbstractItemModel *model, GlxView *preView ) |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
129 |
{ |
50 | 130 |
Q_UNUSED( preView ) |
40 | 131 |
activate(); |
132 |
setModel(model); |
|
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
133 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
134 |
|
42 | 135 |
void GlxGridView::clearCurrentModel() |
136 |
{ |
|
137 |
if ( mModel ) { |
|
65 | 138 |
disconnect( mModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( rowsInserted() ) ); |
139 |
disconnect( mModel, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( rowsRemoved() ) ); |
|
140 |
disconnect( mModel, SIGNAL(destroyed()), this, SLOT( clearCurrentModel() ) ); |
|
141 |
disconnect( mModel, SIGNAL( albumTitleAvailable( QString ) ), this, SLOT( showAlbumTitle( QString ) ) ); |
|
142 |
disconnect( mModel, SIGNAL( populated() ), this, SLOT( populated() ) ); |
|
143 |
mModel = NULL; |
|
42 | 144 |
} |
145 |
} |
|
146 |
||
147 |
void GlxGridView::initializeNewModel() |
|
148 |
{ |
|
149 |
if ( mModel ) { |
|
65 | 150 |
connect( mModel, SIGNAL( rowsInserted( QModelIndex, int, int ) ), this, SLOT( rowsInserted() ) ); |
151 |
connect( mModel, SIGNAL( rowsRemoved( QModelIndex, int, int ) ), this, SLOT( rowsRemoved() ) ); |
|
152 |
connect( mModel, SIGNAL(destroyed()), this, SLOT( clearCurrentModel() ) ); |
|
153 |
if ( getSubState() == ALBUM_ITEM_S ) { |
|
154 |
connect( mModel, SIGNAL( albumTitleAvailable( QString ) ), this, SLOT( showAlbumTitle( QString ) ) ); |
|
54 | 155 |
} |
65 | 156 |
connect( mModel, SIGNAL( populated() ), this, SLOT( populated() ) ); |
42 | 157 |
} |
158 |
} |
|
159 |
||
65 | 160 |
void GlxGridView::setModel( QAbstractItemModel *model ) |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
161 |
{ |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
162 |
OstTraceFunctionEntry0( GLXGRIDVIEW_SETMODEL_ENTRY ); |
65 | 163 |
if( model ) { |
42 | 164 |
clearCurrentModel(); |
165 |
mModel = model; |
|
166 |
initializeNewModel(); |
|
65 | 167 |
|
40 | 168 |
QVariant variantimage = mModel->data(mModel->index(0,0),GlxDefaultImage); |
65 | 169 |
if ( variantimage.isValid() && variantimage.canConvert<QImage> () ) { |
170 |
mWidget->setDefaultImage( variantimage.value<QImage>() ); |
|
171 |
} |
|
172 |
||
173 |
mModelWrapper->setModel( mModel ); |
|
174 |
mWidget->setModel( mModelWrapper ); |
|
175 |
||
176 |
if( !mSelectionModel ) { |
|
177 |
mSelectionModel = new QItemSelectionModel( mModelWrapper, this ); |
|
178 |
connect( mSelectionModel, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ), this, SLOT( visibleIndexChanged( const QModelIndex &, const QModelIndex & ) ) ); |
|
179 |
mWidget->setSelectionModel( mSelectionModel ); |
|
180 |
} |
|
181 |
||
182 |
scrolltofocus(); // Need to do it here ? |
|
42 | 183 |
showItemCount(); |
65 | 184 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
185 |
OstTraceFunctionExit0( GLXGRIDVIEW_SETMODEL_EXIT ); |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
186 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
187 |
|
40 | 188 |
void GlxGridView::visibleIndexChanged(const QModelIndex& current, const QModelIndex& previous) |
189 |
{ |
|
190 |
if(mScrolling) |
|
191 |
{ |
|
192 |
Q_UNUSED(previous); |
|
193 |
if(current.row() >= 0 || current.row() < mModel->rowCount()) |
|
194 |
{ |
|
195 |
mModel->setData(mModel->index(0,0),current.row(),GlxVisualWindowIndex); |
|
196 |
} |
|
197 |
} |
|
198 |
} |
|
199 |
||
44 | 200 |
void GlxGridView::addToolBar( HbToolBar *toolBar ) |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
201 |
{ |
44 | 202 |
OstTraceFunctionEntry0( GLXGRIDVIEW_ADDTOOLBAR_ENTRY ); |
65 | 203 |
|
204 |
//For album grid view, add and remove from album tool bar will be shown |
|
205 |
int subState = getSubState(); |
|
206 |
if ( subState == ALBUM_ITEM_S && mWidget->selectionMode() == HgWidget::NoSelection ) { |
|
207 |
if ( !mToolBar ) { |
|
208 |
createAlbumGridToolBar(); |
|
209 |
} |
|
210 |
if ( mToolBar ) { |
|
211 |
//remove from action will be disable if number of images in the album grid is zero. |
|
212 |
if ( mModel->rowCount() ) { |
|
213 |
mToolBar->actions().at(0)->setEnabled( true ); //To:Do remove once selection dialog is implemented |
|
214 |
mToolBar->actions().at(1)->setEnabled( true ); |
|
215 |
} |
|
216 |
else { |
|
217 |
mToolBar->actions().at(0)->setEnabled( false ); |
|
218 |
mToolBar->actions().at(1)->setEnabled( false ); |
|
219 |
} |
|
220 |
if ( mToolBar != mCurrentToolBar ) { |
|
221 |
takeToolBar(); |
|
222 |
setToolBar( mToolBar ); |
|
223 |
mCurrentToolBar = mToolBar; |
|
224 |
} |
|
225 |
} |
|
226 |
} |
|
227 |
else { |
|
228 |
if ( toolBar != mCurrentToolBar ) { |
|
229 |
takeToolBar(); |
|
230 |
setToolBar( toolBar ); |
|
231 |
mCurrentToolBar = toolBar; |
|
232 |
} |
|
233 |
} |
|
234 |
||
54 | 235 |
showHbItems(); |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
236 |
OstTraceFunctionExit0( GLXGRIDVIEW_ADDTOOLBAR_EXIT ); |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
237 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
238 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
239 |
void GlxGridView::enableMarking() |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
240 |
{ |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
241 |
OstTrace0( TRACE_NORMAL, GLXGRIDVIEW_ENABLEMARKING, "GlxGridView::enableMarking" ); |
40 | 242 |
mWidget->setSelectionMode(HgWidget::MultiSelection); |
54 | 243 |
|
69 | 244 |
if (mMarkingWidget == NULL) { |
54 | 245 |
mMarkingWidget = new HbWidget(this); |
246 |
mMarkContainer = new QGraphicsLinearLayout(Qt::Horizontal, 0); |
|
247 |
mMarkingWidget->setLayout(mMarkContainer); |
|
248 |
||
249 |
mMarkSelectHeading = new HbGroupBox(this); |
|
250 |
mMarkSelectHeading->setHeading(GLX_SELECT_IMAGES); |
|
251 |
mMarkSelectHeading->setObjectName("Select Photos"); |
|
252 |
||
253 |
mMarkCountLabel = new HbLabel(mMarkingWidget); |
|
254 |
mMarkCountLabel->setObjectName("MarkCount"); |
|
255 |
mMarkCountLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); |
|
256 |
||
257 |
mMarkCheckBox = new HbCheckBox(GLX_LABEL_MARK_ALL, mMarkingWidget); |
|
258 |
mMarkCheckBox->setObjectName("CheckB MarkAll"); |
|
259 |
||
260 |
mMarkContainer->addItem(mMarkCheckBox); |
|
261 |
mMarkContainer->addItem(mMarkCountLabel); |
|
69 | 262 |
} |
42 | 263 |
|
69 | 264 |
hideorshowitems( mWindow->orientation() ); |
42 | 265 |
|
69 | 266 |
connect( mWidget->selectionModel() , SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection& ) ), this, SLOT( showMarkedItemCount() ) ); |
267 |
connect( mMarkCheckBox, SIGNAL( stateChanged( int ) ), this, SLOT( stateChanged( int ) )); |
|
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
268 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
269 |
|
44 | 270 |
void GlxGridView::disableMarking() |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
271 |
{ |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
272 |
OstTrace0( TRACE_NORMAL, GLXGRIDVIEW_DISABLEMARKING, "GlxGridView::disableMarking" ); |
40 | 273 |
mWidget->setSelectionMode(HgWidget::NoSelection); |
42 | 274 |
disconnect( mWidget->selectionModel() , SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection& ) ), this, SLOT( showMarkedItemCount() ) ); |
275 |
disconnect(mMarkCheckBox, SIGNAL( stateChanged(int) ), this, SLOT( stateChanged(int))); |
|
54 | 276 |
|
277 |
if (mMarkSelectHeading) { |
|
278 |
mMarkSelectHeading->hide(); |
|
42 | 279 |
} |
280 |
||
54 | 281 |
if (mMarkingWidget) { |
282 |
mMarkingWidget->hide(); |
|
58 | 283 |
} |
54 | 284 |
|
58 | 285 |
if (mMarkCheckBox) { |
286 |
mMarkCheckBox->setCheckState(Qt::Unchecked); |
|
287 |
} |
|
288 |
||
54 | 289 |
showHbItems(); |
42 | 290 |
} |
291 |
||
292 |
void GlxGridView::stateChanged(int state) |
|
293 |
{ |
|
294 |
if(state) |
|
295 |
handleUserAction(EGlxCmdMarkAll); |
|
296 |
else |
|
297 |
handleUserAction(EGlxCmdUnMarkAll); |
|
298 |
} |
|
299 |
||
300 |
void GlxGridView::showMarkedItemCount() |
|
301 |
{ |
|
302 |
int count = mModel->rowCount(); |
|
303 |
QModelIndexList indexList = mWidget->selectionModel()->selectedIndexes(); |
|
69 | 304 |
int markItemCount = indexList.count(); |
305 |
QString text = HbParameterLengthLimiter(GLX_LABEL_MARK_COUNT).arg(markItemCount).arg(count); |
|
306 |
mMarkCountLabel->setPlainText(text); |
|
307 |
||
308 |
//Block The signals generated by the CheckBox |
|
309 |
//if we dont block the signals , then when we call setCheckState to selected and unselect the CheckBox |
|
310 |
//it causes state change signal to emit which will cause either mark all or un mark all of teh images. |
|
311 |
mMarkCheckBox->blockSignals(TRUE); |
|
312 |
if (markItemCount != count && mMarkCheckBox->checkState() == Qt::Checked) { |
|
313 |
//if the mark all option was checked and then the user un marks an slected item |
|
314 |
//Then we have to un check the Mark All check Box |
|
315 |
mMarkCheckBox->setCheckState(Qt::Unchecked); |
|
316 |
} |
|
317 |
else if (markItemCount == count) { |
|
318 |
//if all the images are selected/marked Indiduvally |
|
319 |
//Then the the Mark All check Box has to checked/Selected |
|
320 |
mMarkCheckBox->setCheckState(Qt::Checked); |
|
321 |
} |
|
322 |
//UnBlock The signals generated by the CheckBox |
|
323 |
mMarkCheckBox->blockSignals(FALSE); |
|
42 | 324 |
} |
325 |
||
326 |
void GlxGridView::showItemCount() |
|
327 |
{ |
|
328 |
int count = 0; |
|
65 | 329 |
if( mModel ) { |
42 | 330 |
count = mModel->rowCount(); |
331 |
QSize deviceSize = HbDeviceProfile::current().logicalSize(); |
|
332 |
QSize screenSize = ( mWindow->orientation() == Qt::Vertical ) ? QSize( deviceSize.width(), deviceSize.height() ) |
|
333 |
: QSize( deviceSize.height(), deviceSize.width() ) ; |
|
65 | 334 |
if( count ) { |
42 | 335 |
if(mZeroItemLabel) { |
336 |
mZeroItemLabel->hide(); |
|
337 |
} |
|
54 | 338 |
|
65 | 339 |
if( isItemVisible( Hb::TitleBarItem ) ) { |
42 | 340 |
QString text; |
71 | 341 |
if(XQServiceUtil::isService() && (0 == XQServiceUtil::interfaceName().compare(QLatin1String("com.nokia.symbian.IImageFetch")))) { |
342 |
showAlbumTitle(GLX_SELECT_IMAGE); |
|
343 |
} |
|
344 |
else if ( getSubState() == ALL_ITEM_S || ( getSubState() == FETCHER_ITEM_S)) { |
|
72 | 345 |
text = HbParameterLengthLimiter(GLX_GRID_VIEW_COUNT_LABEL).arg(count); |
346 |
mTotalImagesCountGrpBox->setHeading ( text ); |
|
347 |
mTotalImagesCountGrpBox->setGeometry(QRectF(0,0,screenSize.width(),deviceSize.height()/24)); |
|
348 |
mTotalImagesCountGrpBox->show(); |
|
42 | 349 |
} |
72 | 350 |
else if ( getSubState() == ALBUM_ITEM_S || (getSubState() == FETCHER_ALBUM_ITEM_S) ) { |
351 |
mTotalImagesCountGrpBox->hide(); |
|
42 | 352 |
QVariant variant = mModel->data(mModel->index(0,0),GlxViewTitle); |
353 |
if (variant.toString() != NULL) { |
|
354 |
showAlbumTitle(variant.toString()); |
|
355 |
} |
|
356 |
} |
|
357 |
} |
|
358 |
else { |
|
72 | 359 |
if (mTotalImagesCountGrpBox) { |
360 |
mTotalImagesCountGrpBox->hide(); |
|
42 | 361 |
} |
362 |
} |
|
363 |
||
364 |
} |
|
365 |
else { |
|
366 |
bool populated = FALSE; |
|
367 |
QVariant variant = mModel->data(mModel->index(0,0),GlxPopulated); |
|
368 |
if (variant.isValid() && variant.canConvert<bool>() ) |
|
369 |
{ |
|
370 |
populated = variant.value<bool>(); |
|
371 |
} |
|
372 |
if(populated) { |
|
44 | 373 |
showNoImageString(); |
72 | 374 |
if(!(XQServiceUtil::isService() && |
375 |
(0 == XQServiceUtil::interfaceName().compare(QLatin1String("com.nokia.symbian.IImageFetch"))))) |
|
376 |
{ |
|
377 |
if( getSubState() == ALL_ITEM_S || getSubState() == FETCHER_ITEM_S) { |
|
378 |
QString text; |
|
379 |
text = HbParameterLengthLimiter(GLX_GRID_VIEW_COUNT_LABEL).arg(count); |
|
380 |
mTotalImagesCountGrpBox->setHeading ( text ); |
|
381 |
mTotalImagesCountGrpBox->setGeometry(QRectF(0,0,screenSize.width(),deviceSize.height()/24)); |
|
382 |
mTotalImagesCountGrpBox->show(); |
|
383 |
} |
|
384 |
else if (getSubState() == ALBUM_ITEM_S || getSubState() == FETCHER_ALBUM_ITEM_S) { |
|
385 |
QVariant variant = mModel->data(mModel->index(0,0),GlxViewTitle); |
|
386 |
if (variant.toString() != NULL) { |
|
387 |
showAlbumTitle(variant.toString()); |
|
388 |
} |
|
42 | 389 |
} |
44 | 390 |
} |
42 | 391 |
} |
392 |
} |
|
393 |
} |
|
394 |
} |
|
395 |
||
396 |
void GlxGridView::showAlbumTitle(QString aTitle) |
|
397 |
{ |
|
398 |
int count = mModel->rowCount(); |
|
399 |
QSize deviceSize = HbDeviceProfile::current().logicalSize(); |
|
400 |
QSize screenSize = ( mWindow->orientation() == Qt::Vertical ) ? QSize( deviceSize.width(), deviceSize.height() ) |
|
401 |
: QSize( deviceSize.height(), deviceSize.width() ) ; |
|
54 | 402 |
//If fetcher service set only title text |
72 | 403 |
if ((XQServiceUtil::isService()) && isItemVisible(Hb::TitleBarItem) && |
404 |
(0 == XQServiceUtil::interfaceName().compare(QLatin1String("com.nokia.symbian.IImageFetch")))) |
|
69 | 405 |
{ |
72 | 406 |
mTotalImagesCountGrpBox->setHeading(aTitle); |
407 |
mTotalImagesCountGrpBox->setGeometry(QRectF(0, 0, screenSize.width(),deviceSize.height() / 24)); |
|
408 |
mTotalImagesCountGrpBox->show(); |
|
54 | 409 |
} |
410 |
else |
|
411 |
{ //handle album tiltle and count display logic here |
|
58 | 412 |
if (isItemVisible(Hb::TitleBarItem)) |
54 | 413 |
{ |
69 | 414 |
QString text = HbParameterLengthLimiter(GLX_ALBUM_NAME_COUNT_LABEL).arg(aTitle).arg(count); |
72 | 415 |
mTotalImagesCountGrpBox->setHeading(text); |
416 |
mTotalImagesCountGrpBox->setGeometry(QRectF(0, 0, screenSize.width(),deviceSize.height()/24)); |
|
417 |
mTotalImagesCountGrpBox->show(); |
|
54 | 418 |
} |
419 |
} |
|
42 | 420 |
} |
421 |
||
422 |
void GlxGridView::showNoImageString() |
|
423 |
{ |
|
424 |
qreal chromeHeight = 0.0; |
|
425 |
QSize deviceSize = HbDeviceProfile::current().logicalSize(); |
|
426 |
QSize screenSize = ( mWindow->orientation() == Qt::Vertical ) ? QSize( deviceSize.width(), deviceSize.height() ) |
|
427 |
: QSize( deviceSize.height(), deviceSize.width() ) ; |
|
428 |
qreal midHeight = screenSize.height()/2; |
|
429 |
if (isItemVisible(Hb::TitleBarItem)) { |
|
430 |
style()->parameter("hb-param-widget-chrome-height", chromeHeight); |
|
431 |
midHeight -= chromeHeight; |
|
432 |
} |
|
44 | 433 |
if (mZeroItemLabel == NULL) { |
434 |
QString displayText(GLX_GRID_NO_IMAGE); |
|
435 |
mZeroItemLabel = new HbLabel(displayText, this); |
|
45 | 436 |
mZeroItemLabel->setObjectName( "No Image" ); |
42 | 437 |
} |
438 |
mZeroItemLabel->setGeometry(QRectF(0, midHeight - deviceSize.height()/16, screenSize.width(), 3*deviceSize.height()/32)); |
|
439 |
mZeroItemLabel->setAlignment(Qt::AlignHCenter); |
|
440 |
mZeroItemLabel->show(); |
|
54 | 441 |
|
42 | 442 |
} |
443 |
||
444 |
void GlxGridView::populated() |
|
445 |
{ |
|
65 | 446 |
QVariant variant = mModelWrapper->data(mModelWrapper->index(0,0), GlxVisualWindowIndex ); |
447 |
int visualIndex = 0; |
|
448 |
if ( variant.isValid() && variant.canConvert<int> () ) { |
|
449 |
visualIndex = variant.value<int>(); |
|
450 |
} |
|
451 |
mWidget->scrollTo(mModelWrapper->index(visualIndex,0)); |
|
452 |
showItemCount(); |
|
453 |
} |
|
454 |
||
455 |
void GlxGridView::rowsInserted() |
|
456 |
{ |
|
42 | 457 |
showItemCount(); |
65 | 458 |
if( getSubState() == ALBUM_ITEM_S && mToolBar ) { |
459 |
mToolBar->actions().at(0)->setEnabled( true ); //To:Do remove once selection dialog is implemented |
|
460 |
mToolBar->actions().at(1)->setEnabled( true ); |
|
461 |
} |
|
462 |
} |
|
463 |
||
464 |
void GlxGridView::rowsRemoved() |
|
465 |
{ |
|
466 |
showItemCount(); |
|
467 |
if( getSubState() == ALBUM_ITEM_S && mModel->rowCount() == 0 && mToolBar ) { |
|
468 |
mToolBar->actions().at(0)->setEnabled( false ); //To:Do remove once selection dialog is implemented |
|
469 |
mToolBar->actions().at(1)->setEnabled( false ); |
|
470 |
} |
|
471 |
} |
|
472 |
||
473 |
void GlxGridView::handleToolBarAction() |
|
474 |
{ |
|
475 |
HbAction *action = qobject_cast<HbAction*>( sender() ); |
|
476 |
qint32 commandId = action->data().toInt(); |
|
477 |
emit actionTriggered( commandId ); |
|
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
478 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
479 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
480 |
void GlxGridView::handleUserAction(qint32 commandId) |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
481 |
{ |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
482 |
OstTrace0( TRACE_NORMAL, GLXGRIDVIEW_HANDLEUSERACTION, "GlxGridView::handleUserAction" ); |
40 | 483 |
switch( commandId ) { |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
484 |
case EGlxCmdMarkAll : |
40 | 485 |
mWidget->selectAll(); |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
486 |
break; |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
487 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
488 |
case EGlxCmdUnMarkAll : |
40 | 489 |
mWidget->clearSelection(); |
44 | 490 |
break; |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
491 |
|
50 | 492 |
case EGlxCmd3DEffectOn: |
493 |
mSettings->setmediaWall3DEffect(1); |
|
494 |
if(mWidget && !mWidget->effect3dEnabled()) |
|
495 |
mWidget->setEffect3dEnabled(ETrue); |
|
496 |
break; |
|
497 |
||
498 |
case EGlxCmd3DEffectOff: |
|
499 |
mSettings->setmediaWall3DEffect(0); |
|
500 |
if(mWidget && mWidget->effect3dEnabled()) |
|
501 |
mWidget->setEffect3dEnabled(EFalse); |
|
502 |
break; |
|
503 |
||
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
504 |
default : |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
505 |
break; |
44 | 506 |
} |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
507 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
508 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
509 |
QItemSelectionModel * GlxGridView::getSelectionModel() |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
510 |
{ |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
511 |
OstTrace0( TRACE_NORMAL, GLXGRIDVIEW_GETSELECTIONMODEL, "GlxGridView::getSelectionModel" ); |
40 | 512 |
return mWidget->selectionModel(); |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
513 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
514 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
515 |
QGraphicsItem * GlxGridView::getAnimationItem(GlxEffect transitionEffect) |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
516 |
{ |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
517 |
OstTraceFunctionEntry0( GLXGRIDVIEW_GETANIMATIONITEM_ENTRY ); |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
518 |
int selIndex = -1; |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
519 |
|
69 | 520 |
if ( transitionEffect == FULLSCREEN_TO_GRID || transitionEffect == FULLSCREEN_TO_GRID_PORTRAIT ) { |
72 | 521 |
if ( !mBackGroundItem ) { |
522 |
mBackGroundItem = new HbIconItem(); |
|
523 |
setBackgroundItem( mBackGroundItem ); |
|
524 |
} |
|
525 |
HbIcon icon = HbIcon( mWindow->backgroundImageName( mWindow->orientation() ) ); |
|
526 |
mBackGroundItem->setIcon( icon ); |
|
527 |
return this; |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
528 |
} |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
529 |
|
69 | 530 |
if ( transitionEffect == GRID_TO_FULLSCREEN ) { |
531 |
QVariant variant = mModel->data( mModel->index( 0, 0 ), GlxFocusIndexRole ); |
|
532 |
if ( variant.isValid() && variant.canConvert<int> () ) { |
|
533 |
selIndex = variant.value<int> (); |
|
534 |
} |
|
535 |
else { |
|
40 | 536 |
return mWidget; |
69 | 537 |
} |
538 |
QVariant variantimage = mModel->data( mModel->index( selIndex, 0 ), Qt::DecorationRole ); |
|
539 |
if ( variantimage.isValid() && variantimage.canConvert<HbIcon> () ) { |
|
40 | 540 |
QPolygonF poly; |
69 | 541 |
if ( mModelWrapper && !mWidget->getItemOutline( mModelWrapper->index( selIndex, 0 ), poly ) ) { |
40 | 542 |
return mWidget; |
69 | 543 |
} |
40 | 544 |
QRectF itemRect = poly.boundingRect(); |
545 |
||
69 | 546 |
mIconItem->setSize( QSize( 120, 120 ) ); |
547 |
HbIcon tempIcon = variantimage.value<HbIcon> (); |
|
548 |
QPixmap tempPixmap = tempIcon.qicon().pixmap( 120, 120 ); |
|
549 |
QSize sz = QSize( 120, 120 ); |
|
550 |
tempPixmap = tempPixmap.scaled( sz, Qt::IgnoreAspectRatio ); |
|
551 |
HbIcon tmp = HbIcon( QIcon( tempPixmap ) ); |
|
552 |
mIconItem->setIcon( tmp ); |
|
553 |
mIconItem->setPos( itemRect.topLeft() ); |
|
554 |
mIconItem->setZValue( mIconItem->zValue() + 20 ); |
|
40 | 555 |
mIconItem->show(); |
69 | 556 |
if ( mToolBar ) { |
557 |
mToolBar->setZValue( mIconItem->zValue() - 5 ); |
|
40 | 558 |
} |
69 | 559 |
return mIconItem; |
560 |
} |
|
561 |
else { |
|
40 | 562 |
return mWidget; |
563 |
} |
|
69 | 564 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
565 |
|
69 | 566 |
if ( transitionEffect == GRID_TO_ALBUMLIST || transitionEffect == ALBUMLIST_TO_GRID ) { |
72 | 567 |
return this; |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
568 |
} |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
569 |
OstTraceFunctionExit0( GLXGRIDVIEW_GETANIMATIONITEM_EXIT ); |
44 | 570 |
return NULL; |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
571 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
572 |
|
40 | 573 |
void GlxGridView::loadGridView() |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
574 |
{ |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
575 |
OstTraceFunctionEntry0( GLXGRIDVIEW_LOADGRIDVIEW_ENTRY ); |
40 | 576 |
if(mWidget == NULL) { |
577 |
Qt::Orientation orient = mWindow->orientation(); |
|
578 |
mWindow->viewport()->grabGesture(Qt::PanGesture); |
|
579 |
mWindow->viewport()->grabGesture(Qt::TapGesture); |
|
580 |
mWindow->viewport()->grabGesture(Qt::TapAndHoldGesture); |
|
581 |
mWidget = new HgGrid(orient); |
|
45 | 582 |
mWidget->setObjectName( "Media Wall" ); |
40 | 583 |
mWidget->setLongPressEnabled(true); |
44 | 584 |
mWidget->setScrollBarPolicy(HgWidget::ScrollBarAutoHide); |
72 | 585 |
if(XQServiceUtil::isService()) { |
50 | 586 |
mWidget->setEffect3dEnabled(EFalse); |
72 | 587 |
} |
588 |
else { |
|
50 | 589 |
mWidget->setEffect3dEnabled(mSettings->mediaWall3DEffect()); |
72 | 590 |
} |
44 | 591 |
setWidget( mWidget ); |
40 | 592 |
addViewConnection(); |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
593 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
594 |
OstTraceFunctionExit0( GLXGRIDVIEW_LOADGRIDVIEW_EXIT ); |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
595 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
596 |
|
40 | 597 |
void GlxGridView::orientationchanged(Qt::Orientation orient) |
598 |
{ |
|
54 | 599 |
if (mWidget && mWidget->selectionMode() == HgWidget::MultiSelection) { |
600 |
hideorshowitems(orient); |
|
601 |
} |
|
602 |
showHbItems(); |
|
40 | 603 |
} |
54 | 604 |
|
40 | 605 |
void GlxGridView::hideorshowitems(Qt::Orientation orient) |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
606 |
{ |
44 | 607 |
if ( mWidget && mWidget->selectionMode() == HgWidget::NoSelection ) { |
608 |
if( orient == Qt::Horizontal ) { |
|
42 | 609 |
setItemVisible(Hb::AllItems, FALSE) ; |
610 |
setViewFlags(viewFlags() | HbView::ViewTitleBarHidden | HbView::ViewStatusBarHidden); |
|
45 | 611 |
showItemCount(); |
612 |
if(mUiOnButton == NULL) { |
|
613 |
mUiOnButton = new HbPushButton(this); |
|
614 |
connect(mUiOnButton, SIGNAL(clicked(bool)), this, SLOT(uiButtonClicked(bool))); |
|
615 |
mUiOnButton->setGeometry(QRectF(590,0,40,40)); |
|
616 |
mUiOnButton->setZValue(1); |
|
617 |
mUiOnButton->setIcon(HbIcon(GLXICON_WALL_UI_ON)); |
|
618 |
mUiOnButton->setObjectName( "UiOn Button" ); |
|
40 | 619 |
} |
45 | 620 |
mUiOnButton->show(); |
44 | 621 |
} |
622 |
else { |
|
42 | 623 |
showHbItems(); |
44 | 624 |
} |
42 | 625 |
} |
44 | 626 |
else if (mWidget && mWidget->selectionMode() == HgWidget::MultiSelection) { |
54 | 627 |
setItemVisible(Hb::AllItems, FALSE) ; |
628 |
setViewFlags(viewFlags() | HbView::ViewTitleBarHidden | HbView::ViewStatusBarHidden); |
|
42 | 629 |
if (mUiOnButton) { |
630 |
mUiOnButton->hide(); |
|
40 | 631 |
} |
72 | 632 |
if (mTotalImagesCountGrpBox) { |
633 |
mTotalImagesCountGrpBox->hide(); |
|
40 | 634 |
} |
54 | 635 |
|
42 | 636 |
QSize deviceSize = HbDeviceProfile::current().logicalSize(); |
637 |
QSize screenSize = ( mWindow->orientation() == Qt::Vertical ) ? QSize( deviceSize.width(), deviceSize.height() ) |
|
638 |
: QSize( deviceSize.height(), deviceSize.width() ) ; |
|
54 | 639 |
|
640 |
mMarkSelectHeading->setGeometry(QRectF(0,0,screenSize.width(),deviceSize.height()/24)); |
|
641 |
mMarkingWidget->setGeometry(QRectF(0,deviceSize.height()/24,screenSize.width(),deviceSize.height()/72)); |
|
642 |
||
643 |
mMarkSelectHeading->show(); |
|
69 | 644 |
mMarkingWidget->show(); |
645 |
showMarkedItemCount(); |
|
42 | 646 |
} |
40 | 647 |
} |
648 |
||
649 |
void GlxGridView::scrolltofocus() |
|
650 |
{ |
|
651 |
if(mModelWrapper && mWidget) |
|
652 |
{ |
|
44 | 653 |
QVariant variant = mModelWrapper->data( mModelWrapper->index(0,0), GlxFocusIndexRole ); |
654 |
if ( variant.isValid() && variant.canConvert<int> () ) |
|
40 | 655 |
{ |
656 |
mWidget->scrollTo( mModelWrapper->index( variant.value<int>(),0) ); |
|
657 |
mModel->setData(mModel->index(0,0),variant.value<int>(),GlxVisualWindowIndex); |
|
658 |
} |
|
659 |
} |
|
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
660 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
661 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
662 |
|
40 | 663 |
void GlxGridView::addViewConnection() |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
664 |
{ |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
665 |
OstTrace0( TRACE_NORMAL, GLXGRIDVIEW_ADDVIEWCONNECTION, "GlxGridView::addViewConnection" ); |
40 | 666 |
//connect(mWindow, SIGNAL(aboutToChangeOrientation()), mWidget, SLOT(aboutToChangeOrientation())); |
667 |
connect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), mWidget, SLOT(orientationChanged(Qt::Orientation))); |
|
668 |
connect(mWidget, SIGNAL(activated(const QModelIndex &)), SLOT( itemSelected(const QModelIndex &))); |
|
669 |
connect(mWidget, SIGNAL( scrollingStarted() ), this, SLOT( scrollingStarted() ) ); |
|
670 |
connect(mWidget, SIGNAL( scrollingEnded() ), this, SLOT( scrollingEnded() ) ); |
|
671 |
connect(mWidget, SIGNAL(longPressed(const QModelIndex &, QPointF)), SLOT( indicateLongPress(const QModelIndex &, QPointF) ) ); |
|
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
672 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
673 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
674 |
void GlxGridView::removeViewConnection () |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
675 |
{ |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
676 |
OstTrace0( TRACE_NORMAL, GLXGRIDVIEW_REMOVEVIEWCONNECTION, "GlxGridView::removeViewConnection" ); |
40 | 677 |
if(mWidget) |
678 |
{ |
|
679 |
//disconnect(mWindow, SIGNAL(aboutToChangeOrientation()), mWidget, SLOT(aboutToChangeOrientation())); |
|
680 |
disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), mWidget, SLOT(orientationChanged(Qt::Orientation))); |
|
681 |
disconnect(mWidget, SIGNAL(activated(const QModelIndex &)),this, SLOT( itemSelected(const QModelIndex &))); |
|
682 |
disconnect(mWidget, SIGNAL( scrollingStarted() ), this, SLOT( scrollingStarted() ) ); |
|
683 |
disconnect(mWidget, SIGNAL( scrollingEnded() ), this, SLOT( scrollingEnded() ) ); |
|
684 |
disconnect(mWidget, SIGNAL(longPressed(const QModelIndex &, QPointF)),this, SLOT( indicateLongPress(const QModelIndex &, QPointF) ) ); |
|
685 |
} |
|
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
686 |
} |
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
687 |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
688 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
689 |
void GlxGridView::itemSelected(const QModelIndex & index) |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
690 |
{ |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
691 |
OstTrace1( TRACE_NORMAL, GLXGRIDVIEW_ITEMSELECTED, "GlxGridView::itemSelected;index=%d", index.row() ); |
44 | 692 |
if ( mWidget->selectionMode() == HgWidget::MultiSelection ) { |
26
c499df2dbb33
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
693 |
return ; |
44 | 694 |
} |
695 |
OstTraceEventStart0( EVENT_DUP1_GLXGRIDVIEW_ITEMSELECTED_START, "Fullscreen Launch Time" ); |
|
696 |
if ( mModel ) { |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
697 |
mModel->setData( index, index.row(), GlxFocusIndexRole ); |
44 | 698 |
} |
71 | 699 |
if(XQServiceUtil::isService() ){ |
700 |
if(0 == XQServiceUtil::interfaceName().compare(QLatin1String("com.nokia.symbian.IImageFetch"))){ |
|
701 |
qDebug("GlxGridView::itemSelected actionTriggered( EGlxCmdFetcherSelect )" ); |
|
702 |
emit actionTriggered( EGlxCmdFetcherSelect ); |
|
703 |
} |
|
704 |
else{ |
|
705 |
emit actionTriggered( EGlxCmdBrowseFullScreenOpen); |
|
706 |
} |
|
54 | 707 |
} |
71 | 708 |
else{ |
709 |
emit actionTriggered( EGlxCmdFullScreenOpen ); |
|
710 |
} |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
711 |
OstTraceEventStop( EVENT_DUP1_GLXGRIDVIEW_ITEMSELECTED_STOP, "Fullscreen Launch Time", EVENT_DUP1_GLXGRIDVIEW_ITEMSELECTED_START ); |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
712 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
713 |
|
40 | 714 |
void GlxGridView::scrollingStarted() |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
715 |
{ |
54 | 716 |
if ((mWindow->orientation() == Qt::Horizontal)/* && mWidget->selectionMode() == HgWidget::NoSelection*/) |
40 | 717 |
{ |
718 |
setItemVisible(Hb::AllItems, FALSE) ; |
|
42 | 719 |
setViewFlags(viewFlags() | HbView::ViewTitleBarHidden | HbView::ViewStatusBarHidden); |
720 |
if (mUiOnButton) |
|
721 |
{ |
|
722 |
mUiOnButton->hide(); |
|
723 |
} |
|
72 | 724 |
if (mTotalImagesCountGrpBox) { |
725 |
mTotalImagesCountGrpBox->hide(); |
|
42 | 726 |
} |
727 |
} |
|
728 |
||
40 | 729 |
mScrolling = TRUE; |
730 |
} |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
731 |
|
40 | 732 |
void GlxGridView::scrollingEnded() |
733 |
{ |
|
734 |
mScrolling = FALSE; |
|
65 | 735 |
if ( mUiOnButton && ( mWindow->orientation() == Qt::Horizontal ) ) { |
42 | 736 |
mUiOnButton->show(); |
65 | 737 |
} |
738 |
||
40 | 739 |
QList<QModelIndex> visibleIndex = mWidget->getVisibleItemIndices(); |
65 | 740 |
if ( visibleIndex.count() <= 0 ) { |
40 | 741 |
return; |
65 | 742 |
} |
40 | 743 |
QModelIndex index = visibleIndex.at(0); |
65 | 744 |
|
745 |
if(mModel) { |
|
746 |
if ( index.row() < 0 || index.row() >= mModel->rowCount() ) { |
|
747 |
return; |
|
44 | 748 |
} |
65 | 749 |
mModel->setData( index, index.row(), GlxVisualWindowIndex ); |
750 |
} |
|
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
751 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
752 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
753 |
GlxGridView::~GlxGridView() |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
754 |
{ |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
755 |
OstTraceFunctionEntry0( DUP1_GLXGRIDVIEW_GLXGRIDVIEW_ENTRY ); |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
756 |
removeViewConnection(); |
40 | 757 |
if(mSelectionModel) |
758 |
{ |
|
759 |
disconnect(mSelectionModel, SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(visibleIndexChanged(const QModelIndex &, const QModelIndex &))); |
|
760 |
delete mSelectionModel; |
|
761 |
} |
|
762 |
delete mWidget; |
|
763 |
delete mModelWrapper; |
|
764 |
if(mUiOnButton) { |
|
765 |
disconnect(mUiOnButton, SIGNAL(clicked(bool)), this, SLOT(uiButtonClicked(bool))); |
|
766 |
delete mUiOnButton; |
|
767 |
} |
|
54 | 768 |
|
40 | 769 |
delete mIconItem; |
72 | 770 |
delete mTotalImagesCountGrpBox; |
54 | 771 |
delete mMarkSelectHeading; |
42 | 772 |
delete mMarkCheckBox; |
54 | 773 |
delete mMarkCountLabel; |
774 |
delete mMarkingWidget; |
|
42 | 775 |
delete mZeroItemLabel; |
65 | 776 |
delete mToolBar; |
54 | 777 |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
778 |
OstTraceFunctionExit0( DUP1_GLXGRIDVIEW_GLXGRIDVIEW_EXIT ); |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
779 |
} |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
780 |
|
40 | 781 |
void GlxGridView::indicateLongPress(const QModelIndex& index, QPointF coords) |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
782 |
{ |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
783 |
OstTrace0( TRACE_NORMAL, GLXGRIDVIEW_INDICATELONGPRESS, "GlxGridView::indicateLongPress" ); |
44 | 784 |
|
40 | 785 |
if ( mWidget->selectionMode() == HgWidget::MultiSelection ) |
44 | 786 |
{ |
40 | 787 |
return; |
44 | 788 |
} |
789 |
if ( mModel ) |
|
40 | 790 |
{ |
791 |
mModel->setData( index, index.row(), GlxFocusIndexRole ); |
|
44 | 792 |
} |
40 | 793 |
emit itemSpecificMenuTriggered(viewId(),coords); |
794 |
} |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
795 |
|
40 | 796 |
void GlxGridView::uiButtonClicked(bool /*checked*/) |
797 |
{ |
|
42 | 798 |
showHbItems(); |
799 |
} |
|
800 |
||
801 |
void GlxGridView::showHbItems() |
|
802 |
{ |
|
54 | 803 |
if(mWidget && mWidget->selectionMode() == HgWidget::NoSelection) { |
804 |
setItemVisible( Hb::TitleBarItem, TRUE ); |
|
805 |
setItemVisible( Hb::StatusBarItem, TRUE ); |
|
806 |
setViewFlags(viewFlags() &~ HbView::ViewTitleBarHidden &~ HbView::ViewStatusBarHidden); |
|
42 | 807 |
showItemCount(); |
54 | 808 |
} |
809 |
updateToolBar(); |
|
810 |
if (mUiOnButton) { |
|
42 | 811 |
mUiOnButton->hide(); |
54 | 812 |
} |
24
99ad1390cd33
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
813 |
} |
40 | 814 |
|
42 | 815 |
void GlxGridView::cameraButtonClicked(bool /*checked*/) |
816 |
{ |
|
817 |
emit actionTriggered(EGlxCmdCameraOpen); |
|
818 |
} |
|
819 |
||
820 |
int GlxGridView::getSubState() |
|
821 |
{ |
|
822 |
int substate = NO_GRID_S; |
|
54 | 823 |
if ( mModel ) { |
824 |
QVariant variant = mModel->data( mModel->index(0,0), GlxSubStateRole ); |
|
825 |
if ( variant.isValid() && variant.canConvert<int> () ) { |
|
826 |
substate = variant.value<int>(); |
|
827 |
} |
|
42 | 828 |
} |
829 |
return substate; |
|
830 |
} |
|
831 |
||
54 | 832 |
void GlxGridView::updateToolBar() |
833 |
{ |
|
834 |
//In the case of multiselection show the tool bar. |
|
835 |
if ( mWidget && mWidget->selectionMode() == HgWidget::MultiSelection ) { |
|
836 |
setItemVisible( Hb::ToolBarItem, TRUE ) ; |
|
837 |
return ; |
|
838 |
} |
|
839 |
||
65 | 840 |
//In the case of fetcher, there is no tool bar for album grid view |
54 | 841 |
int subState = getSubState(); |
65 | 842 |
if ( subState == FETCHER_ALBUM_ITEM_S ) { |
54 | 843 |
setItemVisible( Hb::ToolBarItem, FALSE ) ; |
844 |
} |
|
845 |
else { |
|
846 |
setItemVisible( Hb::ToolBarItem, TRUE ); |
|
847 |
} |
|
848 |
} |
|
849 |
||
65 | 850 |
void GlxGridView::createAlbumGridToolBar() |
851 |
{ |
|
852 |
mToolBar = new HbToolBar(); |
|
853 |
mToolBar->setOrientation( Qt::Horizontal ); |
|
854 |
mToolBar->setVisible(true); |
|
855 |
mToolBar->clearActions(); |
|
856 |
||
857 |
HbAction *action = new HbAction(); |
|
858 |
action->setData( EGlxCmdAddToAlbum ); |
|
859 |
action->setIcon( HbIcon( GLXICON_ADD ) ); |
|
860 |
action->setObjectName( "Add Action" ); |
|
861 |
mToolBar->addAction( action ); |
|
862 |
connect( action, SIGNAL( triggered( ) ), this, SLOT( handleToolBarAction( ) ) ); |
|
863 |
||
864 |
action = new HbAction(); |
|
865 |
action->setData( EGlxCmdRemoveFrom ); |
|
866 |
action->setIcon( HbIcon( GLXICON_REMOVE ) ); |
|
867 |
action->setObjectName( "Remove Action" ); |
|
868 |
mToolBar->addAction( action ); |
|
869 |
connect( action, SIGNAL( triggered( ) ), this, SLOT( handleToolBarAction( ) ) ); |
|
870 |
} |
|
871 |