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
This commit is contained in:
Pino Toscano 2007-04-20 23:22:56 +00:00
parent 6cf46e9160
commit bf9f5c6fa8
2 changed files with 8 additions and 0 deletions

View file

@ -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);
}

1
part.h
View file

@ -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;