author | alwin <alwin> | 2004-04-21 18:31:44 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-21 18:31:44 (UTC) |
commit | 81cd1a4a916fb00b6c8867bdc1d945db155b12c0 (patch) (unidiff) | |
tree | ce302c254c8c2160a86ffc0a5abe6cfd51fd33b3 /noncore/graphics/opie-eye/gui | |
parent | ac414fa3802b471857bc84ecdd0d37200541b0a7 (diff) | |
download | opie-81cd1a4a916fb00b6c8867bdc1d945db155b12c0.zip opie-81cd1a4a916fb00b6c8867bdc1d945db155b12c0.tar.gz opie-81cd1a4a916fb00b6c8867bdc1d945db155b12c0.tar.bz2 |
- added DocView mode
- fixed a bug in iconview and some small fixes more
Diffstat (limited to 'noncore/graphics/opie-eye/gui') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 31 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 3 |
2 files changed, 23 insertions, 11 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index 660c4fa..087db30 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp | |||
@@ -345,7 +345,7 @@ void PIconView::loadViews() { | |||
345 | ViewMap::Iterator it; | 345 | ViewMap::Iterator it; |
346 | ViewMap* map = viewMap(); | 346 | ViewMap* map = viewMap(); |
347 | for ( it = map->begin(); it != map->end(); ++it ) | 347 | for ( it = map->begin(); it != map->end(); ++it ) |
348 | m_views->insertItem( QObject::tr(it.key() ) ); | 348 | m_views->insertItem( it.key() ); |
349 | } | 349 | } |
350 | 350 | ||
351 | void PIconView::resetView() { | 351 | void PIconView::resetView() { |
@@ -362,9 +362,15 @@ void PIconView::slotViewChanged( int i) { | |||
362 | } | 362 | } |
363 | 363 | ||
364 | PDirView* cur = currentView(); | 364 | PDirView* cur = currentView(); |
365 | delete cur; | 365 | if (cur) delete cur; |
366 | QString str = m_views->text(i); | 366 | QString str = m_views->text(i); |
367 | cur = (*(*viewMap())[str])(*m_cfg); | 367 | ViewMap* map = viewMap(); |
368 | if (!map) {setCurrentView(0l); return;} | ||
369 | if (map->find(str) == map->end()) { | ||
370 | owarn << "Key not found" << oendl; | ||
371 | setCurrentView(0l); return; | ||
372 | } | ||
373 | cur = (*(*map)[str])(*m_cfg); | ||
368 | setCurrentView( cur ); | 374 | setCurrentView( cur ); |
369 | 375 | ||
370 | /* connect to the signals of the lister */ | 376 | /* connect to the signals of the lister */ |
@@ -406,9 +412,13 @@ void PIconView::addFiles( const QStringList& lst) { | |||
406 | QStringList::ConstIterator it; | 412 | QStringList::ConstIterator it; |
407 | IconViewItem * _iv; | 413 | IconViewItem * _iv; |
408 | QPixmap*m_pix = 0; | 414 | QPixmap*m_pix = 0; |
415 | QString pre = ""; | ||
416 | if (!m_path.isEmpty()) { | ||
417 | pre = m_path+"/"; | ||
418 | } | ||
409 | for (it=lst.begin(); it!= lst.end(); ++it ) { | 419 | for (it=lst.begin(); it!= lst.end(); ++it ) { |
410 | m_pix = PPixmapCache::self()->cachedImage( m_path+"/"+(*it), 64, 64 ); | 420 | m_pix = PPixmapCache::self()->cachedImage( pre+(*it), 64, 64 ); |
411 | _iv = new IconViewItem( m_view, m_path+"/"+(*it), (*it) ); | 421 | _iv = new IconViewItem( m_view, pre+(*it), (*it) ); |
412 | if (m_mode==3) { | 422 | if (m_mode==3) { |
413 | _iv->setTextOnly(true); | 423 | _iv->setTextOnly(true); |
414 | _iv->setPixmap(QPixmap()); | 424 | _iv->setPixmap(QPixmap()); |
@@ -543,11 +553,12 @@ void PIconView::slotShowImage() | |||
543 | bool isDir = false; | 553 | bool isDir = false; |
544 | QString name = currentFileName(isDir); | 554 | QString name = currentFileName(isDir); |
545 | if (isDir) return; | 555 | if (isDir) return; |
546 | |||
547 | slotShowImage( name ); | 556 | slotShowImage( name ); |
548 | } | 557 | } |
549 | void PIconView::slotShowImage( const QString& name) { | 558 | void PIconView::slotShowImage( const QString& name) { |
550 | emit sig_display( name ); | 559 | PDirLister *lister = currentView()->dirLister(); |
560 | QString r_name = lister->nameToFname(name); | ||
561 | emit sig_display( r_name ); | ||
551 | } | 562 | } |
552 | void PIconView::slotImageInfo() { | 563 | void PIconView::slotImageInfo() { |
553 | bool isDir = false; | 564 | bool isDir = false; |
@@ -558,7 +569,9 @@ void PIconView::slotImageInfo() { | |||
558 | } | 569 | } |
559 | 570 | ||
560 | void PIconView::slotImageInfo( const QString& name) { | 571 | void PIconView::slotImageInfo( const QString& name) { |
561 | emit sig_showInfo( name ); | 572 | PDirLister *lister = currentView()->dirLister(); |
573 | QString r_name = lister->nameToFname(name); | ||
574 | emit sig_showInfo(r_name ); | ||
562 | } | 575 | } |
563 | 576 | ||
564 | 577 | ||
@@ -579,8 +592,6 @@ void PIconView::resizeEvent( QResizeEvent* re ) { | |||
579 | 592 | ||
580 | 593 | ||
581 | void PIconView::calculateGrid() { | 594 | void PIconView::calculateGrid() { |
582 | odebug << "Calc grid: x=" << m_view->gridX() << " y=" << m_view->gridY() << oendl; | ||
583 | odebug << "Size of view: " << m_view->size() << oendl; | ||
584 | int dw = QApplication::desktop()->width(); | 595 | int dw = QApplication::desktop()->width(); |
585 | int viewerWidth = dw-style().scrollBarExtent().width(); | 596 | int viewerWidth = dw-style().scrollBarExtent().width(); |
586 | 597 | ||
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 58f02ef..058fca0 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -34,7 +34,8 @@ | |||
34 | 34 | ||
35 | 35 | ||
36 | 36 | ||
37 | OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" ) | 37 | //OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" ) |
38 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>) | ||
38 | 39 | ||
39 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | 40 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) |
40 | : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) | 41 | : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) |