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

add tooltips for form fields

parent f7b26c7d
......@@ -457,7 +457,7 @@ Output data will be in shell-style quotes.
.SS Form options
.TP
.B \-\-field=\fILABEL[:TYPE]\fP
.B \-\-field=\fILABEL[!TOOLTIP][:TYPE]\fP
Add field to form. Type may be \fIH\fP, \fIRO\fP, \fINUM\fP, \fICHK\fP, \fICB\fP, \fICBE\fP, \fICE\fP, \fIFL\fP, \fISFL\fP, \fIDIR\fP, \fICDIR\fP, \fIFN\fP, \fIMFL\fP, \fIMDIR\fP, \fIDT\fP, \fISCL\fP, \fIAPP\fP, \fICLR\fP, \fIBTN\fP, \fIFBTN\fP, \fILBL\fP or \fITXT\fP.
.br
\fBH\fP - hidden field type. All characters are displayed as the invisible char.
......
......@@ -769,10 +769,19 @@ static gboolean
add_field (const gchar * option_name, const gchar * value, gpointer data, GError ** err)
{
YadField *fld;
gchar **names;
gchar **fstr = split_arg (value);
fld = g_new0 (YadField, 1);
fld->name = g_strdup (fstr[0]);
names = g_strsplit (fstr[0], options.common_data.item_separator, 2);
fld->name = g_strdup (names[0]);
if (names[1])
fld->tip = g_strdup (names[1]);
else
fld->tip = NULL;
g_strfreev (names);
if (fstr[1])
{
if (strcasecmp (fstr[1], "H") == 0)
......
......@@ -185,6 +185,7 @@ typedef struct {
typedef struct {
gchar *name;
gchar *tip;
YadFieldType type;
} YadField;
......
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