diff --git a/ui-macos/MainMenu.xib b/ui-macos/MainMenu.xib
index a5cf4c1..3b42cdf 100644
--- a/ui-macos/MainMenu.xib
+++ b/ui-macos/MainMenu.xib
@@ -12,7 +12,7 @@
{1.79769e+308, 1.79769e+308}
- {213, 107}
+ {611, 469}
- 564
-
+ 574
+
YES
-
+
-
+
- 565
-
-
+ 575
+
+
+ YES
+
+
+
+
+
+ 576
+
+
+ YES
+
+
+
+
+
+
+
+ 577
+
+
+
+
+ 578
+
+
+
+
+ 579
+
+
+
+
+ 583
+
+
+ YES
+
+
+
+
+
+ 584
+
+
@@ -2187,9 +2287,15 @@
561.IBAttributePlaceholdersKey
561.IBPluginDependency
562.IBPluginDependency
- 564.IBAttributePlaceholdersKey
- 564.IBPluginDependency
- 565.IBPluginDependency
+ 574.IBAttributePlaceholdersKey
+ 574.IBPluginDependency
+ 575.IBPluginDependency
+ 576.IBPluginDependency
+ 577.IBPluginDependency
+ 578.IBPluginDependency
+ 579.IBPluginDependency
+ 583.IBPluginDependency
+ 584.IBPluginDependency
YES
@@ -2197,13 +2303,13 @@
com.apple.InterfaceBuilder.CocoaPlugin
- {{317, 287}, {611, 469}}
+ {{324, 171}, {611, 469}}
com.apple.InterfaceBuilder.CocoaPlugin
- {{317, 287}, {611, 469}}
+ {{324, 171}, {611, 469}}
- {213, 107}
+ {611, 469}
ToolTip
@@ -2381,12 +2487,18 @@
ToolTip
ToolTip
-
- Search for server names on the remote end and add them to your computer's /etc/hosts file.
+
+ Choose which network traffic should be routed over the VPN.
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
@@ -2405,7 +2517,7 @@
- 573
+ 584
@@ -2435,8 +2547,8 @@
YES
autoReconnectField
debugField
+ latencyControlField
logField
- noLatencyControlField
prefsWindow
routingField
serversController
diff --git a/ui-macos/main.py b/ui-macos/main.py
index cadf0d9..3e6c2a1 100644
--- a/ui-macos/main.py
+++ b/ui-macos/main.py
@@ -136,7 +136,7 @@ class SshuttleController(NSObject):
prefsWindow = objc.IBOutlet()
serversController = objc.IBOutlet()
logField = objc.IBOutlet()
- noLatencyControlField = objc.IBOutlet()
+ latencyControlField = objc.IBOutlet()
servers = []
conns = {}
@@ -162,14 +162,14 @@ class SshuttleController(NSObject):
manual_nets = ['0/0']
else:
manual_nets = []
+ noLatencyControl = (server.latencyControl() != models.LAT_INTERACTIVE)
conn = Runner(sshuttle_args(host,
auto_nets = nets_mode == models.NET_AUTO,
auto_hosts = server.autoHosts(),
dns = server.useDns(),
nets = manual_nets,
debug = self.debugField.state(),
- no_latency_control
- = self.noLatencyControlField.state()),
+ no_latency_control = noLatencyControl),
logfunc=logfunc, promptfunc=promptfunc,
serverobj=server)
self.conns[host] = conn
@@ -286,12 +286,14 @@ class SshuttleController(NSObject):
autoNets = s.get('autoNets', models.NET_AUTO)
autoHosts = s.get('autoHosts', True)
useDns = s.get('useDns', autoNets == models.NET_ALL)
+ latencyControl = s.get('latencyControl', models.LAT_INTERACTIVE)
srv = models.SshuttleServer.alloc().init()
srv.setHost_(host)
srv.setAutoNets_(autoNets)
srv.setAutoHosts_(autoHosts)
srv.setNets_(nl)
srv.setUseDns_(useDns)
+ srv.setLatencyControl_(latencyControl)
sl.append(srv)
self.serversController.addObjects_(sl)
self.serversController.setSelectionIndex_(0)
@@ -310,7 +312,8 @@ class SshuttleController(NSObject):
nets=nets,
autoNets=s.autoNets(),
autoHosts=s.autoHosts(),
- useDns=s.useDns())
+ useDns=s.useDns(),
+ latencyControl=s.latencyControl())
l.append(d)
my.Defaults().setObject_forKey_(l, 'servers')
self.fill_menu()
@@ -322,6 +325,11 @@ class SshuttleController(NSObject):
tf('Determine automatically')
tf('Custom...')
+ self.latencyControlField.removeAllItems()
+ tf = self.latencyControlField.addItemWithTitle_
+ tf('Fast transfer')
+ tf('Low latency')
+
# Hmm, even when I mark this as !enabled in the .nib, it still comes
# through as enabled. So let's just disable it here (since we don't
# support this feature yet).
diff --git a/ui-macos/models.py b/ui-macos/models.py
index ad8e538..c4cbe8b 100644
--- a/ui-macos/models.py
+++ b/ui-macos/models.py
@@ -58,6 +58,9 @@ NET_ALL = 0
NET_AUTO = 1
NET_MANUAL = 2
+LAT_BANDWIDTH = 0
+LAT_INTERACTIVE = 1
+
class SshuttleServer(NSObject):
def init(self):
self = super(SshuttleServer, self).init()
@@ -155,3 +158,9 @@ class SshuttleServer(NSObject):
def setUseDns_(self, v):
self._k_useDns = v
config_changed()
+
+ def latencyControl(self):
+ return getattr(self, '_k_latencyControl', LAT_INTERACTIVE)
+ def setLatencyControl_(self, v):
+ self._k_latencyControl = v
+ config_changed()