Merge branch 'qservice' of dan/ui into master
This commit is contained in:
commit
ec0766946f
|
@ -110,7 +110,7 @@
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="16" /> <!-- android:targetSdkVersion="26"/> -->
|
<uses-sdk android:minSdkVersion="21" /><!-- android:targetSdkVersion="26"/> -->
|
||||||
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
|
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
|
16
main.go
16
main.go
|
@ -11,6 +11,7 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"git.openprivacy.ca/openprivacy/libricochet-go/connectivity"
|
"git.openprivacy.ca/openprivacy/libricochet-go/connectivity"
|
||||||
"git.openprivacy.ca/openprivacy/libricochet-go/log"
|
"git.openprivacy.ca/openprivacy/libricochet-go/log"
|
||||||
|
"github.com/therecipe/qt/androidextras"
|
||||||
"github.com/therecipe/qt/core"
|
"github.com/therecipe/qt/core"
|
||||||
"github.com/therecipe/qt/gui"
|
"github.com/therecipe/qt/gui"
|
||||||
"github.com/therecipe/qt/network"
|
"github.com/therecipe/qt/network"
|
||||||
|
@ -87,12 +88,23 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// QRunnable is a shim for QAndroidService and QGuiApplication
|
||||||
|
type QRunnable interface {
|
||||||
|
Exec() int
|
||||||
|
}
|
||||||
|
|
||||||
func mainService() {
|
func mainService() {
|
||||||
log.Infoln("I am the service")
|
log.Infoln("I am the service")
|
||||||
log.Infoln("Starting a cwtch app...")
|
log.Infoln("Starting a cwtch app...")
|
||||||
go loadNetworkingAndFiles(nil, true, false)
|
go loadNetworkingAndFiles(nil, true, false)
|
||||||
//app := androidextras.NewQAndroidService(len(os.Args), os.Args)
|
var app QRunnable
|
||||||
app := gui.NewQGuiApplication(len(os.Args), os.Args)
|
if runtime.GOOS == "android" {
|
||||||
|
log.Infoln("Making QAndroidService...")
|
||||||
|
app = androidextras.NewQAndroidService(len(os.Args), os.Args)
|
||||||
|
} else {
|
||||||
|
log.Infoln("Making QGuiApplication...")
|
||||||
|
app = gui.NewQGuiApplication(len(os.Args), os.Args)
|
||||||
|
}
|
||||||
log.Infoln("Cwtch Service starting app.Exec")
|
log.Infoln("Cwtch Service starting app.Exec")
|
||||||
app.Exec()
|
app.Exec()
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue