menuselect: Various menuselect enhancements

* Add 'external' as a support level.
* Add ability for module directories to add entries to the menu
  by adding members to the <module_prefix>/<module_prefix>.xml file.
* Expand the description field to 3 lines in the ncurses implementation.
* Allow the description field to wrap in the newt implementation.
* Add description field to the gtk implementation.

Change-Id: I7f9600a1984a42ce0696db574c1051bc9ad7c808
(cherry picked from commit 90f445729d)
This commit is contained in:
George Joseph
2016-07-24 17:27:26 -06:00
parent 948a9b615f
commit 56a07fbab9
7 changed files with 55 additions and 32 deletions

View File

@@ -16,6 +16,8 @@ enum {
COLUMN_USES,
/*! Conflicts */
COLUMN_CNFS,
/*! Description */
COLUMN_DESC,
/*! Number of columns, must be the last element in the enum */
NUM_COLUMNS,
};
@@ -254,7 +256,8 @@ int run_menu(void)
G_TYPE_BOOLEAN, /* COLUMN_SELECTED */
G_TYPE_STRING, /* COLUMN_DEPS */
G_TYPE_STRING, /* COLUMN_USES */
G_TYPE_STRING); /* COLUMN_CNFS */
G_TYPE_STRING, /* COLUMN_CNFS */
G_TYPE_STRING); /* COLUMN_DESC */
AST_LIST_TRAVERSE(&categories, cat, list) {
GtkTreeIter iter, iter2;
@@ -307,6 +310,7 @@ int run_menu(void)
COLUMN_DEPS, dep_buf,
COLUMN_USES, use_buf,
COLUMN_CNFS, cnf_buf,
COLUMN_DESC, mem->displayname,
-1);
}
}
@@ -344,6 +348,11 @@ int run_menu(void)
renderer, "text", COLUMN_CNFS, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes("Description",
renderer, "text", COLUMN_DESC, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
g_signal_connect(tree, "row-activated", (GCallback) row_activated_handler, store);
gtk_container_add(GTK_CONTAINER(s_window), GTK_WIDGET(tree));