/* help.cpp * implements the stuff under Help in the menubar * * for Denemo, a gtk+ frontend to GNU Lilypond * (c) 2000-2005 Matthew Hiller */ #include #include "config.h" #include "binreloc.h" #include /* for strlen */ /* The tutorial mentioned that the actual gchar * held within a * GtkText widget needs to be freed. I don't do such a free, though, * so I think this function has a memory leak in it. */ /** * Create the about dialog * */ void about (GtkAction * action, gpointer callback_data) { GtkWidget *dialog; const char *authors[] = { "Matthew Hiller", "Adam Tee", NULL }; dialog = gtk_about_dialog_new (); gtk_about_dialog_set_name (GTK_ABOUT_DIALOG (dialog), _("Denemo")); gtk_about_dialog_set_comments (GTK_ABOUT_DIALOG (dialog), _("The GNU graphical score editor")); gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (dialog), VERSION); gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (dialog), "http://denemo.sourceforge.net"); gtk_about_dialog_set_website_label (GTK_ABOUT_DIALOG (dialog), _("Denemo website")); gtk_about_dialog_set_license (GTK_ABOUT_DIALOG (dialog), _ ("(c) 1999, 2000, 2001 Matthew Hiller, Adam Tee, and others.\n\n\ http://www.gnu.org/software/denemo/denemo.html\n\n\ This program is licensed under the terms of the GNU\n\ General Public License and is provided with absolutely\n\ NO WARRANTY; see the file COPYING for details.")); gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG (dialog), authors); gtk_widget_show_all (dialog); } /** * Function to allow browsing the user manual * uses the given web browser to display the manual */ void browse_manual (GtkAction * action, DenemoGUI * gui) { gint retval; // struct scoreinfo *si; GError *error = NULL; gchar **argv; gchar *cmd; gchar *data_dir = gbr_find_data_dir (PKGDATADIR); gchar *path = g_strdup_printf ("file://%s/manual/denemo-manual.html", data_dir); gchar *argument = g_shell_quote (path); //g_print("PKGDATADIR %s\n", PKGDATADIR); cmd = g_strconcat (gui->prefs->browser->str, " ", argument, NULL); g_free (argument); if (!g_shell_parse_argv (cmd, NULL, &argv, &error)) { g_message (_("Could not parse specified web browser : %s\n"), error->message); g_error_free (error); return; } retval = g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error); if (!retval) { g_message (_("Could not execute specified web browser:\n%s"), error->message); g_error_free (error); } //g_free (browser); g_free (path); g_free (cmd); g_strfreev (argv); }