author | zecke <zecke> | 2004-04-02 13:34:44 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-04-02 13:34:44 (UTC) |
commit | 96105800596dfbd6b828ef47dd7774769f1e3ef3 (patch) (unidiff) | |
tree | e8862c0d4f8cc6fb3a90da0856857cd21010ba8b /noncore/graphics/opie-eye/gui/iconview.cpp | |
parent | 02696a8b22d86f74a4f123edcd24bfa32dd00441 (diff) | |
download | opie-96105800596dfbd6b828ef47dd7774769f1e3ef3.zip opie-96105800596dfbd6b828ef47dd7774769f1e3ef3.tar.gz opie-96105800596dfbd6b828ef47dd7774769f1e3ef3.tar.bz2 |
-Use OConfig
-Use OKeyConfigManager/Widget for Keyboard short cuts
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 | |||
@@ -11,5 +11,7 @@ | |||
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> |
@@ -17,4 +19,5 @@ | |||
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> |
@@ -28,4 +31,5 @@ | |||
28 | 31 | ||
29 | 32 | ||
33 | using Opie::Ui::OKeyConfigItem; | ||
30 | 34 | ||
31 | namespace { | 35 | namespace { |
@@ -97,5 +101,5 @@ namespace { | |||
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 | { |
@@ -125,4 +129,8 @@ PIconView::PIconView( QWidget* wid, Config* cfg ) | |||
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() ); |
@@ -133,4 +141,40 @@ PIconView::~PIconView() { | |||
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 | ||
@@ -153,7 +197,9 @@ void PIconView::slotChangeDir(const QString& 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 |
@@ -318,2 +364,15 @@ 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 | } | ||