diff options
author | Thomas Haller <thaller@redhat.com> | 2017-03-16 11:27:40 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-03-16 11:36:24 +0100 |
commit | 3fa60c69b8ca522e015dce001e1876453ef03d4a (patch) | |
tree | 4e0e9f17145b4af03e5ccd110e498cc3b7bc23f1 | |
parent | 8684cb81adf91436c6a58852048461b03a20a682 (diff) | |
download | network-manager-applet-th/lr/pkcs11.tar.gz |
fixup! cert-chooser: refactor to delegate file/pkcs11 operations from NMACertChooserth/lr/pkcs11
-rw-r--r-- | src/libnm-gtk/libnm-gtk.ver | 2 | ||||
-rw-r--r-- | src/libnma/libnma.ver | 2 | ||||
-rw-r--r-- | src/libnma/nma-cert-chooser-private.h | 7 | ||||
-rw-r--r-- | src/libnma/nma-cert-chooser.c | 32 | ||||
-rw-r--r-- | src/libnma/nma-cert-chooser.h | 6 | ||||
-rw-r--r-- | src/libnma/nma-file-cert-chooser.c | 6 | ||||
-rw-r--r-- | src/libnma/nma-pkcs11-cert-chooser.c | 5 |
7 files changed, 48 insertions, 12 deletions
diff --git a/src/libnm-gtk/libnm-gtk.ver b/src/libnm-gtk/libnm-gtk.ver index 6e9d3b19..9702180e 100644 --- a/src/libnm-gtk/libnm-gtk.ver +++ b/src/libnm-gtk/libnm-gtk.ver @@ -22,10 +22,12 @@ global: nma_cert_chooser_get_cert_password; nma_cert_chooser_get_cert_password_flags; nma_cert_chooser_get_cert_uri; + nma_cert_chooser_get_flags; nma_cert_chooser_get_key; nma_cert_chooser_get_key_password; nma_cert_chooser_get_key_password_flags; nma_cert_chooser_get_key_uri; + nma_cert_chooser_get_title; nma_cert_chooser_get_type; nma_cert_chooser_new; nma_cert_chooser_set_cert; diff --git a/src/libnma/libnma.ver b/src/libnma/libnma.ver index b1efa747..8573dbc5 100644 --- a/src/libnma/libnma.ver +++ b/src/libnma/libnma.ver @@ -77,10 +77,12 @@ global: nma_cert_chooser_get_cert_password; nma_cert_chooser_get_cert_password_flags; nma_cert_chooser_get_cert_uri; + nma_cert_chooser_get_flags; nma_cert_chooser_get_key; nma_cert_chooser_get_key_password; nma_cert_chooser_get_key_password_flags; nma_cert_chooser_get_key_uri; + nma_cert_chooser_get_title; nma_cert_chooser_get_type; nma_cert_chooser_new; nma_cert_chooser_set_cert; diff --git a/src/libnma/nma-cert-chooser-private.h b/src/libnma/nma-cert-chooser-private.h index 68835004..20ea9780 100644 --- a/src/libnma/nma-cert-chooser-private.h +++ b/src/libnma/nma-cert-chooser-private.h @@ -99,8 +99,6 @@ struct _NMACertChooserClass { * @update_key_password_storage: Update key password storage. * @get_key_password_flags: Returns secret flags corresponding to the key * password if one is present. - * @set_title: Setup the title property - * @set_flags: Setup the flags property */ struct _NMACertChooserVtable { void (*init) (NMACertChooser *cert_chooser); @@ -144,11 +142,6 @@ struct _NMACertChooserVtable { NMSetting *setting, const char *password_flags_name); NMSettingSecretFlags (*get_key_password_flags) (NMACertChooser *cert_chooser); - - void (*set_title) (NMACertChooser *cert_chooser, - const gchar *title); - void (*set_flags) (NMACertChooser *cert_chooser, - NMACertChooserFlags flags); }; extern const NMACertChooserVtable nma_cert_chooser_vtable_file; diff --git a/src/libnma/nma-cert-chooser.c b/src/libnma/nma-cert-chooser.c index ff38b83a..cc9a42b7 100644 --- a/src/libnma/nma-cert-chooser.c +++ b/src/libnma/nma-cert-chooser.c @@ -603,6 +603,38 @@ nma_cert_chooser_get_key_password_flags (NMACertChooser *cert_chooser) return NMA_CERT_CHOOSER_GET_VTABLE (cert_chooser)->get_key_password_flags (cert_chooser); } +/** + * nma_cert_chooser_get_title: + * @cert_chooser: certificate chooser instance + * + * Returns: (transfer none): the title property. + * + * Since: 1.8.0 + */ +const char * +nma_cert_chooser_get_title (NMACertChooser *cert_chooser) +{ + g_return_val_if_fail (NMA_IS_CERT_CHOOSER (cert_chooser), NULL); + + return NMA_CERT_CHOOSER_GET_PRIVATE (cert_chooser)->title; +} + +/** + * nma_cert_chooser_get_flags: + * @cert_chooser: certificate chooser instance + * + * Returns: the flags property. + * + * Since: 1.8.0 + */ +NMACertChooserFlags +nma_cert_chooser_get_flags (NMACertChooser *cert_chooser) +{ + g_return_val_if_fail (NMA_IS_CERT_CHOOSER (cert_chooser), 0); + + return NMA_CERT_CHOOSER_GET_PRIVATE (cert_chooser)->flags; +} + static void constructed (GObject *object) { diff --git a/src/libnma/nma-cert-chooser.h b/src/libnma/nma-cert-chooser.h index b48fbe85..b306cfd7 100644 --- a/src/libnma/nma-cert-chooser.h +++ b/src/libnma/nma-cert-chooser.h @@ -160,6 +160,12 @@ void nma_cert_chooser_update_key_password_storage (NMACertChoos NMA_AVAILABLE_IN_1_8 NMSettingSecretFlags nma_cert_chooser_get_key_password_flags (NMACertChooser *cert_chooser); +NMA_AVAILABLE_IN_1_8 +const char *nma_cert_chooser_get_title (NMACertChooser *cert_chooser); + +NMA_AVAILABLE_IN_1_8 +NMACertChooserFlags nma_cert_chooser_get_flags (NMACertChooser *cert_chooser); + G_END_DECLS #endif /* NMA_CERT_CHOOSER_H */ diff --git a/src/libnma/nma-file-cert-chooser.c b/src/libnma/nma-file-cert-chooser.c index 9f85717c..6d4ecc1a 100644 --- a/src/libnma/nma-file-cert-chooser.c +++ b/src/libnma/nma-file-cert-chooser.c @@ -382,14 +382,14 @@ init (NMACertChooser *cert_chooser) gtk_grid_attach (GTK_GRID (cert_chooser), priv->cert_button_label, 0, 0, 1, 1); gtk_widget_show (priv->cert_button_label); gtk_widget_set_no_show_all (priv->cert_button_label, TRUE); + + set_title (cert_chooser, nma_cert_chooser_get_title (cert_chooser)); + set_flags (cert_chooser, nma_cert_chooser_get_flags (cert_chooser)); } const NMACertChooserVtable nma_cert_chooser_vtable_file = { .init = init, - .set_title = set_title, - .set_flags = set_flags, - .set_cert_uri = set_cert_uri, .get_cert_uri = get_cert_uri, .set_key_uri = set_key_uri, diff --git a/src/libnma/nma-pkcs11-cert-chooser.c b/src/libnma/nma-pkcs11-cert-chooser.c index 852be2e1..b97984f6 100644 --- a/src/libnma/nma-pkcs11-cert-chooser.c +++ b/src/libnma/nma-pkcs11-cert-chooser.c @@ -510,13 +510,14 @@ init (NMACertChooser *cert_chooser) gtk_widget_set_sensitive (priv->cert_password_label, FALSE); gtk_widget_show (priv->cert_password_label); gtk_widget_set_no_show_all (priv->cert_password_label, TRUE); + + set_title (cert_chooser, nma_cert_chooser_get_title (cert_chooser)); + set_flags (cert_chooser, nma_cert_chooser_get_flags (cert_chooser)); } const NMACertChooserVtable nma_cert_chooser_vtable_pkcs11 = { .init = init, - .set_title = set_title, - .set_flags = set_flags, .set_cert_uri = set_cert_uri, .get_cert_uri = get_cert_uri, |