[PATCH V2 nm-openconnect 3/3] auth-dialog: Add support for OC_FORM_OPT_IGNORE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hide any options that libopenconnect doesn't want us to display.
---
 auth-dialog/main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index f4c772b..3f9b77e 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -76,11 +76,13 @@
 #define AUTHGROUP_FIELD(form)		(form)->authgroup_field
 #define AUTHGROUP_SELECTION(form)	(form)->authgroup_selection
 #define FORMCHOICE(sopt, i)		((sopt)->choices[i])
+#define IGNORE_OPT(opt)			((opt)->flags & OC_FORM_OPT_IGNORE)
 #else
 #define NEWGROUP_SUPPORTED		0
 #define AUTHGROUP_FIELD(form)		NULL
 #define AUTHGROUP_SELECTION(form)	0
 #define FORMCHOICE(sopt, i)		(&(sopt)->choices[i])
+#define IGNORE_OPT(opt)			0
 #define OC_FORM_RESULT_ERR		-1
 #define OC_FORM_RESULT_OK		0
 #define OC_FORM_RESULT_CANCELLED	1
@@ -687,7 +689,8 @@ static gboolean ui_form (struct oc_auth_form *form)
 	for (opt = form->opts; opt; opt = opt->next) {
 		ui_fragment_data *data;
 
-		if (opt->type == OC_FORM_OPT_HIDDEN)
+		if (opt->type == OC_FORM_OPT_HIDDEN ||
+		    IGNORE_OPT(opt))
 			continue;
 
 		data = g_slice_new0 (ui_fragment_data);
-- 
1.8.3.2




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux