]> Pileus Git - aweather/commitdiff
Integrate User Guide into UI
authorAndy Spencer <andy753421@gmail.com>
Mon, 9 Jan 2012 06:08:45 +0000 (06:08 +0000)
committerAndy Spencer <andy753421@gmail.com>
Mon, 9 Jan 2012 06:08:45 +0000 (06:08 +0000)
data/main.ui.in
docs/Makefile.am
src/aweather-gui.c

index 7113cc39edc97296b50392911e21876bef107152..cd9d2160956e5849ca6a808b022cfc34e01f123d 100644 (file)
     <property name="stock_id">gtk-clear</property>
     <signal name="activate" handler="on_cleancache" swapped="no"/>
   </object>
-  <object class="GtkAction" id="contents">
-    <property name="label">_Contents</property>
-    <property name="short_label">Contents</property>
-    <property name="tooltip">AWeather Reference Manual</property>
-    <property name="stock_id">gtk-help</property>
-    <signal name="activate" handler="on_contents" swapped="no"/>
-  </object>
   <object class="GtkToggleAction" id="fullscreen">
     <property name="label">_Fullscreen</property>
     <property name="stock_id">gtk-fullscreen</property>
     <signal name="toggled" handler="on_fullscreen" swapped="no"/>
   </object>
+  <object class="GtkAction" id="manpage">
+    <property name="label" translatable="yes">_Man Page</property>
+    <property name="short_label" translatable="yes">Man Page</property>
+    <property name="tooltip" translatable="yes">Unix Man Page</property>
+    <property name="stock_id">gtk-help</property>
+    <signal name="activate" handler="on_help" swapped="no"/>
+  </object>
   <object class="GtkToggleAction" id="offline">
     <property name="label">_Offline</property>
     <property name="stock_id">gtk-disconnect</property>
     <property name="stock_id">gtk-media-play</property>
     <signal name="toggled" handler="on_update" swapped="no"/>
   </object>
+  <object class="GtkAction" id="userguide">
+    <property name="label">_User Guide</property>
+    <property name="short_label">User Guide</property>
+    <property name="tooltip">AWeather User Guide</property>
+    <property name="stock_id">gtk-help</property>
+    <signal name="activate" handler="on_help" swapped="no"/>
+  </object>
   <object class="GtkAction" id="zoomin">
     <property name="label">Zoom _In</property>
     <property name="stock_id">gtk-zoom-in</property>
@@ -72,7 +79,7 @@
     <property name="type_hint">dialog</property>
     <property name="program_name">AWeather</property>
     <property name="version">@VERSION@</property>
-    <property name="copyright" translatable="yes">Copyright ©2008-2011 Andy Spencer</property>
+    <property name="copyright" translatable="yes">Copyright ©2008-2012 Andy Spencer</property>
     <property name="comments" translatable="yes">A weather monitoring program</property>
     <property name="website">http://lug.rose-hulman.edu/proj/aweather</property>
     <property name="license" translatable="yes">                    GNU GENERAL PUBLIC LICENSE
@@ -320,6 +327,7 @@ The hypothetical commands `show w' and `show c' should show the appropriate part
   The GNU General Public License does not permit incorporating your program into proprietary programs.  If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library.  If this is what you want to do, use the GNU Lesser General Public License instead of this License.  But first, please read &lt;http://www.gnu.org/philosophy/why-not-lgpl.html&gt;.
 </property>
     <property name="authors">Andy Spencer &lt;andy753421@gmail.com&gt;</property>
+    <property name="documenters">Jason Holmes &lt;Doppler5@aol.com&gt;</property>
     <property name="logo">logo.svg</property>
     <property name="wrap_license">True</property>
     <signal name="delete-event" handler="gtk_widget_hide_on_delete" swapped="no"/>
@@ -524,10 +532,19 @@ The hypothetical commands `show w' and `show c' should show the appropriate part
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <child>
-                      <object class="GtkImageMenuItem" id="main_menu_help_contents">
+                      <object class="GtkImageMenuItem" id="main_menu_help_userguide">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="related_action">userguide</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_stock">True</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkImageMenuItem" id="main_menu_help_manpage">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="related_action">contents</property>
+                        <property name="related_action">manpage</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                       </object>
index 2c45385aee4f02de8ba96c90467634ba59a10ce4..6e6f23bd478971190260e66f78a301ec5f509407 100644 (file)
@@ -1,5 +1,5 @@
 man1_MANS = aweather.1 wsr88ddec.1
-html_DATA = aweather.html
+html_DATA = aweather.html userguide.html
 
 EXTRA_DIST = $(man1_MANS) $(html_DATA) \
             aweather.ad wsr88ddec.ad
index c34c6e4dd396f1e460f36cc92a348e831b13b656..9c88987f8eff424d7bd7282de98809366fe983eb 100644 (file)
@@ -128,10 +128,17 @@ G_MODULE_EXPORT void on_cleancache(GtkMenuItem *menu, AWeatherGui *self)
        cleancache_r(cache);
 }
 
-G_MODULE_EXPORT void on_contents(GtkMenuItem *menu, AWeatherGui *self)
+G_MODULE_EXPORT void on_help(GtkMenuItem *menu, AWeatherGui *self)
 {
        GError *err = NULL;
-       gchar *path = g_strdup(HTMLDIR "/aweather.html");
+       const gchar *name = gtk_buildable_get_name(GTK_BUILDABLE(menu));
+       gchar *page = g_str_has_suffix(name, "userguide") ? "userguide" :
+                     g_str_has_suffix(name, "manpage")   ? "aweather"  : NULL;
+       if (page == NULL) {
+               g_warning("Unknown help page: %s", page);
+               return;
+       }
+       gchar *path = g_strdup_printf("%s/%s.html", HTMLDIR, page);
        g_strdelimit(path, "/", G_DIR_SEPARATOR);
        gchar *argv[] = {"xdg-open", path, NULL};
        g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &err);