help.c File Reference


Detailed Description

Load the help files and offer About..

Author:
Copyright 2006, 2007 Neil Williams <linux@codehelp.co.uk>

Definition in file help.c.

#include "config.h"
#include <glib.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gtkextra/gtksheet.h>
#include "types.h"
#include "dialog_initial.h"
#include "main.h"
#include "quicklist.xpm"
#include "help.h"

Go to the source code of this file.

Functions

void qlhelp_credits (GtkAction G_GNUC_UNUSED *w, gpointer G_GNUC_UNUSED data)
void qlhelp_manual (GtkAction G_GNUC_UNUSED *w, gpointer data)
 find a usable help browser


Function Documentation

void qlhelp_manual ( GtkAction G_GNUC_UNUSED *  w,
gpointer  data 
)

find a usable help browser

First preference is yelp with the XML file. Next is dwww with the HTML version, x-www-browser with HTML and finally www-browser with HTML.

Definition at line 95 of file help.c.

00096 {
00097     gchar * cmd;
00098     GError * err;
00099 
00100     err = NULL;
00101     if (g_file_test ("/usr/bin/yelp", G_FILE_TEST_EXISTS))
00102         cmd = g_strconcat ("/usr/bin/yelp ", HELPDIR, "/quicklist.xml", NULL);
00103     else if (g_file_test ("/usr/bin/dwww", G_FILE_TEST_EXISTS))
00104         cmd = g_strconcat ("/usr/bin/www-browser ", PACKAGE, NULL);
00105     else if (g_file_test ("/usr/bin/x-www-browser", G_FILE_TEST_EXISTS))
00106         cmd = g_strconcat ("/usr/bin/x-www-browser ", DOCDIR, "/index.html", NULL);
00107     else if (g_file_test ("/usr/bin/www-browser", G_FILE_TEST_EXISTS))
00108         cmd = g_strconcat ("/usr/bin/www-browser ", DOCDIR, "/index.html", NULL);
00109     else
00110     {
00111         QlContext * qlc;
00112         GtkWidget * dlg;
00113         qlc = ql_get_context (GTK_WIDGET(data));
00114         dlg = gtk_message_dialog_new (GTK_WINDOW(qlc->parent), 
00115             GTK_DIALOG_DESTROY_WITH_PARENT,
00116             GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
00117             "%s", "No help viewer found, please install yelp.");
00118         g_signal_connect (GTK_OBJECT (dlg), "response", 
00119             G_CALLBACK (gtk_widget_destroy), dlg);
00120         gtk_dialog_run (GTK_DIALOG (dlg));
00121         gtk_widget_destroy (dlg);
00122         g_warning ("Cannot load quicklist manual, install yelp.");
00123         return;
00124     }
00125     g_spawn_command_line_async (cmd, &err);
00126     g_free (cmd);
00127     if (err)
00128         g_warning (err->message);
00129     g_clear_error (&err);
00130 }


Generated on Mon Jan 28 22:02:11 2008 for quicklist by  doxygen 1.5.4