Fixed a couple bugs relating to settings and wine apps

This commit is contained in:
Caleb
2018-06-04 18:11:49 -05:00
parent be64aa083f
commit 828b9f4cda
3 changed files with 8 additions and 1 deletions
+6 -1
View File
@@ -20,6 +20,7 @@ type app struct {
icon *gdk.Pixbuf icon *gdk.Pixbuf
dir string dir string
ini *os.File ini *os.File
wine bool
} }
func (a *app) getTreeIter(store *gtk.TreeStore) *gtk.TreeIter { func (a *app) getTreeIter(store *gtk.TreeStore) *gtk.TreeIter {
@@ -242,7 +243,11 @@ func (a *app) edit(parent *gtk.Window, reload func()) {
nameTxt.SetHExpand(true) nameTxt.SetHExpand(true)
nameTxt.SetVExpand(false) nameTxt.SetVExpand(false)
nameTxt.SetBorderWindowSize(gtk.TEXT_WINDOW_BOTTOM, 5) nameTxt.SetBorderWindowSize(gtk.TEXT_WINDOW_BOTTOM, 5)
txtBuf.SetText(tmp.name) nameShow := tmp.name
if tmp.wine {
nameShow = strings.TrimSuffix(nameShow, " (Wine)")
}
txtBuf.SetText(nameShow)
vScrollName, _ := gtk.AdjustmentNew(0, 0, 0, 0, 0, 0) vScrollName, _ := gtk.AdjustmentNew(0, 0, 0, 0, 0, 0)
hScrollName, _ := gtk.AdjustmentNew(0, 0, 0, 0, 0, 0) hScrollName, _ := gtk.AdjustmentNew(0, 0, 0, 0, 0, 0)
nameScr, _ := gtk.ScrolledWindowNew(hScrollName, vScrollName) nameScr, _ := gtk.ScrolledWindowNew(hScrollName, vScrollName)
+1
View File
@@ -20,6 +20,7 @@ func settingsUI(parent *gtk.Window, onExit func()) {
win.SetDefaultSize(600, 300) win.SetDefaultSize(600, 300)
win.SetPosition(gtk.WIN_POS_CENTER_ON_PARENT) win.SetPosition(gtk.WIN_POS_CENTER_ON_PARENT)
win.Connect("destroy", func() { win.Connect("destroy", func() {
savePrefs()
parent.SetSensitive(true) parent.SetSensitive(true)
onExit() onExit()
}) })
+1
View File
@@ -114,6 +114,7 @@ func processApp(fold string) (out app) {
} }
if len(out.lin) == 0 { if len(out.lin) == 0 {
out.name += " (Wine)" out.name += " (Wine)"
out.wine = true
} }
return return
} }