Diffstat (limited to 'noncore/graphics/opie-eye/gui/viewmodebutton.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/viewmodebutton.cpp | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/noncore/graphics/opie-eye/gui/viewmodebutton.cpp b/noncore/graphics/opie-eye/gui/viewmodebutton.cpp index fdf4e77..0e4a7cb 100644 --- a/noncore/graphics/opie-eye/gui/viewmodebutton.cpp +++ b/noncore/graphics/opie-eye/gui/viewmodebutton.cpp @@ -1,24 +1,45 @@ #include "viewmodebutton.h" +#include <opie2/odebug.h> + #include <qtoolbar.h> #include <qpopupmenu.h> ViewModeButton::ViewModeButton( QToolBar* bar ) : QToolButton( bar ) { - setIconSet( Resource::loadIconSet( "toys" ) ); + slotChange( 1 ); QPopupMenu *pop= new QPopupMenu( this ); pop->setCheckable( true ); - pop->insertItem( tr("Thumbnail and Imageinfo"), 0 ); - pop->insertItem( tr("Thumbnail and Name" ), 1 ); - pop->insertItem( tr("Name Only" ), 2 ); + pop->insertItem( tr("Thumbnail and Imageinfo"), 1 ); + pop->insertItem( tr("Thumbnail and Name" ), 2 ); + pop->insertItem( tr("Name Only" ), 3 ); connect(pop, SIGNAL(activated(int)), this, SIGNAL(changeMode(int)) ); + connect(pop, SIGNAL(activated(int)), + this, SLOT(slotChange(int)) ); setPopup( pop ); } ViewModeButton::~ViewModeButton() { +} + +void ViewModeButton::slotChange( int i ) { + QString name; + switch( i ) { + case 1: + name = "opie-eye/opie-eye-thumb"; + break; + case 2: + name = "opie-eye/opie-eye-thumbonly"; + break; + case 3: + name = "opie-eye/opie-eye-textview"; + break; + } + qWarning("foo %d" +name, i ); + setIconSet( Resource::loadIconSet( name ) ); } |