[network-manager-openconnect] auth-dialog: Add support for OC_FORM_OPT_IGNORE



commit b1555da58411e1703bffb1defb8f8c50694b9258
Author: Kevin Cernekee <cernekee gmail com>
Date:   Mon Dec 30 17:49:37 2013 -0800

    auth-dialog: Add support for OC_FORM_OPT_IGNORE
    
    Hide any options that libopenconnect doesn't want us to display.

 auth-dialog/main.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 5e7487c..c8f2116 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -76,11 +76,13 @@
 #define AUTHGROUP_OPT(form)            (void *)(form)->authgroup_opt
 #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_OPT(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
@@ -694,7 +696,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);


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