118 } |
120 } |
119 |
121 |
120 //-------------------------------------------------------------------------------------------------------------------------------------------- |
122 //-------------------------------------------------------------------------------------------------------------------------------------------- |
121 //initializeView |
123 //initializeView |
122 //-------------------------------------------------------------------------------------------------------------------------------------------- |
124 //-------------------------------------------------------------------------------------------------------------------------------------------- |
123 void GlxDetailsView::initializeView(QAbstractItemModel *model) |
125 void GlxDetailsView::initializeView( QAbstractItemModel *model, GlxView *preView) |
124 { |
126 { |
|
127 Q_UNUSED( preView ) |
125 OstTraceFunctionEntry0( GLXDETAILSVIEW_INITIALIZEVIEW_ENTRY ); |
128 OstTraceFunctionEntry0( GLXDETAILSVIEW_INITIALIZEVIEW_ENTRY ); |
126 bool loaded = false; |
129 bool loaded = false; |
127 |
130 |
128 if(!mDocLoader) |
131 if(!mDocLoader) |
129 { |
132 { |
130 mDocLoader = new GlxDetailsViewDocLoader(); |
133 mDocLoader = new GlxDetailsViewDocLoader(); |
131 } |
134 } |
132 |
135 |
133 //Load the docml |
136 //Load the docml |
134 mDocLoader->load(GLX_DETAILSVIEW_DOCMLPATH, &loaded); |
137 mDocLoader->load(GLX_DETAILSVIEW_DOCMLPATH, &loaded); |
135 |
138 |
136 HbView *mView = static_cast<HbView*> (mDocLoader->findWidget( |
139 HbView *mView = static_cast<HbView*> (mDocLoader->findWidget( |
137 GLX_DETAILSVIEW_VIEW)); |
140 GLX_DETAILSVIEW_VIEW)); |
138 |
141 |
139 HbWidget *mwidget = static_cast<HbWidget*> (mDocLoader->findWidget( |
142 HbWidget *mwidget = static_cast<HbWidget*> (mDocLoader->findWidget( |
140 "MainWidget")); |
143 "MainWidget")); |
157 GLX_DETAILSVIEW_TIMETEXT)); |
161 GLX_DETAILSVIEW_TIMETEXT)); |
158 |
162 |
159 mSizeLabel = static_cast<HbLabel*> (mDocLoader->findWidget( |
163 mSizeLabel = static_cast<HbLabel*> (mDocLoader->findWidget( |
160 GLX_DETAILSVIEW_SIZETEXT)); |
164 GLX_DETAILSVIEW_SIZETEXT)); |
161 |
165 |
162 //set the frame graphics to the background of the fav icon |
166 |
163 HbFrameItem* frame = new HbFrameItem(this); |
167 //Set the Model |
164 frame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); |
|
165 frame->frameDrawer().setFrameGraphicsName("qtg_fr_multimedia_trans"); |
|
166 frame->graphicsItem()->setOpacity(0.2); |
|
167 mFavIcon->setBackgroundItem(frame->graphicsItem(), -1); |
|
168 mFavIcon->setBackground(HbIcon("qtg_fr_multimedia_trans")); |
|
169 mFavIcon->setIcon(HbIcon(GLXICON_REMOVE_FAV)); |
|
170 |
|
171 setWidget(mView); |
|
172 |
|
173 //Set the Model |
|
174 mModel = model; |
168 mModel = model; |
175 |
169 if(getSubState() == IMAGEVIEWER_DETAIL_S) { |
|
170 mFavIcon->hide(); |
|
171 } |
|
172 else |
|
173 { |
|
174 //set the frame graphics to the background of the fav icon |
|
175 HbFrameItem* frame = new HbFrameItem(this); |
|
176 frame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); |
|
177 frame->frameDrawer().setFrameGraphicsName("qtg_fr_multimedia_trans"); |
|
178 frame->graphicsItem()->setOpacity(0.2); |
|
179 mFavIcon->setBackgroundItem(frame->graphicsItem(), -1); |
|
180 mFavIcon->setBackground(HbIcon("qtg_fr_multimedia_trans")); |
|
181 mFavIcon->setIcon(HbIcon(GLXICON_REMOVE_FAV)); |
|
182 } |
|
183 |
|
184 setWidget(mView); |
|
185 |
176 //Set the Layout Correspondingly. |
186 //Set the Layout Correspondingly. |
177 updateLayout(mWindow->orientation()); |
187 updateLayout(mWindow->orientation()); |
178 |
188 |
179 //Shows the Image |
189 //Shows the Image |
180 showImage(); |
190 showImage(); |
294 //-------------------------------------------------------------------------------------------------------------------------------------------- |
305 //-------------------------------------------------------------------------------------------------------------------------------------------- |
295 void GlxDetailsView::setConnections() |
306 void GlxDetailsView::setConnections() |
296 { |
307 { |
297 connect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, |
308 connect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, |
298 SLOT(updateLayout(Qt::Orientation))); |
309 SLOT(updateLayout(Qt::Orientation))); |
|
310 |
|
311 |
|
312 if(getSubState() != IMAGEVIEWER_DETAIL_S) { |
299 connect(mFavIcon, SIGNAL(clicked()), this, SLOT(updateFavourites())); |
313 connect(mFavIcon, SIGNAL(clicked()), this, SLOT(updateFavourites())); |
300 |
314 |
301 connect(mDescriptions, SIGNAL(labelPressed()), this, |
315 connect(mDescriptions, SIGNAL(labelPressed()), this, |
302 SLOT(UpdateDescription())); |
316 SLOT(UpdateDescription())); |
303 |
317 |
|
318 connect(mFavModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), |
|
319 this, SLOT( dataChanged(QModelIndex,QModelIndex) )); |
|
320 } |
|
321 |
304 connect(mModel, SIGNAL( updateDetailsView() ), this, SLOT( FillDetails() )); |
322 connect(mModel, SIGNAL( updateDetailsView() ), this, SLOT( FillDetails() )); |
305 |
323 |
306 connect(mFavModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), |
324 |
307 this, SLOT( dataChanged(QModelIndex,QModelIndex) )); |
|
308 } |
325 } |
309 |
326 |
310 //-------------------------------------------------------------------------------------------------------------------------------------------- |
327 //-------------------------------------------------------------------------------------------------------------------------------------------- |
311 //clearConnections |
328 //clearConnections |
312 //-------------------------------------------------------------------------------------------------------------------------------------------- |
329 //-------------------------------------------------------------------------------------------------------------------------------------------- |
313 void GlxDetailsView::clearConnections() |
330 void GlxDetailsView::clearConnections() |
314 { |
331 { |
|
332 |
|
333 qDebug("GlxDetailsView:: clearConnections"); |
315 disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, |
334 disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, |
316 SLOT(updateLayout(Qt::Orientation))); |
335 SLOT(updateLayout(Qt::Orientation))); |
317 |
336 |
|
337 if(mModel && getSubState() != IMAGEVIEWER_DETAIL_S) { |
318 disconnect(mFavIcon, SIGNAL(clicked()), this, SLOT(updateFavourites())); |
338 disconnect(mFavIcon, SIGNAL(clicked()), this, SLOT(updateFavourites())); |
319 |
|
320 disconnect(mDescriptions, SIGNAL(labelPressed()), this, |
339 disconnect(mDescriptions, SIGNAL(labelPressed()), this, |
321 SLOT(UpdateDescription())); |
340 SLOT(UpdateDescription())); |
|
341 disconnect(mFavModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), |
|
342 this, SLOT( dataChanged(QModelIndex,QModelIndex) )); |
|
343 } |
322 |
344 |
323 disconnect(mModel, SIGNAL( updateDetailsView() ), this, SLOT( FillDetails() )); |
345 disconnect(mModel, SIGNAL( updateDetailsView() ), this, SLOT( FillDetails() )); |
324 |
346 |
325 disconnect(mFavModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), |
347 |
326 this, SLOT( dataChanged(QModelIndex,QModelIndex) )); |
|
327 } |
348 } |
328 |
349 |
329 //-------------------------------------------------------------------------------------------------------------------------------------------- |
350 //-------------------------------------------------------------------------------------------------------------------------------------------- |
330 //getAnimationItem |
351 //getAnimationItem |
331 //-------------------------------------------------------------------------------------------------------------------------------------------- |
352 //-------------------------------------------------------------------------------------------------------------------------------------------- |