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 @@ YES - + YES @@ -41,9 +41,9 @@ NSApplication - 3 + 11 2 - {{157, 16}, {611, 469}} + {{324, 171}, {611, 469}} 1886913536 Sshuttle VPN Preferences NSWindow @@ -51,15 +51,15 @@ View {1.79769e+308, 1.79769e+308} - {213, 107} + {611, 469} - 256 + 274 YES - 12 + 18 {{-8, -10}, {627, 473}} 2 @@ -69,12 +69,12 @@ 1 - 256 + 274 YES - 268 + 292 {{17, 17}, {25, 23}} 2 @@ -103,7 +103,7 @@ - 268 + 292 {{41, 17}, {25, 23}} 2 @@ -128,7 +128,7 @@ - 268 + 274 YES @@ -318,8 +318,8 @@ - 268 - {{296, 354}, {273, 18}} + 265 + {{291, 356}, {273, 18}} 2 YES @@ -341,7 +341,7 @@ - 268 + 265 {{341, 392}, {249, 22}} 2 @@ -369,8 +369,8 @@ - 268 - {{273, 265}, {320, 26}} + 265 + {{273, 193}, {320, 26}} 2 YES @@ -440,9 +440,76 @@ 2 + + + 265 + {{273, 257}, {320, 26}} + + 2 + YES + + -2076049856 + 2048 + + + 112869631 + 129 + + + 400 + 75 + + + Choose one + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + YES + + + + Item 2 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Item 3 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + 1 + YES + YES + 2 + + - 268 + 265 {{261, 394}, {75, 17}} 2 @@ -459,8 +526,8 @@ - 268 - {{261, 297}, {105, 17}} + 265 + {{261, 226}, {105, 17}} 2 YES @@ -474,9 +541,26 @@ + + + 265 + {{261, 290}, {105, 17}} + + 2 + YES + + 68288064 + 272630784 + Optimize for: + + + + + + - 268 + 289 {{276, 40}, {25, 23}} 2 @@ -498,7 +582,7 @@ - 268 + 289 {{300, 40}, {25, 23}} 2 @@ -520,7 +604,7 @@ - 268 + 273 YES @@ -531,7 +615,7 @@ 256 - {312, 171} + {312, 102} 2 YES @@ -623,7 +707,7 @@ 0 - {{1, 17}, {312, 171}} + {{1, 17}, {312, 102}} 2 @@ -639,7 +723,7 @@ 2 _doScroller: - 0.8529411764705882 + 0.96938775510204078 @@ -669,7 +753,7 @@ - {{276, 63}, {314, 189}} + {{276, 63}, {314, 120}} 2 @@ -683,15 +767,15 @@ - 268 - {{296, 329}, {285, 18}} + 265 + {{291, 323}, {285, 18}} 2 YES -2080244224 0 - Send all DNS requests through this server + Send DNS requests through this server 1211912703 @@ -717,13 +801,13 @@ 2 - 256 + 274 YES - 268 - {{139, 374}, {177, 29}} + 269 + {{195, 374}, {236, 29}} 2 YES @@ -745,8 +829,8 @@ - 268 - {{139, 343}, {270, 29}} + 269 + {{195, 343}, {236, 29}} 2 YES @@ -768,8 +852,8 @@ - 268 - {{139, 312}, {270, 29}} + 269 + {{195, 312}, {236, 29}} 2 YES @@ -789,29 +873,6 @@ 25 - - - 268 - {{139, 287}, {347, 18}} - - 2 - YES - - 67239424 - 0 - Sacrifice interactive latency to maximize bandwidth - - - 1211912703 - 2 - - - - - 200 - 25 - - {{10, 33}, {607, 427}} 2 @@ -829,7 +890,7 @@ YES - 256 + 274 YES @@ -840,7 +901,7 @@ 2322 - {596, 14} + {596, 114} 2 @@ -920,7 +981,7 @@ - {{1, 1}, {596, 310}} + {{1, 1}, {596, 410}} 2 @@ -935,7 +996,7 @@ 256 - {{597, 1}, {15, 310}} + {{597, 1}, {15, 410}} 2 @@ -946,7 +1007,7 @@ 256 - {{1, 311}, {596, 15}} + {{1, 411}, {596, 15}} 2 1 @@ -956,7 +1017,7 @@ 0.94565218687057495 - {{-3, 97}, {613, 327}} + {{-3, -3}, {613, 427}} 2 @@ -1008,8 +1069,8 @@ 2 - {{0, 0}, {800, 578}} - {213, 129} + {{0, 0}, {1280, 778}} + {611, 491} {1.79769e+308, 1.79769e+308} @@ -1025,13 +1086,6 @@ SshuttleController - - YES - - autoHosts - - noLatencyControl - YES @@ -1051,6 +1105,7 @@ isValid useDns title + latencyControl SshuttleServer YES @@ -1476,34 +1531,6 @@ 557 - - - value: values.noLatencyControl - - - - - - value: values.noLatencyControl - value - values.noLatencyControl - - NSNoSelectionPlaceholder - - - 2 - - - 569 - - - - noLatencyControlField - - - - 571 - value: selection.useDns @@ -1553,6 +1580,34 @@ 573 + + + selectedIndex: selection.latencyControl + + + + + + selectedIndex: selection.latencyControl + selectedIndex + selection.latencyControl + + NSNoSelectionPlaceholder + + + 2 + + + 581 + + + + latencyControlField + + + + 582 + @@ -1643,7 +1698,6 @@ - @@ -1654,16 +1708,18 @@ YES - - - + + + + + @@ -2078,18 +2134,62 @@ - 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()