aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2009-12-19 13:21:51 -0200
committerLeandro A. F. Pereira <leandro@hardinfo.org>2009-12-19 13:21:51 -0200
commit63c44e14435fc738839036965575598b7917ecc7 (patch)
treebcfd9ef90c7e4b402cecfcc049134dfca5817e7e /hardinfo2
parentbc1cee54af15d2d88969c730ce6706124a159bc9 (diff)
Open link on a browser if URL protocol is http.
Diffstat (limited to 'hardinfo2')
-rw-r--r--hardinfo2/help-viewer.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/hardinfo2/help-viewer.c b/hardinfo2/help-viewer.c
index 087c8b60..eaaeeb58 100644
--- a/hardinfo2/help-viewer.c
+++ b/hardinfo2/help-viewer.c
@@ -25,6 +25,7 @@
#include "shell.h"
#include "markdown-text-view.h"
#include "help-viewer.h"
+#include "hardinfo.h"
static void do_search(HelpViewer *hv, gchar *text);
@@ -92,12 +93,16 @@ static void link_clicked(MarkdownTextView *text_view, gchar *link, gpointer data
{
HelpViewer *hv = (HelpViewer *)data;
- /* adds the current file to the back stack (before loading the new file */
- hv->back_stack = g_slist_prepend(hv->back_stack, g_strdup(hv->current_file));
- gtk_widget_set_sensitive(hv->btn_back, TRUE);
+ if (g_str_has_prefix(link, "http://")) {
+ open_url(link);
+ } else {
+ /* adds the current file to the back stack (before loading the new file */
+ hv->back_stack = g_slist_prepend(hv->back_stack, g_strdup(hv->current_file));
+ gtk_widget_set_sensitive(hv->btn_back, TRUE);
- gtk_statusbar_pop(GTK_STATUSBAR(hv->status_bar), 1);
- markdown_textview_load_file(text_view, link);
+ gtk_statusbar_pop(GTK_STATUSBAR(hv->status_bar), 1);
+ markdown_textview_load_file(text_view, link);
+ }
}
static void file_load_complete(MarkdownTextView *text_view, gchar *file, gpointer data)