summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/iconview.cpp
authoralwin <alwin>2004-11-02 17:52:41 (UTC)
committer alwin <alwin>2004-11-02 17:52:41 (UTC)
commitebdc2d346272bae27c867b855207993985df4450 (patch) (unidiff)
tree37b4710141434e33df3873c16937a6ad6a015eb4 /noncore/graphics/opie-eye/gui/iconview.cpp
parente246d0590286f6b9b0d5d40f1a17caa78c015b21 (diff)
downloadopie-ebdc2d346272bae27c867b855207993985df4450.zip
opie-ebdc2d346272bae27c867b855207993985df4450.tar.gz
opie-ebdc2d346272bae27c867b855207993985df4450.tar.bz2
if wanted the user may search directories recursiv
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.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp
index 7c8c88d..eafff1d 100644
--- a/noncore/graphics/opie-eye/gui/iconview.cpp
+++ b/noncore/graphics/opie-eye/gui/iconview.cpp
@@ -144,24 +144,25 @@ namespace {
144/* 144/*
145 * Set up the GUI.. initialize the slave set up gui 145 * Set up the GUI.. initialize the slave set up gui
146 * and also load a dir 146 * and also load a dir
147 */ 147 */
148PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) 148PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg )
149 : QVBox( wid ), m_cfg( cfg ), m_updatet( false ) 149 : QVBox( wid ), m_cfg( cfg ), m_updatet( false )
150{ 150{
151 { 151 {
152 QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); 152 QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" );
153 } 153 }
154 m_path = QDir::homeDirPath(); 154 m_path = QDir::homeDirPath();
155 m_mode = 0; 155 m_mode = 0;
156 m_internalReset = false;
156 157
157 QHBox *hbox = new QHBox( this ); 158 QHBox *hbox = new QHBox( this );
158 QLabel* lbl = new QLabel( hbox ); 159 QLabel* lbl = new QLabel( hbox );
159 lbl->setText( tr("View as" ) ); 160 lbl->setText( tr("View as" ) );
160 161
161 m_views = new QComboBox( hbox, "View As" ); 162 m_views = new QComboBox( hbox, "View As" );
162 163
163 m_view= new QIconView( this ); 164 m_view= new QIconView( this );
164 connect(m_view, SIGNAL(clicked(QIconViewItem*) ), 165 connect(m_view, SIGNAL(clicked(QIconViewItem*) ),
165 this, SLOT(slotClicked(QIconViewItem*)) ); 166 this, SLOT(slotClicked(QIconViewItem*)) );
166 connect(m_view, SIGNAL(returnPressed(QIconViewItem*)), 167 connect(m_view, SIGNAL(returnPressed(QIconViewItem*)),
167 this, SLOT(slotClicked(QIconViewItem*)) ); 168 this, SLOT(slotClicked(QIconViewItem*)) );
@@ -354,25 +355,27 @@ void PIconView::slotTrash() {
354 355
355/* 356/*
356 * see what views are available 357 * see what views are available
357 */ 358 */
358void PIconView::loadViews() { 359void PIconView::loadViews() {
359 ViewMap::Iterator it; 360 ViewMap::Iterator it;
360 ViewMap* map = viewMap(); 361 ViewMap* map = viewMap();
361 for ( it = map->begin(); it != map->end(); ++it ) 362 for ( it = map->begin(); it != map->end(); ++it )
362 m_views->insertItem( it.key() ); 363 m_views->insertItem( it.key() );
363} 364}
364 365
365void PIconView::resetView() { 366void PIconView::resetView() {
367 m_internalReset = true;
366 slotViewChanged(m_views->currentItem()); 368 slotViewChanged(m_views->currentItem());
369 m_internalReset = false;
367} 370}
368 371
369/* 372/*
370 *swicth view reloadDir and connect signals 373 *swicth view reloadDir and connect signals
371 */ 374 */
372void PIconView::slotViewChanged( int i) { 375void PIconView::slotViewChanged( int i) {
373 if (!m_views->count() ) { 376 if (!m_views->count() ) {
374 setCurrentView( 0l); 377 setCurrentView( 0l);
375 return; 378 return;
376 } 379 }
377 380
378 PDirView* cur = currentView(); 381 PDirView* cur = currentView();
@@ -398,26 +401,29 @@ void PIconView::slotViewChanged( int i) {
398 /* connect to the signals of the lister */ 401 /* connect to the signals of the lister */
399 PDirLister* lis = cur->dirLister(); 402 PDirLister* lis = cur->dirLister();
400 connect(lis, SIGNAL(sig_thumbInfo(const QString&, const QString& )), 403 connect(lis, SIGNAL(sig_thumbInfo(const QString&, const QString& )),
401 this, SLOT( slotThumbInfo(const QString&, const QString&))); 404 this, SLOT( slotThumbInfo(const QString&, const QString&)));
402 connect(lis, SIGNAL( sig_thumbNail(const QString&, const QPixmap&)), 405 connect(lis, SIGNAL( sig_thumbNail(const QString&, const QPixmap&)),
403 this, SLOT(slotThumbNail(const QString&, const QPixmap&))); 406 this, SLOT(slotThumbNail(const QString&, const QPixmap&)));
404 connect(lis, SIGNAL(sig_start()), 407 connect(lis, SIGNAL(sig_start()),
405 this, SLOT(slotStart())); 408 this, SLOT(slotStart()));
406 connect(lis, SIGNAL(sig_end()) , 409 connect(lis, SIGNAL(sig_end()) ,
407 this, SLOT(slotEnd()) ); 410 this, SLOT(slotEnd()) );
408 411
409 412
410 /* reload now with default Path*/ 413 /* reload now with default Path
411 m_path = lis->defaultPath(); 414 * but only if it isn't a reset like from setupdlg
415 */
416 if (!m_internalReset)
417 m_path = lis->defaultPath();
412 QTimer::singleShot( 0, this, SLOT(slotReloadDir())); 418 QTimer::singleShot( 0, this, SLOT(slotReloadDir()));
413} 419}
414 420
415 421
416void PIconView::slotReloadDir() { 422void PIconView::slotReloadDir() {
417 slotChangeDir( m_path ); 423 slotChangeDir( m_path );
418} 424}
419 425
420 426
421/* 427/*
422 * add files and folders 428 * add files and folders
423 */ 429 */