Author: abrander
Date: 2011-03-21 14:10:31 +0100 (Mon, 21 Mar 2011)
New Revision: 3909

Modified:
   trunk/src/rs-actions.c
   trunk/src/ui.xml
Log:
Added link to online documentation.

Modified: trunk/src/rs-actions.c
===================================================================
--- trunk/src/rs-actions.c      2011-03-21 12:55:30 UTC (rev 3908)
+++ trunk/src/rs-actions.c      2011-03-21 13:10:31 UTC (rev 3909)
@@ -1309,6 +1309,51 @@
        gtk_widget_destroy (dialog);
 }
 
+ACTION(online_documentation)
+{
+       const gchar *link = "http://rawstudio.org/documentation/";;
+
+#ifdef WIN32
+#warning This is untested
+       gchar* argv[]= {
+               getenv("ComSpec"),
+               "/c",
+               "start",
+               "uri click", /* start needs explicit title incase link has 
spaces or quotes */
+               (gchar*) link,
+               NULL
+       };
+#else
+       gchar *argv[]= {
+               "gnome-open", /* this feels like cheating! */
+               (gchar *) link,
+               NULL
+               };
+#endif
+       GError *error = NULL;
+       gint status = 0;
+       gboolean res;
+
+       res = g_spawn_sync(
+               NULL /*PWD*/,
+               argv,
+               NULL /*envp*/,
+               G_SPAWN_SEARCH_PATH, /*flags*/
+               NULL, /*setup_func*/
+               NULL, /*user data for setup*/
+               NULL,
+               NULL, /* stdin/out/error */
+               &status,
+               &error);
+
+       if(!res)
+       {
+               g_error("%s: %s\n", g_quark_to_string(error->domain), 
error->message);
+               g_error_free(error);
+               return ;
+       }
+}
+
 ACTION(about)
 {
        const static gchar *authors[] = {
@@ -1428,6 +1473,9 @@
        { "ProcessBatch", GTK_STOCK_EXECUTE, _("_Start"), NULL, NULL, 
ACTION_CB(ProcessBatch) },
 
        /* help menu */
+       /* The following entry is not translateable to respect string freeze - 
but it's not the end of the
+          world, since online documentation is only available in english 
anyway */
+       { "OnlineDocumentation", GTK_STOCK_HELP, "_Online Documentation", NULL, 
NULL, ACTION_CB(online_documentation) },
        { "About", GTK_STOCK_ABOUT, _("_About"), NULL, NULL, ACTION_CB(about) },
        { "FilterGraph", NULL, "_Filter Graph", NULL, NULL, 
ACTION_CB(filter_graph) },
 

Modified: trunk/src/ui.xml
===================================================================
--- trunk/src/ui.xml    2011-03-21 12:55:30 UTC (rev 3908)
+++ trunk/src/ui.xml    2011-03-21 13:10:31 UTC (rev 3909)
@@ -88,6 +88,8 @@
    <menuitem action="ProcessBatch" />
   </menu>
   <menu action="HelpMenu">
+   <menuitem action="OnlineDocumentation" />
+   <separator />
    <menuitem action="About" />
   </menu>
  </menubar>


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to