From 7c29eeaecc8301fb500851382b3d94092ae72719 Mon Sep 17 00:00:00 2001 From: alwin Date: Fri, 16 Apr 2004 00:54:42 +0000 Subject: not all buttons will showed in every view, small beauties --- (limited to 'noncore/graphics/opie-eye/gui') diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index f6e1816..7231bfb 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp @@ -279,7 +279,6 @@ QString PIconView::nextFileName(bool &isDir)const return QString::null; IconViewItem* it = static_cast( _it ); isDir = it->isDir(); - m_view->setCurrentItem(_it); return it->path(); } @@ -293,7 +292,6 @@ QString PIconView::prevFileName(bool &isDir)const{ return QString::null; IconViewItem* it = static_cast( _it ); isDir = it->isDir(); - m_view->setCurrentItem(_it); return it->path(); } @@ -479,9 +477,10 @@ void PIconView::slotShowNext() { bool isDir = false; QString name = nextFileName(isDir); - if (isDir) return; if (name.isEmpty()) return; - odebug << "Show next: " << name << oendl; + if (isDir) return; + /* if we got a name we have a next item */ + m_view->setCurrentItem(m_view->currentItem()->nextItem()); slotShowImage(name); } @@ -489,8 +488,10 @@ void PIconView::slotShowPrev() { bool isDir = false; QString name = prevFileName(isDir); - if (isDir) return; if (name.isEmpty()) return; + if (isDir) return; + /* if we got a name we have a prev item */ + m_view->setCurrentItem(m_view->currentItem()->prevItem()); slotShowImage(name); } diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp index aa2b9bc..fbc4494 100644 --- a/noncore/graphics/opie-eye/gui/imageview.cpp +++ b/noncore/graphics/opie-eye/gui/imageview.cpp @@ -43,6 +43,8 @@ void ImageView::initKeys() lst.append( Opie::Core::OKeyPair::downArrowKey() ); lst.append( Opie::Core::OKeyPair::leftArrowKey() ); lst.append( Opie::Core::OKeyPair::rightArrowKey() ); + lst.append( Opie::Core::OKeyPair(Qt::Key_N,0)); + lst.append( Opie::Core::OKeyPair(Qt::Key_P,0)); m_viewManager = new Opie::Core::OKeyConfigManager(m_cfg, "image_view_keys", lst, false,this, "image_view_keys" ); diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 57be247..6f3f255 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp @@ -64,16 +64,16 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce); - QToolButton *btn = new QToolButton( bar ); - btn->setIconSet( Resource::loadIconSet( "up" ) ); - connect( btn, SIGNAL(clicked()), + upButton = new QToolButton( bar ); + upButton->setIconSet( Resource::loadIconSet( "up" ) ); + connect( upButton, SIGNAL(clicked()), m_view, SLOT(slotDirUp()) ); - btn = new PFileSystem( bar ); - connect( btn, SIGNAL( changeDir( const QString& ) ), + fsButton = new PFileSystem( bar ); + connect( fsButton, SIGNAL( changeDir( const QString& ) ), m_view, SLOT(slotChangeDir( const QString& ) ) ); - btn = new QToolButton( bar ); + QToolButton*btn = new QToolButton( bar ); btn->setIconSet( Resource::loadIconSet( "edit" ) ); connect( btn, SIGNAL(clicked()), m_view, SLOT(slotRename()) ); @@ -91,8 +91,8 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) m_view, SLOT(slotTrash() ) ); - btn = new ViewModeButton( bar ); - connect( btn, SIGNAL(changeMode(int)), + viewModeButton = new ViewModeButton( bar ); + connect( viewModeButton, SIGNAL(changeMode(int)), m_view, SLOT(slotChangeMode(int))); btn = new QToolButton( bar ); @@ -100,6 +100,18 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) connect( btn, SIGNAL(clicked() ), this, SLOT(slotConfig() ) ); + + + prevButton = new QToolButton(bar); + prevButton->setIconSet( Resource::loadIconSet( "back" ) ); + connect(prevButton,SIGNAL(clicked()),m_view,SLOT(slotShowPrev())); + prevButton->hide(); + + nextButton = new QToolButton(bar); + nextButton->setIconSet( Resource::loadIconSet( "forward" ) ); + connect(nextButton,SIGNAL(clicked()),m_view,SLOT(slotShowNext())); + nextButton->hide(); + rotateButton = new QToolButton(bar); rotateButton->setIconSet( Resource::loadIconSet( "rotate" ) ); rotateButton->setToggleButton(true); @@ -284,6 +296,11 @@ void PMainWindow::slotShowInfo( const QString& inf ) { initInfo(); } m_info->setPath( inf ); + prevButton->hide(); + nextButton->hide(); + upButton->hide(); + fsButton->hide(); + viewModeButton->hide(); m_stack->raiseWidget( ImageInfo ); } @@ -292,6 +309,11 @@ void PMainWindow::slotDisplay( const QString& inf ) { initDisp(); } m_disp->setImage( inf ); + prevButton->show(); + nextButton->show(); + upButton->hide(); + fsButton->hide(); + viewModeButton->hide(); m_stack->raiseWidget( ImageDisplay ); } @@ -316,6 +338,11 @@ void PMainWindow::closeEvent( QCloseEvent* ev ) { } void PMainWindow::raiseIconView() { + prevButton->hide(); + nextButton->hide(); + upButton->show(); + fsButton->show(); + viewModeButton->show(); m_stack->raiseWidget( IconView ); } diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h index adb5dc2..1967ef7 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.h +++ b/noncore/graphics/opie-eye/gui/mainwindow.h @@ -63,8 +63,8 @@ private: bool autoRotate; bool autoScale; bool zoomerOn; - QToolButton*rotateButton; - + QToolButton*rotateButton,*upButton,*fsButton,*viewModeButton; + QToolButton*nextButton,*prevButton; private slots: void slotConfig(); -- cgit v0.9.0.2