mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-02-13 08:59:37 +01:00
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.
This commit is contained in:
parent
57e744dadd
commit
e2ec475de3
@ -3,6 +3,7 @@ import my
|
|||||||
|
|
||||||
|
|
||||||
configchange_callback = setconnect_callback = None
|
configchange_callback = setconnect_callback = None
|
||||||
|
objc_validator = objc.signature('@@:N^@o^@')
|
||||||
|
|
||||||
|
|
||||||
def config_changed():
|
def config_changed():
|
||||||
@ -39,7 +40,7 @@ class SshuttleNet(NSObject):
|
|||||||
def setSubnet_(self, v):
|
def setSubnet_(self, v):
|
||||||
self._k_subnet = v
|
self._k_subnet = v
|
||||||
config_changed()
|
config_changed()
|
||||||
@objc.accessor
|
@objc_validator
|
||||||
def validateSubnet_error_(self, value, error):
|
def validateSubnet_error_(self, value, error):
|
||||||
#print 'validateSubnet!'
|
#print 'validateSubnet!'
|
||||||
return True, _validate_ip(value), error
|
return True, _validate_ip(value), error
|
||||||
@ -49,7 +50,7 @@ class SshuttleNet(NSObject):
|
|||||||
def setWidth_(self, v):
|
def setWidth_(self, v):
|
||||||
self._k_width = v
|
self._k_width = v
|
||||||
config_changed()
|
config_changed()
|
||||||
@objc.accessor
|
@objc_validator
|
||||||
def validateWidth_error_(self, value, error):
|
def validateWidth_error_(self, value, error):
|
||||||
#print 'validateWidth!'
|
#print 'validateWidth!'
|
||||||
return True, _validate_width(value), error
|
return True, _validate_width(value), error
|
||||||
@ -118,7 +119,7 @@ class SshuttleServer(NSObject):
|
|||||||
self._k_host = v
|
self._k_host = v
|
||||||
self.setTitle_(None)
|
self.setTitle_(None)
|
||||||
config_changed()
|
config_changed()
|
||||||
@objc.accessor
|
@objc_validator
|
||||||
def validateHost_error_(self, value, error):
|
def validateHost_error_(self, value, error):
|
||||||
#print 'validatehost! %r %r %r' % (self, value, error)
|
#print 'validatehost! %r %r %r' % (self, value, error)
|
||||||
while value.startswith('-'):
|
while value.startswith('-'):
|
||||||
|
Loading…
Reference in New Issue
Block a user