summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/iconview.cpp
Unidiff
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.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp
index 5472ead..948477c 100644
--- a/noncore/graphics/opie-eye/gui/iconview.cpp
+++ b/noncore/graphics/opie-eye/gui/iconview.cpp
@@ -192,18 +192,19 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg )
192 QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); 192 QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" );
193 } 193 }
194 m_path = QDir::homeDirPath(); 194 m_path = QDir::homeDirPath();
195 m_mode = 0; 195 m_mode = 0;
196 m_iconsize = 32; 196 m_iconsize = 32;
197 m_internalReset = false; 197 m_internalReset = false;
198 m_customWidget = 0;
198 199
199 QHBox *hbox = new QHBox( this ); 200 m_hbox = new QHBox( this );
200 QLabel* lbl = new QLabel( hbox ); 201 QLabel* lbl = new QLabel( m_hbox );
201 lbl->setText( tr("View as" ) ); 202 lbl->setText( tr("View as" ) );
202 203
203 m_views = new QComboBox( hbox, "View As" ); 204 m_views = new QComboBox( m_hbox, "View As" );
204 205
205 m_view= new QIconView( this ); 206 m_view= new QIconView( this );
206 connect(m_view, SIGNAL(clicked(QIconViewItem*) ), 207 connect(m_view, SIGNAL(clicked(QIconViewItem*) ),
207 this, SLOT(slotClicked(QIconViewItem*)) ); 208 this, SLOT(slotClicked(QIconViewItem*)) );
208 connect(m_view, SIGNAL(returnPressed(QIconViewItem*)), 209 connect(m_view, SIGNAL(returnPressed(QIconViewItem*)),
209 this, SLOT(slotClicked(QIconViewItem*)) ); 210 this, SLOT(slotClicked(QIconViewItem*)) );
@@ -446,14 +447,20 @@ void PIconView::resetView() {
446void PIconView::slotViewChanged( int i) { 447void PIconView::slotViewChanged( int i) {
447 if (!m_views->count() ) { 448 if (!m_views->count() ) {
448 setCurrentView( 0l); 449 setCurrentView( 0l);
449 return; 450 return;
450 } 451 }
451 452
453 if (m_customWidget) {
454 delete m_customWidget;
455 m_customWidget = 0;
456 }
452 PDirView* cur = currentView(); 457 PDirView* cur = currentView();
453 if (cur) delete cur; 458 if (cur) {
459 delete cur;
460 }
454 QString str = m_views->text(i); 461 QString str = m_views->text(i);
455 ViewMap* map = viewMap(); 462 ViewMap* map = viewMap();
456 if (!map) { 463 if (!map) {
457 setCurrentView(0l); 464 setCurrentView(0l);
458 return; 465 return;
459 } 466 }
@@ -465,24 +472,29 @@ void PIconView::slotViewChanged( int i) {
465 } 472 }
466 473
467 m_cfg->writeEntry("LastView",str); 474 m_cfg->writeEntry("LastView",str);
468 m_cfg->write(); 475 m_cfg->write();
469 cur = (*(*map)[str])(*m_cfg); 476 cur = (*(*map)[str])(*m_cfg);
470 setCurrentView( cur ); 477 setCurrentView( cur );
478 m_customWidget = cur->widget(m_hbox);
479 if (m_customWidget) {
480 odebug << "Got a widget" << oendl;
481 m_customWidget->show();
482 }
471 483
472 /* connect to the signals of the lister */ 484 /* connect to the signals of the lister */
473 PDirLister* lis = cur->dirLister(); 485 PDirLister* lis = cur->dirLister();
474 connect(lis, SIGNAL(sig_thumbInfo(const QString&, const QString& )), 486 connect(lis, SIGNAL(sig_thumbInfo(const QString&, const QString& )),
475 this, SLOT( slotThumbInfo(const QString&, const QString&))); 487 this, SLOT( slotThumbInfo(const QString&, const QString&)));
476 connect(lis, SIGNAL( sig_thumbNail(const QString&, const QPixmap&)), 488 connect(lis, SIGNAL( sig_thumbNail(const QString&, const QPixmap&)),
477 this, SLOT(slotThumbNail(const QString&, const QPixmap&))); 489 this, SLOT(slotThumbNail(const QString&, const QPixmap&)));
478 connect(lis, SIGNAL(sig_start()), 490 connect(lis, SIGNAL(sig_start()),
479 this, SLOT(slotStart())); 491 this, SLOT(slotStart()));
480 connect(lis, SIGNAL(sig_end()) , 492 connect(lis, SIGNAL(sig_end()) ,
481 this, SLOT(slotEnd()) ); 493 this, SLOT(slotEnd()) );
482 494 connect(lis,SIGNAL(sig_reloadDir()),this,SLOT(slotReloadDir()));
483 495
484 /* reload now with default Path 496 /* reload now with default Path
485 * but only if it isn't a reset like from setupdlg 497 * but only if it isn't a reset like from setupdlg
486 */ 498 */
487 if (!m_internalReset) { 499 if (!m_internalReset) {
488 m_path = lis->defaultPath(); 500 m_path = lis->defaultPath();