Commit 5ee85fe4 authored by Dan Winship's avatar Dan Winship Committed by Jiří Klimeš

tui: fix setting Clone MAC Address properties

NmtMacEntry wasn't notifying its mac-address property when it changed,
so the change never got saved to the NMSetting.

https://bugzilla.gnome.org/show_bug.cgi?id=731160
parent 92898e84
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#include "config.h" #include "config.h"
#include <string.h>
#include <dbus/dbus-glib.h> #include <dbus/dbus-glib.h>
#include <nm-utils.h> #include <nm-utils.h>
...@@ -128,6 +130,17 @@ nmt_mac_entry_init (NmtMacEntry *entry) ...@@ -128,6 +130,17 @@ nmt_mac_entry_init (NmtMacEntry *entry)
nmt_newt_entry_set_validator (NMT_NEWT_ENTRY (entry), mac_validator, NULL); nmt_newt_entry_set_validator (NMT_NEWT_ENTRY (entry), mac_validator, NULL);
} }
static void
nmt_mac_entry_notify (GObject *object,
GParamSpec *pspec)
{
if (G_OBJECT_CLASS (nmt_mac_entry_parent_class)->notify)
G_OBJECT_CLASS (nmt_mac_entry_parent_class)->notify (object, pspec);
if (pspec->owner_type == NMT_TYPE_NEWT_ENTRY && !strcmp (pspec->name, "text"))
g_object_notify (object, "mac-address");
}
static void static void
nmt_mac_entry_set_property (GObject *object, nmt_mac_entry_set_property (GObject *object,
guint prop_id, guint prop_id,
...@@ -189,6 +202,7 @@ nmt_mac_entry_class_init (NmtMacEntryClass *entry_class) ...@@ -189,6 +202,7 @@ nmt_mac_entry_class_init (NmtMacEntryClass *entry_class)
g_type_class_add_private (entry_class, sizeof (NmtMacEntryPrivate)); g_type_class_add_private (entry_class, sizeof (NmtMacEntryPrivate));
/* virtual methods */ /* virtual methods */
object_class->notify = nmt_mac_entry_notify;
object_class->set_property = nmt_mac_entry_set_property; object_class->set_property = nmt_mac_entry_set_property;
object_class->get_property = nmt_mac_entry_get_property; object_class->get_property = nmt_mac_entry_get_property;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment