Skip to content

Commit

Permalink
v1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
rocket049 committed Jun 11, 2020
1 parent 22b2073 commit 16b49c4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mainwindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ func (a *MyApp) showCmdWin(cfg *JsonCmd, filename string) {
line := a.createLine(name, entry, dialog)
entry.ConnectMouseDoubleClickEvent(func(e *gui.QMouseEvent) {
home, _ := os.UserHomeDir()
if len(wdEntry.Text()) > 0 {
home = wdEntry.Text()
}
dir1 := widgets.QFileDialog_GetExistingDirectory(dialog, name, home, widgets.QFileDialog__ShowDirsOnly)
entry.SetText(dir1)
optMap[opt] = dir1
Expand All @@ -188,6 +191,9 @@ func (a *MyApp) showCmdWin(cfg *JsonCmd, filename string) {
line := a.createLine(name, entry, dialog)
entry.ConnectMouseDoubleClickEvent(func(e *gui.QMouseEvent) {
home, _ := os.UserHomeDir()
if len(wdEntry.Text()) > 0 {
home = wdEntry.Text()
}
path1 := widgets.QFileDialog_GetOpenFileName(dialog, name, home, "*", "*", widgets.QFileDialog__ReadOnly)
entry.SetText(path1)
optMap[opt] = path1
Expand Down Expand Up @@ -220,6 +226,9 @@ func (a *MyApp) showCmdWin(cfg *JsonCmd, filename string) {
line := a.createLine(name, entry, dialog)
entry.ConnectMouseDoubleClickEvent(func(e *gui.QMouseEvent) {
home, _ := os.UserHomeDir()
if len(wdEntry.Text()) > 0 {
home = wdEntry.Text()
}
path1 := widgets.QFileDialog_GetExistingDirectory(dialog, name, home, widgets.QFileDialog__ShowDirsOnly)
entry.SetText(path1)
})
Expand All @@ -236,6 +245,9 @@ func (a *MyApp) showCmdWin(cfg *JsonCmd, filename string) {
line := a.createLine(name, entry, dialog)
entry.ConnectMouseDoubleClickEvent(func(e *gui.QMouseEvent) {
home, _ := os.UserHomeDir()
if len(wdEntry.Text()) > 0 {
home = wdEntry.Text()
}
path1 := widgets.QFileDialog_GetOpenFileName(dialog, name, home, "*", "*", widgets.QFileDialog__ReadOnly)
entry.SetText(path1)
})
Expand Down

0 comments on commit 16b49c4

Please sign in to comment.