28 #include <xqserviceutil.h> |
28 #include <xqserviceutil.h> |
29 #include <hbcheckbox.h> |
29 #include <hbcheckbox.h> |
30 #include <hblabel.h> |
30 #include <hblabel.h> |
31 #include <QString> |
31 #include <QString> |
32 #include <hbframeitem.h> |
32 #include <hbframeitem.h> |
|
33 #include <QCoreApplication> |
33 |
34 |
34 //User Includes |
35 //User Includes |
35 #include "glxviewids.h" |
36 #include "glxviewids.h" |
36 #include "glxgridview.h" |
37 #include "glxgridview.h" |
37 #include "glxmodelparm.h" |
38 #include "glxmodelparm.h" |
38 #include "glxcommandhandlers.hrh" |
39 #include "glxcommandhandlers.hrh" |
39 #include "glxicondefs.h" |
40 #include "glxicondefs.h" |
40 #include "glxlocalisationstrings.h" |
41 #include "glxlocalisationstrings.h" |
|
42 #include "glxlog.h" |
|
43 #include "glxtracer.h" |
|
44 |
41 |
45 |
42 #include "OstTraceDefinitions.h" |
46 #include "OstTraceDefinitions.h" |
43 #ifdef OST_TRACE_COMPILER_IN_USE |
47 #ifdef OST_TRACE_COMPILER_IN_USE |
44 #include "glxgridviewTraces.h" |
48 #include "glxgridviewTraces.h" |
45 #endif |
49 #endif |
88 frame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); |
92 frame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); |
89 frame->frameDrawer().setFrameGraphicsName("qtg_fr_multimedia_trans"); |
93 frame->frameDrawer().setFrameGraphicsName("qtg_fr_multimedia_trans"); |
90 frame->graphicsItem()->setOpacity(1); |
94 frame->graphicsItem()->setOpacity(1); |
91 mCountItem->setBackgroundItem(frame->graphicsItem(),-1); |
95 mCountItem->setBackgroundItem(frame->graphicsItem(),-1); |
92 } |
96 } |
|
97 QCoreApplication::instance()->installEventFilter(this); |
93 OstTraceFunctionExit0( GLXGRIDVIEW_ACTIVATE_EXIT ); |
98 OstTraceFunctionExit0( GLXGRIDVIEW_ACTIVATE_EXIT ); |
94 } |
99 } |
95 |
100 |
96 void GlxGridView::deActivate() |
101 void GlxGridView::deActivate() |
97 { |
102 { |
98 OstTraceFunctionEntry0( GLXGRIDVIEW_DEACTIVATE_ENTRY ); |
103 OstTraceFunctionEntry0( GLXGRIDVIEW_DEACTIVATE_ENTRY ); |
99 mScrolling = FALSE; |
104 mScrolling = FALSE; |
100 if (mUiOnButton) |
105 if (mUiOnButton){ |
101 { |
|
102 mUiOnButton->hide(); |
106 mUiOnButton->hide(); |
103 } |
107 } |
104 if(mIconItem) |
108 if(mIconItem) { |
105 { |
|
106 mIconItem->hide(); |
109 mIconItem->hide(); |
107 mIconItem->resetTransform(); |
110 mIconItem->resetTransform(); |
108 mIconItem->setOpacity(0); |
111 mIconItem->setOpacity(0); |
109 mIconItem->setZValue(mIconItem->zValue()-20); |
112 mIconItem->setZValue(mIconItem->zValue()-20); |
110 } |
113 } |
111 if (mCountItem) |
114 if (mCountItem) { |
112 { |
|
113 mCountItem->hide(); |
115 mCountItem->hide(); |
114 } |
116 } |
115 if (mAlbumName) |
117 if (mAlbumName) { |
116 { |
|
117 mAlbumName->hide(); |
118 mAlbumName->hide(); |
118 } |
119 } |
119 if(mZeroItemLabel) |
120 if(mZeroItemLabel) { |
120 { |
|
121 mZeroItemLabel->hide(); |
121 mZeroItemLabel->hide(); |
122 } |
122 } |
123 if(mCameraButton) |
123 if(mCameraButton) { |
124 { |
|
125 mCameraButton->hide(); |
124 mCameraButton->hide(); |
126 } |
125 } |
|
126 QCoreApplication::instance()->removeEventFilter(this); |
127 disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationchanged(Qt::Orientation))); |
127 disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationchanged(Qt::Orientation))); |
128 OstTraceFunctionExit0( GLXGRIDVIEW_DEACTIVATE_EXIT ); |
128 OstTraceFunctionExit0( GLXGRIDVIEW_DEACTIVATE_EXIT ); |
129 } |
129 } |
130 |
130 |
131 void GlxGridView::initializeView(QAbstractItemModel *model) |
131 void GlxGridView::initializeView(QAbstractItemModel *model) |
414 void GlxGridView::populated() |
414 void GlxGridView::populated() |
415 { |
415 { |
416 showItemCount(); |
416 showItemCount(); |
417 } |
417 } |
418 |
418 |
|
419 bool GlxGridView::eventFilter(QObject *obj, QEvent *event) |
|
420 { |
|
421 TRACER("GlxGridView::eventFilter() "); |
|
422 GLX_LOG_INFO1("GlxGridView::eventFilter() %d event type", event->type()); |
|
423 |
|
424 if ( event->type() == QEvent::ApplicationActivate ) { |
|
425 emit actionTriggered( EGlxCmdAppForeground ); |
|
426 } |
|
427 if ( event->type() == QEvent::ApplicationDeactivate ) { |
|
428 emit actionTriggered( EGlxCmdAppBackground ); |
|
429 } |
|
430 return HbView::eventFilter(obj,event); |
|
431 } |
|
432 |
419 void GlxGridView::handleUserAction(qint32 commandId) |
433 void GlxGridView::handleUserAction(qint32 commandId) |
420 { |
434 { |
421 OstTrace0( TRACE_NORMAL, GLXGRIDVIEW_HANDLEUSERACTION, "GlxGridView::handleUserAction" ); |
435 OstTrace0( TRACE_NORMAL, GLXGRIDVIEW_HANDLEUSERACTION, "GlxGridView::handleUserAction" ); |
422 switch( commandId ) { |
436 switch( commandId ) { |
423 case EGlxCmdMarkAll : |
437 case EGlxCmdMarkAll : |
516 { |
530 { |
517 hideorshowitems(orient); |
531 hideorshowitems(orient); |
518 } |
532 } |
519 void GlxGridView::hideorshowitems(Qt::Orientation orient) |
533 void GlxGridView::hideorshowitems(Qt::Orientation orient) |
520 { |
534 { |
521 if (mWidget->selectionMode() == HgWidget::NoSelection) { |
535 if (mWidget && mWidget->selectionMode() == HgWidget::NoSelection) { |
522 if(orient == Qt::Horizontal) |
536 if(orient == Qt::Horizontal) |
523 { |
537 { |
524 setItemVisible(Hb::AllItems, FALSE) ; |
538 setItemVisible(Hb::AllItems, FALSE) ; |
525 setViewFlags(viewFlags() | HbView::ViewTitleBarHidden | HbView::ViewStatusBarHidden); |
539 setViewFlags(viewFlags() | HbView::ViewTitleBarHidden | HbView::ViewStatusBarHidden); |
526 showItemCount(); |
540 showItemCount(); |