Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
bitmask-vpn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vladimir KozLove
bitmask-vpn
Commits
59daf6c6
Unverified
Commit
59daf6c6
authored
6 years ago
by
meskio
Browse files
Options
Downloads
Patches
Plain Diff
[feat] don't need the cancel button
We can do just with two buttons and changing the names.
parent
1e55f578
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
systray.go
+5
-15
5 additions, 15 deletions
systray.go
transifex/messages.json
+0
-1
0 additions, 1 deletion
transifex/messages.json
with
5 additions
and
16 deletions
systray.go
+
5
−
15
View file @
59daf6c6
...
...
@@ -37,7 +37,6 @@ type bmTray struct {
mTurnOn
*
systray
.
MenuItem
mTurnOff
*
systray
.
MenuItem
mDonate
*
systray
.
MenuItem
mCancel
*
systray
.
MenuItem
activeGateway
*
gatewayTray
autostart
autostart
}
...
...
@@ -75,8 +74,6 @@ func (bt *bmTray) onReady() {
bt
.
mTurnOn
.
Hide
()
bt
.
mTurnOff
=
systray
.
AddMenuItem
(
printer
.
Sprintf
(
"Turn off"
),
""
)
bt
.
mTurnOff
.
Hide
()
bt
.
mCancel
=
systray
.
AddMenuItem
(
printer
.
Sprintf
(
"Cancel"
),
printer
.
Sprintf
(
"Cancel connection to %s"
,
applicationName
))
bt
.
mCancel
.
Hide
()
systray
.
AddSeparator
()
if
bt
.
conf
.
SelectGateway
{
...
...
@@ -114,11 +111,6 @@ func (bt *bmTray) onReady() {
bt
.
changeStatus
(
"stopping"
)
bt
.
bm
.
StopVPN
()
bt
.
conf
.
setUserStoppedVPN
(
true
)
case
<-
bt
.
mCancel
.
ClickedCh
:
log
.
Println
(
"cancel"
)
bt
.
changeStatus
(
"stopping"
)
bt
.
bm
.
StopVPN
()
bt
.
conf
.
setUserStoppedVPN
(
true
)
case
<-
mHelp
.
ClickedCh
:
open
.
Run
(
"https://riseup.net/vpn/support"
)
...
...
@@ -195,7 +187,6 @@ func (bt *bmTray) addGateways() {
}
func
(
bt
*
bmTray
)
changeStatus
(
status
string
)
{
bt
.
mTurnOn
.
SetTitle
(
printer
.
Sprintf
(
"Turn on"
))
if
bt
.
waitCh
!=
nil
{
bt
.
waitCh
<-
true
bt
.
waitCh
=
nil
...
...
@@ -205,25 +196,25 @@ func (bt *bmTray) changeStatus(status string) {
switch
status
{
case
"on"
:
systray
.
SetIcon
(
icon
.
On
)
bt
.
mTurnOff
.
SetTitle
(
printer
.
Sprintf
(
"Turn off"
))
statusStr
=
printer
.
Sprintf
(
"%s on"
,
applicationName
)
bt
.
mTurnOn
.
Hide
()
bt
.
mTurnOff
.
Show
()
bt
.
mCancel
.
Hide
()
case
"off"
:
systray
.
SetIcon
(
icon
.
Off
)
bt
.
mTurnOn
.
SetTitle
(
printer
.
Sprintf
(
"Turn on"
))
statusStr
=
printer
.
Sprintf
(
"%s off"
,
applicationName
)
bt
.
mTurnOn
.
Show
()
bt
.
mTurnOff
.
Hide
()
bt
.
mCancel
.
Hide
()
case
"starting"
:
bt
.
waitCh
=
make
(
chan
bool
)
go
bt
.
waitIcon
()
bt
.
mTurnOff
.
SetTitle
(
printer
.
Sprintf
(
"Cancel"
))
statusStr
=
printer
.
Sprintf
(
"Connecting to %s"
,
applicationName
)
bt
.
mTurnOn
.
Hide
()
bt
.
mTurnOff
.
Hide
()
bt
.
mCancel
.
Show
()
bt
.
mTurnOff
.
Show
()
case
"stopping"
:
bt
.
waitCh
=
make
(
chan
bool
)
...
...
@@ -231,15 +222,14 @@ func (bt *bmTray) changeStatus(status string) {
statusStr
=
printer
.
Sprintf
(
"Stopping %s"
,
applicationName
)
bt
.
mTurnOn
.
Hide
()
bt
.
mTurnOff
.
Hide
()
bt
.
mCancel
.
Hide
()
case
"failed"
:
systray
.
SetIcon
(
icon
.
Blocked
)
bt
.
mTurnOn
.
SetTitle
(
printer
.
Sprintf
(
"Retry"
))
bt
.
mTurnOff
.
SetTitle
(
printer
.
Sprintf
(
"Turn off"
))
statusStr
=
printer
.
Sprintf
(
"%s blocking internet"
,
applicationName
)
bt
.
mTurnOn
.
Show
()
bt
.
mTurnOff
.
Show
()
bt
.
mCancel
.
Hide
()
}
systray
.
SetTooltip
(
statusStr
)
...
...
This diff is collapsed.
Click to expand it.
transifex/messages.json
+
0
−
1
View file @
59daf6c6
...
...
@@ -2,7 +2,6 @@
"About"
:
"About"
,
"About..."
:
"About..."
,
"Cancel"
:
"Cancel"
,
"Cancel connection to {ApplicationName}"
:
"Cancel connection to {ApplicationName}"
,
"Checking status..."
:
"Checking status..."
,
"Connecting to {ApplicationName}"
:
"Connecting to {ApplicationName}"
,
"Donate"
:
"Donate"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment