aboutsummaryrefslogtreecommitdiffstats
path: root/xs_view.c
diff options
context:
space:
mode:
Diffstat (limited to 'xs_view.c')
-rw-r--r--xs_view.c40
1 files changed, 34 insertions, 6 deletions
diff --git a/xs_view.c b/xs_view.c
index 824cf3b..7f791b7 100644
--- a/xs_view.c
+++ b/xs_view.c
@@ -44,11 +44,28 @@ static void menu_cb_expand_all(void)
gtk_tree_view_expand_all(GTK_TREE_VIEW(view));
}
+static void menu_cb_about(void)
+{
+ static char *comments = "xenstore browser";
+ static char *copyright = "(c) 2005-2007 Gerd Hoffmann";
+ static char *authors[] = { "Gerd Hoffmann <kraxel@redhat.com>", NULL };
+
+ gtk_show_about_dialog(GTK_WINDOW(xs_toplevel),
+ "authors", authors,
+ "comments", comments,
+ "copyright", copyright,
+ "logo-icon-name", GTK_STOCK_ABOUT,
+ "version", VERSION,
+ NULL);
+}
+
static void destroy(GtkWidget *widget,
gpointer data)
{
g_object_unref(store);
xs_toplevel = NULL;
+
+ gtk_main_quit();
}
/* ------------------------------------------------------------------ */
@@ -58,10 +75,9 @@ static const GtkActionEntry entries[] = {
.name = "FileMenu",
.label = "_File",
},{
- .name = "Close",
- .stock_id = GTK_STOCK_CLOSE,
- .label = "_Close",
- .accelerator = "<control>Q",
+ .name = "Quit",
+ .stock_id = GTK_STOCK_QUIT,
+ .label = "_Quit",
.callback = menu_cb_close,
},{
@@ -77,6 +93,15 @@ static const GtkActionEntry entries[] = {
.label = "Expand _all",
.accelerator = "<control>A",
.callback = menu_cb_expand_all,
+ },{
+
+ .name = "HelpMenu",
+ .label = "_Help",
+ },{
+ .name = "About",
+ .stock_id = GTK_STOCK_ABOUT,
+ .label = "_About ...",
+ .callback = menu_cb_about,
},
};
@@ -84,15 +109,18 @@ static char ui_xml[] =
"<ui>"
" <menubar name='MainMenu'>"
" <menu action='FileMenu'>"
-" <menuitem action='Close'/>"
+" <menuitem action='Quit'/>"
" </menu>"
" <menu action='ViewMenu'>"
" <menuitem action='ExpandSubTree'/>"
" <menuitem action='ExpandAll'/>"
" </menu>"
+" <menu action='HelpMenu'>"
+" <menuitem action='About'/>"
+" </menu>"
" </menubar>"
" <toolbar action='ToolBar'>"
-" <toolitem action='Close'/>"
+" <toolitem action='Quit'/>"
" </toolbar>"
"</ui>";