summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/viewmodebutton.cpp
Unidiff
Diffstat (limited to 'noncore/graphics/opie-eye/gui/viewmodebutton.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/viewmodebutton.cpp29
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 @@
1#include "viewmodebutton.h" 1#include "viewmodebutton.h"
2 2
3#include <opie2/odebug.h>
4
3#include <qtoolbar.h> 5#include <qtoolbar.h>
4#include <qpopupmenu.h> 6#include <qpopupmenu.h>
5 7
6ViewModeButton::ViewModeButton( QToolBar* bar ) 8ViewModeButton::ViewModeButton( QToolBar* bar )
7 : QToolButton( bar ) 9 : QToolButton( bar )
8{ 10{
9 setIconSet( Resource::loadIconSet( "toys" ) ); 11 slotChange( 1 );
10 QPopupMenu *pop= new QPopupMenu( this ); 12 QPopupMenu *pop= new QPopupMenu( this );
11 pop->setCheckable( true ); 13 pop->setCheckable( true );
12 pop->insertItem( tr("Thumbnail and Imageinfo"), 0 ); 14 pop->insertItem( tr("Thumbnail and Imageinfo"), 1 );
13 pop->insertItem( tr("Thumbnail and Name" ), 1 ); 15 pop->insertItem( tr("Thumbnail and Name" ), 2 );
14 pop->insertItem( tr("Name Only" ), 2 ); 16 pop->insertItem( tr("Name Only" ), 3 );
15 connect(pop, SIGNAL(activated(int)), 17 connect(pop, SIGNAL(activated(int)),
16 this, SIGNAL(changeMode(int)) ); 18 this, SIGNAL(changeMode(int)) );
19 connect(pop, SIGNAL(activated(int)),
20 this, SLOT(slotChange(int)) );
17 21
18 22
19 setPopup( pop ); 23 setPopup( pop );
20} 24}
21 25
22ViewModeButton::~ViewModeButton() { 26ViewModeButton::~ViewModeButton() {
27}
28
29void ViewModeButton::slotChange( int i ) {
30 QString name;
31 switch( i ) {
32 case 1:
33 name = "opie-eye/opie-eye-thumb";
34 break;
35 case 2:
36 name = "opie-eye/opie-eye-thumbonly";
37 break;
38 case 3:
39 name = "opie-eye/opie-eye-textview";
40 break;
41 }
23 42
43 qWarning("foo %d" +name, i );
44 setIconSet( Resource::loadIconSet( name ) );
24} 45}