From e2ec475de3e70e32da202d96099a94fa4e98885b Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Sat, 7 May 2011 23:09:47 -0400 Subject: [PATCH] ui-macos/models.py: fix a compatibility problem on MacOS for PPC. @objc.accessor isn't the right thing to use for a Core Data Validation function. Yowee, PyObjc sure is non-obvious. --- ui-macos/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui-macos/models.py b/ui-macos/models.py index c4cbe8b..e71fce5 100644 --- a/ui-macos/models.py +++ b/ui-macos/models.py @@ -3,6 +3,7 @@ import my configchange_callback = setconnect_callback = None +objc_validator = objc.signature('@@:N^@o^@') def config_changed(): @@ -39,7 +40,7 @@ class SshuttleNet(NSObject): def setSubnet_(self, v): self._k_subnet = v config_changed() - @objc.accessor + @objc_validator def validateSubnet_error_(self, value, error): #print 'validateSubnet!' return True, _validate_ip(value), error @@ -49,7 +50,7 @@ class SshuttleNet(NSObject): def setWidth_(self, v): self._k_width = v config_changed() - @objc.accessor + @objc_validator def validateWidth_error_(self, value, error): #print 'validateWidth!' return True, _validate_width(value), error @@ -118,7 +119,7 @@ class SshuttleServer(NSObject): self._k_host = v self.setTitle_(None) config_changed() - @objc.accessor + @objc_validator def validateHost_error_(self, value, error): #print 'validatehost! %r %r %r' % (self, value, error) while value.startswith('-'):