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, 7 insertions, 17 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index cdaf34c..274a22a 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -30,23 +30,21 @@ | |||
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 | |||
37 | //OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" ) | 36 | //OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" ) |
38 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>) | 37 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>) |
39 | 38 | ||
40 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | 39 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) |
41 | : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) | 40 | : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) |
42 | { | 41 | { |
43 | setCaption( QObject::tr("Opie Eye Caramba" ) ); | 42 | setCaption( QObject::tr("Opie Eye Caramba" ) ); |
44 | m_cfg = new Opie::Core::OConfig("phunkview"); | 43 | m_cfg = new Opie::Core::OConfig("phunkview"); |
45 | m_cfg->setGroup("Zecke_view" ); | 44 | m_cfg->setGroup("Zecke_view" ); |
46 | tFrame = 0; | ||
47 | // qDebug( "Process-wide OApplication object @ %0x", oApp ); | 45 | // qDebug( "Process-wide OApplication object @ %0x", oApp ); |
48 | /* | 46 | /* |
49 | * Initialize ToolBar and IconView | 47 | * Initialize ToolBar and IconView |
50 | * And Connect Them | 48 | * And Connect Them |
51 | */ | 49 | */ |
52 | QToolBar *bar = new QToolBar( this ); | 50 | QToolBar *bar = new QToolBar( this ); |
@@ -143,15 +141,12 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | |||
143 | zoomButton->setOn(true); | 141 | zoomButton->setOn(true); |
144 | connect(zoomButton,SIGNAL(toggled(bool)),this,SLOT(slotZoomerToggled(bool))); | 142 | connect(zoomButton,SIGNAL(toggled(bool)),this,SLOT(slotZoomerToggled(bool))); |
145 | zoomerOn = true; | 143 | zoomerOn = true; |
146 | } | 144 | } |
147 | 145 | ||
148 | PMainWindow::~PMainWindow() { | 146 | PMainWindow::~PMainWindow() { |
149 | odebug << "Shutting down" << oendl; | ||
150 | if (tFrame) delete tFrame; | ||
151 | odebug << "Shutting down done" << oendl; | ||
152 | } | 147 | } |
153 | 148 | ||
154 | void PMainWindow::slotToggleZoomer() | 149 | void PMainWindow::slotToggleZoomer() |
155 | { | 150 | { |
156 | if (!m_disp) return; | 151 | if (!m_disp) return; |
157 | bool cur = zoomButton->isOn(); | 152 | bool cur = zoomButton->isOn(); |
@@ -322,44 +317,38 @@ void PMainWindow::initDisp() { | |||
322 | 317 | ||
323 | void PMainWindow::slotToggleFullScreen() | 318 | void PMainWindow::slotToggleFullScreen() |
324 | { | 319 | { |
325 | odebug << "Toggle full " << oendl; | 320 | odebug << "Toggle full " << oendl; |
326 | if (!m_disp) return; | 321 | if (!m_disp) return; |
327 | bool current = !m_disp->fullScreen(); | 322 | bool current = !m_disp->fullScreen(); |
328 | m_disp->setFullScreen(current); | ||
329 | odebug << "Current = " << current << oendl; | 323 | odebug << "Current = " << current << oendl; |
330 | if (current) { | 324 | if (current) { |
331 | odebug << "full" << oendl; | 325 | odebug << "full" << oendl; |
332 | m_disp->setBackgroundColor(black); | 326 | m_disp->setBackgroundColor(black); |
333 | if (!tFrame) { | 327 | m_disp->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); |
334 | tFrame = new ImageWidget(0,0,WStyle_Customize|WStyle_NoBorder); | ||
335 | tFrame->resize(qApp->desktop()->width(), qApp->desktop()->height()); | ||
336 | tFrame->setMinimumSize(qApp->desktop()->width(), qApp->desktop()->height()); | ||
337 | } | ||
338 | m_disp->reparent(tFrame,QPoint(0,0)); | ||
339 | m_disp->setVScrollBarMode(QScrollView::AlwaysOff); | 328 | m_disp->setVScrollBarMode(QScrollView::AlwaysOff); |
340 | m_disp->setHScrollBarMode(QScrollView::AlwaysOff); | 329 | m_disp->setHScrollBarMode(QScrollView::AlwaysOff); |
341 | m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); | 330 | m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); |
342 | tFrame->showFullScreen(); | 331 | //m_disp->showFullScreen(); |
332 | //qwsDisplay()->requestFocus( m_disp->winId(), TRUE); | ||
343 | } else { | 333 | } else { |
344 | setUpdatesEnabled(false); | 334 | setUpdatesEnabled(false); |
345 | odebug << "window" << oendl; | 335 | odebug << "window" << oendl; |
346 | m_disp->reparent(0,QPoint(0,0)); | 336 | m_disp->reparent(0,QPoint(0,0)); |
347 | m_disp->showNormal(); | 337 | m_disp->showNormal(); |
348 | /* don't forget it! */ | ||
349 | tFrame->hide(); | ||
350 | m_disp->setBackgroundColor(white); | 338 | m_disp->setBackgroundColor(white); |
351 | m_stack->addWidget(m_disp,ImageDisplay); | 339 | m_stack->addWidget(m_disp,ImageDisplay); |
352 | m_disp->setVScrollBarMode(QScrollView::Auto); | 340 | m_disp->setVScrollBarMode(QScrollView::Auto); |
353 | m_disp->setHScrollBarMode(QScrollView::Auto); | 341 | m_disp->setHScrollBarMode(QScrollView::Auto); |
354 | m_stack->raiseWidget(m_disp); | 342 | m_stack->raiseWidget(m_disp); |
355 | if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { | 343 | if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { |
356 | m_disp->resize(m_disp->minimumSize()); | 344 | m_disp->resize(m_disp->minimumSize()); |
357 | } | 345 | } |
358 | setUpdatesEnabled(true); | 346 | setUpdatesEnabled(true); |
359 | } | 347 | } |
348 | m_disp->setFullScreen(current); | ||
360 | } | 349 | } |
361 | 350 | ||
362 | /** | 351 | /** |
363 | * With big Screen the plan could be to 'detach' the image | 352 | * With big Screen the plan could be to 'detach' the image |
364 | * window if visible and to create a ne wone | 353 | * window if visible and to create a ne wone |
365 | * init* already supports it but I make no use of it for | 354 | * init* already supports it but I make no use of it for |
@@ -395,13 +384,14 @@ void PMainWindow::slotDisplay( const QString& inf ) { | |||
395 | nextButton->show(); | 384 | nextButton->show(); |
396 | upButton->hide(); | 385 | upButton->hide(); |
397 | fsButton->hide(); | 386 | fsButton->hide(); |
398 | viewModeButton->hide(); | 387 | viewModeButton->hide(); |
399 | } | 388 | } |
400 | if (m_disp->fullScreen()) { | 389 | if (m_disp->fullScreen()) { |
401 | tFrame->show();//FullScreen(); | 390 | //m_disp->showFullScreen(); |
391 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); | ||
402 | } else { | 392 | } else { |
403 | m_stack->raiseWidget( ImageDisplay ); | 393 | m_stack->raiseWidget( ImageDisplay ); |
404 | } | 394 | } |
405 | } | 395 | } |
406 | 396 | ||
407 | void PMainWindow::slotReturn() { | 397 | void PMainWindow::slotReturn() { |
@@ -436,13 +426,13 @@ void PMainWindow::raiseIconView() { | |||
436 | nextButton->hide(); | 426 | nextButton->hide(); |
437 | upButton->show(); | 427 | upButton->show(); |
438 | fsButton->show(); | 428 | fsButton->show(); |
439 | viewModeButton->show(); | 429 | viewModeButton->show(); |
440 | } | 430 | } |
441 | if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { | 431 | if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { |
442 | tFrame->hide(); | 432 | m_disp->hide(); |
443 | } | 433 | } |
444 | m_stack->raiseWidget( IconView ); | 434 | m_stack->raiseWidget( IconView ); |
445 | setUpdatesEnabled(true); | 435 | setUpdatesEnabled(true); |
446 | repaint(); | 436 | repaint(); |
447 | } | 437 | } |
448 | 438 | ||