Commit b6d4f9fb authored by Cosimo Cecchi's avatar Cosimo Cecchi
Browse files

app-menu: move Help to the application menu

parent 6bc1e908
...@@ -5,6 +5,11 @@ ...@@ -5,6 +5,11 @@
<attribute name="action">app.about</attribute> <attribute name="action">app.about</attribute>
<attribute name="label" translatable="yes">About System Log</attribute> <attribute name="label" translatable="yes">About System Log</attribute>
</item> </item>
<item>
<attribute name="action">app.help</attribute>
<attribute name="label" translatable="yes">Help</attribute>
<attribute name="accel">F1</attribute>
</item>
<item> <item>
<attribute name="action">app.quit</attribute> <attribute name="action">app.quit</attribute>
<attribute name="label" translatable="yes">Quit</attribute> <attribute name="label" translatable="yes">Quit</attribute>
......
...@@ -271,6 +271,24 @@ logview_app_activate (GApplication *application) ...@@ -271,6 +271,24 @@ logview_app_activate (GApplication *application)
gtk_widget_show (app->priv->window); gtk_widget_show (app->priv->window);
} }
static void
action_help (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
LogviewApp *app = user_data;
GError *error = NULL;
gtk_show_uri (gtk_widget_get_screen (app->priv->window),
"ghelp:gnome-system-log", gtk_get_current_event_time (),
&error);
if (error) {
g_warning (_("There was an error displaying help: %s"), error->message);
g_error_free (error);
}
}
static void static void
action_about (GSimpleAction *action, action_about (GSimpleAction *action,
GVariant *parameter, GVariant *parameter,
...@@ -310,6 +328,7 @@ action_quit (GSimpleAction *action, ...@@ -310,6 +328,7 @@ action_quit (GSimpleAction *action,
static GActionEntry action_entries[] = { static GActionEntry action_entries[] = {
{ "about", action_about, NULL, NULL, NULL }, { "about", action_about, NULL, NULL, NULL },
{ "help", action_help, NULL, NULL, NULL },
{ "quit", action_quit, NULL, NULL, NULL } { "quit", action_quit, NULL, NULL, NULL }
}; };
......
...@@ -26,8 +26,5 @@ ...@@ -26,8 +26,5 @@
<menuitem action="FilterMatchOnly" /> <menuitem action="FilterMatchOnly" />
<menuitem action="FilterManage" /> <menuitem action="FilterManage" />
</menu> </menu>
<menu action="HelpMenu">
<menuitem action="HelpContents"/>
</menu>
</menubar> </menubar>
</ui> </ui>
...@@ -343,21 +343,6 @@ logview_close_log (GtkAction *action, LogviewWindow *logview) ...@@ -343,21 +343,6 @@ logview_close_log (GtkAction *action, LogviewWindow *logview)
logview_manager_close_active_log (logview->priv->manager); logview_manager_close_active_log (logview->priv->manager);
} }
static void
logview_help (GtkAction *action, GtkWidget *parent_window)
{
GError *error = NULL;
gtk_show_uri (gtk_widget_get_screen (parent_window),
"ghelp:gnome-system-log", gtk_get_current_event_time (),
&error);
if (error) {
g_warning (_("There was an error displaying help: %s"), error->message);
g_error_free (error);
}
}
static void static void
logview_bigger_text (GtkAction *action, LogviewWindow *logview) logview_bigger_text (GtkAction *action, LogviewWindow *logview)
{ {
...@@ -807,9 +792,6 @@ static GtkActionEntry entries[] = { ...@@ -807,9 +792,6 @@ static GtkActionEntry entries[] = {
{ "FilterManage", NULL, N_("Manage Filters"), NULL, N_("Manage filters"), { "FilterManage", NULL, N_("Manage Filters"), NULL, N_("Manage filters"),
G_CALLBACK (logview_manage_filters)}, G_CALLBACK (logview_manage_filters)},
{ "HelpContents", GTK_STOCK_HELP, N_("_Contents"), "F1", N_("Open the help contents for the log viewer"),
G_CALLBACK (logview_help) },
}; };
static GtkToggleActionEntry toggle_entries[] = { static GtkToggleActionEntry toggle_entries[] = {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment