Skip to content

Commit

Permalink
some UI polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
julsemaan committed Sep 11, 2018
1 parent e6b8a32 commit 539b34d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
3 changes: 2 additions & 1 deletion certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ func addCertToMachine(userCertDecode string, CERTUTIL_PROGRAM_PATH string) error

MainWindow{
AssignTo: &mw,
Title: T("enterCertificatePassword"),
Title: PROGRAM_NAME,
MinSize: Size{350, 100},
Layout: VBox{},
Children: []Widget{
Label{Text: T("enterCertificatePassword")},
LineEdit{AssignTo: &passwordTE, PasswordMode: true},
PushButton{
Text: "OK",
Expand Down
22 changes: 22 additions & 0 deletions hide_console.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package main

import (
"github.com/gonutz/ide/w32"
)

func hideConsole() {
console := w32.GetConsoleWindow()
if console == 0 {
return // no console attached
}
// If this application is the process that created the console window, then
// this program was not compiled with the -H=windowsgui flag and on start-up
// it created a console along with the main application window. In this case
// hide the console window.
// See
// http://stackoverflow.com/questions/9009333/how-to-check-if-the-program-is-run-from-a-console
_, consoleProcID := w32.GetWindowThreadProcessId(console)
if w32.GetCurrentProcessId() == consoleProcID {
w32.ShowWindowAsync(console, w32.SW_HIDE)
}
}
6 changes: 5 additions & 1 deletion parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import (
"howett.net/plist"
)

const PROGRAM_NAME = "PacketFence Provisioning Agent"

const CERTUTIL_PROGRAM_PATH = "C:\\Windows\\System32\\certutil.exe"
const WIFI_PEAP_TEMPLATE_NAME = "wireless PEAP template"
const WIFI_TLS_TEMPLATE_NAME = "wireless TLS template"
Expand Down Expand Up @@ -58,6 +60,8 @@ type Template struct {
type Handle uintptr

func main() {
hideConsole()

log.Println("==================== PacketFence Provisioning Agent ===================")

currentWorkingDirectory, err := os.Executable()
Expand Down Expand Up @@ -89,7 +93,7 @@ func main() {
var mw1 *walk.MainWindow
if _, err := (MainWindow{
AssignTo: &mw1,
Title: "PacketFence Provisioning Agent",
Title: PROGRAM_NAME,
MinSize: Size{400, 400},
Layout: VBox{},
Background: SolidColorBrush{Color: walk.RGB(4, 5, 3)},
Expand Down

0 comments on commit 539b34d

Please sign in to comment.