Diffstat (limited to 'noncore/graphics/opie-eye/gui/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 5eb065f..6660eb2 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -205,34 +205,28 @@ void PMainWindow::slotConfig() { | |||
205 | m_view->resetView(); | 205 | m_view->resetView(); |
206 | keyWid->save(); | 206 | keyWid->save(); |
207 | m_disp->manager()->save(); | 207 | m_disp->manager()->save(); |
208 | m_info->manager()->save(); | 208 | m_info->manager()->save(); |
209 | m_view->manager()->save(); | 209 | m_view->manager()->save(); |
210 | bSetup->save_values(); | 210 | bSetup->save_values(); |
211 | readConfig(); | 211 | readConfig(); |
212 | } | 212 | } |
213 | delete keyWid; | 213 | delete keyWid; |
214 | 214 | ||
215 | m_stack->raiseWidget(w); | 215 | m_stack->raiseWidget(w); |
216 | if (remdisp) { | 216 | if (remdisp) { |
217 | m_disp->disconnect(this, SLOT(slotReturn())); | 217 | m_disp->hide(); |
218 | m_disp->setDestructiveClose(); | ||
219 | m_stack->removeWidget(m_disp); | ||
220 | m_disp = 0; | ||
221 | } | 218 | } |
222 | if (reminfo) { | 219 | if (reminfo) { |
223 | m_info->disconnect(this, SLOT(slotReturn())); | 220 | m_info->hide(); |
224 | m_info->setDestructiveClose(); | ||
225 | m_stack->removeWidget(m_info); | ||
226 | m_info = 0; | ||
227 | } | 221 | } |
228 | } | 222 | } |
229 | 223 | ||
230 | /* | 224 | /* |
231 | * create a new image info component | 225 | * create a new image info component |
232 | * and detach the current one | 226 | * and detach the current one |
233 | * we will make the other delete on exit | 227 | * we will make the other delete on exit |
234 | */ | 228 | */ |
235 | template<class T> | 229 | template<class T> |
236 | void PMainWindow::initT( const char* name, T** ptr, int id) { | 230 | void PMainWindow::initT( const char* name, T** ptr, int id) { |
237 | if ( *ptr ) { | 231 | if ( *ptr ) { |
238 | (*ptr)->disconnect(this, SLOT(slotReturn())); | 232 | (*ptr)->disconnect(this, SLOT(slotReturn())); |
@@ -279,32 +273,27 @@ void PMainWindow::initDisp() { | |||
279 | void PMainWindow::slotToggleFullScreen() | 273 | void PMainWindow::slotToggleFullScreen() |
280 | { | 274 | { |
281 | bool current = !m_aFullScreen->isOn(); | 275 | bool current = !m_aFullScreen->isOn(); |
282 | m_aFullScreen->setOn(current); | 276 | m_aFullScreen->setOn(current); |
283 | } | 277 | } |
284 | 278 | ||
285 | void PMainWindow::slotFullScreenButton(bool current) | 279 | void PMainWindow::slotFullScreenButton(bool current) |
286 | { | 280 | { |
287 | if (autoSave) { | 281 | if (autoSave) { |
288 | m_cfg->writeEntry("fullscreen",current); | 282 | m_cfg->writeEntry("fullscreen",current); |
289 | } | 283 | } |
290 | if (!m_disp) return; | 284 | if (!m_disp) return; |
291 | 285 | if (m_disp->isVisible()) { | |
292 | if (m_disp->isHidden()) { | 286 | setupViewWindow(current, true); |
293 | /* it must get some setups for switch we can just do if the window is visible. | ||
294 | so we must delete the imageview window and re-create it when displaying new | ||
295 | image */ | ||
296 | return; | ||
297 | } | 287 | } |
298 | setupViewWindow(current, true); | ||
299 | } | 288 | } |
300 | 289 | ||
301 | void PMainWindow::setupViewWindow(bool current, bool forceDisplay) | 290 | void PMainWindow::setupViewWindow(bool current, bool forceDisplay) |
302 | { | 291 | { |
303 | if (!m_disp) return; | 292 | if (!m_disp) return; |
304 | if (current) { | 293 | if (current) { |
305 | m_disp->setBackgroundColor(black); | 294 | m_disp->setBackgroundColor(black); |
306 | m_disp->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); | 295 | m_disp->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); |
307 | m_disp->setVScrollBarMode(QScrollView::AlwaysOff); | 296 | m_disp->setVScrollBarMode(QScrollView::AlwaysOff); |
308 | m_disp->setHScrollBarMode(QScrollView::AlwaysOff); | 297 | m_disp->setHScrollBarMode(QScrollView::AlwaysOff); |
309 | m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); | 298 | m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); |
310 | } else { | 299 | } else { |
@@ -360,40 +349,45 @@ void PMainWindow::slotShowInfo( const QString& inf ) { | |||
360 | m_aNext->setEnabled(false); | 349 | m_aNext->setEnabled(false); |
361 | m_aPrevious->setEnabled(false); | 350 | m_aPrevious->setEnabled(false); |
362 | m_aDirUp->setEnabled(false); | 351 | m_aDirUp->setEnabled(false); |
363 | m_aShowInfo->setEnabled(false); | 352 | m_aShowInfo->setEnabled(false); |
364 | m_aViewfile->setEnabled(true); | 353 | m_aViewfile->setEnabled(true); |
365 | m_aStartSlide->setEnabled(false); | 354 | m_aStartSlide->setEnabled(false); |
366 | fsButton->hide(); | 355 | fsButton->hide(); |
367 | } | 356 | } |
368 | m_stack->raiseWidget( ImageInfo ); | 357 | m_stack->raiseWidget( ImageInfo ); |
369 | } | 358 | } |
370 | 359 | ||
371 | void PMainWindow::slotDisplay( const QString& inf ) { | 360 | void PMainWindow::slotDisplay( const QString& inf ) { |
361 | bool nwindow = false; | ||
372 | if ( !m_disp ) { | 362 | if ( !m_disp ) { |
363 | nwindow = true; | ||
373 | initDisp(); | 364 | initDisp(); |
374 | } | 365 | } |
375 | m_disp->setImage( inf ); | 366 | m_disp->setImage( inf ); |
376 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { | 367 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { |
377 | if (m_gPrevNext->isEnabled()==false) { | 368 | if (m_gPrevNext->isEnabled()==false) { |
378 | m_gPrevNext->addTo(toolBar); | 369 | m_gPrevNext->addTo(toolBar); |
379 | m_gPrevNext->setEnabled(true); | 370 | m_gPrevNext->setEnabled(true); |
380 | 371 | ||
381 | m_aDirUp->setEnabled(false); | 372 | m_aDirUp->setEnabled(false); |
382 | m_aShowInfo->setEnabled(true); | 373 | m_aShowInfo->setEnabled(true); |
383 | m_aViewfile->setEnabled(false); | 374 | m_aViewfile->setEnabled(false); |
384 | m_aStartSlide->setEnabled(false); | 375 | m_aStartSlide->setEnabled(false); |
385 | fsButton->hide(); | 376 | fsButton->hide(); |
386 | } | 377 | } |
387 | } | 378 | } |
379 | if (!nwindow && m_disp->fullScreen()!=m_aFullScreen->isOn()) { | ||
380 | slotFullScreenToggled(m_aFullScreen->isOn()); | ||
381 | } | ||
388 | if (m_disp->fullScreen()) { | 382 | if (m_disp->fullScreen()) { |
389 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); | 383 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); |
390 | } else { | 384 | } else { |
391 | m_stack->raiseWidget( ImageDisplay ); | 385 | m_stack->raiseWidget( ImageDisplay ); |
392 | } | 386 | } |
393 | } | 387 | } |
394 | 388 | ||
395 | void PMainWindow::raiseIconView() { | 389 | void PMainWindow::raiseIconView() { |
396 | setUpdatesEnabled(false); | 390 | setUpdatesEnabled(false); |
397 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { | 391 | if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { |
398 | m_gPrevNext->removeFrom(toolBar); | 392 | m_gPrevNext->removeFrom(toolBar); |
399 | m_gPrevNext->setEnabled(false); | 393 | m_gPrevNext->setEnabled(false); |