summaryrefslogtreecommitdiff
path: root/src/gui/helpwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-18 15:34:03 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-18 16:10:31 +0300
commit0e21b478636fac986a5e2276662da6a6e1692f9e (patch)
tree8c442eb9ea5118ba9fbab14831aa12dbe42a58ab /src/gui/helpwindow.cpp
parente714f084284e14ff8a338d68c15088ab7662a42f (diff)
downloadmv-0e21b478636fac986a5e2276662da6a6e1692f9e.tar.gz
mv-0e21b478636fac986a5e2276662da6a6e1692f9e.tar.bz2
mv-0e21b478636fac986a5e2276662da6a6e1692f9e.tar.xz
mv-0e21b478636fac986a5e2276662da6a6e1692f9e.zip
Add support for help seach links.
To add link to search text: /url ?text Also add support for links in format: help://topic
Diffstat (limited to 'src/gui/helpwindow.cpp')
-rw-r--r--src/gui/helpwindow.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/helpwindow.cpp b/src/gui/helpwindow.cpp
index c035b2a24..712d9fa6a 100644
--- a/src/gui/helpwindow.cpp
+++ b/src/gui/helpwindow.cpp
@@ -36,6 +36,7 @@
#include "utils/gettext.h"
#include "utils/langs.h"
+#include "utils/paths.h"
#include "utils/process.h"
#include "utils/translation/podict.h"
@@ -101,18 +102,19 @@ void HelpWindow::handleLink(const std::string &link,
void HelpWindow::loadHelp(const std::string &helpFile)
{
+ if (!checkPath(helpFile))
+ return;
mBrowserBox->clearRows();
-
loadFile("header");
loadFile(helpFile);
loadFile("footer");
-
mScrollArea->setVerticalScrollAmount(0);
setVisible(true);
}
-void HelpWindow::loadFile(const std::string &file)
+void HelpWindow::loadFile(std::string file)
{
+ trim(file);
std::string helpPath = branding.getStringValue("helpPath");
if (helpPath.empty())
helpPath = paths.getStringValue("help");
@@ -144,6 +146,7 @@ void HelpWindow::loadTags()
void HelpWindow::search(const std::string &text0)
{
std::string text = text0;
+ trim(text);
toLower(text);
if (mTagFileMap.find(text) == mTagFileMap.end())
{