Commit dac9fb01 authored by Matthias Möller's avatar Matthias Möller
Browse files

some fixes when the backward button was pressed

followed by a new site:
- buttons will be updated
- last site is reachable with the backward button

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14428 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 79291391
......@@ -86,13 +86,15 @@ void HelpBrowser::updateNameSpaceAndFolder (const QUrl& _url) {
void HelpBrowser::rememberHistory (const QUrl& _url) {
QUrl newUrl = resolveUrl(_url);
// Delete the visited pages after the current position if they exist
if ( currentPage_ < visitedPages_.size()-1 )
visitedPages_.erase((visitedPages_.begin()+currentPage_),visitedPages_.end());
visitedPages_.erase((visitedPages_.begin()+currentPage_+1),visitedPages_.end());
visitedPages_.push_back(newUrl);
currentPage_ = visitedPages_.size()-1;
emit historyChanged(_url);
}
QUrl HelpBrowser::resolveUrl(const QUrl &_url)
......
......@@ -108,6 +108,14 @@ public:
*/
QUrl resolveUrl(const QUrl &_url);
signals:
/*
* is emitted, when the page history was changed.
* it is not equal to the signal 'sourceChanged'
* because saving in the history can be skipped
*/
void historyChanged(const QUrl&);
public slots:
void open(const QString& _url);
......
......@@ -174,9 +174,12 @@ HelpWidget::HelpWidget(QWidget* parent, const QString& _homeSite /*=""*/, const
// Forward button
connect(homeButton_, SIGNAL(clicked()), this, SLOT(goHome()));
// Source has been reloaded
// Source has been reloaded, so the buttons need an update and the modelview
connect(textWindow_, SIGNAL(sourceChanged(const QUrl&)), this, SLOT(update(const QUrl&)));
// the history has changed, so the buttons need an update
connect(textWindow_, SIGNAL(historyChanged(const QUrl&)), this, SLOT(updateButtons()));
// Register documentation
// Seems to be an unneeded call!
//helpEngine_->registerDocumentation(filename);
......
......@@ -98,14 +98,17 @@ private slots:
void showResults(int _hits);
// updates the buttons an the content widget
// the content widget is synchronized with the helpBrowser
void update(const QUrl& url);
void openFoundSite(QListWidgetItem* _item);
private:
//updates only the buttons (for/back)
void updateButtons();
private:
// For the search popup
QDockWidget* searchWidget_;
......
Supports Markdown
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