wicd misc.go bug fix

This commit is contained in:
cuu 2018-12-09 23:31:12 +08:00
parent 9bb5a7ea97
commit 86b5fe868f
3 changed files with 7 additions and 5 deletions

View File

@ -55,7 +55,8 @@ func (self *WifiDisconnectConfirmPage) KeyDown(ev *event.Event ) {
self.Screen.Draw() self.Screen.Draw()
self.Screen.SwapAndShow() self.Screen.SwapAndShow()
DBUS.DBusHandler.Daemon.Method("Disconnect") //DBUS.DBusHandler.Daemon.Method("Disconnect")
self.Parent.Daemon.Method("Disconnect")
time.BlockDelay(400) time.BlockDelay(400)
@ -609,7 +610,7 @@ func (self *WifiList) UpdateNetList(state int,info []string ,force_check bool,fi
_id,_ := strconv.Atoi(info[3]) _id,_ := strconv.Atoi(info[3])
if _id < len(self.MyList) { if _id < len(self.MyList) {
var strength_str string var strength_str string
strength,err := strconv.Atoi(info[2]) strength,err := strconv.Atoi(strings.Replace(info[2],"\"","",-1))
if err == nil { if err == nil {
self.Daemon.Get(self.Daemon.Method("FormatSignalForPrinting",strength),&strength_str) self.Daemon.Get(self.Daemon.Method("FormatSignalForPrinting",strength),&strength_str)
self.MyList[_id].UpdateStrenLabel(strength_str) self.MyList[_id].UpdateStrenLabel(strength_str)
@ -801,9 +802,9 @@ func (self *WifiList) GetWirelessEncrypt(network_id int) []map[string]string {
activeID := -1 activeID := -1
var enc_type string var enc_type string
for i,v := range self.EncMethods { for i,v := range self.EncMethods {
enc_type = "" enc_type = ""
fmt.Println(i,v)
self.Wireless.Get(self.Wireless.Method("GetWirelessProperty",network_id,"enctype"),&enc_type) self.Wireless.Get(self.Wireless.Method("GetWirelessProperty",network_id,"enctype"),&enc_type)
enc_type = strings.ToLower(enc_type) enc_type = strings.ToLower(enc_type)
if enc_type != "" && v.Type == enc_type { if enc_type != "" && v.Type == enc_type {
@ -813,6 +814,7 @@ func (self *WifiList) GetWirelessEncrypt(network_id int) []map[string]string {
} }
if activeID == -1 { if activeID == -1 {
fmt.Println("GetWirelessEncrypt activeID == -1")
return results return results
} }

View File

@ -15,7 +15,7 @@ var (
Battery = "/sys/class/power_supply/axp20x-battery/uevent" Battery = "/sys/class/power_supply/axp20x-battery/uevent"
MPD_socket = "/tmp/mpd.socket" MPD_socket = "/tmp/mpd.socket"
UPDATE_URL="https://raw.githubusercontent.com/cuu/CPI/master/launchergo_ver.json" UPDATE_URL="https://raw.githubusercontent.com/clockworkpi/CPI/master/launchergo_ver.json"
VERSION="0.22" VERSION="0.22"

View File

@ -125,7 +125,7 @@ func LoadEncryptionMethods(wired bool) []*CurType {
for _, v := range enctypes { for _, v := range enctypes {
c := parse_enc_templat(v) c := parse_enc_templat(v)
c.Type = v
encryptionTypes = append(encryptionTypes, c) encryptionTypes = append(encryptionTypes, c)
} }