Merge branch 'ui-tweaks' of cwtch.im/ui into master

This commit is contained in:
erinn 2019-08-30 13:54:32 -07:00 committed by Gogs
commit c230187d15
11 changed files with 145 additions and 43 deletions

9
go.mod
View File

@ -3,7 +3,14 @@ module cwtch.im/ui
go 1.12
require (
cwtch.im/cwtch v0.2.0
cwtch.im/cwtch v0.2.1-pr-1
git.openprivacy.ca/openprivacy/libricochet-go v1.0.6
github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/stretchr/testify v1.4.0 // indirect
github.com/therecipe/qt v0.0.0-20190824160953-615e084bab56
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 // indirect
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 // indirect
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
)

31
go.sum
View File

@ -1,5 +1,5 @@
cwtch.im/cwtch v0.2.0 h1:kHjI/Ux+ft6/Zjfta5CIiwrBIpDQgxalyCjdvdjl6V4=
cwtch.im/cwtch v0.2.0/go.mod h1:8tmtp3c7fccWw9H7s9u6E8GD2PKI3ar21i0fjN8pzd0=
cwtch.im/cwtch v0.2.1-pr-1 h1:yC9aP9OnE6mUtLbZ5JNJjGMZGA3OWq6Vd+e5j8rihMg=
cwtch.im/cwtch v0.2.1-pr-1/go.mod h1:8tmtp3c7fccWw9H7s9u6E8GD2PKI3ar21i0fjN8pzd0=
cwtch.im/tapir v0.1.10 h1:V+TkmwXNd6gySZqlVw468wMYEkmDwMSyvhkkpOfUw7w=
cwtch.im/tapir v0.1.10/go.mod h1:EuRYdVrwijeaGBQ4OijDDRHf7R2MDSypqHkSl5DxI34=
git.openprivacy.ca/openprivacy/libricochet-go v1.0.4/go.mod h1:yMSG1gBaP4f1U+RMZXN85d29D39OK5s8aTpyVRoH5FY=
@ -16,10 +16,16 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/gopherjs/gopherjs v0.0.0-20190411002643-bd77b112433e h1:XWcjeEtTFTOVA9Fs1w7n2XBftk5ib4oZrhzWk0B+3eA=
github.com/gopherjs/gopherjs v0.0.0-20190411002643-bd77b112433e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f h1:KMlcu9X58lhTA/KrfX8Bi1LQSO4pzoVjTiL3h4Jk+Zk=
github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
@ -32,32 +38,39 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/struCoder/pidusage v0.1.2/go.mod h1:pWBlW3YuSwRl6h7R5KbvA4N8oOqe9LjaKW5CwT1SPjI=
github.com/therecipe/qt v0.0.0-20190628021130-a9acd1ab63c1 h1:hqGfUSaL+5eJCyYJp89HNABOlkIUravsMVmqtK1fRX8=
github.com/therecipe/qt v0.0.0-20190628021130-a9acd1ab63c1/go.mod h1:SUUR2j3aE1z6/g76SdD6NwACEpvCxb3fvG82eKbD6us=
github.com/therecipe/qt v0.0.0-20190824160953-615e084bab56 h1:CAFR/rHptsl8gEP6igtp6VbuQpPALEJ/B+gl9QkyFXU=
github.com/therecipe/qt v0.0.0-20190824160953-615e084bab56/go.mod h1:SUUR2j3aE1z6/g76SdD6NwACEpvCxb3fvG82eKbD6us=
golang.org/x/crypto v0.0.0-20190128193316-c7b33c32a30b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190420063019-afa5a82059c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190628185345-da137c7871d7 h1:rTIdg5QFRR7XCaK4LCjBiPbx8j4DQRpdYMnGn/bJUEU=
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 h1:fHDIZ2oxGnUZRN6WgWFCbYBjH9uqVPRCUVUDhs0wnbA=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a h1:XCr/YX7O0uxRkLq2k1ApNQMims9eCioF9UpzIPBDmuo=
golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

View File

@ -3,6 +3,7 @@ package characters
import (
"cwtch.im/cwtch/app/plugins"
"cwtch.im/cwtch/event"
"cwtch.im/ui/go/constants"
"cwtch.im/ui/go/cwutil"
"cwtch.im/ui/go/gobjects"
"cwtch.im/ui/go/gothings"
@ -118,10 +119,15 @@ func AppEventListener(gcd *gothings.GrandCentralDispatcher, subscribed chan bool
// load ui preferences
gcd.RequestSettings()
locale, exists := the.Peer.GetProfile().GetAttribute("settings.locale")
locale, exists := the.Peer.GetProfile().GetAttribute(constants.LocaleSetting)
if exists {
gcd.SetLocale_helper(locale)
}
blockUnkownPeers, exists := the.Peer.GetProfile().GetAttribute(constants.BlockUnknownPeersSetting)
if exists && blockUnkownPeers == "true" {
the.EventBus.Publish(event.NewEvent(event.BlockUnknownPeers, map[event.Field]string{}))
}
}
}

5
go/constants/settings.go Normal file
View File

@ -0,0 +1,5 @@
package constants
const BlockUnknownPeersSetting = "settings.blockunknownpeers"
const LocaleSetting = "settings.locale"
const ZoomSetting = "settings.zoom"

View File

@ -51,7 +51,7 @@ type GrandCentralDispatcher struct {
// settings helpers
_ func(str string) `signal:"InvokePopup"`
_ func(zoom, locale string) `signal:"SupplySettings"`
_ func(zoom, locale string, blockunknownpeers bool) `signal:"SupplySettings"`
_ func(groupID, name, server, invitation string, accepted bool, addrbooknames, addrbookaddrs []string) `signal:"SupplyGroupSettings"`
_ func(onion, nick string, blocked bool) `signal:"SupplyPeerSettings"`
@ -77,6 +77,8 @@ type GrandCentralDispatcher struct {
_ func(onion, key, nick string) `signal:"setAttribute,auto"`
_ func(onion string) `signal:"deleteContact,auto""`
_ func(locale string) `signal:"setLocale,auto"`
_ func() `signal:"allowUnknownPeers,auto"`
_ func() `signal:"blockUnknownPeers,auto"`
}
func (this *GrandCentralDispatcher) sendMessage(message string, mID string) {
@ -266,9 +268,10 @@ func (this *GrandCentralDispatcher) loadMessagesPaneHelper(handle string) {
}
func (this *GrandCentralDispatcher) requestSettings() {
zoom, _ := the.Peer.GetProfile().GetAttribute("settings.zoom")
locale, _ := the.Peer.GetProfile().GetAttribute("settings.locale")
this.SupplySettings(zoom, locale)
zoom, _ := the.Peer.GetProfile().GetAttribute(constants.ZoomSetting)
locale, _ := the.Peer.GetProfile().GetAttribute(constants.LocaleSetting)
blockunkownpeers, _ := the.Peer.GetProfile().GetAttribute(constants.BlockUnknownPeersSetting)
this.SupplySettings(zoom, locale, blockunkownpeers == "true")
}
func (this *GrandCentralDispatcher) saveSettings(zoom, locale string) {
@ -279,9 +282,10 @@ func (this *GrandCentralDispatcher) saveSettings(zoom, locale string) {
}
the.EventBus.Publish(event.NewEvent(event.SetAttribute, map[event.Field]string{
event.Key: "settings.zoom",
event.Key: constants.ZoomSetting,
event.Data: zoom,
}))
the.Peer.GetProfile().SetAttribute(constants.ZoomSetting, zoom)
}
func (this *GrandCentralDispatcher) requestPeerSettings() {
@ -536,15 +540,42 @@ func (this *GrandCentralDispatcher) setAttribute(onion, key, value string) {
}
}
func (this *GrandCentralDispatcher) blockUnknownPeers() {
// Save this setting
the.EventBus.Publish(event.NewEvent(event.SetAttribute, map[event.Field]string{
event.Key: constants.BlockUnknownPeersSetting,
event.Data: "true",
}))
the.Peer.GetProfile().SetAttribute(constants.BlockUnknownPeersSetting, "true")
the.EventBus.Publish(event.NewEvent(event.BlockUnknownPeers, map[event.Field]string{}))
}
func (this *GrandCentralDispatcher) allowUnknownPeers() {
// Save this setting
the.EventBus.Publish(event.NewEvent(event.SetAttribute, map[event.Field]string{
event.Key: constants.BlockUnknownPeersSetting,
event.Data: "false",
}))
the.Peer.GetProfile().SetAttribute(constants.BlockUnknownPeersSetting, "false")
the.EventBus.Publish(event.NewEvent(event.AllowUnknownPeers, map[event.Field]string{}))
}
func (this *GrandCentralDispatcher) setLocale(locale string) {
this.SetLocale_helper(locale)
the.EventBus.Publish(event.NewEvent(event.SetAttribute, map[event.Field]string{
event.Key: "settings.locale",
event.Key: constants.LocaleSetting,
event.Data: locale,
}))
this.SupplySettings("", locale)
zoom, _ := the.Peer.GetProfile().GetAttribute(constants.ZoomSetting)
blockunkownpeers, _ := the.Peer.GetProfile().GetAttribute(constants.BlockUnknownPeersSetting)
this.SupplySettings(zoom, locale, blockunkownpeers == "true")
}
func (this *GrandCentralDispatcher) SetLocale_helper(locale string) {

View File

@ -268,36 +268,41 @@
<context>
<name>SettingsPane</name>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="20"/>
<location filename="../qml/panes/SettingsPane.qml" line="21"/>
<source>cwtch-settings-title</source>
<extracomment>Cwtch Settings title</extracomment>
<translation>Cwtch Einstellungen</translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="46"/>
<location filename="../qml/panes/SettingsPane.qml" line="47"/>
<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="53"/>
<location filename="../qml/panes/SettingsPane.qml" line="54"/>
<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="71"/>
<location filename="../qml/panes/SettingsPane.qml" line="83"/>
<source>block-unknown-label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="90"/>
<source>large-text-label</source>
<translation>Groß</translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="79"/>
<location filename="../qml/panes/SettingsPane.qml" line="98"/>
<source>default-scaling-text</source>
<extracomment>&quot;Default size text (scale factor: &quot;</extracomment>
<translation>defaultmäßige Textgröße (Skalierungsfaktor:</translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="83"/>
<location filename="../qml/panes/SettingsPane.qml" line="102"/>
<source>small-text-label</source>
<translation>Klein</translation>
</message>

Binary file not shown.

View File

@ -268,36 +268,41 @@
<context>
<name>SettingsPane</name>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="20"/>
<location filename="../qml/panes/SettingsPane.qml" line="21"/>
<source>cwtch-settings-title</source>
<extracomment>Cwtch Settings title</extracomment>
<translation>Cwtch Settings</translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="46"/>
<location filename="../qml/panes/SettingsPane.qml" line="47"/>
<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="53"/>
<location filename="../qml/panes/SettingsPane.qml" line="54"/>
<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="71"/>
<location filename="../qml/panes/SettingsPane.qml" line="83"/>
<source>block-unknown-label</source>
<translation>Block Unknown Peers</translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="90"/>
<source>large-text-label</source>
<translation>Large</translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="79"/>
<location filename="../qml/panes/SettingsPane.qml" line="98"/>
<source>default-scaling-text</source>
<extracomment>&quot;Default size text (scale factor: &quot;</extracomment>
<translation>Default size text (scale factor:</translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="83"/>
<location filename="../qml/panes/SettingsPane.qml" line="102"/>
<source>small-text-label</source>
<translation>Small</translation>
</message>

View File

@ -268,36 +268,41 @@
<context>
<name>SettingsPane</name>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="20"/>
<location filename="../qml/panes/SettingsPane.qml" line="21"/>
<source>cwtch-settings-title</source>
<extracomment>Cwtch Settings title</extracomment>
<translation>Préférences Cwtch</translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="46"/>
<location filename="../qml/panes/SettingsPane.qml" line="47"/>
<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="53"/>
<location filename="../qml/panes/SettingsPane.qml" line="54"/>
<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&apos;interface)</translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="71"/>
<location filename="../qml/panes/SettingsPane.qml" line="83"/>
<source>block-unknown-label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="90"/>
<source>large-text-label</source>
<translation type="unfinished">Large</translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="79"/>
<location filename="../qml/panes/SettingsPane.qml" line="98"/>
<source>default-scaling-text</source>
<extracomment>&quot;Default size text (scale factor: &quot;</extracomment>
<translation>Taille par défaut du texte (échelle:</translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="83"/>
<location filename="../qml/panes/SettingsPane.qml" line="102"/>
<source>small-text-label</source>
<translation>Petit</translation>
</message>

View File

@ -268,36 +268,41 @@
<context>
<name>SettingsPane</name>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="20"/>
<location filename="../qml/panes/SettingsPane.qml" line="21"/>
<source>cwtch-settings-title</source>
<extracomment>Cwtch Settings title</extracomment>
<translation>Configurações do Cwtch</translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="46"/>
<location filename="../qml/panes/SettingsPane.qml" line="47"/>
<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="53"/>
<location filename="../qml/panes/SettingsPane.qml" line="54"/>
<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="71"/>
<location filename="../qml/panes/SettingsPane.qml" line="83"/>
<source>block-unknown-label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="90"/>
<source>large-text-label</source>
<translation>Grande</translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="79"/>
<location filename="../qml/panes/SettingsPane.qml" line="98"/>
<source>default-scaling-text</source>
<extracomment>&quot;Default size text (scale factor: &quot;</extracomment>
<translation>Texto tamanho padrão (fator de escala: </translation>
</message>
<message>
<location filename="../qml/panes/SettingsPane.qml" line="83"/>
<location filename="../qml/panes/SettingsPane.qml" line="102"/>
<source>small-text-label</source>
<translation>Pequeno</translation>
</message>

View File

@ -5,6 +5,7 @@ import QtQuick.Controls.Material 2.0
import QtQuick.Layouts 1.3
import QtQuick.Window 2.11
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import "../widgets"
import "../widgets/controls"
@ -66,6 +67,24 @@ ColumnLayout { // settingsPane
width: 400
}
CheckBox {
id: blockUnknownToggle
checked: true
onClicked: {
if (blockUnknownToggle.checked) {
gcd.blockUnknownPeers()
} else {
gcd.allowUnknownPeers()
}
}
style: CheckBoxStyle {
label: ScalingLabel {
text: qsTr("block-unknown-label")
}
}
}
ScalingLabel {
wrapMode: TextEdit.Wrap
text: qsTr("large-text-label")
@ -122,9 +141,10 @@ ColumnLayout { // settingsPane
Connections {
target: gcd
onSupplySettings: function(zoom, locale) {
onSupplySettings: function(zoom, locale, blockunknown) {
if (zoom != "") zoomSlider.value = zoom
// (locale is handled automatically by FlagButton)
blockUnknownToggle.checked = blockunknown
}
}
}