Finished up downloading

This commit is contained in:
Belac Darkstorm
2017-04-09 01:44:02 -05:00
parent 695ce815d9
commit a0213d1886
4 changed files with 7 additions and 7 deletions
+1 -3
View File
@@ -1,13 +1,11 @@
package appimg
type appimg struct {
url string
name string
}
func newApp(url, name string) appimg {
func newApp(name string) appimg {
var out appimg
out.url = url
out.name = name
return out
}
+2 -1
View File
@@ -28,6 +28,7 @@ func downloadApp(parent *gtk.Window, ap appimg) {
box.Add(spn)
box.Add(lbl)
win.Add(box)
win.SetPosition(gtk.WIN_POS_CENTER_ON_PARENT)
win.ShowAll()
win.Show()
go func(win *gtk.Window, ap appimg) {
@@ -38,7 +39,7 @@ func downloadApp(parent *gtk.Window, ap appimg) {
return nil
},
}
resp, err := check.Get(urlBase + ap.url)
resp, err := check.Get(urlBase + ap.name)
if err != nil {
fmt.Println(err)
return
+3 -2
View File
@@ -40,6 +40,7 @@ func ShowUI(clsFunc func()) {
downloadApp(win, apps[appList.GetSelectedRow().GetIndex()])
}
})
win.SetPosition(gtk.WIN_POS_CENTER_ON_PARENT)
win.ShowAll()
win.Show()
getList(win, apch)
@@ -56,7 +57,7 @@ func ShowUI(clsFunc func()) {
}
func getList(parent *gtk.Window, apch chan appimg) {
win, _ := gtk.WindowNew(gtk.WINDOW_TOPLEVEL)
win, _ := gtk.WindowNew(gtk.WINDOW_POPUP)
win.SetTransientFor(parent)
win.SetDestroyWithParent(true)
win.Connect("destroy", func() {
@@ -102,7 +103,7 @@ func getList(parent *gtk.Window, apch chan appimg) {
tgs := convert(string(btys))
for _, v := range tgs {
if strings.HasSuffix(strings.ToLower(v.Meat), ".appimage") {
apch <- newApp(v.value("href"), v.Meat)
apch <- newApp(v.Meat)
}
}
close(apch)