Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
Update icons for new security level names
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Apr 30, 2020
1 parent 93af1f4 commit 5fe9547
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package icons

var FortressICO []byte = []byte{
var ExtremeICO []byte = []byte{
0x00, 0x00, 0x01, 0x00, 0x06, 0x00, 0x10, 0x10, 0x00, 0x00, 0x01, 0x00,
0x20, 0x00, 0x68, 0x04, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x20, 0x20,
0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0xa8, 0x10, 0x00, 0x00, 0xce, 0x04,
Expand Down
2 changes: 1 addition & 1 deletion notifier/icons/icoSecure.go → notifier/icons/icoHigh.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package icons

var SecureICO []byte = []byte{
var HighICO []byte = []byte{
0x00, 0x00, 0x01, 0x00, 0x06, 0x00, 0x10, 0x10, 0x00, 0x00, 0x01, 0x00,
0x20, 0x00, 0x68, 0x04, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x20, 0x20,
0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0xa8, 0x10, 0x00, 0x00, 0xce, 0x04,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package icons

var DynamicICO []byte = []byte{
var NormalICO []byte = []byte{
0x00, 0x00, 0x01, 0x00, 0x06, 0x00, 0x10, 0x10, 0x00, 0x00, 0x01, 0x00,
0x20, 0x00, 0x68, 0x04, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x20, 0x20,
0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0xa8, 0x10, 0x00, 0x00, 0xce, 0x04,
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
6 changes: 3 additions & 3 deletions notifier/icons/icos.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ var (
// ICOs holds all the security level icons as .ICOs
ICOs = [][]byte{
OffICO,
DynamicICO,
SecureICO,
FortressICO,
NormalICO,
HighICO,
ExtremeICO,
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package icons

var Fortress128PNG []byte = []byte{
var Extreme128PNG []byte = []byte{
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80,
0x08, 0x06, 0x00, 0x00, 0x00, 0xc3, 0x3e, 0x61, 0xcb, 0x00, 0x00, 0x00,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package icons

var Secure128PNG []byte = []byte{
var High128PNG []byte = []byte{
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80,
0x08, 0x06, 0x00, 0x00, 0x00, 0xc3, 0x3e, 0x61, 0xcb, 0x00, 0x00, 0x00,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package icons

var Dynamic128PNG []byte = []byte{
var Normal128PNG []byte = []byte{
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80,
0x08, 0x06, 0x00, 0x00, 0x00, 0xc3, 0x3e, 0x61, 0xcb, 0x00, 0x00, 0x00,
Expand Down
6 changes: 3 additions & 3 deletions notifier/icons/pngs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ var (
// PNGs holds all the security level icons as .PNGs
PNGs = [][]byte{
Off128PNG,
Dynamic128PNG,
Secure128PNG,
Fortress128PNG,
Normal128PNG,
High128PNG,
Extreme128PNG,
}
)
20 changes: 10 additions & 10 deletions notifier/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (

// Security Level constants
const (
SecurityLevelOffline uint8 = 0
SecurityLevelDynamic uint8 = 1
SecurityLevelSecure uint8 = 2
SecurityLevelFortress uint8 = 4
SecurityLevelOffline uint8 = 0
SecurityLevelNormal uint8 = 1
SecurityLevelHigh uint8 = 2
SecurityLevelExtreme uint8 = 4

systemStatusKey = "core:status/status"
)
Expand Down Expand Up @@ -102,12 +102,12 @@ func fmtLevel(level uint8, active bool) string {
return "Offline"
}
return "Autopilot"
case SecurityLevelDynamic:
return "Dynamic"
case SecurityLevelSecure:
return "Secure"
case 3, SecurityLevelFortress:
return "Fortress"
case SecurityLevelNormal:
return "Normal"
case SecurityLevelHigh:
return "High"
case SecurityLevelExtreme:
return "Extreme"
}
return "Unknown"
}
Expand Down
20 changes: 10 additions & 10 deletions notifier/tray.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,22 @@ func onReady() {
SelectSecurityLevel(0)
})

menuItemLevelDynamic := systray.AddMenuItem("Level Dynamic", "")
go clickListener(menuItemLevelDynamic, func() {
SelectSecurityLevel(SecurityLevelDynamic)
menuItemLevelNormal := systray.AddMenuItem("Level Dynamic", "")
go clickListener(menuItemLevelNormal, func() {
SelectSecurityLevel(SecurityLevelNormal)
})

menuItemLevelSecure := systray.AddMenuItem("Level Secure", "")
go clickListener(menuItemLevelSecure, func() {
SelectSecurityLevel(SecurityLevelSecure)
menuItemLevelHigh := systray.AddMenuItem("Level Secure", "")
go clickListener(menuItemLevelHigh, func() {
SelectSecurityLevel(SecurityLevelHigh)
})

menuItemLevelFortess := systray.AddMenuItem("Level Fortess", "")
go clickListener(menuItemLevelFortess, func() {
SelectSecurityLevel(SecurityLevelFortress)
menuItemLevelExtreme := systray.AddMenuItem("Level Fortess", "")
go clickListener(menuItemLevelExtreme, func() {
SelectSecurityLevel(SecurityLevelExtreme)
})

menuLevelItems = [4]*systray.MenuItem{menuItemAutopilot, menuItemLevelDynamic, menuItemLevelSecure, menuItemLevelFortess}
menuLevelItems = [4]*systray.MenuItem{menuItemAutopilot, menuItemLevelNormal, menuItemLevelHigh, menuItemLevelExtreme}

// menu: threat info
systray.AddSeparator()
Expand Down

0 comments on commit 5fe9547

Please sign in to comment.