diff --git a/go/gothings/gcd.go b/go/gothings/gcd.go index f4bbc447..e6b9d1bb 100644 --- a/go/gothings/gcd.go +++ b/go/gothings/gcd.go @@ -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"` diff --git a/i18n/translation_de.ts b/i18n/translation_de.ts index 554a8416..8ade7ff3 100644 --- a/i18n/translation_de.ts +++ b/i18n/translation_de.ts @@ -264,24 +264,30 @@ Cwtch Einstellungen - + + version %1 builddate %2 + Version: %1 Built on: %2 + + + + zoom-label Interface zoom (mostly affects text and button sizes) Benutzeroberflächen-Zoom (betriftt hauptsächlich Text- und Knopgrößen) - + large-text-label Groß - + default-scaling-text "Default size text (scale factor: " defaultmäßige Textgröße (Skalierungsfaktor: - + small-text-label Klein diff --git a/i18n/translation_en.qm b/i18n/translation_en.qm index 09021b5b..fc7c40a8 100644 Binary files a/i18n/translation_en.qm and b/i18n/translation_en.qm differ diff --git a/i18n/translation_en.ts b/i18n/translation_en.ts index 8dc4649b..71ea1465 100644 --- a/i18n/translation_en.ts +++ b/i18n/translation_en.ts @@ -264,24 +264,30 @@ Cwtch Settings - + + version %1 builddate %2 + Version: %1 Built on: %2 + Version: %1 Built on: %2 + + + zoom-label Interface zoom (mostly affects text and button sizes) Interface zoom (mostly affects text and button sizes) - + large-text-label Large - + default-scaling-text "Default size text (scale factor: " Default size text (scale factor: - + small-text-label Small diff --git a/i18n/translation_fr.ts b/i18n/translation_fr.ts index d3fb4308..96597e65 100644 --- a/i18n/translation_fr.ts +++ b/i18n/translation_fr.ts @@ -264,24 +264,30 @@ Préférences Cwtch - + + version %1 builddate %2 + Version: %1 Built on: %2 + + + + zoom-label Interface zoom (mostly affects text and button sizes) Interface zoom (essentiellement la taille du texte et des composants de l'interface) - + large-text-label Large - + default-scaling-text "Default size text (scale factor: " Taille par défaut du texte (échelle: - + small-text-label Petit diff --git a/i18n/translation_pt.ts b/i18n/translation_pt.ts index 76875267..cb7f4574 100644 --- a/i18n/translation_pt.ts +++ b/i18n/translation_pt.ts @@ -264,24 +264,30 @@ Configurações do Cwtch - + + version %1 builddate %2 + Version: %1 Built on: %2 + + + + zoom-label Interface zoom (mostly affects text and button sizes) Zoom da interface (afeta principalmente tamanho de texto e botões) - + large-text-label Grande - + default-scaling-text "Default size text (scale factor: " Texto tamanho padrão (fator de escala: - + small-text-label Pequeno diff --git a/main.go b/main.go index 4d59a0e1..8e9ef682 100644 --- a/main.go +++ b/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) @@ -105,7 +117,7 @@ func main() { the.CwtchDir = os.Getenv("CWTCH_FOLDER") } else if runtime.GOOS == "android" { the.CwtchDir = path.Join(androidBaseDir, "files") - } else { + } else { usr, err := user.Current() if err != nil { fmt.Printf("\nerror: could not load current user: %v\n", err) @@ -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) } diff --git a/qml/panes/SettingsPane.qml b/qml/panes/SettingsPane.qml index 3278e5df..22e308c0 100644 --- a/qml/panes/SettingsPane.qml +++ b/qml/panes/SettingsPane.qml @@ -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) @@ -99,4 +104,4 @@ ColumnLayout { // settingsPane // (locale is handled automatically by FlagButton) } } -} \ No newline at end of file +}