mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
Don't allow navigating back to the empty initial pages.
This commit is contained in:
parent
4e6e0a5e05
commit
0712d8fd96
|
@ -790,6 +790,23 @@ void ArticleView::updateMutedContents()
|
|||
}
|
||||
}
|
||||
|
||||
void ArticleView::back()
|
||||
{
|
||||
// Don't allow navigating back to page 0, which is usually the initial
|
||||
// empty page
|
||||
if ( ui.definition->history()->currentItemIndex() > 1 )
|
||||
{
|
||||
saveHistoryUserData();
|
||||
ui.definition->back();
|
||||
}
|
||||
}
|
||||
|
||||
void ArticleView::forward()
|
||||
{
|
||||
saveHistoryUserData();
|
||||
ui.definition->forward();
|
||||
}
|
||||
|
||||
bool ArticleView::hasSound()
|
||||
{
|
||||
return ui.definition->page()->mainFrame()->
|
||||
|
|
|
@ -104,12 +104,10 @@ public:
|
|||
public slots:
|
||||
|
||||
/// Goes back in history
|
||||
void back()
|
||||
{ saveHistoryUserData(); ui.definition->back(); }
|
||||
void back();
|
||||
|
||||
/// Goes forward in history
|
||||
void forward()
|
||||
{ saveHistoryUserData(); ui.definition->forward(); }
|
||||
void forward();
|
||||
|
||||
public:
|
||||
|
||||
|
|
Loading…
Reference in a new issue