mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2025-12-13 08:28:51 +01:00
next is keyboard bugs
This commit is contained in:
parent
098105f890
commit
fc7afbb680
Binary file not shown.
Binary file not shown.
@ -26,8 +26,12 @@ type NetItemMultiIcon struct {
|
|||||||
|
|
||||||
func NewNetItemMultiIcon() *NetItemMultiIcon{
|
func NewNetItemMultiIcon() *NetItemMultiIcon{
|
||||||
p := &NetItemMultiIcon{}
|
p := &NetItemMultiIcon{}
|
||||||
p.Width = 18
|
p.IconIndex = 0
|
||||||
p.Height = 18
|
p.IconWidth = 18
|
||||||
|
p.IconHeight = 18
|
||||||
|
|
||||||
|
p.Width = 18
|
||||||
|
p.Height = 18
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,9 +126,6 @@ func (self *NetItem) SetActive( act bool) {
|
|||||||
|
|
||||||
func (self *NetItem) UpdateStrenLabel( strenstr string) { // ## strenstr should be 'number',eg:'90'
|
func (self *NetItem) UpdateStrenLabel( strenstr string) { // ## strenstr should be 'number',eg:'90'
|
||||||
|
|
||||||
|
|
||||||
self.Daemon.Get( self.Daemon.Method("FormatSignalForPrinting",strenstr), &strenstr)
|
|
||||||
|
|
||||||
self.Stren = strenstr
|
self.Stren = strenstr
|
||||||
|
|
||||||
if _, ok := self.Labels["stren"]; ok {
|
if _, ok := self.Labels["stren"]; ok {
|
||||||
@ -134,6 +135,7 @@ func (self *NetItem) UpdateStrenLabel( strenstr string) { // ## strenstr should
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *NetItem) Init(i int,is_active bool) {
|
func (self *NetItem) Init(i int,is_active bool) {
|
||||||
|
|
||||||
var sig_display_type int
|
var sig_display_type int
|
||||||
strenstr := "quality"
|
strenstr := "quality"
|
||||||
gap := 4
|
gap := 4
|
||||||
@ -155,15 +157,16 @@ func (self *NetItem) Init(i int,is_active bool) {
|
|||||||
|
|
||||||
self.NetId = i
|
self.NetId = i
|
||||||
|
|
||||||
tmp :=""
|
tmp := 0
|
||||||
self.Wireless.Get(self.Wireless.Method("GetWirelessProperty",self.NetId, strenstr),&tmp)
|
self.Wireless.Get(self.Wireless.Method("GetWirelessProperty",self.NetId, strenstr),&tmp)
|
||||||
self.Daemon.Get( self.Daemon.Method("FormatSignalForPrinting",tmp), &tmp)
|
tmp2 := ""
|
||||||
self.Stren = tmp
|
self.Daemon.Get( self.Daemon.Method("FormatSignalForPrinting",tmp), &tmp2)
|
||||||
|
|
||||||
|
self.Stren = tmp2
|
||||||
|
|
||||||
self.Wireless.Get( self.Wireless.Method("GetWirelessProperty",self.NetId,"essid"),&self.Essid)
|
self.Wireless.Get( self.Wireless.Method("GetWirelessProperty",self.NetId,"essid"),&self.Essid)
|
||||||
self.Wireless.Get( self.Wireless.Method("GetWirelessProperty",self.NetId,"bssid"),&self.Bssid)
|
self.Wireless.Get( self.Wireless.Method("GetWirelessProperty",self.NetId,"bssid"),&self.Bssid)
|
||||||
|
|
||||||
|
|
||||||
check_enc := false
|
check_enc := false
|
||||||
self.Wireless.Get( self.Wireless.Method("GetWirelessProperty",self.NetId,"encryption"),&check_enc)
|
self.Wireless.Get( self.Wireless.Method("GetWirelessProperty",self.NetId,"encryption"),&check_enc)
|
||||||
|
|
||||||
@ -186,10 +189,10 @@ func (self *NetItem) Init(i int,is_active bool) {
|
|||||||
self.SetActive(is_active)
|
self.SetActive(is_active)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(theString)
|
//fmt.Println(theString)
|
||||||
|
|
||||||
essid_label := UI.NewLabel()
|
essid_label := UI.NewLabel()
|
||||||
essid_label.PosY = 36
|
essid_label.PosX = 36
|
||||||
essid_label.CanvasHWND = self.Parent.GetCanvasHWND()
|
essid_label.CanvasHWND = self.Parent.GetCanvasHWND()
|
||||||
|
|
||||||
essid_ := ""
|
essid_ := ""
|
||||||
@ -199,7 +202,7 @@ func (self *NetItem) Init(i int,is_active bool) {
|
|||||||
}else {
|
}else {
|
||||||
essid_ = self.Essid
|
essid_ = self.Essid
|
||||||
}
|
}
|
||||||
fmt.Println(essid_)
|
|
||||||
essid_label.Init(essid_, self.FontObj,nil)
|
essid_label.Init(essid_, self.FontObj,nil)
|
||||||
|
|
||||||
self.Labels["essid"] = essid_label
|
self.Labels["essid"] = essid_label
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import (
|
|||||||
"github.com/cuu/gogame/color"
|
"github.com/cuu/gogame/color"
|
||||||
*/
|
*/
|
||||||
"github.com/cuu/LauncherGo/sysgo/UI"
|
"github.com/cuu/LauncherGo/sysgo/UI"
|
||||||
"github.com/cuu/LauncherGo/sysgo/DBUS"
|
//"github.com/cuu/LauncherGo/sysgo/DBUS"
|
||||||
)
|
)
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
@ -29,8 +29,8 @@ func (self *WifiPlugin) Init( main_screen *UI.MainScreen ) {
|
|||||||
|
|
||||||
self.ScanPage = NewWifiList()
|
self.ScanPage = NewWifiList()
|
||||||
self.ScanPage.Name = "Scan wifi"
|
self.ScanPage.Name = "Scan wifi"
|
||||||
self.ScanPage.Wireless = DBUS.DBusHandler.Wifi
|
self.ScanPage.Wireless = main_screen.DBusManager.Wifi
|
||||||
self.ScanPage.Daemon = DBUS.DBusHandler.Daemon
|
self.ScanPage.Daemon = main_screen.DBusManager.Daemon
|
||||||
|
|
||||||
self.ScanPage.Screen = main_screen
|
self.ScanPage.Screen = main_screen
|
||||||
|
|
||||||
@ -40,7 +40,8 @@ func (self *WifiPlugin) Init( main_screen *UI.MainScreen ) {
|
|||||||
|
|
||||||
func (self *WifiPlugin) Run( main_screen *UI.MainScreen ) {
|
func (self *WifiPlugin) Run( main_screen *UI.MainScreen ) {
|
||||||
if main_screen != nil {
|
if main_screen != nil {
|
||||||
main_screen.PushPage(self.ScanPage)
|
main_screen.PushCurPage()
|
||||||
|
main_screen.SetCurPage(self.ScanPage)
|
||||||
main_screen.Draw()
|
main_screen.Draw()
|
||||||
main_screen.SwapAndShow()
|
main_screen.SwapAndShow()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -520,9 +520,11 @@ func (self *WifiList) UpdateNetList(state int,info []string ,force_check bool,fi
|
|||||||
var mystatus status
|
var mystatus status
|
||||||
|
|
||||||
if state == -1 {
|
if state == -1 {
|
||||||
|
|
||||||
self.Daemon.Get(self.Daemon.Method("GetConnectionStatus"),&mystatus)
|
self.Daemon.Get(self.Daemon.Method("GetConnectionStatus"),&mystatus)
|
||||||
fmt.Println("state ",mystatus.State)
|
fmt.Println("state ",mystatus.State)
|
||||||
fmt.Println("Trash ",mystatus.Trash)
|
fmt.Println("Trash ",mystatus.Trash)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if force_check == true || self.PrevWicdState != state {
|
if force_check == true || self.PrevWicdState != state {
|
||||||
@ -730,8 +732,9 @@ func (self *WifiList) GetWirelessEncrypt(network_id int) []map[string]string {
|
|||||||
|
|
||||||
for i,v := range self.EncMethods {
|
for i,v := range self.EncMethods {
|
||||||
enc_type = ""
|
enc_type = ""
|
||||||
self.Wireless.Get(self.Wireless.Method("GetWirelessProperty",network_id,"enctype"),&enc_type)
|
self.Wireless.Get(self.Wireless.Method("GetWirelessProperty",network_id,"encryption_method"),&enc_type)
|
||||||
if v.Type == enc_type {
|
enc_type = strings.ToLower(enc_type)
|
||||||
|
if enc_type != "" && v.Type == enc_type {
|
||||||
activeID = i
|
activeID = i
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -882,6 +885,7 @@ func (self *WifiList) KeyDown( ev *event.Event ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
wicd_wireless_encrypt_pwd := self.GetWirelessEncrypt(self.PsIndex)
|
wicd_wireless_encrypt_pwd := self.GetWirelessEncrypt(self.PsIndex)
|
||||||
|
fmt.Println("wicd_wireless_encrypt_pwd ", wicd_wireless_encrypt_pwd)
|
||||||
|
|
||||||
if self.MyList[self.PsIndex].IsActive == true {
|
if self.MyList[self.PsIndex].IsActive == true {
|
||||||
var ip string
|
var ip string
|
||||||
@ -900,7 +904,9 @@ func (self *WifiList) KeyDown( ev *event.Event ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println("APIOBJ.PasswordPage.SetPassword ", thepass,len(thepass))
|
||||||
APIOBJ.PasswordPage.SetPassword(thepass)
|
APIOBJ.PasswordPage.SetPassword(thepass)
|
||||||
|
|
||||||
self.Screen.Draw()
|
self.Screen.Draw()
|
||||||
self.Screen.SwapAndShow()
|
self.Screen.SwapAndShow()
|
||||||
|
|
||||||
@ -929,6 +935,7 @@ func (self *WifiList) KeyDown( ev *event.Event ) {
|
|||||||
|
|
||||||
|
|
||||||
func (self *WifiList) Init() {
|
func (self *WifiList) Init() {
|
||||||
|
|
||||||
self.PosX = self.Index * self.Screen.Width
|
self.PosX = self.Index * self.Screen.Width
|
||||||
self.Width = self.Screen.Width
|
self.Width = self.Screen.Width
|
||||||
self.Height = self.Screen.Height
|
self.Height = self.Screen.Height
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -2,7 +2,7 @@ package DBUS
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
//"strconv"
|
||||||
"github.com/godbus/dbus"
|
"github.com/godbus/dbus"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -127,8 +127,8 @@ func (self *DBus) check_for_wireless(iwconfig string, wireless_ip string) bool
|
|||||||
if strength == 0 {
|
if strength == 0 {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
strength_str := strconv.Itoa(strength)
|
strength_str := ""
|
||||||
self.Daemon.Get( self.Daemon.Method("FormatSignalForPrinting",strength_str), &strength_str)
|
self.Daemon.Get( self.Daemon.Method("FormatSignalForPrinting",strength), &strength_str)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@ -174,5 +174,5 @@ var DBusHandler *DBus //global
|
|||||||
func init() {
|
func init() {
|
||||||
DBusHandler = NewDBus()
|
DBusHandler = NewDBus()
|
||||||
DBusHandler.Init()
|
DBusHandler.Init()
|
||||||
fmt.Println("dbus inited")
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,7 +61,7 @@ func (self *InfoPageListItem) Draw() {
|
|||||||
x,_ = self.Labels["Small"].Coord()
|
x,_ = self.Labels["Small"].Coord()
|
||||||
w,h = self.Labels["Small"].Size()
|
w,h = self.Labels["Small"].Size()
|
||||||
|
|
||||||
self.Labels["Small"].NewCoord( self.Width - w + 5 , self.PosY + (self.Height - h)/2 )
|
self.Labels["Small"].NewCoord( self.Width - w - 5 , self.PosY + (self.Height - h)/2 )
|
||||||
self.Labels["Small"].Draw()
|
self.Labels["Small"].Draw()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -101,6 +101,7 @@ func (self *Textarea) AppendAndBlitText(alphabet string) {
|
|||||||
|
|
||||||
func (self *Textarea) BuildBlitText() {
|
func (self *Textarea) BuildBlitText() {
|
||||||
blit_rows := make([][]string,0)
|
blit_rows := make([][]string,0)
|
||||||
|
blit_rows = append(blit_rows,[]string{})
|
||||||
|
|
||||||
w := 0
|
w := 0
|
||||||
// xmargin := 5
|
// xmargin := 5
|
||||||
@ -114,11 +115,7 @@ func (self *Textarea) BuildBlitText() {
|
|||||||
t_width := surface.GetWidth(t)
|
t_width := surface.GetWidth(t)
|
||||||
w+=t_width
|
w+=t_width
|
||||||
|
|
||||||
if linenumber < len(blit_rows) {
|
blit_rows[linenumber] = append(blit_rows[linenumber],v)
|
||||||
blit_rows[linenumber] = append(blit_rows[linenumber],v)
|
|
||||||
}else {
|
|
||||||
blit_rows = append(blit_rows,[]string{v})
|
|
||||||
}
|
|
||||||
|
|
||||||
if i == self.TextIndex - 1 {
|
if i == self.TextIndex - 1 {
|
||||||
cursor_row = linenumber
|
cursor_row = linenumber
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package sysgo
|
package sysgo
|
||||||
|
|
||||||
var (
|
var (
|
||||||
CurKeySet = "GameShell"
|
CurKeySet = "PC"
|
||||||
DontLeave = false
|
DontLeave = false
|
||||||
BackLight = "/proc/driver/backlight"
|
BackLight = "/proc/driver/backlight"
|
||||||
Battery = "/sys/class/power_supply/axp20x-battery/uevent"
|
Battery = "/sys/class/power_supply/axp20x-battery/uevent"
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package misc
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"fmt"
|
//"fmt"
|
||||||
"github.com/cuu/LauncherGo/sysgo/UI"
|
"github.com/cuu/LauncherGo/sysgo/UI"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
@ -119,7 +119,6 @@ func LoadEncryptionMethods(wired bool) []*CurType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enctypes, _ := UI.ReadLines(wpath_encryption + active_fname)
|
enctypes, _ := UI.ReadLines(wpath_encryption + active_fname)
|
||||||
fmt.Println(enctypes)
|
|
||||||
|
|
||||||
var encryptionTypes []*CurType
|
var encryptionTypes []*CurType
|
||||||
|
|
||||||
|
|||||||
29
test.go
29
test.go
@ -16,6 +16,8 @@ import (
|
|||||||
"github.com/cuu/gogame/image"
|
"github.com/cuu/gogame/image"
|
||||||
"github.com/cuu/gogame/font"
|
"github.com/cuu/gogame/font"
|
||||||
"github.com/cuu/gogame/time"
|
"github.com/cuu/gogame/time"
|
||||||
|
|
||||||
|
"github.com/cuu/LauncherGo/sysgo/DBUS"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -88,8 +90,35 @@ func run() int {
|
|||||||
|
|
||||||
display.Flip()
|
display.Flip()
|
||||||
|
|
||||||
|
|
||||||
event.AddCustomEvent(RUNEVT)
|
event.AddCustomEvent(RUNEVT)
|
||||||
|
|
||||||
|
type status struct {
|
||||||
|
State int
|
||||||
|
Trash []string
|
||||||
|
}
|
||||||
|
|
||||||
|
var mystatus status
|
||||||
|
|
||||||
|
DBUS.DBusHandler.Daemon.Get(DBUS.DBusHandler.Daemon.Method("GetConnectionStatus"),&mystatus)
|
||||||
|
fmt.Println("state ",mystatus.State)
|
||||||
|
fmt.Println("Trash ",mystatus.Trash)
|
||||||
|
|
||||||
|
|
||||||
|
var essid string
|
||||||
|
var bssid string
|
||||||
|
|
||||||
|
DBUS.DBusHandler.Wifi.Get(DBUS.DBusHandler.Wifi.Method("GetWirelessProperty",0,"essid"),&essid)
|
||||||
|
|
||||||
|
fmt.Println(essid)
|
||||||
|
DBUS.DBusHandler.Wifi.Get(DBUS.DBusHandler.Wifi.Method("GetWirelessProperty",0,"bssid"),&bssid)
|
||||||
|
fmt.Println(bssid)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
running := true
|
running := true
|
||||||
for running {
|
for running {
|
||||||
ev := event.Wait()
|
ev := event.Wait()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user