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

added "whats this" hyperlink to help Browser support

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13874 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 93e00e86
...@@ -606,6 +606,18 @@ CoreWidget( QVector<ViewMode*>& _viewModes, ...@@ -606,6 +606,18 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
// Close button // Close button
connect(stereoSettingsWidget_->closeButton, SIGNAL(clicked()), connect(stereoSettingsWidget_->closeButton, SIGNAL(clicked()),
stereoSettingsWidget_, SLOT(hide())); stereoSettingsWidget_, SLOT(hide()));
// ======================================================================
// Help Browser start up
// ======================================================================
if (!OpenFlipper::Options::nogui())
{
helpWidget_ = new HelpWidget(this);
connect(this, SIGNAL(changeHelpSite(QUrl)), helpWidget_, SLOT(linkActivated(QUrl)));
}
} }
...@@ -1023,5 +1035,21 @@ void CoreWidget::setForceNativeCursor ( bool _state ) ...@@ -1023,5 +1035,21 @@ void CoreWidget::setForceNativeCursor ( bool _state )
cursorPainter_->setForceNative (_state); cursorPainter_->setForceNative (_state);
} }
//-----------------------------------------------------------------------------
bool CoreWidget::event( QEvent *_event )
{
//WhatsThisClicked for hyperlinks in 'whats this' Message Boxes
if( _event->type() == QEvent::WhatsThisClicked )
{
QWhatsThisClickedEvent *wtcEvent = static_cast<QWhatsThisClickedEvent*>(_event);
QWhatsThis::hideText();
this->showHelpBrowser(wtcEvent->href());
return true;
}
return QWidget::event(_event);
}
//============================================================================= //=============================================================================
...@@ -327,6 +327,8 @@ public: ...@@ -327,6 +327,8 @@ public:
// Filter alt key events under windows // Filter alt key events under windows
//bool eventFilter(QObject *obj, QEvent *ev); //bool eventFilter(QObject *obj, QEvent *ev);
bool event( QEvent *event );
signals : signals :
/** When this Signal is emitted when a Keyevent Event occures /** When this Signal is emitted when a Keyevent Event occures
...@@ -1028,7 +1030,10 @@ public: ...@@ -1028,7 +1030,10 @@ public:
public slots: public slots:
/// Display the help Browser /// Display the help Browser
void showHelpBrowser(); void showHelpBrowser(const QString &page = "qthelp://org.openflipper.dev/doc/main.html");
signals:
void changeHelpSite(QUrl);
private: private:
/// Pointer to the help Browser /// Pointer to the help Browser
......
...@@ -57,17 +57,15 @@ ...@@ -57,17 +57,15 @@
//== IMPLEMENTATION ========================================================== //== IMPLEMENTATION ==========================================================
void CoreWidget::showHelpBrowser(const QString &page /*= "qthelp://org.openflipper.dev/doc/main.html"*/) {
void CoreWidget::showHelpBrowser( ) {
if ( OpenFlipper::Options::nogui() ) if ( OpenFlipper::Options::nogui() )
return; return;
if(helpWidget_ == 0) emit changeHelpSite(QUrl(page));
helpWidget_ = new HelpWidget(this, "qthelp://org.openflipper.dev/doc/main.html");
helpWidget_->show(); helpWidget_->show();
helpWidget_->activateWindow();
} }
......
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