[gnome-packagekit] Move the 'Help' menu into the application menu
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-packagekit] Move the 'Help' menu into the application menu
- Date: Fri, 11 May 2012 16:15:36 +0000 (UTC)
commit 9b4c00cfcae1f4186c4d106d36040e6143ecfbed
Author: Richard Hughes <richard hughsie com>
Date: Thu May 10 16:54:34 2012 +0100
Move the 'Help' menu into the application menu
data/gpk-application.ui | 64 ++++++-----------------------------------------
src/gpk-application.c | 49 ++++++++----------------------------
2 files changed, 19 insertions(+), 94 deletions(-)
---
diff --git a/data/gpk-application.ui b/data/gpk-application.ui
index 1c2e987..77ca80c 100644
--- a/data/gpk-application.ui
+++ b/data/gpk-application.ui
@@ -416,45 +416,6 @@
</child>
</object>
</child>
- <child>
- <object class="GtkMenuItem" id="menuitem_help_menu">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="label" translatable="yes">_Help</property>
- <property name="use_underline">True</property>
- <child type="submenu">
- <object class="GtkMenu" id="menu_about">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <child>
- <object class="GtkMenuItem" id="menuitem_help">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Help with this software</property>
- <property name="label" translatable="yes">_Contents</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
- <object class="GtkImageMenuItem" id="menuitem_about">
- <property name="label">gtk-about</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="tooltip_text" translatable="yes">About this software</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
</object>
<packing>
<property name="expand">False</property>
@@ -717,23 +678,6 @@
<property name="spacing">6</property>
<property name="layout_style">end</property>
<child>
- <object class="GtkButton" id="button_help">
- <property name="label">gtk-help</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- <property name="secondary">True</property>
- </packing>
- </child>
- <child>
<object class="GtkButton" id="button_cancel">
<property name="label">gtk-cancel</property>
<property name="use_action_appearance">False</property>
@@ -830,6 +774,14 @@
</section>
<section>
<item>
+ <attribute name="label" translatable="yes">Help</attribute>
+ <attribute name="action">app.help</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">About Software Install</attribute>
+ <attribute name="action">app.about</attribute>
+ </item>
+ <item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
<attribute name="accel"><Primary>q</attribute>
diff --git a/src/gpk-application.c b/src/gpk-application.c
index c9c8e30..8ab9638 100644
--- a/src/gpk-application.c
+++ b/src/gpk-application.c
@@ -1867,15 +1867,6 @@ gpk_application_packages_installed_clicked_cb (GtkCellRendererToggle *cell, gcha
static void gpk_application_packages_treeview_clicked_cb (GtkTreeSelection *selection, GpkApplicationPrivate *priv);
/**
- * gpk_application_button_help_cb:
- **/
-static void
-gpk_application_button_help_cb (GtkWidget *widget_button, GpkApplicationPrivate *priv)
-{
- gpk_gnome_help ("add-remove");
-}
-
-/**
* gpk_application_button_clear_cb:
**/
static void
@@ -2635,20 +2626,25 @@ gpk_application_entry_text_icon_press_cb (GtkEntry *entry, GtkEntryIconPosition
}
/**
- * gpk_application_menu_help_cb:
+ * gpk_application_activate_help_cb:
**/
static void
-gpk_application_menu_help_cb (GtkAction *_action, GpkApplicationPrivate *priv)
+gpk_application_activate_help_cb (GSimpleAction *action,
+ GVariant *parameter,
+ gpointer user_data)
{
gpk_gnome_help ("add-remove");
}
/**
- * gpk_application_menu_about_cb:
+ * gpk_application_activate_about_cb:
**/
static void
-gpk_application_menu_about_cb (GtkAction *_action, GpkApplicationPrivate *priv)
+gpk_application_activate_about_cb (GSimpleAction *action,
+ GVariant *parameter,
+ gpointer user_data)
{
+ GpkApplicationPrivate *priv = user_data;
GtkWidget *main_window;
const char *authors[] = {
"Richard Hughes <richard hughsie com>",
@@ -3690,7 +3686,6 @@ gpk_application_startup_cb (GtkApplication *application, GpkApplicationPrivate *
GtkTreeSelection *selection;
gboolean ret;
GError *error = NULL;
- GSList *array;
guint retval;
priv->package_sack = pk_package_sack_new ();
@@ -3785,22 +3780,6 @@ gpk_application_startup_cb (GtkApplication *application, GpkApplicationPrivate *
/* TRANSLATORS: tooltip on the clear button */
gtk_widget_set_tooltip_text (widget, _("Clear current selection"));
- /* help */
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_help"));
- g_signal_connect (widget, "clicked",
- G_CALLBACK (gpk_application_button_help_cb), priv);
-
- /* set F1 = contents */
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "menu_about"));
- array = gtk_accel_groups_from_object (G_OBJECT (main_window));
- if (array != NULL)
- gtk_menu_set_accel_group (GTK_MENU (widget), GTK_ACCEL_GROUP (array->data));
-
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "menuitem_help"));
- gtk_menu_item_set_accel_path (GTK_MENU_ITEM (widget),
- "<gpk-application>/menuitem_help");
- gtk_accel_map_add_entry ("<gpk-application>/menuitem_help", GDK_KEY_F1, 0);
-
/* install */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_apply"));
g_signal_connect (widget, "clicked",
@@ -3808,14 +3787,6 @@ gpk_application_startup_cb (GtkApplication *application, GpkApplicationPrivate *
/* TRANSLATORS: tooltip on the apply button */
gtk_widget_set_tooltip_text (widget, _("Changes are not applied instantly, this button applies all changes"));
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "menuitem_about"));
- g_signal_connect (widget, "activate",
- G_CALLBACK (gpk_application_menu_about_cb), priv);
-
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "menuitem_help"));
- g_signal_connect (widget, "activate",
- G_CALLBACK (gpk_application_menu_help_cb), priv);
-
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "menuitem_homepage"));
g_signal_connect (widget, "activate",
G_CALLBACK (gpk_application_menu_homepage_cb), priv);
@@ -4064,6 +4035,8 @@ static GActionEntry gpk_menu_app_entries[] = {
{ "refresh", gpk_application_activate_refresh_cb, NULL, NULL, NULL },
{ "log", gpk_application_activate_log_cb, NULL, NULL, NULL },
{ "quit", gpk_application_activate_quit_cb, NULL, NULL, NULL },
+ { "help", gpk_application_activate_help_cb, NULL, NULL, NULL },
+ { "about", gpk_application_activate_about_cb, NULL, NULL, NULL },
};
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]