summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index 6fff5ab..438fbf2 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -1,127 +1,126 @@
1/* 1/*
2 * GPLv2 zecke@handhelds.org 2 * GPLv2 zecke@handhelds.org
3 * No WArranty... 3 * No WArranty...
4 */ 4 */
5#include "mainwindow.h" 5#include "mainwindow.h"
6#include "imageview.h" 6#include "imageview.h"
7 7
8#include "iconview.h" 8#include "iconview.h"
9#include "filesystem.h" 9#include "filesystem.h"
10#include "imageinfoui.h" 10#include "imageinfoui.h"
11#include "viewmodebutton.h" 11#include "viewmodebutton.h"
12 12
13#include <iface/ifaceinfo.h> 13#include <iface/ifaceinfo.h>
14#include <iface/dirview.h> 14#include <iface/dirview.h>
15 15
16#include <opie2/odebug.h> 16#include <opie2/odebug.h>
17#include <opie2/owidgetstack.h> 17#include <opie2/owidgetstack.h>
18#include <opie2/oapplicationfactory.h> 18#include <opie2/oapplicationfactory.h>
19#include <opie2/otabwidget.h> 19#include <opie2/otabwidget.h>
20#include <opie2/okeyconfigwidget.h> 20#include <opie2/okeyconfigwidget.h>
21 21
22#include <qpe/resource.h> 22#include <qpe/resource.h>
23#include <qpe/config.h> 23#include <qpe/config.h>
24#include <qpe/ir.h> 24#include <qpe/ir.h>
25#include <qpe/applnk.h> 25#include <qpe/applnk.h>
26 26
27#include <qtoolbar.h> 27#include <qtoolbar.h>
28#include <qtoolbutton.h> 28#include <qtoolbutton.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qdialog.h> 30#include <qdialog.h>
31#include <qmap.h> 31#include <qmap.h>
32#include <qtimer.h> 32#include <qtimer.h>
33#include <qframe.h> 33#include <qframe.h>
34 34
35 35
36//OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" ) 36//OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" )
37OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>) 37OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>)
38 38
39PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) 39PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
40 : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) 40 : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 )
41{ 41{
42 setCaption( QObject::tr("Opie Eye Caramba" ) ); 42 setCaption( QObject::tr("Opie Eye Caramba" ) );
43 m_cfg = new Opie::Core::OConfig("phunkview"); 43 m_cfg = new Opie::Core::OConfig("phunkview");
44 m_cfg->setGroup("Zecke_view" ); 44 m_cfg->setGroup("Zecke_view" );
45// odebug << "Process-wide OApplication object @ " << oApp << oendl;
46 /* 45 /*
47 * Initialize ToolBar and IconView 46 * Initialize ToolBar and IconView
48 * And Connect Them 47 * And Connect Them
49 */ 48 */
50 QToolBar *bar = new QToolBar( this ); 49 QToolBar *bar = new QToolBar( this );
51 bar->setHorizontalStretchable( true ); 50 bar->setHorizontalStretchable( true );
52 setToolBarsMovable( false ); 51 setToolBarsMovable( false );
53 52
54 m_stack = new Opie::Ui::OWidgetStack( this ); 53 m_stack = new Opie::Ui::OWidgetStack( this );
55 setCentralWidget( m_stack ); 54 setCentralWidget( m_stack );
56 55
57 m_view = new PIconView( m_stack, m_cfg ); 56 m_view = new PIconView( m_stack, m_cfg );
58 m_stack->addWidget( m_view, IconView ); 57 m_stack->addWidget( m_view, IconView );
59 m_stack->raiseWidget( IconView ); 58 m_stack->raiseWidget( IconView );
60 connect(m_view, SIGNAL(sig_display(const QString&)), 59 connect(m_view, SIGNAL(sig_display(const QString&)),
61 this, SLOT(slotDisplay(const QString&))); 60 this, SLOT(slotDisplay(const QString&)));
62 connect(m_view, SIGNAL(sig_showInfo(const QString&)), 61 connect(m_view, SIGNAL(sig_showInfo(const QString&)),
63 this, SLOT(slotShowInfo(const QString&)) ); 62 this, SLOT(slotShowInfo(const QString&)) );
64 63
65 m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce); 64 m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce);
66 65
67 upButton = new QToolButton( bar ); 66 upButton = new QToolButton( bar );
68 upButton->setIconSet( Resource::loadIconSet( "up" ) ); 67 upButton->setIconSet( Resource::loadIconSet( "up" ) );
69 connect( upButton, SIGNAL(clicked()), 68 connect( upButton, SIGNAL(clicked()),
70 m_view, SLOT(slotDirUp()) ); 69 m_view, SLOT(slotDirUp()) );
71 70
72 fsButton = new PFileSystem( bar ); 71 fsButton = new PFileSystem( bar );
73 connect( fsButton, SIGNAL( changeDir( const QString& ) ), 72 connect( fsButton, SIGNAL( changeDir( const QString& ) ),
74 m_view, SLOT(slotChangeDir( const QString& ) ) ); 73 m_view, SLOT(slotChangeDir( const QString& ) ) );
75 74
76 QToolButton*btn = new QToolButton( bar ); 75 QToolButton*btn = new QToolButton( bar );
77 btn->setIconSet( Resource::loadIconSet( "edit" ) ); 76 btn->setIconSet( Resource::loadIconSet( "edit" ) );
78 connect( btn, SIGNAL(clicked()), 77 connect( btn, SIGNAL(clicked()),
79 m_view, SLOT(slotRename()) ); 78 m_view, SLOT(slotImageInfo()) );
80 79
81 if ( Ir::supported() ) { 80 if ( Ir::supported() ) {
82 btn = new QToolButton( bar ); 81 btn = new QToolButton( bar );
83 btn->setIconSet( Resource::loadIconSet( "beam" ) ); 82 btn->setIconSet( Resource::loadIconSet( "beam" ) );
84 connect( btn, SIGNAL(clicked()), 83 connect( btn, SIGNAL(clicked()),
85 m_view, SLOT(slotBeam()) ); 84 m_view, SLOT(slotBeam()) );
86 } 85 }
87 86
88 btn = new QToolButton( bar ); 87 btn = new QToolButton( bar );
89 btn->setIconSet( Resource::loadIconSet( "trash" ) ); 88 btn->setIconSet( Resource::loadIconSet( "trash" ) );
90 connect( btn, SIGNAL(clicked() ), 89 connect( btn, SIGNAL(clicked() ),
91 m_view, SLOT(slotTrash() ) ); 90 m_view, SLOT(slotTrash() ) );
92 91
93 92
94 int mode = m_cfg->readNumEntry("ListViewMode", 1); 93 int mode = m_cfg->readNumEntry("ListViewMode", 1);
95 if (mode < 1 || mode>3) mode = 1; 94 if (mode < 1 || mode>3) mode = 1;
96 viewModeButton = new ViewModeButton( bar,mode ); 95 viewModeButton = new ViewModeButton( bar,mode );
97 connect( viewModeButton, SIGNAL(changeMode(int)), 96 connect( viewModeButton, SIGNAL(changeMode(int)),
98 m_view, SLOT(slotChangeMode(int))); 97 m_view, SLOT(slotChangeMode(int)));
99 98
100 btn = new QToolButton( bar ); 99 btn = new QToolButton( bar );
101 btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) ); 100 btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) );
102 connect( btn, SIGNAL(clicked() ), 101 connect( btn, SIGNAL(clicked() ),
103 this, SLOT(slotConfig() ) ); 102 this, SLOT(slotConfig() ) );
104 103
105 104
106 105
107 prevButton = new QToolButton(bar); 106 prevButton = new QToolButton(bar);
108 prevButton->setIconSet( Resource::loadIconSet( "back" ) ); 107 prevButton->setIconSet( Resource::loadIconSet( "back" ) );
109 connect(prevButton,SIGNAL(clicked()),m_view,SLOT(slotShowPrev())); 108 connect(prevButton,SIGNAL(clicked()),m_view,SLOT(slotShowPrev()));
110 109
111 nextButton = new QToolButton(bar); 110 nextButton = new QToolButton(bar);
112 nextButton->setIconSet( Resource::loadIconSet( "forward" ) ); 111 nextButton->setIconSet( Resource::loadIconSet( "forward" ) );
113 connect(nextButton,SIGNAL(clicked()),m_view,SLOT(slotShowNext())); 112 connect(nextButton,SIGNAL(clicked()),m_view,SLOT(slotShowNext()));
114 113
115 rotateButton = new QToolButton(bar); 114 rotateButton = new QToolButton(bar);
116 rotateButton->setIconSet( Resource::loadIconSet( "rotate" ) ); 115 rotateButton->setIconSet( Resource::loadIconSet( "rotate" ) );
117 rotateButton->setToggleButton(true); 116 rotateButton->setToggleButton(true);
118 117
119 if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { 118 if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) {
120 rotateButton->setOn(true); 119 rotateButton->setOn(true);
121 autoRotate = true; 120 autoRotate = true;
122 prevButton->hide(); 121 prevButton->hide();
123 nextButton->hide(); 122 nextButton->hide();
124 } else { 123 } else {
125 rotateButton->setOn(false); 124 rotateButton->setOn(false);
126 autoRotate = false; 125 autoRotate = false;
127 } 126 }