Skip to content
Snippets Groups Projects
Unverified Commit c2a582fa authored by Kali Kaneko's avatar Kali Kaneko
Browse files

[feat] restrict locations to selected transport

parent 330d1172
No related branches found
No related tags found
No related merge requests found
...@@ -181,6 +181,7 @@ ApplicationWindow { ...@@ -181,6 +181,7 @@ ApplicationWindow {
ctx = JSON.parse(jsonModel.getJson()) ctx = JSON.parse(jsonModel.getJson())
// TODO pass QML_DEBUG variable to be hyper-verbose // TODO pass QML_DEBUG variable to be hyper-verbose
//console.debug(jsonModel.getJson()) //console.debug(jsonModel.getJson())
gwSelector.model = Object.keys(ctx.locations) gwSelector.model = Object.keys(ctx.locations)
if (ctx.donateDialog == 'true') { if (ctx.donateDialog == 'true') {
......
...@@ -81,6 +81,7 @@ func UseAutomaticGateway() { ...@@ -81,6 +81,7 @@ func UseAutomaticGateway() {
func SetTransport(label string) { func SetTransport(label string) {
ctx.bm.SetTransport(label) ctx.bm.SetTransport(label)
go trigger(OnStatusChanged)
} }
func GetTransport() *C.char { func GetTransport() *C.char {
......
...@@ -97,6 +97,9 @@ func (p *gatewayPool) listLocationFullness(transport string) map[string]float64 ...@@ -97,6 +97,9 @@ func (p *gatewayPool) listLocationFullness(transport string) map[string]float64
} }
if len(p.recommended) != 0 { if len(p.recommended) != 0 {
for _, gw := range p.recommended { for _, gw := range p.recommended {
if gw.gateway.Transport != transport {
continue
}
if _, ok := cm[gw.gateway.Location]; ok { if _, ok := cm[gw.gateway.Location]; ok {
continue continue
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment