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