~ubuntu-branches/ubuntu/quantal/gnome-panel/quantal

« back to all changes in this revision

Viewing changes to libpanel-applet/panel-applet.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-02-08 00:17:11 UTC
  • mfrom: (1.13.15)
  • Revision ID: package-import@ubuntu.com-20120208001711-npwmthl0c6iy3s9a
Tags: 1:3.3.5-0ubuntu1
* New upstream release.
* debian/control.in:
  - Bump minimum glib to 2.31.14
* debian/patches/13_disable_missing_help.patch:
  Updated patch from bugzilla
* debian/patches/14_revert-timedate-change.patch:
  - Revert switch to systemd timedate protocol until ubuntu-system-
    services supports it

Show diffs side-by-side

added added

removed removed

Lines of Context:
980
980
        g_free (xml);
981
981
}
982
982
 
 
983
/**
 
984
 * panel_applet_setup_menu_from_resource:
 
985
 * @applet: a #PanelApplet.
 
986
 * @resource_path: a resource path
 
987
 * @action_group: a #GtkActionGroup.
 
988
 *
 
989
 * Sets up the context menu of @applet. @filename is a resource path to a menu
 
990
 * XML file, containing a #GtkUIManager UI definition that describes how to
 
991
 * display the menu items. @action_group contains the various #GtkAction that
 
992
 * are referenced in @xml.
 
993
 *
 
994
 * See also the <link linkend="getting-started.context-menu">Context
 
995
 * Menu</link> section.
 
996
 *
 
997
 * Since: 3.4
 
998
 **/
 
999
void
 
1000
panel_applet_setup_menu_from_resource (PanelApplet    *applet,
 
1001
                                       const gchar    *resource_path,
 
1002
                                       GtkActionGroup *action_group)
 
1003
{
 
1004
        GBytes *bytes;
 
1005
        GError *error = NULL;
 
1006
 
 
1007
        bytes = g_resources_lookup_data (resource_path,
 
1008
                                         G_RESOURCE_LOOKUP_FLAGS_NONE,
 
1009
                                         &error);
 
1010
 
 
1011
        if (bytes) {
 
1012
                panel_applet_setup_menu (applet,
 
1013
                                         g_bytes_get_data (bytes, NULL),
 
1014
                                         action_group);
 
1015
        } else {
 
1016
                g_warning ("%s", error->message);
 
1017
                g_error_free (error);
 
1018
        }
 
1019
 
 
1020
        g_bytes_unref (bytes);
 
1021
}
 
1022
 
983
1023
static void
984
1024
panel_applet_finalize (GObject *object)
985
1025
{
1127
1167
 
1128
1168
        *x = menu_x;
1129
1169
        *y = menu_y;
1130
 
        *push_in = TRUE;
 
1170
        *push_in = FALSE;
1131
1171
}
1132
1172
 
1133
1173
static void