Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Cleanup unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
achhabra2 committed Dec 29, 2021
1 parent 3fc728a commit 58f8d57
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (b *App) shutdown(ctx context.Context) {

// Greet returns a greeting for the given name
func (b *App) OpenDirectoryDialog() ([]string, error) {
opts := runtime.OpenDialogOptions{Title: "Select Directory", DefaultDirectory: b.GetDownloadsFolder()}
opts := runtime.OpenDialogOptions{Title: "Select Directory", DefaultDirectory: b.UserPrefs.DownloadsDirectory}
selection, err := runtime.OpenDirectoryDialog(b.ctx, opts)
if err != nil {
runtime.LogError(b.ctx, "Error opening dialog")
Expand All @@ -92,7 +92,7 @@ func (b *App) OpenDirectoryDialog() ([]string, error) {
}

func (b *App) OpenFilesDialog() ([]string, error) {
opts := runtime.OpenDialogOptions{Title: "Select File", DefaultDirectory: b.GetDownloadsFolder()}
opts := runtime.OpenDialogOptions{Title: "Select File", DefaultDirectory: b.UserPrefs.DownloadsDirectory}
selection, err := runtime.OpenMultipleFilesDialog(b.ctx, opts)
if err != nil {
runtime.LogError(b.ctx, "Error opening dialog")
Expand Down Expand Up @@ -350,10 +350,6 @@ func (b *App) UpdateCheckUI() {
}
}

func (b *App) GetDownloadsFolder() string {
return b.UserPrefs.DownloadsDirectory
}

func (b *App) GetCurrentVersion() string {
return update.Version
}
Expand All @@ -363,7 +359,7 @@ func (b *App) GetLogPath() string {
}

func (b *App) SetDownloadsFolder() string {
opts := runtime.OpenDialogOptions{Title: "Select Directory", DefaultDirectory: b.GetDownloadsFolder()}
opts := runtime.OpenDialogOptions{Title: "Select Directory", DefaultDirectory: b.UserPrefs.DownloadsDirectory}
selection, err := runtime.OpenDirectoryDialog(b.ctx, opts)
if err != nil {
runtime.LogInfo(b.ctx, "Error opening dialog")
Expand All @@ -380,20 +376,12 @@ func (b *App) SetOverwriteParam(val bool) bool {
return b.c.OverwriteExisting
}

func (b *App) GetOverwriteParam() bool {
return b.c.OverwriteExisting
}

func (b *App) SetNotificationsParam(val bool) bool {
b.c.Notifications = val
b.UserPrefs.Notifications = val
return b.c.Notifications
}

func (b *App) GetNotificationsParam() bool {
return b.c.Notifications
}

func (b *App) GetSelectedFiles() []string {
return b.selectedFiles
}
Expand Down

0 comments on commit 58f8d57

Please sign in to comment.