Merge branch 'startFix' of dan/ui into master
the build was successful
Details
the build was successful
Details
This commit is contained in:
commit
033c1c4279
|
@ -31,16 +31,18 @@ func AppEventListener(gcd *gothings.GrandCentralDispatcher, subscribed chan bool
|
||||||
percent, _ := strconv.Atoi(progStr)
|
percent, _ := strconv.Atoi(progStr)
|
||||||
message := e.Data[event.Status]
|
message := e.Data[event.Status]
|
||||||
var statuscode int
|
var statuscode int
|
||||||
if percent == 0 {
|
if percent >= 0 && percent <= 25 {
|
||||||
statuscode = 0
|
statuscode = 1
|
||||||
message = "can't find tor. is it running? is the controlport configured?"
|
message = "Connecting to network"
|
||||||
|
} else if percent < 100 {
|
||||||
|
statuscode = 2
|
||||||
|
message = "Establishng Tor circut"
|
||||||
} else if percent == 100 {
|
} else if percent == 100 {
|
||||||
statuscode = 3
|
statuscode = 3
|
||||||
message = "tor appears to be running just fine!"
|
message = "tor appears to be running just fine!"
|
||||||
} else if percent < 80 {
|
|
||||||
statuscode = 1
|
|
||||||
} else {
|
} else {
|
||||||
statuscode = 2
|
statuscode = 0
|
||||||
|
message = "can't find tor. is it running? is the controlport configured?"
|
||||||
}
|
}
|
||||||
|
|
||||||
gcd.TorStatus(statuscode, message)
|
gcd.TorStatus(statuscode, message)
|
||||||
|
|
6
main.go
6
main.go
|
@ -83,9 +83,9 @@ func main() {
|
||||||
|
|
||||||
if *flagService {
|
if *flagService {
|
||||||
mainService()
|
mainService()
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
mainUi(*flagLocal, *flagClientUI)
|
clientUI := *flagClientUI || runtime.GOOS == "android"
|
||||||
|
mainUi(*flagLocal, clientUI)
|
||||||
}
|
}
|
||||||
|
|
||||||
if the.ACN != nil {
|
if the.ACN != nil {
|
||||||
|
@ -115,7 +115,7 @@ func mainService() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func mainUi(flagLocal bool, flagClientUI bool) {
|
func mainUi(flagLocal bool, flagClientUI bool) {
|
||||||
log.Infoln("I am the application")
|
log.Infof("I am the UI (client:%v)\n", flagClientUI)
|
||||||
|
|
||||||
app := gui.NewQGuiApplication(len(os.Args), os.Args)
|
app := gui.NewQGuiApplication(len(os.Args), os.Args)
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ ColumnLayout {
|
||||||
|
|
||||||
Rectangle { //0: no tor, 1: progress 0%, 2: progress 1-99%, 3: DONE
|
Rectangle { //0: no tor, 1: progress 0%, 2: progress 1-99%, 3: DONE
|
||||||
id: rectTorStatus
|
id: rectTorStatus
|
||||||
color: code == 3 ? "green": code == 2 ? "orange" : code == 1 ? "yellow" : "red"
|
color: code == 3 ? "green": code == 2 ? "yellow" : code == 1 ? "orange" : "red"
|
||||||
width: 8
|
width: 8
|
||||||
height: 8
|
height: 8
|
||||||
radius: 2
|
radius: 2
|
||||||
|
|
Reference in New Issue