Commit 8a3b3689 authored by Victor Ananjevsky's avatar Victor Ananjevsky

add initial tree mode implementation for list dialog

parent e3d6fc8d
......@@ -585,6 +585,9 @@ Size of icons may be set in gtk config file at GTK_ICON_SIZE_MENU position of gt
Special column names \fI@fore@\fP, \fI@back@\fP and \fI@font@\fP sets corresponding rows attributes.
Values of those columns don't show in results.
.TP
.B \-\-tree
Enbale tree mode. In this mode extra data in form \fIROW_ID[:PARENT_ID]\fP must be passed to yad before each row. See \fBEXAMPLES\fP for details.
.TP
.B \-\-checklist
Use check boxes for the first column. Output checked rows instead of selected rows. Disable multiple selection.
.TP
......@@ -674,6 +677,9 @@ This option doesn't work with \fI--multiple\fP.
Set the \fICMD\fP as a action when the row is added, modified or removed. First argument for the command is the name of action (\fIadd\fP, \fIedit\fP or \fIdel\fP).
The rest of command line is data from selected row. Output of this command sets the new row values.
.TP
.B \-\-tree-expanded
Expand all tree nodes at startup.
.TP
.B \-\-regex-search
Use regular expressions in search for text fields.
.TP
......@@ -1175,6 +1181,10 @@ find $HOME \-name '*.ps' | yad \-\-progress \-\-pulsate
Display a box with all of the installed desktop applications
.IP
yad \-\-icons \-\-read-dir=/usr/share/applications
.PP
Display list in tree mode
.IP
yad --list --tree --column "Items" f Fruits 1:f Apple 2:f Lemon v Vegetables 3:v Popato 4:v Onion
.SH DEVELOPMENT
There are some developers features providing with YAD.
......
......@@ -410,6 +410,8 @@ static GOptionEntry list_options[] = {
N_("Display list dialog"), NULL },
{ "column", 0, 0, G_OPTION_ARG_CALLBACK, add_column,
N_("Set the column header (see man page for list of possible types)"), N_("COLUMN[:TYPE]") },
{ "tree", 0, 0, G_OPTION_ARG_NONE, &options.list_data.tree_mode,
N_("Enbale tree mode"), NULL },
{ "checklist", 0, 0, G_OPTION_ARG_NONE, &options.list_data.checkbox,
N_("Use checkboxes for first column"), NULL },
{ "radiolist", 0, 0, G_OPTION_ARG_NONE, &options.list_data.radiobox,
......@@ -454,6 +456,8 @@ static GOptionEntry list_options[] = {
N_("Set select action"), N_("CMD") },
{ "row-action", 0, 0, G_OPTION_ARG_STRING, &options.list_data.row_action,
N_("Set row action"), N_("CMD") },
{ "tree-expanded", 0, 0, G_OPTION_ARG_NONE, &options.list_data.tree_expanded,
N_("Expand all tree nodes"), NULL },
{ "regex-search", 0, 0, G_OPTION_ARG_NONE, &options.list_data.regex_search,
N_("Use regex in search"), NULL },
{ "no-selection", 0, 0, G_OPTION_ARG_NONE, &options.list_data.no_selection,
......@@ -1593,9 +1597,10 @@ yad_options_init (void)
/* Initialize list data */
options.list_data.columns = NULL;
options.list_data.no_headers = FALSE;
options.list_data.tree_mode = FALSE;
options.list_data.checkbox = FALSE;
options.list_data.radiobox = FALSE;
options.list_data.no_headers = FALSE;
options.list_data.print_all = FALSE;
options.list_data.grid_lines = GTK_TREE_VIEW_GRID_LINES_NONE;
options.list_data.print_column = 0;
......@@ -1614,6 +1619,7 @@ yad_options_init (void)
options.list_data.dclick_action = NULL;
options.list_data.select_action = NULL;
options.list_data.row_action = NULL;
options.list_data.tree_expanded = FALSE;
options.list_data.regex_search = FALSE;
options.list_data.clickable = TRUE;
options.list_data.no_selection = FALSE;
......
......@@ -336,9 +336,10 @@ typedef struct {
typedef struct {
GSList *columns;
gboolean no_headers;
gboolean tree_mode;
gboolean checkbox;
gboolean radiobox;
gboolean no_headers;
gboolean print_all;
GtkTreeViewGridLines grid_lines;
gint print_column;
......@@ -357,6 +358,7 @@ typedef struct {
gchar *dclick_action;
gchar *select_action;
gchar *row_action;
gboolean tree_expanded;
gboolean regex_search;
gboolean clickable;
gboolean no_selection;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment