author | alwin <alwin> | 2004-11-02 00:30:38 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-11-02 00:30:38 (UTC) |
commit | 51b7bdf260bc2b5b066c6594a6d0c507add682fd (patch) (side-by-side diff) | |
tree | 991e7658e5abc440343e03b83eb4f867ae6adbaf | |
parent | 2dc92f4bfe9e81edc2b0b24ecacf3bc44b344984 (diff) | |
download | opie-51b7bdf260bc2b5b066c6594a6d0c507add682fd.zip opie-51b7bdf260bc2b5b066c6594a6d0c507add682fd.tar.gz opie-51b7bdf260bc2b5b066c6594a6d0c507add682fd.tar.bz2 |
ok. now we have real working, simple solution how to act with switching fullscreen
when imagewindow is hidden.
It is realy impressive what a brain can generate brainf* ideas finding such a solution
- I should stop programming on holidays.
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.cpp | 3 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 24 |
2 files changed, 12 insertions, 15 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp index be58c72..ebdfc60 100644 --- a/noncore/graphics/opie-eye/gui/imageview.cpp +++ b/noncore/graphics/opie-eye/gui/imageview.cpp @@ -25,32 +25,33 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name initKeys(); m_slideValue = 5; m_gDisplayType = 0; m_gPrevNext = 0; m_hGroup = 0; } void ImageView::setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup) { m_gDisplayType = disptypeGroup; m_gPrevNext = nextprevGroup; m_hGroup = hGroup; } ImageView::~ImageView() { + odebug << "Destructor imageview" << oendl; delete m_viewManager; } Opie::Core::OKeyConfigManager* ImageView::manager() { if (!m_viewManager) { initKeys(); } return m_viewManager; } void ImageView::startSlide(int value) { if (!m_slideTimer) { m_slideTimer = new QTimer(this); } @@ -64,37 +65,39 @@ void ImageView::startSlide(int value) void ImageView::stopSlide() { if (!m_slideTimer) { return; } m_slideTimer->stop(); delete m_slideTimer; m_slideTimer = 0; } void ImageView::nextSlide() { if (!m_slideTimer) { return; } +#if 0 if (isHidden()) { delete m_slideTimer; m_slideTimer = 0; return; } +#endif emit dispNext(); m_slideTimer->start(m_slideValue*1000,true); } void ImageView::initKeys() { odebug << "init imageview keys" << oendl; if (!m_cfg) { m_cfg = new Opie::Core::OConfig("opie-eye"); m_cfg->setGroup("image_view_keys" ); } Opie::Core::OKeyPair::List lst; lst.append( Opie::Core::OKeyPair::upArrowKey() ); lst.append( Opie::Core::OKeyPair::downArrowKey() ); lst.append( Opie::Core::OKeyPair::leftArrowKey() ); lst.append( Opie::Core::OKeyPair::rightArrowKey() ); lst.append( Opie::Core::OKeyPair(Qt::Key_Escape,0)); 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 @@ -201,42 +201,36 @@ void PMainWindow::slotConfig() { } if ( act ) { m_view->resetView(); keyWid->save(); m_disp->manager()->save(); m_info->manager()->save(); m_view->manager()->save(); bSetup->save_values(); readConfig(); } delete keyWid; m_stack->raiseWidget(w); if (remdisp) { - m_disp->disconnect(this, SLOT(slotReturn())); - m_disp->setDestructiveClose(); - m_stack->removeWidget(m_disp); - m_disp = 0; + m_disp->hide(); } if (reminfo) { - m_info->disconnect(this, SLOT(slotReturn())); - m_info->setDestructiveClose(); - m_stack->removeWidget(m_info); - m_info = 0; + m_info->hide(); } } /* * create a new image info component * and detach the current one * we will make the other delete on exit */ template<class T> void PMainWindow::initT( const char* name, T** ptr, int id) { if ( *ptr ) { (*ptr)->disconnect(this, SLOT(slotReturn())); (*ptr)->setDestructiveClose(); m_stack->removeWidget( *ptr ); } *ptr = new T(m_cfg, m_stack, name ); @@ -275,41 +269,36 @@ void PMainWindow::initDisp() { slotFullScreenToggled(m_aFullScreen->isOn()); } } void PMainWindow::slotToggleFullScreen() { bool current = !m_aFullScreen->isOn(); m_aFullScreen->setOn(current); } void PMainWindow::slotFullScreenButton(bool current) { if (autoSave) { m_cfg->writeEntry("fullscreen",current); } if (!m_disp) return; - - if (m_disp->isHidden()) { - /* it must get some setups for switch we can just do if the window is visible. - so we must delete the imageview window and re-create it when displaying new - image */ - return; - } + if (m_disp->isVisible()) { setupViewWindow(current, true); } +} void PMainWindow::setupViewWindow(bool current, bool forceDisplay) { if (!m_disp) return; if (current) { m_disp->setBackgroundColor(black); m_disp->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); m_disp->setVScrollBarMode(QScrollView::AlwaysOff); m_disp->setHScrollBarMode(QScrollView::AlwaysOff); m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); } else { setUpdatesEnabled(false); if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { m_disp->setMinimumSize(QApplication::desktop()->size()/2); } else { m_disp->setMinimumSize(10,10); @@ -356,48 +345,53 @@ void PMainWindow::slotShowInfo( const QString& inf ) { m_info->setPath( inf ); if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { m_aNext->removeFrom(toolBar); m_aPrevious->removeFrom(toolBar); m_aNext->setEnabled(false); m_aPrevious->setEnabled(false); m_aDirUp->setEnabled(false); m_aShowInfo->setEnabled(false); m_aViewfile->setEnabled(true); m_aStartSlide->setEnabled(false); fsButton->hide(); } m_stack->raiseWidget( ImageInfo ); } void PMainWindow::slotDisplay( const QString& inf ) { + bool nwindow = false; if ( !m_disp ) { + nwindow = true; initDisp(); } m_disp->setImage( inf ); if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { if (m_gPrevNext->isEnabled()==false) { m_gPrevNext->addTo(toolBar); m_gPrevNext->setEnabled(true); m_aDirUp->setEnabled(false); m_aShowInfo->setEnabled(true); m_aViewfile->setEnabled(false); m_aStartSlide->setEnabled(false); fsButton->hide(); } } + if (!nwindow && m_disp->fullScreen()!=m_aFullScreen->isOn()) { + slotFullScreenToggled(m_aFullScreen->isOn()); + } if (m_disp->fullScreen()) { qwsDisplay()->requestFocus( m_disp->winId(), TRUE); } else { m_stack->raiseWidget( ImageDisplay ); } } void PMainWindow::raiseIconView() { setUpdatesEnabled(false); if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { m_gPrevNext->removeFrom(toolBar); m_gPrevNext->setEnabled(false); m_aDirUp->setEnabled(true); m_aShowInfo->setEnabled(true); m_aViewfile->setEnabled(true); m_aStartSlide->setEnabled(true); |