From 5ee85fe46e86fdc9e063c22700697802435503a6 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 3 Jun 2014 09:13:43 -0400 Subject: [PATCH] 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 --- tui/nmt-mac-entry.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tui/nmt-mac-entry.c b/tui/nmt-mac-entry.c index d76c097f20..b065640812 100644 --- a/tui/nmt-mac-entry.c +++ b/tui/nmt-mac-entry.c @@ -28,6 +28,8 @@ #include "config.h" +#include + #include #include @@ -128,6 +130,17 @@ nmt_mac_entry_init (NmtMacEntry *entry) 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 nmt_mac_entry_set_property (GObject *object, guint prop_id, @@ -189,6 +202,7 @@ nmt_mac_entry_class_init (NmtMacEntryClass *entry_class) g_type_class_add_private (entry_class, sizeof (NmtMacEntryPrivate)); /* virtual methods */ + object_class->notify = nmt_mac_entry_notify; object_class->set_property = nmt_mac_entry_set_property; object_class->get_property = nmt_mac_entry_get_property;