[easytag] Add Help item to About menu
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Add Help item to About menu
- Date: Wed, 19 Feb 2014 19:52:55 +0000 (UTC)
commit 42ecdcda50fd047bf2f2466d112a3746edde8611
Author: David King <amigadave amigadave com>
Date: Wed Feb 19 19:50:50 2014 +0000
Add Help item to About menu
src/bar.c | 5 +++++
src/bar.h | 1 +
src/misc.c | 19 +++++++++++++++++++
src/misc.h | 2 ++
src/ui_manager.h | 1 +
5 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/src/bar.c b/src/bar.c
index 8367f1b..262684f 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -305,6 +305,11 @@ void Create_UI (GtkWidget **ppmenubar, GtkWidget **pptoolbar)
{ MENU_GO, NULL, _("_Go"), NULL, NULL, NULL },
{ MENU_HELP, NULL, _("_Help"), NULL,
NULL, NULL },
+/* TODO: Link to help.gnome.org, or locally-installed help, on Windows. */
+#ifndef G_OS_WIN32
+ { AM_OPEN_HELP_CONTENTS, GTK_STOCK_HELP, _("_Contents"), "F1",
+ _("Show help"), G_CALLBACK (et_show_help) },
+#endif
{ AM_OPEN_ABOUT_WINDOW, GTK_STOCK_ABOUT, _("_About"), NULL,
_("About"), G_CALLBACK(Show_About_Window) },
diff --git a/src/bar.h b/src/bar.h
index d189a4e..904eded 100644
--- a/src/bar.h
+++ b/src/bar.h
@@ -100,6 +100,7 @@ GtkWidget *CheckMenuItemBrowseHiddenDirMainMenu;
#define AM_WRITE_PLAYLIST "WritePlaylist"
#define AM_RUN_AUDIO_PLAYER "RunAudio"
#define AM_OPEN_ABOUT_WINDOW "About"
+#define AM_OPEN_HELP_CONTENTS "HelpContents"
#define AM_QUIT "Quit"
#define AM_ARTIST_RUN_AUDIO_PLAYER "ArtistRunAudio"
diff --git a/src/misc.c b/src/misc.c
index b6befe1..af68db0 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1063,6 +1063,25 @@ gchar *Convert_Duration (gulong duration)
}
/*
+ * et_show_help:
+ */
+void
+et_show_help (void)
+{
+ GError *error = NULL;
+
+ /* TODO: Add link to application help instead. */
+ gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (MainWindow)),
+ "help:easytag", GDK_CURRENT_TIME, &error);
+
+ if (error)
+ {
+ g_debug ("Error while opening help: %s", error->message);
+ g_error_free (error);
+ }
+}
+
+/*
* @filename: (type filename): the path to a file
*
* Gets the size of a file in bytes.
diff --git a/src/misc.h b/src/misc.h
index a013700..1885d3b 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -82,6 +82,8 @@ void Run_Audio_Player_Using_Browser_Album_List (void);
gchar *Convert_Duration (gulong duration);
+void et_show_help (void);
+
goffset et_get_file_size (const gchar *filename);
gint Combo_Alphabetic_Sort (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer data);
diff --git a/src/ui_manager.h b/src/ui_manager.h
index 9f062cb..8a064c6 100644
--- a/src/ui_manager.h
+++ b/src/ui_manager.h
@@ -177,6 +177,7 @@ static const gchar *ui_xml =
" </menu>"
" <menu action='HelpMenu'>"
+" <menuitem action='HelpContents' />"
" <menuitem action='About' />"
" </menu>"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]