author | alwin <alwin> | 2004-11-10 23:42:14 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-11-10 23:42:14 (UTC) |
commit | 79060b829e9231cddc0acfe2dd2b7da3f13dfbc4 (patch) (side-by-side diff) | |
tree | 0e7a6a344bfce1aaf76bedd939a9765014f6ec09 /noncore/graphics/opie-eye/gui | |
parent | a57e46d9b290712fa1ff106a1be133f4f9751a96 (diff) | |
download | opie-79060b829e9231cddc0acfe2dd2b7da3f13dfbc4.zip opie-79060b829e9231cddc0acfe2dd2b7da3f13dfbc4.tar.gz opie-79060b829e9231cddc0acfe2dd2b7da3f13dfbc4.tar.bz2 |
lister modules can insert special widgets.
doc_dirlister will insert a category select widget
Diffstat (limited to 'noncore/graphics/opie-eye/gui') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 22 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.h | 2 |
2 files changed, 19 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 ) QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); } 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*)) ); connect(m_view, SIGNAL(returnPressed(QIconViewItem*)), this, SLOT(slotClicked(QIconViewItem*)) ); @@ -446,14 +447,20 @@ void PIconView::resetView() { void PIconView::slotViewChanged( int i) { if (!m_views->count() ) { 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); return; } @@ -465,24 +472,29 @@ 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& )), this, SLOT( slotThumbInfo(const QString&, const QString&))); connect(lis, SIGNAL( sig_thumbNail(const QString&, const QPixmap&)), this, SLOT(slotThumbNail(const QString&, const QPixmap&))); 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 */ if (!m_internalReset) { m_path = lis->defaultPath(); diff --git a/noncore/graphics/opie-eye/gui/iconview.h b/noncore/graphics/opie-eye/gui/iconview.h index b018c51..78dda58 100644 --- a/noncore/graphics/opie-eye/gui/iconview.h +++ b/noncore/graphics/opie-eye/gui/iconview.h @@ -94,9 +94,11 @@ private: QIconView* m_view; QString m_path; bool m_updatet : 1; int m_mode; bool m_internalReset:1; int m_iconsize; + QHBox*m_hbox; + QWidget*m_customWidget; }; #endif |