22 #include <hbtoolbar.h> |
22 #include <hbtoolbar.h> |
23 #include <hblistview.h> |
23 #include <hblistview.h> |
24 #include <hbmainwindow.h> |
24 #include <hbmainwindow.h> |
25 #include <hbdocumentloader.h> |
25 #include <hbdocumentloader.h> |
26 #include <hbabstractviewitem.h> |
26 #include <hbabstractviewitem.h> |
27 |
27 #include <HbListViewItem.h> |
28 //User Includes |
28 //User Includes |
29 #include "glxviewids.h" |
29 #include "glxviewids.h" |
30 #include "glxlistview.h" |
30 #include "glxlistview.h" |
31 #include "glxmodelparm.h" |
31 #include "glxmodelparm.h" |
32 #include "glxdocloaderdefs.h" |
32 #include "glxdocloaderdefs.h" |
52 |
52 |
53 void GlxListView::deActivate() |
53 void GlxListView::deActivate() |
54 { |
54 { |
55 qDebug("GlxListView::deActivate()"); |
55 qDebug("GlxListView::deActivate()"); |
56 disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation))); |
56 disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation))); |
57 takeToolBar(); //To:Do improved later |
|
58 emit toolBarChanged(); |
|
59 } |
57 } |
60 |
58 |
61 void GlxListView::setModel(QAbstractItemModel *model) |
59 void GlxListView::setModel(QAbstractItemModel *model) |
62 { |
60 { |
63 qDebug("GlxListView::setModel()"); |
61 qDebug("GlxListView::setModel()"); |
95 void GlxListView::addViewConnection () |
89 void GlxListView::addViewConnection () |
96 { |
90 { |
97 qDebug("GlxListView::addViewConnection()"); |
91 qDebug("GlxListView::addViewConnection()"); |
98 connect(mListView, SIGNAL(activated(const QModelIndex &)), this, SLOT( itemSelected(const QModelIndex &))); |
92 connect(mListView, SIGNAL(activated(const QModelIndex &)), this, SLOT( itemSelected(const QModelIndex &))); |
99 connect(mListView, SIGNAL(longPressed( HbAbstractViewItem*, QPointF )),this, SLOT( indicateLongPress( HbAbstractViewItem*, QPointF ) ) ); |
93 connect(mListView, SIGNAL(longPressed( HbAbstractViewItem*, QPointF )),this, SLOT( indicateLongPress( HbAbstractViewItem*, QPointF ) ) ); |
|
94 connect( mListView, SIGNAL( scrollingEnded() ), this, SLOT( setVisvalWindowIndex() ) ); |
100 } |
95 } |
101 |
96 |
102 void GlxListView::removeViewConnection() |
97 void GlxListView::removeViewConnection() |
103 { |
98 { |
104 qDebug("GlxListView::removeViewConnection()"); |
99 qDebug("GlxListView::removeViewConnection()"); |
105 disconnect(mListView, SIGNAL(activated(const QModelIndex &)), this, SLOT( itemSelected(const QModelIndex &))); |
100 disconnect(mListView, SIGNAL(activated(const QModelIndex &)), this, SLOT( itemSelected(const QModelIndex &))); |
106 disconnect(mListView, SIGNAL(longPressed( HbAbstractViewItem*, QPointF )),this, SLOT( indicateLongPress( HbAbstractViewItem*, QPointF ) ) ); |
101 disconnect(mListView, SIGNAL(longPressed( HbAbstractViewItem*, QPointF )),this, SLOT( indicateLongPress( HbAbstractViewItem*, QPointF ) ) ); |
107 } |
102 disconnect( mListView, SIGNAL( scrollingEnded() ), this, SLOT( setVisvalWindowIndex() ) ); |
|
103 } |
|
104 |
|
105 void GlxListView::setVisvalWindowIndex() |
|
106 { |
|
107 QList< HbAbstractViewItem * > visibleItemList = mListView->visibleItems(); |
|
108 qDebug("GlxListView::setVisvalWindowIndex() %d", visibleItemList.count()); |
|
109 |
|
110 if ( visibleItemList.count() <= 0 ) |
|
111 return ; |
|
112 |
|
113 HbAbstractViewItem *item = visibleItemList.at(0); |
|
114 if ( item == NULL ) |
|
115 return ; |
|
116 |
|
117 if ( item->modelIndex().row() < 0 || item->modelIndex().row() >= mModel->rowCount() ) |
|
118 return ; |
|
119 |
|
120 mModel->setData( item->modelIndex (), item->modelIndex().row(), GlxVisualWindowIndex); |
|
121 } |
108 |
122 |
109 void GlxListView::loadListView() |
123 void GlxListView::loadListView() |
110 { |
124 { |
111 qDebug("GlxListView::loadListView()"); |
125 qDebug("GlxListView::loadListView()"); |
112 bool loaded = true; |
126 bool loaded = true; |