From fe3baafcf90809ace9dca20ee63b7cac3bc7ca42 Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Wed, 5 May 2010 04:25:05 +0000 Subject: [PATCH] Add user documentations - Use an AsciiDoc file to generate a man page and a html page. - Add Help->Contents menu which opens the HTML page in the default browser. --- data/main.ui.in | 49 ++++++++++++++++------- docs/.gitignore | 3 ++ docs/Makefile.am | 12 +++++- docs/aweather.ad | 98 ++++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 1 + src/aweather-gui.c | 10 +++++ 6 files changed, 158 insertions(+), 15 deletions(-) create mode 100644 docs/.gitignore create mode 100644 docs/aweather.ad diff --git a/data/main.ui.in b/data/main.ui.in index edcc377..986c029 100644 --- a/data/main.ui.in +++ b/data/main.ui.in @@ -50,15 +50,15 @@ True Work offline - offline True + offline True - prefs True + prefs True True @@ -71,8 +71,8 @@ True - quit True + quit True True @@ -92,8 +92,8 @@ True - zoomin True + zoomin True True @@ -101,8 +101,8 @@ True - zoomout True + zoomout True True @@ -115,8 +115,8 @@ True - refresh True + refresh True True @@ -133,11 +133,26 @@ True + + + True + True + contents + True + True + + + + + + True + + True - about True + about True True @@ -159,8 +174,8 @@ True - zoomin True + zoomin False @@ -170,8 +185,8 @@ True - zoomout True + zoomout False @@ -190,8 +205,8 @@ True - offline True + offline toolbutton3 True @@ -203,8 +218,8 @@ True - refresh True + refresh True @@ -224,8 +239,8 @@ True - prefs True + prefs toolbutton1 True @@ -900,13 +915,19 @@ The hypothetical commands `show w' and `show c' should show the appropriate part - - + + 8 1 + + Contents + Contents + AWeather Reference Manual + gtk-help + diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..d0a941d --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,3 @@ +*.1 +*.html +*.xml diff --git a/docs/Makefile.am b/docs/Makefile.am index 2b6c157..03af3ec 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,4 +1,14 @@ -# TODO: write man pages +man1_MANS = aweather.1 +html_DATA = aweather.html + +%.html: %.ad + asciidoc $< + +%.1: %.ad + a2x -f manpage $< + +test: $(man1_MANS) + nroff -man $(man1_MANS) maintainer-clean-local: rm -f Makefile.in diff --git a/docs/aweather.ad b/docs/aweather.ad new file mode 100644 index 0000000..c21c097 --- /dev/null +++ b/docs/aweather.ad @@ -0,0 +1,98 @@ +aweather(1) +=========== +Andy Spencer + +NAME +---- +aweather - Advanced weather reporting program + +SYNOPSIS +-------- +*aweather* [*-aho*] [-d 'level'] [-s 'site'] + +DESCRIPTION +----------- +AWeather is a advanced weather reporting program which is designed to be used +by weather enthusiasts. AWeather is not another weather dockapp that simply +displays a pre-computed forecast. It is designed to be an easy to use program +that integrates a variety of weather data in simple unified interface; see +features for more details. + +OPTIONS +------- +*-a*, *--auto*:: + Auto update radar (todo) + +*-h*, *--help*:: + Show usage. + +*-d*, *--debug*='level':: + Change default log level*, a debug level ranges from 0 to 7. A debug + level of 7 is recommended only for debugging purposes. + +*-s*, *--site*='site':: + Set initial site. The site should be given as a WSR88D site code such + as KLSX. + +*-o*, *--offline*:: + Run in offline mode, AWeather will not attempt to connect to the + internet to download radar files but will show the closest matching + cached file. + +KEY BINDINGS +------------ +*h*, *j*, *k*, *l*:: +*Left*, *Down*, *Up*, *Right*:: + Pan the surface of the earth left, down, up, or right. + +*i*, *o*:: +*+*, *-*:: +*Scroll up*, *Scroll down*:: + Zoom towards or away from the surface of the earth. + +*J*, *K*:: + Zoom + Rotate the camera back or forward. If looking across the surface of the + earth, J will point the camera towards ground while K will point the + camera towards the sky. + +*H*, *L*:: + Rotate the counter clockwise or clockwise around the vertical axes. If + looking across the surface of the earth, H will pan to the left while L + will pan to the right. + +*w*:: + Draw a wire frame of the earth for debugging purposes. + +*q*:: + Exit AWeather. + +*Tab*:: + Cycle through available plugins. + +*CTRL-R*:: + Refresh all map data. + +MOUSE MOTION +------------ +*Left-click and drag*:: + Pan the surface of the earth. + +*Middle-click and drag*:: + Zoom towards (up) or away (down) from the surface of the earth. + +*Right-click and drag*:: + Rotate the camera around the vertical and horizontal axes. + +EXAMPLES +-------- +Start AWeather in offline mode and center the map on the St. Louis radar.:: +`$ aweather -s KLSX -o` + +SEE ALSO +-------- +gis-demo(1) + +BUGS +---- +Many diff --git a/src/Makefile.am b/src/Makefile.am index 535b1d0..7bba88f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,6 +8,7 @@ aweather_SOURCES = main.c \ aweather-gui.c aweather-gui.h \ aweather-location.c aweather-location.h aweather_CPPFLAGS = \ + -DHTMLDIR="\"$(dots)$(htmldir)\"" \ -DPKGDATADIR="\"$(dots)$(pkgdatadir)\"" \ -DPLUGINSDIR="\"$(dots)$(pkglibdir)\"" aweather_LDADD = $(GIS_LIBS) diff --git a/src/aweather-gui.c b/src/aweather-gui.c index 5c2558f..42f65af 100644 --- a/src/aweather-gui.c +++ b/src/aweather-gui.c @@ -49,6 +49,16 @@ G_MODULE_EXPORT gboolean on_gui_key_press(GtkWidget *widget, GdkEventKey *event, return FALSE; } +G_MODULE_EXPORT void on_help_contents(GtkMenuItem *menu, AWeatherGui *self) +{ + GError *err = NULL; + const gchar *uri = "file://" HTMLDIR "/aweather.html"; + gtk_show_uri(NULL, uri, GDK_CURRENT_TIME, &err); + if (err) + g_warning("Unable to open help page: %s - %s", uri, err->message); + g_error_free(err); +} + G_MODULE_EXPORT void on_quit(GtkMenuItem *menu, AWeatherGui *self) { gtk_widget_destroy(GTK_WIDGET(self)); -- 2.43.2