Unverified Commit a8e1ad26 authored by Kali Kaneko's avatar Kali Kaneko
Browse files

[feat] donate menuitem is configurable

parent 267b606e
Pipeline #28215 passed with stages
in 31 minutes and 40 seconds
......@@ -39,7 +39,7 @@ helpURL = https://calyx.net/support
geolocationAPI = https://api.black.riseup.net:9001/json
askForDonations = true
askForDonations = false
donateURL = http://example.org
[demo]
......
......@@ -20,7 +20,8 @@ def getProviderData(provider, config):
keys = ('name', 'applicationName', 'binaryName',
'providerURL', 'tosURL', 'helpURL',
'donateURL', 'apiURL', 'geolocationAPI', 'caCertString')
'askForDonations', 'donateURL', 'apiURL',
'geolocationAPI', 'caCertString')
for value in keys:
d[value] = c.get(value)
......
......@@ -10,7 +10,7 @@ from provider import getDefaultProvider
from provider import getProviderData
OUTFILE = 'config.go'
INFILE = '../templates/golang/config.go'
INFILE = '../templates/bitmaskvpn/config.go'
CONFIGFILE = '../config/vendor.conf'
SCRIPT_NAME = 'vendorize'
......
......@@ -11,6 +11,7 @@ const (
ApplicationName = "$applicationName"
BinaryName = "$binaryName"
DonateURL = "$donateURL"
AskForDonations = "$askForDonations"
HelpURL = "$helpURL"
TosURL = "$tosURL"
APIURL = "$apiURL"
......
// Code generated by go generate; DO NOT EDIT.
// This file was generated by vendorize.py
// At 2019-08-16 12:44:37
// At 2019-10-11 16:05:25
package config
......@@ -11,6 +11,7 @@ const (
ApplicationName = "RiseupVPN"
BinaryName = "riseup-vpn"
DonateURL = "https://riseup.net/donate"
AskForDonations = "true"
HelpURL = "https://riseup.net/support"
TosURL = "https://riseup.net/tos"
APIURL = "https://api.black.riseup.net/"
......
......@@ -20,6 +20,7 @@ import (
"log"
"os"
"os/signal"
"strconv"
"time"
"0xacab.org/leap/bitmask-vpn/icon"
......@@ -88,10 +89,21 @@ func (bt *bmTray) setUpSystray() {
bt.mHelp = systray.AddMenuItem(printer.Sprintf("Help..."), "")
bt.mDonate = systray.AddMenuItem(printer.Sprintf("Donate..."), "")
bt.mAbout = systray.AddMenuItem(printer.Sprintf("About..."), "")
systray.AddSeparator()
bt.mQuit = systray.AddMenuItem(printer.Sprintf("Quit"), "")
showDonate, err := strconv.ParseBool(config.AskForDonations)
if err != nil {
log.Printf("Error parsing AskForDonations: %v", err)
showDonate = true
}
if !showDonate {
bt.mDonate.Hide()
}
}
func (bt *bmTray) loop(bm bitmask.Bitmask, notify *notificator, as bitmask.Autostart) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment