cli/display/window.go
google-labs-jules[bot] 31d29711c0 chore: Remove failing openpgp tests
Removes the failing tests for the `crypt/lib/openpgp` package at the user's request.
2025-10-23 12:41:14 +00:00

28 lines
863 B
Go

package display
import "github.com/wailsapp/wails/v3/pkg/application"
// OpenWindow creates and shows a new webview window.
// This function is callable from the frontend.
func (s *Service) OpenWindow(name string, options application.WebviewWindowOptions) {
// Check if a window with that name already exists
if window, exists := s.app.Window.GetByName(name); exists {
window.Focus()
return
}
window := s.app.Window.NewWithOptions(options)
s.windowHandles[name] = window
window.Show()
}
// SelectDirectory opens a directory selection dialog and returns the selected path.
func (s *Service) SelectDirectory() (string, error) {
dialog := application.OpenFileDialog()
dialog.SetTitle("Select Project Directory")
if path, err := dialog.PromptForSingleSelection(); err == nil {
// Use selected directory path
return path, nil
}
return "", nil
}