This commit is contained in:
Nuno Cruces 2021-03-02 17:51:12 +00:00
parent 80459ed6ff
commit c214d2b6ff
2 changed files with 14 additions and 4 deletions

View file

@ -1,12 +1,12 @@
#!/bin/bash
GOOS=windows GOARCH=386 go build -ldflags="-s -w" &&
GOOS=windows GOARCH=386 go build -ldflags="-s -w" -trimpath &&
zip -9 zenity_win32.zip zenity.exe
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" &&
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -trimpath &&
zip -9 zenity_win64.zip zenity.exe
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" &&
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -trimpath &&
zip -9 zenity_macos.zip zenity
go build

View file

@ -129,7 +129,7 @@ func setupFlags() {
// Message options
flag.StringVar(&text, "text", "", "Set the dialog text")
flag.StringVar(&icon, "icon-name", "", "Set the dialog icon (error, info, question, warning)")
flag.StringVar(&icon, "icon-name", "", "Set the dialog icon (dialog-error, dialog-information, dialog-question, dialog-warning)")
flag.StringVar(&okLabel, "ok-label", "", "Set the label of the OK button")
flag.StringVar(&cancelLabel, "cancel-label", "", "Set the label of the Cancel button")
flag.StringVar(&extraButton, "extra-button", "", "Add an extra button")
@ -202,6 +202,16 @@ func loadFlags() []zenity.Option {
// Message options
var ico zenity.DialogIcon
switch {
case errorDlg:
ico = zenity.ErrorIcon
case infoDlg:
ico = zenity.InfoIcon
case warningDlg:
ico = zenity.WarningIcon
case questionDlg:
ico = zenity.QuestionIcon
}
switch icon {
case "error", "dialog-error":
ico = zenity.ErrorIcon