Diffstat (limited to 'noncore/graphics/opie-eye/gui/iconview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 63 |
1 files changed, 61 insertions, 2 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index 74a8d0f..b3f0006 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp | |||
@@ -10,12 +10,15 @@ | |||
10 | #include <iface/dirview.h> | 10 | #include <iface/dirview.h> |
11 | #include <iface/dirlister.h> | 11 | #include <iface/dirlister.h> |
12 | 12 | ||
13 | #include <qpe/config.h> | 13 | #include <opie2/oconfig.h> |
14 | #include <opie2/okeyconfigwidget.h> | ||
15 | |||
14 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
15 | #include <qpe/qpemessagebox.h> | 17 | #include <qpe/qpemessagebox.h> |
16 | #include <qpe/ir.h> | 18 | #include <qpe/ir.h> |
17 | #include <qpe/qcopenvelope_qws.h> | 19 | #include <qpe/qcopenvelope_qws.h> |
18 | 20 | ||
21 | |||
19 | #include <qiconview.h> | 22 | #include <qiconview.h> |
20 | #include <qlabel.h> | 23 | #include <qlabel.h> |
21 | #include <qhbox.h> | 24 | #include <qhbox.h> |
@@ -27,6 +30,7 @@ | |||
27 | #include <qstyle.h> | 30 | #include <qstyle.h> |
28 | 31 | ||
29 | 32 | ||
33 | using Opie::Ui::OKeyConfigItem; | ||
30 | 34 | ||
31 | namespace { | 35 | namespace { |
32 | QPixmap* _dirPix = 0; | 36 | QPixmap* _dirPix = 0; |
@@ -96,7 +100,7 @@ namespace { | |||
96 | } | 100 | } |
97 | 101 | ||
98 | 102 | ||
99 | PIconView::PIconView( QWidget* wid, Config* cfg ) | 103 | PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) |
100 | : QVBox( wid ), m_cfg( cfg ) | 104 | : QVBox( wid ), m_cfg( cfg ) |
101 | { | 105 | { |
102 | { | 106 | { |
@@ -124,6 +128,10 @@ PIconView::PIconView( QWidget* wid, Config* cfg ) | |||
124 | int viewerWidth = dw-style().scrollBarExtent().width(); | 128 | int viewerWidth = dw-style().scrollBarExtent().width(); |
125 | m_view->setGridX( viewerWidth-2*m_view->spacing() ); | 129 | m_view->setGridX( viewerWidth-2*m_view->spacing() ); |
126 | m_view->setGridY( fontMetrics().height()*2+40 ); | 130 | m_view->setGridY( fontMetrics().height()*2+40 ); |
131 | |||
132 | |||
133 | initKeys(); | ||
134 | |||
127 | loadViews(); | 135 | loadViews(); |
128 | slotViewChanged( m_views->currentItem() ); | 136 | slotViewChanged( m_views->currentItem() ); |
129 | } | 137 | } |
@@ -132,6 +140,42 @@ PIconView::~PIconView() { | |||
132 | { | 140 | { |
133 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); | 141 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); |
134 | } | 142 | } |
143 | m_viewManager->save(); | ||
144 | delete m_viewManager; | ||
145 | } | ||
146 | |||
147 | Opie::Ui::OKeyConfigManager* PIconView::manager() { | ||
148 | return m_viewManager; | ||
149 | } | ||
150 | |||
151 | void PIconView::initKeys() { | ||
152 | Opie::Ui::OKeyPair::List lst; | ||
153 | lst.append( Opie::Ui::OKeyPair::upArrowKey() ); | ||
154 | lst.append( Opie::Ui::OKeyPair::downArrowKey() ); | ||
155 | lst.append( Opie::Ui::OKeyPair::leftArrowKey() ); | ||
156 | lst.append( Opie::Ui::OKeyPair::rightArrowKey() ); | ||
157 | lst.append( Opie::Ui::OKeyPair::returnKey() ); | ||
158 | |||
159 | m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "View-KeyBoard-Config", | ||
160 | lst, false,this, "keyconfig name" ); | ||
161 | m_viewManager->addKeyConfig( OKeyConfigItem(tr("Beam Current Item") , "beam", | ||
162 | QString::fromLatin1("beam"), BeamItem, | ||
163 | Opie::Ui::OKeyPair(Qt::Key_B, Qt::ShiftButton), | ||
164 | this, SLOT(slotBeam())) ); | ||
165 | m_viewManager->addKeyConfig( OKeyConfigItem(tr("Delete Current Item"), "delete", | ||
166 | QString::fromLatin1("trash"), DeleteItem, | ||
167 | Opie::Ui::OKeyPair(Qt::Key_D, Qt::ShiftButton), | ||
168 | this, SLOT(slotTrash())) ); | ||
169 | m_viewManager->addKeyConfig( OKeyConfigItem(tr("View Current Item"), "view", | ||
170 | QString::fromLatin1("1to1"), ViewItem, | ||
171 | Opie::Ui::OKeyPair(Qt::Key_V, Qt::ShiftButton), | ||
172 | this, SLOT(slotShowImage()))); | ||
173 | m_viewManager->addKeyConfig( OKeyConfigItem(tr("Show Image Info") , "info", | ||
174 | QString::fromLatin1("DocumentTypeWord"), InfoItem, | ||
175 | Opie::Ui::OKeyPair(Qt::Key_I, Qt::ShiftButton ), | ||
176 | this, SLOT(slotImageInfo()) ) ); | ||
177 | m_viewManager->load(); | ||
178 | m_viewManager->handleWidget( m_view ); | ||
135 | } | 179 | } |
136 | 180 | ||
137 | void PIconView::slotDirUp() { | 181 | void PIconView::slotDirUp() { |
@@ -152,9 +196,11 @@ void PIconView::slotChangeDir(const QString& path) { | |||
152 | lister->setStartPath( path ); | 196 | lister->setStartPath( path ); |
153 | m_path = lister->currentPath(); | 197 | m_path = lister->currentPath(); |
154 | 198 | ||
199 | m_view->setUpdatesEnabled( false ); | ||
155 | m_view->clear(); | 200 | m_view->clear(); |
156 | addFolders( lister->folders() ); | 201 | addFolders( lister->folders() ); |
157 | addFiles( lister->files() ); | 202 | addFiles( lister->files() ); |
203 | m_view->setUpdatesEnabled( true ); | ||
158 | 204 | ||
159 | // Also invalidate the cache. We can't cancel the operations anyway | 205 | // Also invalidate the cache. We can't cancel the operations anyway |
160 | g_stringPix.clear(); | 206 | g_stringPix.clear(); |
@@ -317,3 +363,16 @@ void PIconView::slotStart() { | |||
317 | void PIconView::slotEnd() { | 363 | void PIconView::slotEnd() { |
318 | m_view->setUpdatesEnabled( true ); | 364 | m_view->setUpdatesEnabled( true ); |
319 | } | 365 | } |
366 | |||
367 | void PIconView::slotShowImage() { | ||
368 | |||
369 | } | ||
370 | void PIconView::slotShowImage( const QString& ) { | ||
371 | |||
372 | } | ||
373 | void PIconView::slotImageInfo() { | ||
374 | |||
375 | } | ||
376 | void PIconView::slotImageInfo( const QString& ) { | ||
377 | |||
378 | } | ||