[network-manager-applet/lr/pkcs11: 22/24] fixup! libnma: add a file certificate chooser
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/lr/pkcs11: 22/24] fixup! libnma: add a file certificate chooser
- Date: Wed, 8 Mar 2017 15:32:02 +0000 (UTC)
commit 624d306208f96375720fe1fe8870848d3cf276a3
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Wed Mar 8 15:23:55 2017 +0100
fixup! libnma: add a file certificate chooser
Add URI setters/getters.
src/libnma/nma-file-cert-chooser.c | 42 ++++++++++++------------------------
1 files changed, 14 insertions(+), 28 deletions(-)
---
diff --git a/src/libnma/nma-file-cert-chooser.c b/src/libnma/nma-file-cert-chooser.c
index b76f3b4..4f53f07 100644
--- a/src/libnma/nma-file-cert-chooser.c
+++ b/src/libnma/nma-file-cert-chooser.c
@@ -65,51 +65,37 @@ get_key_password (NMACertChooser *cert_chooser)
}
static void
-set_key (NMACertChooser *cert_chooser, const gchar *value, NMSetting8021xCKScheme scheme)
+set_key_uri (NMACertChooser *cert_chooser, const gchar *uri)
{
NMAFileCertChooserPrivate *priv = NMA_FILE_CERT_CHOOSER_GET_PRIVATE (cert_chooser);
- if (value) {
- if (scheme != NM_SETTING_802_1X_CK_SCHEME_PATH) {
- g_warning ("The key '%s' uses an unknown scheme %d\n", value, scheme);
- return;
- }
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (priv->key_button), value);
- }
+ if (uri)
+ gtk_file_chooser_set_uri (GTK_FILE_CHOOSER (priv->key_button), uri);
}
static gchar *
-get_key (NMACertChooser *cert_chooser, NMSetting8021xCKScheme *scheme)
+get_key_uri (NMACertChooser *cert_chooser)
{
NMAFileCertChooserPrivate *priv = NMA_FILE_CERT_CHOOSER_GET_PRIVATE (cert_chooser);
- g_return_val_if_fail (scheme != NULL, NULL);
- *scheme = NM_SETTING_802_1X_CK_SCHEME_PATH;
- return gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (priv->key_button));
+ return gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (priv->key_button));
}
static void
-set_cert (NMACertChooser *cert_chooser, const gchar *value, NMSetting8021xCKScheme scheme)
+set_cert_uri (NMACertChooser *cert_chooser, const gchar *uri)
{
NMAFileCertChooserPrivate *priv = NMA_FILE_CERT_CHOOSER_GET_PRIVATE (cert_chooser);
- if (value) {
- if (scheme != NM_SETTING_802_1X_CK_SCHEME_PATH) {
- g_warning ("The certificate '%s' uses an unknown scheme %d\n", value, scheme);
- return;
- }
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (priv->cert_button), value);
- }
+ if (uri)
+ gtk_file_chooser_set_uri (GTK_FILE_CHOOSER (priv->cert_button), uri);
}
static gchar *
-get_cert (NMACertChooser *cert_chooser, NMSetting8021xCKScheme *scheme)
+get_cert_uri (NMACertChooser *cert_chooser)
{
NMAFileCertChooserPrivate *priv = NMA_FILE_CERT_CHOOSER_GET_PRIVATE (cert_chooser);
- g_return_val_if_fail (scheme != NULL, NULL);
- *scheme = NM_SETTING_802_1X_CK_SCHEME_PATH;
- return gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (priv->cert_button));
+ return gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (priv->cert_button));
}
static void
@@ -324,10 +310,10 @@ nma_file_cert_chooser_class_init (NMAFileCertChooserClass *klass)
chooser_class->set_title = set_title;
chooser_class->set_flags = set_flags;
- chooser_class->set_cert = set_cert;
- chooser_class->get_cert = get_cert;
- chooser_class->set_key = set_key;
- chooser_class->get_key = get_key;
+ chooser_class->set_cert_uri = set_cert_uri;
+ chooser_class->get_cert_uri = get_cert_uri;
+ chooser_class->set_key_uri = set_key_uri;
+ chooser_class->get_key_uri = get_key_uri;
chooser_class->set_key_password = set_key_password;
chooser_class->get_key_password = get_key_password;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]