Skip to content

Commit

Permalink
Finished up downloading
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebQ42 committed Apr 9, 2017
1 parent 695ce81 commit a0213d1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 1 addition & 3 deletions appimg/appimg.go
Original file line number Diff line number Diff line change
@@ -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
}
3 changes: 2 additions & 1 deletion appimg/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions appimg/installui.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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() {
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func getIcon(fold string) *gdk.Pixbuf {
pic = fold + "/appicon.png"
} else {
img, _ := gtk.ImageNewFromIconName("application-x-executable", gtk.ICON_SIZE_BUTTON)
buf, _ := img.GetPixbuf().ScaleSimple(32, 32, gdk.INTERP_BILINEAR)
buf := img.GetPixbuf()
return buf
}
img, _ := gtk.ImageNewFromFile(pic)
Expand Down

0 comments on commit a0213d1

Please sign in to comment.