summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui
authoralwin <alwin>2004-11-10 23:42:14 (UTC)
committer alwin <alwin>2004-11-10 23:42:14 (UTC)
commit79060b829e9231cddc0acfe2dd2b7da3f13dfbc4 (patch) (unidiff)
tree0e7a6a344bfce1aaf76bedd939a9765014f6ec09 /noncore/graphics/opie-eye/gui
parenta57e46d9b290712fa1ff106a1be133f4f9751a96 (diff)
downloadopie-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.cpp22
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.h2
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
@@ -195,12 +195,13 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg )
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*) ),
@@ -449,8 +450,14 @@ void PIconView::slotViewChanged( int i) {
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) {
@@ -468,6 +475,11 @@ void PIconView::slotViewChanged( int i) {
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();
@@ -479,7 +491,7 @@ void PIconView::slotViewChanged( int i) {
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
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
@@ -97,6 +97,8 @@ private:
97 int m_mode; 97 int m_mode;
98 bool m_internalReset:1; 98 bool m_internalReset:1;
99 int m_iconsize; 99 int m_iconsize;
100 QHBox*m_hbox;
101 QWidget*m_customWidget;
100}; 102};
101 103
102#endif 104#endif