From bf9f5c6fa83e85e666178a8246e649f37e282fc9 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Fri, 20 Apr 2007 23:22:56 +0000 Subject: [PATCH] Forwardport of SVN commit 656308 by pino: Restore the previously open pane in the side toolbox after reloading a watched document. (closed KPDF #116771) svn path=/trunk/KDE/kdegraphics/okular/; revision=656309 --- part.cpp | 7 +++++++ part.h | 1 + 2 files changed, 8 insertions(+) diff --git a/part.cpp b/part.cpp index 1cfbd15c5..33fea90cf 100644 --- a/part.cpp +++ b/part.cpp @@ -879,6 +879,9 @@ void Part::slotDoFileDirty() // store the current viewport m_viewportDirty = m_document->viewport(); + // store the current toolbox pane + m_dirtyToolboxIndex = m_toolBox->currentIndex(); + // store if presentation view was open m_wasPresentationOpen = ((PresentationWidget*)m_presentationWidget != 0); @@ -894,6 +897,10 @@ void Part::slotDoFileDirty() m_viewportDirty.pageNumber = (int) m_document->pages() - 1; m_document->setViewport( m_viewportDirty ); m_viewportDirty.pageNumber = -1; + if ( m_toolBox->currentIndex() != m_dirtyToolboxIndex && m_toolBox->isItemEnabled( m_dirtyToolboxIndex ) ) + { + m_toolBox->setCurrentIndex( m_dirtyToolboxIndex ); + } if (m_wasPresentationOpen) slotShowPresentation(); emit enablePrintAction(true); } diff --git a/part.h b/part.h index b9a1231f2..43c5b93da 100644 --- a/part.h +++ b/part.h @@ -191,6 +191,7 @@ class Part : public KParts::ReadOnlyPart, public Okular::DocumentObserver, publi QTimer *m_dirtyHandler; Okular::DocumentViewport m_viewportDirty; bool m_wasPresentationOpen; + int m_dirtyToolboxIndex; // Remember the search history QStringList m_searchHistory;