Commit bf9f5c6f authored by Pino Toscano's avatar Pino Toscano

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
parent 6cf46e91
......@@ -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);
}
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment