mirror of
https://github.com/garraflavatra/rolens.git
synced 2024-11-22 10:25:48 +01:00
18 lines
370 B
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
|
|
}
|