diff --git a/CHANGELOG b/CHANGELOG index cbaf8224c8f562fd2737f97dddf73ef3717b8e73..2595c7d1c822f5b3d160ff497b6e7d46141f6c37 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,4 +4,5 @@ - First iteration of the gateway selector. - Allow to select obfs4 gateways (bridges) to bypass censorship. - Ability to define explicitly allowed addresses for local networks. -- Update translations. New locales: greek, farsi, hungarian, dutch, polish and uyghur. +- Make the donate dialog less intrusive (#470) +- Updated translations. New locales: greek, farsi, hungarian, dutch, polish and uyghur. diff --git a/gui/qml/VpnState.qml b/gui/qml/VpnState.qml index b18d6b5a06b8da4c885261d30f8845665f898ba5..86239e433ebf025fdfef109783a226fe8747e6ce 100644 --- a/gui/qml/VpnState.qml +++ b/gui/qml/VpnState.qml @@ -48,6 +48,12 @@ StateGroup { script: { Logic.setNeedsReconnect(false); brReconnect = false; + + if (needsDonate && !shownDonate) { + donate.visible = true; + shownDonate = true; + backend.donateSeen(); + } } } diff --git a/gui/qml/logic.js b/gui/qml/logic.js index 582b82490ee0bbe278aae3245221a046a3743863..10ebfcd6996773de392aa32ed5de2ba770bc70af 100644 --- a/gui/qml/logic.js +++ b/gui/qml/logic.js @@ -1,5 +1,13 @@ -let status = 'off'; -let needsReconnect = false; +var status = 'off'; +var needsReconnect = false; + +function setNeedsReconnect(val) { + needsReconnect = val; +} + +function getNeedsReconnect() { + return needsReconnect; +} function setStatus(st) { status = st; @@ -9,12 +17,8 @@ function getStatus() { return status; } -function setNeedsReconnect(val) { - needsReconnect = val; -} - -function getNeedsReconnect() { - return needsReconnect; +function setNeedsDonate(val) { + needsDonate = val; } function toHuman(st) { diff --git a/gui/qml/main.qml b/gui/qml/main.qml index e0a9a8171e679a6602cd6770330a35ba8c41462e..e12c61da6f3dec2657b0112d53fb16ff10300fcb 100644 --- a/gui/qml/main.qml +++ b/gui/qml/main.qml @@ -21,7 +21,8 @@ ApplicationWindow { property var loginDone property var allowEmptyPass property var needsRestart - + property var needsDonate + property var shownDonate onSceneGraphError: function(error, msg) { console.debug("ERROR while initializing scene") @@ -189,9 +190,7 @@ ApplicationWindow { gwSelector.model = Object.keys(ctx.locations) if (ctx.donateDialog == 'true') { - console.debug(jsonModel.getJson()) - donate.visible = true - backend.donateSeen() + Logic.setNeedsDonate(true); } if (ctx.loginDialog == 'true') { console.debug(jsonModel.getJson()) @@ -276,6 +275,7 @@ ApplicationWindow { loginDone = false allowEmptyPass = Logic.shouldAllowEmptyPass(providers) needsRestart = false; + shownDonate = false; if (!systrayAvailable) { app.visible = true app.raise() diff --git a/pkg/backend/donate.go b/pkg/backend/donate.go index c16c0f4e9f91f8518630f5f19d4650a223cb42c7..98f9e6ba3767dfea3f21ada7a6c861e324484693 100644 --- a/pkg/backend/donate.go +++ b/pkg/backend/donate.go @@ -15,6 +15,8 @@ func runDonationReminder() { } } }() + // to test manually, uncomment this line. + // time.AfterFunc(1*time.Minute, func() { showDonate() }) } func needsDonationReminder() bool {