summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/iconview.cpp
Unidiff
Diffstat (limited to 'noncore/graphics/opie-eye/gui/iconview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.cpp61
1 files changed, 41 insertions, 20 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp
index de2cdf0..4ced52d 100644
--- a/noncore/graphics/opie-eye/gui/iconview.cpp
+++ b/noncore/graphics/opie-eye/gui/iconview.cpp
@@ -35,9 +35,12 @@
35 35
36using Opie::Ui::OKeyConfigItem; 36using Opie::Ui::OKeyConfigItem;
37 37
38/*
39 * The Icons, Request Cache and IconViewItem for the IconView
40 */
38namespace { 41namespace {
39 QPixmap* _dirPix = 0; 42 static QPixmap* _dirPix = 0;
40 QPixmap* _unkPix = 0; 43 static QPixmap* _unkPix = 0;
41 class IconViewItem : public QIconViewItem { 44 class IconViewItem : public QIconViewItem {
42 public: 45 public:
43 IconViewItem( QIconView*, const QString& path, const QString& name, bool isDir = false); 46 IconViewItem( QIconView*, const QString& path, const QString& name, bool isDir = false);
@@ -59,8 +62,8 @@ namespace {
59 * If we request an Image or String 62 * If we request an Image or String
60 * we add it to the map 63 * we add it to the map
61 */ 64 */
62 QMap<QString, IconViewItem*> g_stringInf; 65 static QMap<QString, IconViewItem*> g_stringInf;
63 QMap<QString, IconViewItem*> g_stringPix; 66 static QMap<QString, IconViewItem*> g_stringPix;
64 67
65 IconViewItem::IconViewItem( QIconView* view,const QString& path, 68 IconViewItem::IconViewItem( QIconView* view,const QString& path,
66 const QString& name, bool isDir ) 69 const QString& name, bool isDir )
@@ -101,6 +104,10 @@ namespace {
101} 104}
102 105
103 106
107/*
108 * Set up the GUI.. initialize the slave set up gui
109 * and also load a dir
110 */
104PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) 111PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg )
105 : QVBox( wid ), m_cfg( cfg ), m_updatet( false ) 112 : QVBox( wid ), m_cfg( cfg ), m_updatet( false )
106{ 113{
@@ -136,6 +143,9 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg )
136 slotViewChanged( m_views->currentItem() ); 143 slotViewChanged( m_views->currentItem() );
137} 144}
138 145
146/*
147 * Unref the slave and save the keyboard manager
148 */
139PIconView::~PIconView() { 149PIconView::~PIconView() {
140 { 150 {
141 QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); 151 QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" );
@@ -148,6 +158,11 @@ Opie::Ui::OKeyConfigManager* PIconView::manager() {
148 return m_viewManager; 158 return m_viewManager;
149} 159}
150 160
161
162/*
163 * init the KeyBoard Shortcuts
164 * called from the c'tor
165 */
151void PIconView::initKeys() { 166void PIconView::initKeys() {
152 Opie::Ui::OKeyPair::List lst; 167 Opie::Ui::OKeyPair::List lst;
153 lst.append( Opie::Ui::OKeyPair::upArrowKey() ); 168 lst.append( Opie::Ui::OKeyPair::upArrowKey() );
@@ -178,6 +193,10 @@ void PIconView::initKeys() {
178 m_viewManager->handleWidget( m_view ); 193 m_viewManager->handleWidget( m_view );
179} 194}
180 195
196
197/*
198 * change one dir up
199 */
181void PIconView::slotDirUp() { 200void PIconView::slotDirUp() {
182 QDir dir( m_path ); 201 QDir dir( m_path );
183 dir.cdUp(); 202 dir.cdUp();
@@ -185,6 +204,9 @@ void PIconView::slotDirUp() {
185 204
186} 205}
187 206
207/*
208 * change the dir
209 */
188void PIconView::slotChangeDir(const QString& path) { 210void PIconView::slotChangeDir(const QString& path) {
189 if ( !currentView() ) 211 if ( !currentView() )
190 return; 212 return;
@@ -284,9 +306,9 @@ void PIconView::slotReloadDir() {
284void PIconView::addFolders( const QStringList& lst) { 306void PIconView::addFolders( const QStringList& lst) {
285 QStringList::ConstIterator it; 307 QStringList::ConstIterator it;
286 308
287 for(it=lst.begin(); it != lst.end(); ++it ) { 309 for(it=lst.begin(); it != lst.end(); ++it )
288 (void)new IconViewItem( m_view, m_path+"/"+(*it), (*it), true ); 310 (void)new IconViewItem( m_view, m_path+"/"+(*it), (*it), true );
289 } 311
290 312
291} 313}
292 314
@@ -305,7 +327,7 @@ void PIconView::slotClicked(QIconViewItem* _it) {
305 if( it->isDir() ) 327 if( it->isDir() )
306 slotChangeDir( it->path() ); 328 slotChangeDir( it->path() );
307 else // view image 329 else // view image
308 ; 330 slotShowImage();
309} 331}
310 332
311void PIconView::slotThumbInfo( const QString& _path, const QString& str ) { 333void PIconView::slotThumbInfo( const QString& _path, const QString& str ) {
@@ -360,37 +382,36 @@ void PIconView::slotBeamDone( Ir* ir) {
360 382
361void PIconView::slotStart() { 383void PIconView::slotStart() {
362 m_view->viewport()->setUpdatesEnabled( false ); 384 m_view->viewport()->setUpdatesEnabled( false );
363 qWarning( "Sig Start" );
364} 385}
365 386
366void PIconView::slotEnd() { 387void PIconView::slotEnd() {
367 qWarning( "SLot End" );
368 if ( m_updatet ) 388 if ( m_updatet )
369 m_view->arrangeItemsInGrid( ); 389 m_view->arrangeItemsInGrid( );
370 m_view->viewport()->setUpdatesEnabled( true ); 390 m_view->viewport()->setUpdatesEnabled( true );
371 m_updatet = false; 391 m_updatet = false;
372} 392}
373 393
374void PIconView::slotShowImage() { 394void PIconView::slotShowImage()
375 qDebug("image show"); 395{
396 qWarning( "SLotShowImage" );
376 bool isDir = false; 397 bool isDir = false;
377 QString name = currentFileName(isDir); 398 QString name = currentFileName(isDir);
378 if (isDir) return; 399 if (isDir) return;
379 ImageDlg dlg(name);
380 QPEApplication::execDialog(&dlg);
381}
382void PIconView::slotShowImage( const QString& ) {
383 400
401 slotShowImage( name );
402}
403void PIconView::slotShowImage( const QString& name) {
404 emit sig_display( name );
384} 405}
385void PIconView::slotImageInfo() { 406void PIconView::slotImageInfo() {
386 qDebug("image info"); 407 qWarning( "SlotImageInfo" );
387 bool isDir = false; 408 bool isDir = false;
388 QString name = currentFileName(isDir); 409 QString name = currentFileName(isDir);
389 if (isDir) return; 410 if (isDir) return;
390 infoDlg dlg(name);
391 QPEApplication::execDialog(&dlg);
392}
393 411
394void PIconView::slotImageInfo( const QString& ) { 412 slotImageInfo( name );
413}
395 414
415void PIconView::slotImageInfo( const QString& name) {
416 emit sig_showInfo( name );
396} 417}