diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2018-05-28 09:12:22 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2018-06-11 15:06:49 +0200 |
commit | 87f5ff69277c566284de96eea19eb79bb244bada (patch) | |
tree | deb602bd3f106ef386a2f297879e11dfe833e05e | |
parent | f3c63ca4b1fd67af884fd586e6b990852f57e166 (diff) | |
download | NetworkManager-87f5ff69277c566284de96eea19eb79bb244bada.tar.gz |
settings-connection: expose Filename property on D-Bus
This allows implementing some convenience features in nmcli -- listing
the backing store for the connection in "nmcli c show", and using the
filename for specifying connection in "nmcli c up/down".
Eventually, paired with ReloadConnections(), this could be used to
implement something similar to what "systemctl edit" does for units
(though we'd need to pick another command name as we aready use
"nmcli c edit" for something different).
-rw-r--r-- | introspection/org.freedesktop.NetworkManager.Settings.Connection.xml | 9 | ||||
-rw-r--r-- | src/settings/nm-settings-connection.c | 5 | ||||
-rw-r--r-- | src/settings/nm-settings-connection.h | 4 |
3 files changed, 14 insertions, 4 deletions
diff --git a/introspection/org.freedesktop.NetworkManager.Settings.Connection.xml b/introspection/org.freedesktop.NetworkManager.Settings.Connection.xml index 13f626c339..2cbb6c2ebc 100644 --- a/introspection/org.freedesktop.NetworkManager.Settings.Connection.xml +++ b/introspection/org.freedesktop.NetworkManager.Settings.Connection.xml @@ -171,6 +171,15 @@ <property name="Flags" type="u" access="read"/> <!-- + Filename: + + File that stores the connection in case the connection is file-backed. + + Since: 1.12 + --> + <property name="Filename" type="s" access="read"/> + + <!-- PropertiesChanged: @properties: A dictionary mapping property names to variant boxed values. diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c index 6526abc76f..50cc14274d 100644 --- a/src/settings/nm-settings-connection.c +++ b/src/settings/nm-settings-connection.c @@ -3189,8 +3189,9 @@ static const NMDBusInterfaceInfoExtended interface_info_settings_connection = { &signal_info_removed, ), .properties = NM_DEFINE_GDBUS_PROPERTY_INFOS ( - NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("Unsaved", "b", NM_SETTINGS_CONNECTION_UNSAVED), - NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("Flags", "u", NM_SETTINGS_CONNECTION_FLAGS), + NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("Unsaved", "b", NM_SETTINGS_CONNECTION_UNSAVED), + NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("Flags", "u", NM_SETTINGS_CONNECTION_FLAGS), + NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("Filename", "s", NM_SETTINGS_CONNECTION_FILENAME), ), ), .legacy_property_changed = TRUE, diff --git a/src/settings/nm-settings-connection.h b/src/settings/nm-settings-connection.h index 70518687c2..cd64f9762d 100644 --- a/src/settings/nm-settings-connection.h +++ b/src/settings/nm-settings-connection.h @@ -42,11 +42,11 @@ /* Properties */ #define NM_SETTINGS_CONNECTION_UNSAVED "unsaved" +#define NM_SETTINGS_CONNECTION_FLAGS "flags" +#define NM_SETTINGS_CONNECTION_FILENAME "filename" /* Internal properties */ #define NM_SETTINGS_CONNECTION_READY "ready" -#define NM_SETTINGS_CONNECTION_FLAGS "flags" -#define NM_SETTINGS_CONNECTION_FILENAME "filename" /** * NMSettingsConnectionIntFlags: |