diff --git a/scanpopup.cc b/scanpopup.cc index a70711e9..b973fbef 100644 --- a/scanpopup.cc +++ b/scanpopup.cc @@ -207,6 +207,9 @@ ScanPopup::ScanPopup( QWidget * parent, this, SLOT(mouseGrabPoll()) ); MouseOver::instance().setPreferencesPtr( &( cfg.preferences ) ); + + ui.goBackButton->setEnabled( false ); + ui.goForwardButton->setEnabled( false ); } ScanPopup::~ScanPopup() @@ -785,6 +788,8 @@ void ScanPopup::pageLoaded( ArticleView * ) { ui.pronounceButton->setVisible( definition->hasSound() ); + updateBackForwardButtons(); + if ( cfg.preferences.pronounceOnLoadPopup ) definition->playSound(); } @@ -888,3 +893,19 @@ void ScanPopup::switchExpandOptionalPartsMode() if( isVisible() ) emit switchExpandMode(); } + +void ScanPopup::updateBackForwardButtons() +{ + ui.goBackButton->setEnabled(definition->canGoBack()); + ui.goForwardButton->setEnabled(definition->canGoForward()); +} + +void ScanPopup::on_goBackButton_clicked() +{ + definition->back(); +} + +void ScanPopup::on_goForwardButton_clicked() +{ + definition->forward(); +} diff --git a/scanpopup.hh b/scanpopup.hh index 689b513b..5d0d00d7 100644 --- a/scanpopup.hh +++ b/scanpopup.hh @@ -143,6 +143,8 @@ private: /// Returns inputWord, chopped with appended ... if it's too long/ QString elideInputWord(); + void updateBackForwardButtons(); + private slots: void clipboardChanged( QClipboard::Mode ); @@ -155,6 +157,8 @@ private slots: void on_showDictionaryBar_clicked( bool checked ); void showStatusBarMessage ( QString const &, int, QPixmap const & ); void on_sendWordButton_clicked(); + void on_goBackButton_clicked(); + void on_goForwardButton_clicked(); void hideTimerExpired(); void altModeExpired(); diff --git a/scanpopup.ui b/scanpopup.ui index 948c9b38..91dbed81 100644 --- a/scanpopup.ui +++ b/scanpopup.ui @@ -61,6 +61,34 @@ + + + + Back + + + ... + + + + :/icons/previous.png:/icons/previous.png + + + + + + + Forward + + + ... + + + + :/icons/next.png:/icons/next.png + + +