Commit a27ca79c authored by Albert Astals Cid's avatar Albert Astals Cid

Improve Audio handling

Say "Play Sound" instead of "Follow this link"
Only offer to stop sound when there's one playing

Inspired by https://git.reviewboard.kde.org/r/120683 by Nidhi Jain
parent 9a3672b2
......@@ -2430,8 +2430,12 @@ void PageView::mouseReleaseEvent( QMouseEvent * e )
KMenu menu( this );
QAction * actProcessLink = menu.addAction( i18n( "Follow This Link" ) );
QAction * actStopSound = 0;
if ( link->actionType() == Okular::Action::Sound )
actStopSound = menu.addAction( i18n( "Stop Sound" ) );
if ( link->actionType() == Okular::Action::Sound ) {
actProcessLink->setText( i18n( "Play this Sound" ) );
if ( Okular::AudioPlayer::instance()->state() == Okular::AudioPlayer::PlayingState ) {
actStopSound = menu.addAction( i18n( "Stop Sound" ) );
}
}
QAction * actCopyLinkLocation = 0;
if ( dynamic_cast< const Okular::BrowseAction * >( link ) )
actCopyLinkLocation = menu.addAction( KIcon( "edit-copy" ), i18n( "Copy Link Address" ) );
......
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