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.cpp | 22 |
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 @@ -194,14 +194,15 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) m_path = QDir::homeDirPath(); m_mode = 0; m_iconsize = 32; m_internalReset = false; + m_customWidget = 0; - QHBox *hbox = new QHBox( this ); - QLabel* lbl = new QLabel( hbox ); + m_hbox = new QHBox( this ); + QLabel* lbl = new QLabel( m_hbox ); lbl->setText( tr("View as" ) ); - m_views = new QComboBox( hbox, "View As" ); + m_views = new QComboBox( m_hbox, "View As" ); m_view= new QIconView( this ); connect(m_view, SIGNAL(clicked(QIconViewItem*) ), this, SLOT(slotClicked(QIconViewItem*)) ); @@ -448,10 +449,16 @@ void PIconView::slotViewChanged( int i) { setCurrentView( 0l); return; } + if (m_customWidget) { + delete m_customWidget; + m_customWidget = 0; + } PDirView* cur = currentView(); - if (cur) delete cur; + if (cur) { + delete cur; + } QString str = m_views->text(i); ViewMap* map = viewMap(); if (!map) { setCurrentView(0l); @@ -467,8 +474,13 @@ void PIconView::slotViewChanged( int i) { m_cfg->writeEntry("LastView",str); m_cfg->write(); cur = (*(*map)[str])(*m_cfg); setCurrentView( cur ); + m_customWidget = cur->widget(m_hbox); + if (m_customWidget) { + odebug << "Got a widget" << oendl; + m_customWidget->show(); + } /* connect to the signals of the lister */ PDirLister* lis = cur->dirLister(); connect(lis, SIGNAL(sig_thumbInfo(const QString&, const QString& )), @@ -478,9 +490,9 @@ void PIconView::slotViewChanged( int i) { connect(lis, SIGNAL(sig_start()), this, SLOT(slotStart())); connect(lis, SIGNAL(sig_end()) , this, SLOT(slotEnd()) ); - + connect(lis,SIGNAL(sig_reloadDir()),this,SLOT(slotReloadDir())); /* reload now with default Path * but only if it isn't a reset like from setupdlg */ |