2
* implements the stuff under Help in the menubar
4
* for Denemo, a gtk+ frontend to GNU Lilypond
5
* (c) 2000-2005 Matthew Hiller
8
#include <denemo/denemo.h>
11
#include <string.h> /* for strlen */
12
/* The tutorial mentioned that the actual gchar * held within a
13
* GtkText widget needs to be freed. I don't do such a free, though,
14
* so I think this function has a memory leak in it. */
17
* Create the about dialog
21
about (GtkAction * action, gpointer callback_data)
24
DenemoGUI *gui = (DenemoGUI *)callback_data;
25
const char *authors[] = { "Richard Shann", "Jeremiah Benham", "Matthew Hiller", "Adam Tee", NULL };
27
dialog = gtk_about_dialog_new ();
28
gtk_about_dialog_set_name (GTK_ABOUT_DIALOG (dialog), _("Denemo"));
29
gtk_about_dialog_set_comments (GTK_ABOUT_DIALOG (dialog),
30
_("The GNU graphical score editor"));
31
gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (dialog), VERSION);
32
gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (dialog),
34
gtk_about_dialog_set_website_label (GTK_ABOUT_DIALOG (dialog),
36
gtk_about_dialog_set_license (GTK_ABOUT_DIALOG (dialog),
38
("(c) 1999 - 2008 Matthew Hiller, Adam Tee, and others.\n\n\
39
http://www.denemo.org\n\n\
40
This program is licensed under the terms of the GNU\n\
41
General Public License and is provided with absolutely\n\
42
NO WARRANTY; see the file COPYING for details."));
45
gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG (dialog), authors);
46
gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(Denemo.window));
47
gtk_dialog_run(GTK_DIALOG(dialog));
48
gtk_widget_destroy(dialog);
53
* Function to allow browsing the user manual
54
* uses the given web browser to display the manual
55
* If param contains a url it opens that
58
browse_manual (GtkAction * action, DenemoScriptParam *param)
60
GET_1PARAM(action, param, url);
61
DenemoGUI *gui = Denemo.gui;
65
/* get the uri to the manual */
66
gchar *manualpath = g_build_filename (get_data_dir (), "manual",
67
"denemo-manual.html", NULL);
68
gchar *manualuri = url?g_strdup(url):g_filename_to_uri (manualpath, NULL, NULL);
70
/* check that the browser exists */
71
gchar *browserpath = g_find_program_in_path (Denemo.prefs.browser->str);
72
if (browserpath == NULL)
74
if(run_file_association(manualuri))
76
/* show a warning dialog */
78
gtk_message_dialog_new (GTK_WINDOW (Denemo.window),
79
GTK_DIALOG_DESTROY_WITH_PARENT,
82
_("Could not find %s in the path"),
83
Denemo.prefs.browser->str);
84
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
85
_("Please edit the chosen "
88
gtk_dialog_run (GTK_DIALOG (dialog));
90
/* free the memory and return */
91
gtk_widget_destroy (dialog);
97
/* spawn the process to show the manual */
98
gchar *argv[] = {Denemo.prefs.browser->str,
101
retval = g_spawn_async (NULL, argv, NULL,
102
G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error);
105
g_message (_("Could not execute specified web browser: %s\n"),
107
g_error_free (error);
110
/* free the memory */
111
g_free (browserpath);