author | alwin <alwin> | 2004-11-12 15:57:59 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-11-12 15:57:59 (UTC) |
commit | e1ed329d0b8be10ac6e019d37b82afcf21990691 (patch) (unidiff) | |
tree | 0c84e2c4fd062487932de9add39a083da194cca0 /noncore/graphics/opie-eye/gui/mainwindow.cpp | |
parent | de558d6f0bc31f58ffaa894a0236f0d9cb5d73e0 (diff) | |
download | opie-e1ed329d0b8be10ac6e019d37b82afcf21990691.zip opie-e1ed329d0b8be10ac6e019d37b82afcf21990691.tar.gz opie-e1ed329d0b8be10ac6e019d37b82afcf21990691.tar.bz2 |
- fixed a bug in docview-lister: different files may have same docview
name. So mapping filenames to docname isn't usefull.
- when opie-eye is started from doctab closing the imagewindow
closes the application
- when a doc-link is changed while opie-eye is running it get the
changes, too.
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 | 47 |
1 files changed, 35 insertions, 12 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,11 +421,13 @@ void PMainWindow::closeEvent( QCloseEvent* ev ) { | |||
419 | * return from view | 421 | * return from view |
420 | * or properly quit | 422 | * or properly quit |
421 | */ | 423 | */ |
422 | if ( m_stack->visibleWidget() == m_info || | 424 | if (!m_setDocCalled) { |
423 | m_stack->visibleWidget() == m_disp ) { | 425 | if ( m_stack->visibleWidget() == m_info || |
424 | ev->ignore(); | 426 | m_stack->visibleWidget() == m_disp ) { |
425 | raiseIconView(); | 427 | ev->ignore(); |
426 | return; | 428 | raiseIconView(); |
429 | return; | ||
430 | } | ||
427 | } | 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! */ |
@@ -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 | } | ||