author | zecke <zecke> | 2004-04-07 23:47:43 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-04-07 23:47:43 (UTC) |
commit | 10ec13c9068e7e4ca0acf75e5843ebd91e4e8566 (patch) (unidiff) | |
tree | 9889be205ecb8d65aeca3b280d1db7ed0f07791c | |
parent | 61cb9c9ad238e5aec6aaa1384549e0aab99d14bf (diff) | |
download | opie-10ec13c9068e7e4ca0acf75e5843ebd91e4e8566.zip opie-10ec13c9068e7e4ca0acf75e5843ebd91e4e8566.tar.gz opie-10ec13c9068e7e4ca0acf75e5843ebd91e4e8566.tar.bz2 |
Implement setDocument so now we could start replacing showimg
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 10 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 21a668a..3650493 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -1,283 +1,293 @@ | |||
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 | 6 | ||
7 | #include "iconview.h" | 7 | #include "iconview.h" |
8 | #include "filesystem.h" | 8 | #include "filesystem.h" |
9 | #include "imageinfoui.h" | 9 | #include "imageinfoui.h" |
10 | #include "imageview.h" | 10 | #include "imageview.h" |
11 | 11 | ||
12 | #include <iface/ifaceinfo.h> | 12 | #include <iface/ifaceinfo.h> |
13 | #include <iface/dirview.h> | 13 | #include <iface/dirview.h> |
14 | 14 | ||
15 | #include <opie2/odebug.h> | 15 | #include <opie2/odebug.h> |
16 | #include <opie2/owidgetstack.h> | 16 | #include <opie2/owidgetstack.h> |
17 | #include <opie2/oapplicationfactory.h> | 17 | #include <opie2/oapplicationfactory.h> |
18 | #include <opie2/otabwidget.h> | 18 | #include <opie2/otabwidget.h> |
19 | #include <opie2/okeyconfigwidget.h> | 19 | #include <opie2/okeyconfigwidget.h> |
20 | 20 | ||
21 | #include <qpe/resource.h> | 21 | #include <qpe/resource.h> |
22 | #include <qpe/config.h> | 22 | #include <qpe/config.h> |
23 | #include <qpe/ir.h> | 23 | #include <qpe/ir.h> |
24 | #include <qpe/applnk.h> | ||
24 | 25 | ||
25 | #include <qtoolbar.h> | 26 | #include <qtoolbar.h> |
26 | #include <qtoolbutton.h> | 27 | #include <qtoolbutton.h> |
27 | #include <qlayout.h> | 28 | #include <qlayout.h> |
28 | #include <qdialog.h> | 29 | #include <qdialog.h> |
29 | #include <qmap.h> | 30 | #include <qmap.h> |
30 | #include <qtimer.h> | 31 | #include <qtimer.h> |
31 | 32 | ||
32 | 33 | ||
33 | 34 | ||
34 | 35 | ||
35 | OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" ) | 36 | OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" ) |
36 | 37 | ||
37 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | 38 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) |
38 | : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) | 39 | : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) |
39 | { | 40 | { |
40 | setCaption( QObject::tr("Opie Eye Caramba" ) ); | 41 | setCaption( QObject::tr("Opie Eye Caramba" ) ); |
41 | m_cfg = new Opie::Core::OConfig("phunkview"); | 42 | m_cfg = new Opie::Core::OConfig("phunkview"); |
42 | m_cfg->setGroup("Zecke_view" ); | 43 | m_cfg->setGroup("Zecke_view" ); |
43 | // qDebug( "Process-wide OApplication object @ %0x", oApp ); | 44 | // qDebug( "Process-wide OApplication object @ %0x", oApp ); |
44 | /* | 45 | /* |
45 | * Initialize ToolBar and IconView | 46 | * Initialize ToolBar and IconView |
46 | * And Connect Them | 47 | * And Connect Them |
47 | */ | 48 | */ |
48 | QToolBar *bar = new QToolBar( this ); | 49 | QToolBar *bar = new QToolBar( this ); |
49 | bar->setHorizontalStretchable( true ); | 50 | bar->setHorizontalStretchable( true ); |
50 | setToolBarsMovable( false ); | 51 | setToolBarsMovable( false ); |
51 | 52 | ||
52 | m_stack = new Opie::Ui::OWidgetStack( this ); | 53 | m_stack = new Opie::Ui::OWidgetStack( this ); |
53 | setCentralWidget( m_stack ); | 54 | setCentralWidget( m_stack ); |
54 | 55 | ||
55 | m_view = new PIconView( m_stack, m_cfg ); | 56 | m_view = new PIconView( m_stack, m_cfg ); |
56 | m_stack->addWidget( m_view, IconView ); | 57 | m_stack->addWidget( m_view, IconView ); |
57 | m_stack->raiseWidget( IconView ); | 58 | m_stack->raiseWidget( IconView ); |
58 | connect(m_view, SIGNAL(sig_display(const QString&)), | 59 | connect(m_view, SIGNAL(sig_display(const QString&)), |
59 | this, SLOT(slotDisplay(const QString&))); | 60 | this, SLOT(slotDisplay(const QString&))); |
60 | connect(m_view, SIGNAL(sig_showInfo(const QString&)), | 61 | connect(m_view, SIGNAL(sig_showInfo(const QString&)), |
61 | this, SLOT(slotShowInfo(const QString&)) ); | 62 | this, SLOT(slotShowInfo(const QString&)) ); |
62 | 63 | ||
63 | QToolButton *btn = new QToolButton( bar ); | 64 | QToolButton *btn = new QToolButton( bar ); |
64 | btn->setIconSet( Resource::loadIconSet( "up" ) ); | 65 | btn->setIconSet( Resource::loadIconSet( "up" ) ); |
65 | connect( btn, SIGNAL(clicked()), | 66 | connect( btn, SIGNAL(clicked()), |
66 | m_view, SLOT(slotDirUp()) ); | 67 | m_view, SLOT(slotDirUp()) ); |
67 | 68 | ||
68 | btn = new PFileSystem( bar ); | 69 | btn = new PFileSystem( bar ); |
69 | connect( btn, SIGNAL( changeDir( const QString& ) ), | 70 | connect( btn, SIGNAL( changeDir( const QString& ) ), |
70 | m_view, SLOT(slotChangeDir( const QString& ) ) ); | 71 | m_view, SLOT(slotChangeDir( const QString& ) ) ); |
71 | 72 | ||
72 | btn = new QToolButton( bar ); | 73 | btn = new QToolButton( bar ); |
73 | btn->setIconSet( Resource::loadIconSet( "edit" ) ); | 74 | btn->setIconSet( Resource::loadIconSet( "edit" ) ); |
74 | connect( btn, SIGNAL(clicked()), | 75 | connect( btn, SIGNAL(clicked()), |
75 | m_view, SLOT(slotRename()) ); | 76 | m_view, SLOT(slotRename()) ); |
76 | 77 | ||
77 | if ( Ir::supported() ) { | 78 | if ( Ir::supported() ) { |
78 | btn = new QToolButton( bar ); | 79 | btn = new QToolButton( bar ); |
79 | btn->setIconSet( Resource::loadIconSet( "beam" ) ); | 80 | btn->setIconSet( Resource::loadIconSet( "beam" ) ); |
80 | connect( btn, SIGNAL(clicked()), | 81 | connect( btn, SIGNAL(clicked()), |
81 | m_view, SLOT(slotBeam()) ); | 82 | m_view, SLOT(slotBeam()) ); |
82 | } | 83 | } |
83 | 84 | ||
84 | btn = new QToolButton( bar ); | 85 | btn = new QToolButton( bar ); |
85 | btn->setIconSet( Resource::loadIconSet( "trash" ) ); | 86 | btn->setIconSet( Resource::loadIconSet( "trash" ) ); |
86 | connect( btn, SIGNAL(clicked() ), | 87 | connect( btn, SIGNAL(clicked() ), |
87 | m_view, SLOT(slotTrash() ) ); | 88 | m_view, SLOT(slotTrash() ) ); |
88 | 89 | ||
89 | btn = new QToolButton( bar ); | 90 | btn = new QToolButton( bar ); |
90 | btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) ); | 91 | btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) ); |
91 | connect( btn, SIGNAL(clicked() ), | 92 | connect( btn, SIGNAL(clicked() ), |
92 | this, SLOT(slotConfig() ) ); | 93 | this, SLOT(slotConfig() ) ); |
93 | 94 | ||
94 | rotateButton = new QToolButton(bar); | 95 | rotateButton = new QToolButton(bar); |
95 | rotateButton->setIconSet( Resource::loadIconSet( "rotate" ) ); | 96 | rotateButton->setIconSet( Resource::loadIconSet( "rotate" ) ); |
96 | rotateButton->setToggleButton(true); | 97 | rotateButton->setToggleButton(true); |
97 | rotateButton->setOn(true); | 98 | rotateButton->setOn(true); |
98 | connect(rotateButton,SIGNAL(toggled(bool)),this,SLOT(slotRotateToggled(bool))); | 99 | connect(rotateButton,SIGNAL(toggled(bool)),this,SLOT(slotRotateToggled(bool))); |
99 | autoRotate = true; | 100 | autoRotate = true; |
100 | 101 | ||
101 | btn = new QToolButton(bar); | 102 | btn = new QToolButton(bar); |
102 | btn->setIconSet( Resource::loadIconSet( "1to1" ) ); | 103 | btn->setIconSet( Resource::loadIconSet( "1to1" ) ); |
103 | btn->setToggleButton(true); | 104 | btn->setToggleButton(true); |
104 | btn->setOn(false); | 105 | btn->setOn(false); |
105 | connect(btn,SIGNAL(toggled(bool)),this,SLOT(slotScaleToggled(bool))); | 106 | connect(btn,SIGNAL(toggled(bool)),this,SLOT(slotScaleToggled(bool))); |
106 | autoScale = true; | 107 | autoScale = true; |
107 | 108 | ||
108 | } | 109 | } |
109 | 110 | ||
110 | PMainWindow::~PMainWindow() { | 111 | PMainWindow::~PMainWindow() { |
111 | odebug << "Shutting down" << oendl; | 112 | odebug << "Shutting down" << oendl; |
112 | } | 113 | } |
113 | 114 | ||
114 | void PMainWindow::slotRotateToggled(bool how) | 115 | void PMainWindow::slotRotateToggled(bool how) |
115 | { | 116 | { |
116 | autoRotate = how; | 117 | autoRotate = how; |
117 | if (m_disp) { | 118 | if (m_disp) { |
118 | m_disp->setAutoRotate(how); | 119 | m_disp->setAutoRotate(how); |
119 | } | 120 | } |
120 | } | 121 | } |
121 | 122 | ||
122 | void PMainWindow::slotScaleToggled(bool how) | 123 | void PMainWindow::slotScaleToggled(bool how) |
123 | { | 124 | { |
124 | autoScale = !how; | 125 | autoScale = !how; |
125 | if (m_disp) { | 126 | if (m_disp) { |
126 | m_disp->setAutoScale(autoScale); | 127 | m_disp->setAutoScale(autoScale); |
127 | } | 128 | } |
128 | if (!autoScale && autoRotate) { | 129 | if (!autoScale && autoRotate) { |
129 | rotateButton->setOn(false); | 130 | rotateButton->setOn(false); |
130 | } | 131 | } |
131 | rotateButton->setEnabled(!how); | 132 | rotateButton->setEnabled(!how); |
132 | } | 133 | } |
133 | 134 | ||
134 | void PMainWindow::slotConfig() { | 135 | void PMainWindow::slotConfig() { |
135 | /* | 136 | /* |
136 | * have a tab with the possible views | 137 | * have a tab with the possible views |
137 | * a tab for globals image cache size.. scaled loading | 138 | * a tab for globals image cache size.. scaled loading |
138 | * and one tab for the KeyConfigs | 139 | * and one tab for the KeyConfigs |
139 | */ | 140 | */ |
140 | QDialog dlg(this, 0, true); | 141 | QDialog dlg(this, 0, true); |
141 | dlg.setCaption( tr("Phunk View - Config" ) ); | 142 | dlg.setCaption( tr("Phunk View - Config" ) ); |
142 | 143 | ||
143 | QHBoxLayout *lay = new QHBoxLayout(&dlg); | 144 | QHBoxLayout *lay = new QHBoxLayout(&dlg); |
144 | Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg ); | 145 | Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg ); |
145 | lay->addWidget( wid ); | 146 | lay->addWidget( wid ); |
146 | ViewMap *vM = viewMap(); | 147 | ViewMap *vM = viewMap(); |
147 | ViewMap::Iterator _it = vM->begin(); | 148 | ViewMap::Iterator _it = vM->begin(); |
148 | QMap<PDirView*, QWidget*> lst; | 149 | QMap<PDirView*, QWidget*> lst; |
149 | 150 | ||
150 | for( ; _it != vM->end(); ++_it ) { | 151 | for( ; _it != vM->end(); ++_it ) { |
151 | PDirView *view = (_it.data())(*m_cfg); | 152 | PDirView *view = (_it.data())(*m_cfg); |
152 | PInterfaceInfo *inf = view->interfaceInfo(); | 153 | PInterfaceInfo *inf = view->interfaceInfo(); |
153 | QWidget *_wid = inf->configWidget( *m_cfg ); | 154 | QWidget *_wid = inf->configWidget( *m_cfg ); |
154 | _wid->reparent(wid, QPoint() ); | 155 | _wid->reparent(wid, QPoint() ); |
155 | lst.insert( view, _wid ); | 156 | lst.insert( view, _wid ); |
156 | wid->addTab( _wid, "fileopen", inf->name() ); | 157 | wid->addTab( _wid, "fileopen", inf->name() ); |
157 | } | 158 | } |
158 | 159 | ||
159 | /* | 160 | /* |
160 | * Add the KeyConfigWidget | 161 | * Add the KeyConfigWidget |
161 | */ | 162 | */ |
162 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); | 163 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); |
163 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); | 164 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); |
164 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); | 165 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); |
165 | 166 | ||
166 | if ( !m_info ) { | 167 | if ( !m_info ) { |
167 | initInfo(); | 168 | initInfo(); |
168 | } | 169 | } |
169 | keyWid->insert( tr("Imageinfo Keyboard Actions"), m_info->manager() ); | 170 | keyWid->insert( tr("Imageinfo Keyboard Actions"), m_info->manager() ); |
170 | 171 | ||
171 | if ( !m_disp ) { | 172 | if ( !m_disp ) { |
172 | initDisp(); | 173 | initDisp(); |
173 | } | 174 | } |
174 | keyWid->insert( tr("Imageview Keyboard Actions"), m_disp->manager() ); | 175 | keyWid->insert( tr("Imageview Keyboard Actions"), m_disp->manager() ); |
175 | 176 | ||
176 | keyWid->load(); | 177 | keyWid->load(); |
177 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); | 178 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); |
178 | 179 | ||
179 | 180 | ||
180 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); | 181 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); |
181 | 182 | ||
182 | /* | 183 | /* |
183 | * clean up | 184 | * clean up |
184 | *apply changes | 185 | *apply changes |
185 | */ | 186 | */ |
186 | 187 | ||
187 | QMap<PDirView*, QWidget*>::Iterator it; | 188 | QMap<PDirView*, QWidget*>::Iterator it; |
188 | for ( it = lst.begin(); it != lst.end(); ++it ) { | 189 | for ( it = lst.begin(); it != lst.end(); ++it ) { |
189 | if ( act ) | 190 | if ( act ) |
190 | it.key()->interfaceInfo()->writeConfig(it.data(), *m_cfg); | 191 | it.key()->interfaceInfo()->writeConfig(it.data(), *m_cfg); |
191 | delete it.key(); | 192 | delete it.key(); |
192 | } | 193 | } |
193 | 194 | ||
194 | 195 | ||
195 | if ( act ) { | 196 | if ( act ) { |
196 | m_view->resetView(); | 197 | m_view->resetView(); |
197 | keyWid->save(); | 198 | keyWid->save(); |
198 | m_disp->manager()->save(); | 199 | m_disp->manager()->save(); |
199 | m_info->manager()->save(); | 200 | m_info->manager()->save(); |
200 | m_view->manager()->save(); | 201 | m_view->manager()->save(); |
201 | } | 202 | } |
202 | delete keyWid; | 203 | delete keyWid; |
203 | } | 204 | } |
204 | 205 | ||
205 | /* | 206 | /* |
206 | * create a new image info component | 207 | * create a new image info component |
207 | * and detach the current one | 208 | * and detach the current one |
208 | * we will make the other delete on exit | 209 | * we will make the other delete on exit |
209 | */ | 210 | */ |
210 | template<class T> | 211 | template<class T> |
211 | void PMainWindow::initT( const char* name, T** ptr, int id) { | 212 | void PMainWindow::initT( const char* name, T** ptr, int id) { |
212 | if ( *ptr ) { | 213 | if ( *ptr ) { |
213 | (*ptr)->disconnect(this, SLOT(slotReturn())); | 214 | (*ptr)->disconnect(this, SLOT(slotReturn())); |
214 | (*ptr)->setDestructiveClose(); | 215 | (*ptr)->setDestructiveClose(); |
215 | m_stack->removeWidget( *ptr ); | 216 | m_stack->removeWidget( *ptr ); |
216 | } | 217 | } |
217 | *ptr = new T(m_cfg, m_stack, name ); | 218 | *ptr = new T(m_cfg, m_stack, name ); |
218 | m_stack->addWidget( *ptr, id ); | 219 | m_stack->addWidget( *ptr, id ); |
219 | 220 | ||
220 | connect(*ptr, SIGNAL(sig_return()), | 221 | connect(*ptr, SIGNAL(sig_return()), |
221 | this,SLOT(slotReturn())); | 222 | this,SLOT(slotReturn())); |
222 | 223 | ||
223 | } | 224 | } |
224 | void PMainWindow::initInfo() { | 225 | void PMainWindow::initInfo() { |
225 | initT<imageinfo>( "Image Info", &m_info, ImageInfo ); | 226 | initT<imageinfo>( "Image Info", &m_info, ImageInfo ); |
226 | connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&))); | 227 | connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&))); |
227 | } | 228 | } |
228 | void PMainWindow::initDisp() { | 229 | void PMainWindow::initDisp() { |
229 | initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay ); | 230 | initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay ); |
230 | if (m_disp) { | 231 | if (m_disp) { |
231 | m_disp->setAutoScale(autoScale); | 232 | m_disp->setAutoScale(autoScale); |
232 | m_disp->setAutoRotate(autoRotate); | 233 | m_disp->setAutoRotate(autoRotate); |
233 | connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&))); | 234 | connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&))); |
234 | } | 235 | } |
235 | } | 236 | } |
236 | 237 | ||
237 | /** | 238 | /** |
238 | * With big Screen the plan could be to 'detach' the image | 239 | * With big Screen the plan could be to 'detach' the image |
239 | * window if visible and to create a ne wone | 240 | * window if visible and to create a ne wone |
240 | * init* already supports it but I make no use of it for | 241 | * init* already supports it but I make no use of it for |
241 | * now. We set filename and raise | 242 | * now. We set filename and raise |
242 | * | 243 | * |
243 | * ### FIXME and talk to alwin | 244 | * ### FIXME and talk to alwin |
244 | */ | 245 | */ |
245 | void PMainWindow::slotShowInfo( const QString& inf ) { | 246 | void PMainWindow::slotShowInfo( const QString& inf ) { |
246 | if ( !m_info ) { | 247 | if ( !m_info ) { |
247 | initInfo(); | 248 | initInfo(); |
248 | } | 249 | } |
249 | m_info->setPath( inf ); | 250 | m_info->setPath( inf ); |
250 | m_stack->raiseWidget( ImageInfo ); | 251 | m_stack->raiseWidget( ImageInfo ); |
251 | } | 252 | } |
252 | 253 | ||
253 | void PMainWindow::slotDisplay( const QString& inf ) { | 254 | void PMainWindow::slotDisplay( const QString& inf ) { |
254 | if ( !m_disp ) { | 255 | if ( !m_disp ) { |
255 | initDisp(); | 256 | initDisp(); |
256 | } | 257 | } |
257 | m_disp->setImage( inf ); | 258 | m_disp->setImage( inf ); |
258 | m_stack->raiseWidget( ImageDisplay ); | 259 | m_stack->raiseWidget( ImageDisplay ); |
259 | } | 260 | } |
260 | 261 | ||
261 | void PMainWindow::slotReturn() { | 262 | void PMainWindow::slotReturn() { |
262 | raiseIconView(); | 263 | raiseIconView(); |
263 | } | 264 | } |
264 | 265 | ||
265 | 266 | ||
266 | void PMainWindow::closeEvent( QCloseEvent* ev ) { | 267 | void PMainWindow::closeEvent( QCloseEvent* ev ) { |
267 | /* | 268 | /* |
268 | * return from view | 269 | * return from view |
269 | * or properly quit | 270 | * or properly quit |
270 | */ | 271 | */ |
271 | if ( m_stack->visibleWidget() == m_info || | 272 | if ( m_stack->visibleWidget() == m_info || |
272 | m_stack->visibleWidget() == m_disp ) { | 273 | m_stack->visibleWidget() == m_disp ) { |
273 | raiseIconView(); | 274 | raiseIconView(); |
274 | ev->ignore(); | 275 | ev->ignore(); |
275 | return; | 276 | return; |
276 | } | 277 | } |
277 | ev->accept(); | 278 | ev->accept(); |
278 | QTimer::singleShot(0, qApp, SLOT(closeAllWindows())); | 279 | QTimer::singleShot(0, qApp, SLOT(closeAllWindows())); |
279 | } | 280 | } |
280 | 281 | ||
281 | void PMainWindow::raiseIconView() { | 282 | void PMainWindow::raiseIconView() { |
282 | m_stack->raiseWidget( IconView ); | 283 | m_stack->raiseWidget( IconView ); |
283 | } | 284 | } |
285 | |||
286 | void PMainWindow::setDocument( const QString& showImg ) { | ||
287 | QString file = showImg; | ||
288 | DocLnk lnk(showImg); | ||
289 | if (lnk.isValid() ) | ||
290 | file = lnk.file(); | ||
291 | |||
292 | slotDisplay( file ); | ||
293 | } | ||
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h index 5de2f42..042d568 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.h +++ b/noncore/graphics/opie-eye/gui/mainwindow.h | |||
@@ -1,67 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | * GPLv2 zecke@handhelds.org | 2 | * GPLv2 zecke@handhelds.org |
3 | * No WArranty... | 3 | * No WArranty... |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #ifndef PHUNK_MAIN_WINDOW_H | 6 | #ifndef PHUNK_MAIN_WINDOW_H |
7 | #define PHUNK_MAIN_WINDOW_H | 7 | #define PHUNK_MAIN_WINDOW_H |
8 | 8 | ||
9 | #include <opie2/oconfig.h> | 9 | #include <opie2/oconfig.h> |
10 | 10 | ||
11 | #include <qmainwindow.h> | 11 | #include <qmainwindow.h> |
12 | 12 | ||
13 | 13 | ||
14 | 14 | ||
15 | namespace Opie { | 15 | namespace Opie { |
16 | namespace Ui{ | 16 | namespace Ui{ |
17 | class OKeyConfigManager; | 17 | class OKeyConfigManager; |
18 | class OWidgetStack; | 18 | class OWidgetStack; |
19 | } | 19 | } |
20 | } | 20 | } |
21 | 21 | ||
22 | class PIconView; | 22 | class PIconView; |
23 | class imageinfo; | 23 | class imageinfo; |
24 | class ImageView; | 24 | class ImageView; |
25 | class PMainWindow : public QMainWindow { | 25 | class PMainWindow : public QMainWindow { |
26 | Q_OBJECT | 26 | Q_OBJECT |
27 | enum Views { IconView, ImageInfo, ImageDisplay }; | 27 | enum Views { IconView, ImageInfo, ImageDisplay }; |
28 | public: | 28 | public: |
29 | static QString appName() { return QString::fromLatin1("opie-eye" ); } | 29 | static QString appName() { return QString::fromLatin1("opie-eye" ); } |
30 | PMainWindow(QWidget*, const char*, WFlags ); | 30 | PMainWindow(QWidget*, const char*, WFlags ); |
31 | ~PMainWindow(); | 31 | ~PMainWindow(); |
32 | 32 | ||
33 | signals: | 33 | signals: |
34 | void configChanged(); | 34 | void configChanged(); |
35 | 35 | ||
36 | public slots: | 36 | public slots: |
37 | void slotShowInfo( const QString& inf ); | 37 | void slotShowInfo( const QString& inf ); |
38 | void slotDisplay( const QString& inf ); | 38 | void slotDisplay( const QString& inf ); |
39 | void slotReturn(); | 39 | void slotReturn(); |
40 | void slotRotateToggled(bool); | 40 | void slotRotateToggled(bool); |
41 | void slotScaleToggled(bool); | 41 | void slotScaleToggled(bool); |
42 | void setDocument( const QString& ); | ||
42 | 43 | ||
43 | protected: | 44 | protected: |
44 | void raiseIconView(); | 45 | void raiseIconView(); |
45 | void closeEvent( QCloseEvent* ); | 46 | void closeEvent( QCloseEvent* ); |
46 | 47 | ||
47 | private: | 48 | private: |
48 | template<class T> void initT( const char* name, T**, int ); | 49 | template<class T> void initT( const char* name, T**, int ); |
49 | void initInfo(); | 50 | void initInfo(); |
50 | void initDisp(); | 51 | void initDisp(); |
51 | 52 | ||
52 | private: | 53 | private: |
53 | Opie::Core::OConfig *m_cfg; | 54 | Opie::Core::OConfig *m_cfg; |
54 | Opie::Ui::OWidgetStack *m_stack; | 55 | Opie::Ui::OWidgetStack *m_stack; |
55 | PIconView* m_view; | 56 | PIconView* m_view; |
56 | imageinfo *m_info; | 57 | imageinfo *m_info; |
57 | ImageView *m_disp; | 58 | ImageView *m_disp; |
58 | bool autoRotate; | 59 | bool autoRotate; |
59 | bool autoScale; | 60 | bool autoScale; |
60 | QToolButton*rotateButton; | 61 | QToolButton*rotateButton; |
61 | 62 | ||
62 | 63 | ||
63 | private slots: | 64 | private slots: |
64 | void slotConfig(); | 65 | void slotConfig(); |
65 | }; | 66 | }; |
66 | 67 | ||
67 | #endif | 68 | #endif |