Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav
yad
Commits
8ba82ecd
Commit
8ba82ecd
authored
Sep 21, 2020
by
Victor Ananjevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix field names parsing for form dialog
parent
344f5914
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
7 deletions
+31
-7
form.c
src/form.c
+26
-5
option.c
src/option.c
+5
-2
No files found.
src/form.c
View file @
8ba82ecd
...
...
@@ -764,7 +764,13 @@ form_create_widget (GtkWidget * dlg)
fld
->
type
!=
YAD_FIELD_FULL_BUTTON
&&
fld
->
type
!=
YAD_FIELD_LINK
&&
fld
->
type
!=
YAD_FIELD_LABEL
&&
fld
->
type
!=
YAD_FIELD_TEXT
)
{
gchar
*
buf
=
g_strcompress
(
fld
->
name
);
gchar
*
buf
;
if
(
fld
->
name
)
buf
=
g_strcompress
(
fld
->
name
);
else
buf
=
g_strdup
(
""
);
l
=
gtk_label_new
(
NULL
);
if
(
!
options
.
data
.
no_markup
)
{
...
...
@@ -800,7 +806,7 @@ form_create_widget (GtkWidget * dlg)
else
gtk_widget_set_tooltip_text
(
e
,
fld
->
tip
);
}
g_signal_connect
(
G_OBJECT
(
e
),
"activate"
,
G_CALLBACK
(
form_activate_cb
),
dlg
);
g_signal_connect
(
G_OBJECT
(
e
),
"activate"
,
G_CALLBACK
(
form_activate_cb
),
dlg
);
if
(
fld
->
type
==
YAD_FIELD_HIDDEN
)
gtk_entry_set_visibility
(
GTK_ENTRY
(
e
),
FALSE
);
else
if
(
fld
->
type
==
YAD_FIELD_READ_ONLY
)
...
...
@@ -847,7 +853,11 @@ form_create_widget (GtkWidget * dlg)
case
YAD_FIELD_CHECK
:
{
gchar
*
buf
=
g_strcompress
(
fld
->
name
);
gchar
*
buf
;
if
(
fld
->
name
)
buf
=
g_strcompress
(
fld
->
name
);
else
buf
=
g_strdup
(
""
);
e
=
gtk_check_button_new_with_label
(
buf
);
gtk_widget_set_name
(
e
,
"yad-form-check"
);
if
(
fld
->
tip
)
...
...
@@ -1090,7 +1100,12 @@ form_create_widget (GtkWidget * dlg)
case
YAD_FIELD_LINK
:
{
gchar
*
buf
=
g_strcompress
(
fld
->
name
[
0
]
?
fld
->
name
:
_
(
"Link"
));
gchar
*
buf
;
if
(
fld
->
name
)
buf
=
g_strdup
(
fld
->
name
[
0
]
?
fld
->
name
:
_
(
"Link"
));
else
buf
=
g_strdup
(
_
(
"Link"
));
e
=
gtk_link_button_new_with_label
(
""
,
buf
);
gtk_widget_set_name
(
e
,
"yad-form-link"
);
if
(
fld
->
tip
)
...
...
@@ -1104,6 +1119,7 @@ form_create_widget (GtkWidget * dlg)
gtk_grid_attach
(
GTK_GRID
(
tbl
),
e
,
col
*
2
,
row
,
2
,
1
);
gtk_widget_set_hexpand
(
e
,
TRUE
);
fields
=
g_slist_append
(
fields
,
e
);
g_free
(
buf
);
break
;
}
...
...
@@ -1142,7 +1158,12 @@ form_create_widget (GtkWidget * dlg)
case
YAD_FIELD_TEXT
:
{
GtkWidget
*
l
,
*
sw
,
*
b
;
gchar
*
ltxt
=
g_strcompress
(
fld
->
name
);
gchar
*
ltxt
;
if
(
fld
->
name
)
ltxt
=
g_strcompress
(
fld
->
name
);
else
ltxt
=
g_strdup
(
""
);
b
=
gtk_box_new
(
GTK_ORIENTATION_VERTICAL
,
2
);
l
=
gtk_label_new
(
""
);
...
...
src/option.c
View file @
8ba82ecd
...
...
@@ -779,14 +779,17 @@ add_field (const gchar * option_name, const gchar * value, gpointer data, GError
names
=
g_strsplit
(
fstr
[
0
],
options
.
common_data
.
item_separator
,
3
);
if
(
names
[
1
]
&&
names
[
2
])
{
fld
->
name
=
g_strdup_printf
(
"%s%s%s"
,
names
[
0
],
options
.
common_data
.
item_separator
,
names
[
1
]);
fld
->
name
=
g_strdup_printf
(
"%s%s%s"
,
*
names
[
0
]
?
names
[
0
]
:
""
,
options
.
common_data
.
item_separator
,
*
names
[
1
]
?
names
[
1
]
:
""
);
fld
->
tip
=
g_strdup
(
names
[
2
]);
}
else
{
if
(
names
[
0
]
&&
*
names
[
0
])
fld
->
name
=
g_strdup
(
names
[
0
]);
if
(
names
[
1
])
if
(
names
[
1
]
&&
*
names
[
1
]
)
fld
->
tip
=
g_strdup
(
names
[
1
]);
}
g_strfreev
(
names
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment