Skip to content

Commit

Permalink
fix tips for zenity on other OS
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnywong committed Jul 13, 2024
1 parent c93a516 commit f40f870
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions trzsz/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ func zenityErrorWithTips(err error) error {
if err == zenity.ErrCanceled {
return errUserCanceled
}
if !isRunningOnLinux() || zenityExecutable() {
if isRunningOnMacOS() || isRunningOnWindows() || zenityExecutable() {
return fmt.Errorf("Open file dialog failed: %v", err)
}
tips := "'zenity' needs to be installed on the Linux Desktop."
tips := "'zenity' needs to be installed on your local Linux desktop."
if os.Getenv("WSL_DISTRO_NAME") == "" {
return simpleTrzszError(tips)
}
Expand All @@ -271,7 +271,7 @@ func (filter *TrzszFilter) chooseDownloadPath() (string, error) {
zenity.Directory(),
zenity.ShowHidden(),
}
if !isRunningOnLinux() {
if isRunningOnMacOS() || isRunningOnWindows() {
options = append(options, zenity.Attach(parentWindowID))
}
path, err := zenity.SelectFile(options...)
Expand Down Expand Up @@ -300,7 +300,7 @@ func (filter *TrzszFilter) chooseUploadPaths(directory bool) ([]string, error) {
if directory {
options = append(options, zenity.Directory())
}
if !isRunningOnLinux() {
if isRunningOnMacOS() || isRunningOnWindows() {
options = append(options, zenity.Attach(parentWindowID))
}
files, err := zenity.SelectFileMultiple(options...)
Expand Down

0 comments on commit f40f870

Please sign in to comment.