Commit 969bc7b9 authored by Pino Toscano's avatar Pino Toscano

Ctrl+A to select all the text in the document.

Implements KPDF bug #109346.

svn path=/trunk/KDE/kdegraphics/okular/; revision=708124
parent 6b6e0a8d
...@@ -331,6 +331,8 @@ m_searchStarted(false), m_cliPresentation(false), m_generatorGuiClient(0) ...@@ -331,6 +331,8 @@ m_searchStarted(false), m_cliPresentation(false), m_generatorGuiClient(0)
m_copy = KStandardAction::create( KStandardAction::Copy, m_pageView, SLOT( copyTextSelection() ), ac ); m_copy = KStandardAction::create( KStandardAction::Copy, m_pageView, SLOT( copyTextSelection() ), ac );
ac->addAction("edit_copy",m_copy); ac->addAction("edit_copy",m_copy);
m_selectAll = KStandardAction::selectAll( m_pageView, SLOT( selectAll() ), ac );
// Find and other actions // Find and other actions
m_find = KStandardAction::find( this, SLOT( slotShowFindBar() ), ac ); m_find = KStandardAction::find( this, SLOT( slotShowFindBar() ), ac );
ac->addAction("find", m_find); ac->addAction("find", m_find);
......
...@@ -214,6 +214,7 @@ class Part : public KParts::ReadOnlyPart, public Okular::DocumentObserver, publi ...@@ -214,6 +214,7 @@ class Part : public KParts::ReadOnlyPart, public Okular::DocumentObserver, publi
QAction *m_prevBookmark; QAction *m_prevBookmark;
QAction *m_nextBookmark; QAction *m_nextBookmark;
QAction *m_copy; QAction *m_copy;
QAction *m_selectAll;
QAction *m_find; QAction *m_find;
QAction *m_findNext; QAction *m_findNext;
QAction *m_saveAs; QAction *m_saveAs;
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
<Menu name="edit"><text>&amp;Edit</text> <Menu name="edit"><text>&amp;Edit</text>
<Action name="edit_copy"/> <Action name="edit_copy"/>
<Separator/> <Separator/>
<Action name="edit_select_all"/>
<Separator/>
<Action name="find"/> <Action name="find"/>
<Action name="find_next"/> <Action name="find_next"/>
</Menu> </Menu>
......
...@@ -618,6 +618,20 @@ void PageView::copyTextSelection() const ...@@ -618,6 +618,20 @@ void PageView::copyTextSelection() const
} }
} }
void PageView::selectAll()
{
if ( d->mouseMode != MouseTextSelect )
return;
QVector< PageViewItem * >::const_iterator it = d->items.begin(), itEnd = d->items.end();
for ( ; it < itEnd; ++it )
{
Okular::RegularAreaRect * area = textSelectionForItem( *it );
d->pagesWithTextSelection.insert( (*it)->pageNumber() );
d->document->setPageTextSelection( (*it)->pageNumber(), area, palette().color( QPalette::Active, QPalette::Highlight ) );
}
}
//BEGIN DocumentObserver inherited methods //BEGIN DocumentObserver inherited methods
void PageView::notifySetup( const QVector< Okular::Page * > & pageSet, bool documentChanged ) void PageView::notifySetup( const QVector< Okular::Page * > & pageSet, bool documentChanged )
{ {
......
...@@ -101,6 +101,7 @@ Q_OBJECT ...@@ -101,6 +101,7 @@ Q_OBJECT
} }
void copyTextSelection() const; void copyTextSelection() const;
void selectAll();
void setAnnotationWindow( Okular::Annotation *annotation ); void setAnnotationWindow( Okular::Annotation *annotation );
......
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