aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/menu.c
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2006-10-15 21:57:09 +0000
committerLeandro A. F. Pereira <leandro@hardinfo.org>2006-10-15 21:57:09 +0000
commit3722c94e232b39d2a05ef359a60d25ac0cbe7887 (patch)
tree3212d41dd2db5e96fe09587a80f6606e9fb69317 /hardinfo2/menu.c
parent9949aa0b97e44d67713eed79859028c5ba92b1a3 (diff)
Make menu shortcuts work, plug memory leaks, socket code cleanup
Diffstat (limited to 'hardinfo2/menu.c')
-rw-r--r--hardinfo2/menu.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/hardinfo2/menu.c b/hardinfo2/menu.c
index d5303507..09ced371 100644
--- a/hardinfo2/menu.c
+++ b/hardinfo2/menu.c
@@ -27,6 +27,8 @@
#include <binreloc.h>
#include <callbacks.h>
+#include <hardinfo.h>
+
static GtkActionEntry entries[] =
{
@@ -84,6 +86,7 @@ void menu_init(Shell *shell)
GtkUIManager *menu_manager; /* The magic widget! */
GError *error; /* For reporting exceptions or errors */
gchar *uidefs_path;
+ GtkAccelGroup *accel_group;
/* Create our objects */
menu_box = shell->vbox;
@@ -105,16 +108,20 @@ void menu_init(Shell *shell)
/* Read in the UI from our XML file */
error = NULL;
- uidefs_path = g_strdup_printf("%s/hardinfo/uidefs.xml",
- gbr_find_data_dir(PREFIX));
+ uidefs_path = g_strdup_printf("%s/hardinfo/uidefs.xml", path_data);
gtk_ui_manager_add_ui_from_file(menu_manager, uidefs_path, &error);
g_free(uidefs_path);
if (error) {
g_error("building menus failed: %s", error->message);
g_error_free(error);
+ return;
}
+ /* Enable menu accelerators */
+ accel_group = gtk_ui_manager_get_accel_group(menu_manager);
+ gtk_window_add_accel_group(GTK_WINDOW(shell->window), accel_group);
+
/* Connect up important signals */
/* This signal is necessary in order to place widgets from the UI manager
* into the menu_box */