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).
This commit is contained in:
Lubomir Rintel 2018-05-28 09:12:22 +02:00
parent f3c63ca4b1
commit 87f5ff6927
3 changed files with 14 additions and 4 deletions

View file

@ -170,6 +170,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.

View file

@ -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,

View file

@ -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: