updating states and adding icons
Before Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB |
BIN
src/com.dlprows.httpproxy.sdPlugin/images/error.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
src/com.dlprows.httpproxy.sdPlugin/images/error@2x.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 999 B |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 1.3 KiB |
BIN
src/com.dlprows.httpproxy.sdPlugin/images/noNetwork.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
src/com.dlprows.httpproxy.sdPlugin/images/noNetwork@2x.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 13 KiB |
BIN
src/com.dlprows.httpproxy.sdPlugin/images/proxyDisabled.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
src/com.dlprows.httpproxy.sdPlugin/images/proxyDisabled@2x.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
src/com.dlprows.httpproxy.sdPlugin/images/proxyEnabled.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
src/com.dlprows.httpproxy.sdPlugin/images/proxyEnabled@2x.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
@ -7,24 +7,28 @@
|
||||
"Icon": "Images/icon",
|
||||
"States": [
|
||||
{
|
||||
"Image": "Images/pluginAction",
|
||||
"Image": "Images/proxyDisabled",
|
||||
"TitleAlignment": "middle",
|
||||
"FontSize": "12"
|
||||
"FontSize": "12",
|
||||
"Title" : "Disabled"
|
||||
},
|
||||
{
|
||||
"Image": "Images/pluginAction",
|
||||
"Image": "Images/proxyEnabled",
|
||||
"TitleAlignment": "middle",
|
||||
"FontSize": "12"
|
||||
"FontSize": "12",
|
||||
"Title": "Enabled"
|
||||
},
|
||||
{
|
||||
"Image": "Images/pluginAction",
|
||||
"Image": "Images/noNetwork",
|
||||
"TitleAlignment": "middle",
|
||||
"FontSize": "12"
|
||||
"FontSize": "12",
|
||||
"Title": "No Network"
|
||||
},
|
||||
{
|
||||
"Image": "Images/pluginAction",
|
||||
"Image": "Images/error",
|
||||
"TitleAlignment": "middle",
|
||||
"FontSize": "12"
|
||||
"FontSize": "12",
|
||||
"Title": "Error"
|
||||
}
|
||||
],
|
||||
"Controllers": [ "Keypad" ],
|
||||
|
12
src/main.go
@ -104,9 +104,9 @@ func toggleVpn() error {
|
||||
|
||||
func getState() int {
|
||||
/*
|
||||
0 for no network
|
||||
1 for proxy off
|
||||
2 for proxy on
|
||||
0 for proxy off
|
||||
1 for proxy on
|
||||
2 for no network
|
||||
3 for busted
|
||||
*/
|
||||
activeDevice, err := networking.GetActiveDevice()
|
||||
@ -116,7 +116,7 @@ func getState() int {
|
||||
}
|
||||
|
||||
if activeDevice == "" {
|
||||
return 0
|
||||
return 2
|
||||
}
|
||||
|
||||
proxyEnabled, err := networking.IsProxyEnabled(activeDevice)
|
||||
@ -125,7 +125,7 @@ func getState() int {
|
||||
return 3
|
||||
}
|
||||
if proxyEnabled {
|
||||
return 2
|
||||
}
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|