Skip to content

Commit

Permalink
remove fallback ui
Browse files Browse the repository at this point in the history
  • Loading branch information
arguablykomodo committed May 19, 2019
1 parent f2f7995 commit d2b27ff
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 85 deletions.
68 changes: 0 additions & 68 deletions fallbackui.go

This file was deleted.

14 changes: 1 addition & 13 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,12 @@ package main

import (
"os"

"github.com/gen2brain/dlgs"
)

func checkErr(msg string, err error) {
if err != nil {
dlgs.Error("Shadowfox Updater", msg+"\n"+err.Error())
panic(err)
}
}

func main() {
if len(os.Args) > 1 {
cli()
} else {
err := createUI()
if err != nil {
createFallbackUI()
}
createUI()
}
}
14 changes: 10 additions & 4 deletions ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@ import (
"github.com/gen2brain/dlgs"
)

func createUI() error {
func checkErr(msg string, err error) {
if err != nil {
dlgs.Error("Shadowfox Updater", msg+"\n"+err.Error())
panic(err)
}
}

func createUI() {
paths, names := getProfilePaths()

name, selected, err := dlgs.List("Shadowfox Updater", "Which Firefox profile are you going to use?", names)
checkErr("", err)
if !selected {
dlgs.Info("Shadowfox Updater", "You didn't pick any profile, the application will now close.")
return nil
return
}

pathIndex := 0
Expand All @@ -27,7 +34,7 @@ func createUI() error {
checkErr("", err)
if !selected {
dlgs.Info("Shadowfox Updater", "You didn't pick any action, the application will now close.")
return nil
return
}

if action == "Install/Update Shadowfox" {
Expand All @@ -51,5 +58,4 @@ func createUI() error {
checkErr(msg, err)
}
}
return nil
}

0 comments on commit d2b27ff

Please sign in to comment.