Extend Document::processAction() to handle RenditionActions

REVIEW: 106608
This commit is contained in:
Tobias Koenig 2012-09-27 14:15:04 +02:00
parent d68bba55b4
commit 563ad0458e
2 changed files with 21 additions and 0 deletions

View file

@ -3254,6 +3254,19 @@ void Document::processAction( const Action * action )
case Action::Movie:
emit processMovieAction( static_cast< const MovieAction * >( action ) );
break;
case Action::Rendition: {
const RenditionAction * linkrendition = static_cast< const RenditionAction * >( action );
if ( !linkrendition->script().isEmpty() )
{
if ( !d->m_scripter )
d->m_scripter = new Scripter( d );
d->m_scripter->execute( linkrendition->scriptType(), linkrendition->script() );
}
else
{
emit processRenditionAction( static_cast< const RenditionAction * >( action ) );
}
} break;
}
}

View file

@ -48,6 +48,7 @@ class Action;
class MovieAction;
class Page;
class PixmapRequest;
class RenditionAction;
class SourceReference;
class View;
class VisiblePageRect;
@ -801,6 +802,13 @@ class OKULAR_EXPORT Document : public QObject
*/
void processMovieAction( const Okular::MovieAction *action );
/**
* This signal is emitted whenever an rendition action is triggered and the UI should process it.
*
* @since 0.16 (KDE 4.10)
*/
void processRenditionAction( const Okular::RenditionAction *action );
private:
/// @cond PRIVATE
friend class DocumentPrivate;