From 0db159ef0f611ba014c59e773a59661b92ab7fde Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 21 Jul 2012 22:03:13 +0300 Subject: Add support for opening urls in system default browser. --- src/gui/helpwindow.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/gui/helpwindow.cpp') diff --git a/src/gui/helpwindow.cpp b/src/gui/helpwindow.cpp index c2b0d873f..f88394f82 100644 --- a/src/gui/helpwindow.cpp +++ b/src/gui/helpwindow.cpp @@ -38,6 +38,7 @@ #include "utils/gettext.h" #include "utils/langs.h" +#include "utils/process.h" #include "utils/translation/podict.h" #include "utils/translation/translationmanager.h" @@ -92,8 +93,15 @@ void HelpWindow::action(const gcn::ActionEvent &event) void HelpWindow::handleLink(const std::string &link, gcn::MouseEvent *event A_UNUSED) { - std::string helpFile = link; - loadHelp(helpFile); + if (!strStartWith(link, "http://")) + { + std::string helpFile = link; + loadHelp(helpFile); + } + else + { + openBrowser(link); + } } void HelpWindow::loadHelp(const std::string &helpFile) -- cgit v1.2.3-70-g09d2