1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2024-11-22 10:25:48 +01:00
rolens/internal/ui/dialogs.go

18 lines
370 B
Go

package ui
import "github.com/ncruces/zenity"
func (u *UI) OpenDirectory(title string) string {
if title == "" {
title = "Choose a directory"
}
dir, err := zenity.SelectFile(zenity.Title(title), zenity.Directory(), zenity.Modal())
if err != nil && err != zenity.ErrCanceled {
zenity.Error("Error while opening directory", zenity.ErrorIcon)
}
return dir
}