Commit 59828079 authored by Pino Toscano's avatar Pino Toscano

New actions Prev/Next Bookmark for navigating back and forth in the bookmarked pages.

svn path=/trunk/playground/graphics/okular/; revision=554556
parent 90bc2dad
......@@ -38,7 +38,6 @@ More items (first items will enter 'In progress list' first):
-> part: collapsing the left panel will hide it (activate hiding action)
-> preload: add a delay when forward loading pages
-> bookmarks: fastmarks (new bookmark concept with tab-like signs, shortcuts, etc) (BR
-> bookmarks: go to next/previous actions (showing in thumbnailslist rmb popup too)
-> viewport restoring: sometimes it seems to restore the viewport a bit under where it was
-> viewport restoring: save the zoom/viewCols/continous setting between runs (BR97307+patch)
-> search: use shortcut for 'find next' action (not the default one) in find-ahead
......@@ -108,6 +107,7 @@ Icons needed:
- COMMON (here in ToolBox): Toc, Annotations
Done (newest features come first):
-> ADD: bookmarks: go to next/previous actions (showing in thumbnailslist rmb popup too)
-> CHG: open dialog: switch to directory where the already opened (local) file is
-> ADD: toc: add search bar (a 'prune on type' lineedit like in thumbnails widget) (BR99349)
-> FIX: kfile-plugins/pdf: provide internal support and rewrite that plugin (drops xpdf dependancy from kdegraphics) (by ktech)
......
......@@ -230,6 +230,14 @@ Part::Part(QWidget *parentWidget,
m_historyNext = KStdAction::forward( this, SLOT( slotHistoryNext() ), ac, "history_forward" );
m_historyNext->setWhatsThis( i18n( "Go to the place you were after" ) );
m_prevBookmark = new KAction( KIcon( "previous" ), i18n( "Previous Bookmark" ), ac, "previous_bookmark" );
m_prevBookmark->setWhatsThis( i18n( "Go to the previous bookmarked page" ) );
connect( m_prevBookmark, SIGNAL( triggered() ), this, SLOT( slotPreviousBookmark() ) );
m_nextBookmark = new KAction( KIcon( "next" ), i18n( "Next Bookmark" ), ac, "next_bookmark" );
m_nextBookmark->setWhatsThis( i18n( "Go to the next bookmarked page" ) );
connect( m_nextBookmark, SIGNAL( triggered() ), this, SLOT( slotNextBookmark() ) );
// Find and other actions
m_find = KStdAction::find( this, SLOT( slotFind() ), ac, "find" );
m_find->setEnabled( false );
......@@ -798,6 +806,41 @@ void Part::slotHistoryNext()
m_document->setNextViewport();
}
void Part::slotPreviousBookmark()
{
uint current = m_document->currentPage();
// we are at the first page
if ( current == 0 )
return;
for ( int i = current - 1; i >= 0; --i )
{
if ( m_document->page( i )->hasBookmark() )
{
m_document->setViewportPage( i );
break;
}
}
}
void Part::slotNextBookmark()
{
uint current = m_document->currentPage();
uint pages = m_document->pages();
// we are at the last page
if ( current == pages )
return;
for ( uint i = current + 1; i < pages; ++i )
{
if ( m_document->page( i )->hasBookmark() )
{
m_document->setViewportPage( i );
break;
}
}
}
void Part::slotFind()
{
KFindDialog dlg( widget() );
......@@ -973,6 +1016,8 @@ void Part::slotShowMenu(const KPDFPage *page, const QPoint &point)
fitPageWidth = popup->addAction( KIcon("viewmagfit"), i18n("Fit Width") );
//popup->insertItem( SmallIcon("pencil"), i18n("Edit"), 3 );
//popup->setItemEnabled( 3, false );
popup->addAction( m_prevBookmark );
popup->addAction( m_nextBookmark );
reallyShow = true;
}
/*
......
......@@ -109,6 +109,8 @@ protected slots:
void slotGoToPage();
void slotHistoryBack();
void slotHistoryNext();
void slotPreviousBookmark();
void slotNextBookmark();
void slotFindNext();
void slotSaveFileAs();
void slotGetNewStuff();
......@@ -169,6 +171,8 @@ private:
KAction *m_lastPage;
KAction *m_historyBack;
KAction *m_historyNext;
KAction *m_prevBookmark;
KAction *m_nextBookmark;
KAction *m_find;
KAction *m_findNext;
KAction *m_saveAs;
......
......@@ -40,6 +40,9 @@
<Action name="history_back"/>
<Action name="history_forward" />
<Separator/>
<Action name="previous_bookmark"/>
<Action name="next_bookmark" />
<Separator/>
<Action name="goto_page"/>
</Menu>
<Menu name="mouseMode"><text>&amp;Tools</text>
......
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