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
remotes/origin/pdfprintpdf
Albert Astals Cid 11 years ago
parent 9a3672b255
commit a27ca79cf3
  1. 8
      ui/pageview.cpp

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

Loading…
Cancel
Save