Diffstat (limited to 'noncore/graphics/opie-eye/gui/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index f443ccb..295f93f 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -46,6 +46,8 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | |||
46 | m_cfg = new Opie::Core::OConfig("opie-eye"); | 46 | m_cfg = new Opie::Core::OConfig("opie-eye"); |
47 | m_cfg->setGroup("main" ); | 47 | m_cfg->setGroup("main" ); |
48 | readConfig(); | 48 | readConfig(); |
49 | m_setDocCalled = false; | ||
50 | m_polishDone = false; | ||
49 | 51 | ||
50 | m_storage = new StorageInfo(); | 52 | m_storage = new StorageInfo(); |
51 | connect(m_storage, SIGNAL(disksChanged() ), | 53 | connect(m_storage, SIGNAL(disksChanged() ), |
@@ -419,12 +421,14 @@ void PMainWindow::closeEvent( QCloseEvent* ev ) { | |||
419 | * return from view | 421 | * return from view |
420 | * or properly quit | 422 | * or properly quit |
421 | */ | 423 | */ |
424 | if (!m_setDocCalled) { | ||
422 | if ( m_stack->visibleWidget() == m_info || | 425 | if ( m_stack->visibleWidget() == m_info || |
423 | m_stack->visibleWidget() == m_disp ) { | 426 | m_stack->visibleWidget() == m_disp ) { |
424 | ev->ignore(); | 427 | ev->ignore(); |
425 | raiseIconView(); | 428 | raiseIconView(); |
426 | return; | 429 | return; |
427 | } | 430 | } |
431 | } | ||
428 | if (m_disp && m_disp->fullScreen()) { | 432 | if (m_disp && m_disp->fullScreen()) { |
429 | /* otherwise opie-eye crashes in bigscreen mode! */ | 433 | /* otherwise opie-eye crashes in bigscreen mode! */ |
430 | m_disp->reparent(0,QPoint(0,0)); | 434 | m_disp->reparent(0,QPoint(0,0)); |
@@ -436,16 +440,16 @@ void PMainWindow::closeEvent( QCloseEvent* ev ) { | |||
436 | 440 | ||
437 | void PMainWindow::setDocument( const QString& showImg ) | 441 | void PMainWindow::setDocument( const QString& showImg ) |
438 | { | 442 | { |
439 | bool first_start = m_disp==0; | ||
440 | |||
441 | QString file = showImg; | 443 | QString file = showImg; |
442 | DocLnk lnk(showImg); | 444 | DocLnk lnk(showImg); |
443 | if (lnk.isValid() ) | 445 | if (lnk.isValid() ) |
444 | file = lnk.file(); | 446 | file = lnk.file(); |
445 | slotDisplay( file ); | 447 | slotDisplay( file ); |
446 | if (first_start && m_aFullScreen->isOn()) { | 448 | #if 0 |
449 | if (!m_polishDone) { | ||
447 | QTimer::singleShot(0,this,SLOT(check_view_fullscreen())); | 450 | QTimer::singleShot(0,this,SLOT(check_view_fullscreen())); |
448 | } | 451 | } |
452 | #endif | ||
449 | } | 453 | } |
450 | 454 | ||
451 | void PMainWindow::check_view_fullscreen() | 455 | void PMainWindow::check_view_fullscreen() |
@@ -689,17 +693,13 @@ void PMainWindow::listviewselected(QAction*which) | |||
689 | { | 693 | { |
690 | if (!which || which->isOn()==false) return; | 694 | if (!which || which->isOn()==false) return; |
691 | int val = 1; | 695 | int val = 1; |
692 | // QString name; | ||
693 | 696 | ||
694 | if (which==m_aDirName) { | 697 | if (which==m_aDirName) { |
695 | val = 3; | 698 | val = 3; |
696 | // name = "opie-eye/opie-eye-textview"; | ||
697 | } else if (which==m_aDirShort) { | 699 | } else if (which==m_aDirShort) { |
698 | val = 2; | 700 | val = 2; |
699 | // name = "opie-eye/opie-eye-thumbonly"; | ||
700 | } else if (which==m_aDirLong) { | 701 | } else if (which==m_aDirLong) { |
701 | val = 1; | 702 | val = 1; |
702 | // name = "opie-eye/opie-eye-thumb"; | ||
703 | } | 703 | } |
704 | emit changeListMode(val); | 704 | emit changeListMode(val); |
705 | } | 705 | } |
@@ -708,3 +708,26 @@ void PMainWindow::readConfig() | |||
708 | { | 708 | { |
709 | autoSave =m_cfg->readBoolEntry("savestatus",true); | 709 | autoSave =m_cfg->readBoolEntry("savestatus",true); |
710 | } | 710 | } |
711 | |||
712 | void PMainWindow::polish() | ||
713 | { | ||
714 | if (m_disp) { | ||
715 | odebug << "======================\n" | ||
716 | << "Called via setdocument\n" | ||
717 | << "======================" << oendl; | ||
718 | m_setDocCalled = true; | ||
719 | m_view->setDoccalled(true); | ||
720 | m_disp->setCloseIfHide(true); | ||
721 | } else { | ||
722 | m_setDocCalled = false; | ||
723 | m_view->setDoccalled(false); | ||
724 | } | ||
725 | m_polishDone = true; | ||
726 | QMainWindow::polish(); | ||
727 | if (m_setDocCalled) { | ||
728 | if (m_aFullScreen->isOn()) { | ||
729 | QTimer::singleShot(0,this,SLOT(check_view_fullscreen())); | ||
730 | } else if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { | ||
731 | } | ||
732 | } | ||
733 | } | ||