accept version at build time; display version in settings pane
This commit is contained in:
parent
dfef958c68
commit
eeb167ce38
|
@ -26,6 +26,8 @@ type GrandCentralDispatcher struct {
|
|||
_ string `property:"os"`
|
||||
_ string `property:"currentOpenConversation"`
|
||||
_ float32 `property:"themeScale"`
|
||||
_ string `property:"version"`
|
||||
_ string `property:"buildDate"`
|
||||
|
||||
// contact list stuff
|
||||
_ func(handle, displayName, image, server string, badge, status int, trusted bool) `signal:"AddContact"`
|
||||
|
|
|
@ -264,24 +264,30 @@
|
|||
<translation>Cwtch Einstellungen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="29"/>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="28"/>
|
||||
<source>version %1 builddate %2</source>
|
||||
<extracomment>Version: %1 Built on: %2</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="35"/>
|
||||
<source>zoom-label</source>
|
||||
<extracomment>Interface zoom (mostly affects text and button sizes)</extracomment>
|
||||
<translation>Benutzeroberflächen-Zoom (betriftt hauptsächlich Text- und Knopgrößen)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="46"/>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="52"/>
|
||||
<source>large-text-label</source>
|
||||
<translation>Groß</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="52"/>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="58"/>
|
||||
<source>default-scaling-text</source>
|
||||
<extracomment>"Default size text (scale factor: "</extracomment>
|
||||
<translation>defaultmäßige Textgröße (Skalierungsfaktor:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="56"/>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="62"/>
|
||||
<source>small-text-label</source>
|
||||
<translation>Klein</translation>
|
||||
</message>
|
||||
|
|
Binary file not shown.
|
@ -264,24 +264,30 @@
|
|||
<translation>Cwtch Settings</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="29"/>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="28"/>
|
||||
<source>version %1 builddate %2</source>
|
||||
<extracomment>Version: %1 Built on: %2</extracomment>
|
||||
<translation>Version: %1 Built on: %2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="35"/>
|
||||
<source>zoom-label</source>
|
||||
<extracomment>Interface zoom (mostly affects text and button sizes)</extracomment>
|
||||
<translation>Interface zoom (mostly affects text and button sizes)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="46"/>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="52"/>
|
||||
<source>large-text-label</source>
|
||||
<translation>Large</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="52"/>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="58"/>
|
||||
<source>default-scaling-text</source>
|
||||
<extracomment>"Default size text (scale factor: "</extracomment>
|
||||
<translation>Default size text (scale factor:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="56"/>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="62"/>
|
||||
<source>small-text-label</source>
|
||||
<translation>Small</translation>
|
||||
</message>
|
||||
|
|
|
@ -264,24 +264,30 @@
|
|||
<translation>Préférences Cwtch</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="29"/>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="28"/>
|
||||
<source>version %1 builddate %2</source>
|
||||
<extracomment>Version: %1 Built on: %2</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="35"/>
|
||||
<source>zoom-label</source>
|
||||
<extracomment>Interface zoom (mostly affects text and button sizes)</extracomment>
|
||||
<translation>Interface zoom (essentiellement la taille du texte et des composants de l'interface)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="46"/>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="52"/>
|
||||
<source>large-text-label</source>
|
||||
<translation type="unfinished">Large</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="52"/>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="58"/>
|
||||
<source>default-scaling-text</source>
|
||||
<extracomment>"Default size text (scale factor: "</extracomment>
|
||||
<translation>Taille par défaut du texte (échelle:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="56"/>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="62"/>
|
||||
<source>small-text-label</source>
|
||||
<translation>Petit</translation>
|
||||
</message>
|
||||
|
|
|
@ -264,24 +264,30 @@
|
|||
<translation>Configurações do Cwtch</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="29"/>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="28"/>
|
||||
<source>version %1 builddate %2</source>
|
||||
<extracomment>Version: %1 Built on: %2</extracomment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="35"/>
|
||||
<source>zoom-label</source>
|
||||
<extracomment>Interface zoom (mostly affects text and button sizes)</extracomment>
|
||||
<translation>Zoom da interface (afeta principalmente tamanho de texto e botões)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="46"/>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="52"/>
|
||||
<source>large-text-label</source>
|
||||
<translation>Grande</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="52"/>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="58"/>
|
||||
<source>default-scaling-text</source>
|
||||
<extracomment>"Default size text (scale factor: "</extracomment>
|
||||
<translation>Texto tamanho padrão (fator de escala: </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="56"/>
|
||||
<location filename="../qml/panes/SettingsPane.qml" line="62"/>
|
||||
<source>small-text-label</source>
|
||||
<translation>Pequeno</translation>
|
||||
</message>
|
||||
|
|
19
main.go
19
main.go
|
@ -25,6 +25,11 @@ import (
|
|||
|
||||
const androidBaseDir = "/data/data/org.qtproject.example.go/"
|
||||
|
||||
var (
|
||||
buildVer string
|
||||
buildDate string
|
||||
)
|
||||
|
||||
func init() {
|
||||
// make go-defined types available in qml
|
||||
gothings.GrandCentralDispatcher_QmlRegisterType2("CustomQmlTypes", 1, 0, "GrandCentralDispatcher")
|
||||
|
@ -44,6 +49,13 @@ func main() {
|
|||
// our globals
|
||||
gcd := gothings.NewGrandCentralDispatcher(nil)
|
||||
gcd.SetOs(runtime.GOOS)
|
||||
if buildVer != "" {
|
||||
gcd.SetVersion(buildVer)
|
||||
gcd.SetBuildDate(buildDate)
|
||||
} else {
|
||||
gcd.SetVersion("development")
|
||||
gcd.SetBuildDate("now")
|
||||
}
|
||||
gcd.UIState = gothings.NewUIState(gcd)
|
||||
the.AcknowledgementIDs = make(map[string][]*the.AckId)
|
||||
gcd.OutgoingMessages = make(chan gobjects.Letter, 1000)
|
||||
|
@ -158,7 +170,6 @@ func main() {
|
|||
acn.Close()
|
||||
}
|
||||
|
||||
|
||||
// this is mostly going to get factored out when we add profile support
|
||||
// for now, it loads a single peer and fills the ui with its data
|
||||
func loadCwtchData(gcd *gothings.GrandCentralDispatcher, acn connectivity.ACN) {
|
||||
|
@ -217,9 +228,9 @@ func loadCwtchData(gcd *gothings.GrandCentralDispatcher, acn connectivity.ACN) {
|
|||
if !exists {
|
||||
nick = group.GroupID[:12]
|
||||
}
|
||||
deleted,_ := group.GetAttribute("deleted")
|
||||
deleted, _ := group.GetAttribute("deleted")
|
||||
// Only join servers for active and explicitly accepted groups.
|
||||
if deleted != "deleted"{
|
||||
if deleted != "deleted" {
|
||||
|
||||
gcd.UIState.AddContact(&gobjects.Contact{
|
||||
Handle: group.GroupID,
|
||||
|
@ -230,7 +241,7 @@ func loadCwtchData(gcd *gothings.GrandCentralDispatcher, acn connectivity.ACN) {
|
|||
})
|
||||
|
||||
// Only send a join server packet if we haven't joined this server yet...
|
||||
_,connecting := the.Peer.GetServers()[group.GroupServer]
|
||||
_, connecting := the.Peer.GetServers()[group.GroupServer]
|
||||
if group.Accepted && !connecting {
|
||||
the.Peer.JoinServer(group.GroupServer)
|
||||
}
|
||||
|
|
|
@ -23,6 +23,11 @@ ColumnLayout { // settingsPane
|
|||
leftPadding: 10
|
||||
spacing: 5
|
||||
|
||||
ScalingLabel {
|
||||
//: Version: %1 Built on: %2
|
||||
text: qsTr("version %1 builddate %2").arg(gcd.version).arg(gcd.buildDate)
|
||||
}
|
||||
|
||||
ScalingLabel {
|
||||
Layout.maximumWidth: parent.width
|
||||
//: Interface zoom (mostly affects text and button sizes)
|
||||
|
|
Reference in New Issue