Skip to content

Commit

Permalink
Revert "Optimized windows clashing"
Browse files Browse the repository at this point in the history
This reverts commit bbd7ef1.
  • Loading branch information
gvrosun committed Apr 3, 2022
1 parent 6246d97 commit 265c683
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"os"
"strconv"
"strings"
"time"
)

func readCSV(fileName string, ch chan string) (int, dataframe.DataFrame) {
Expand All @@ -32,7 +33,7 @@ func generateRange(min int, max int) []int {
}

func processSplitting(fileName string, option string, numOf int, folder bool, progress *widget.ProgressBar, ch chan string) {

fmt.Println(fileName, option, numOf, folder)
if option == "" {
ch <- "Please select the chunk type"
return
Expand Down Expand Up @@ -71,6 +72,7 @@ func processSplitting(fileName string, option string, numOf int, folder bool, pr
totalChunks = float64(numOf)
}

fmt.Println(totalChunks, chunkRow)
start := 0
end := chunkRow
for i := 1.0; i <= totalChunks; i += 1.0 {
Expand Down Expand Up @@ -128,21 +130,19 @@ func main() {
a := app.New()
w := a.NewWindow("Split CSV")
w1 := a.NewWindow("Result")
w1.SetMaster()
w.CenterOnScreen()
w.Resize(fyne.Size{Width: 400, Height: 200})
entryOption := ""
isFolder := false
ch := make(chan string)
waitResult := false
CSVFileName := ""

fileName := widget.NewLabel("Detecting...")
go setFileName(fileName, ch)
go func() {
result := <-ch
if strings.Contains(result, "Error") {
waitResult = true
time.Sleep(time.Millisecond * 1000)
w.Close()
w1.SetContent(widget.NewLabel(result))
w1.CenterOnScreen()
Expand Down Expand Up @@ -186,11 +186,7 @@ func main() {
SubmitText: "Split Now",
CancelText: "Close",
}

w.SetContent(container.NewVBox(form, progress))
if waitResult {
w1.Show()
} else {
w.Show()
}
a.Run()
w.ShowAndRun()
}

0 comments on commit 265c683

Please sign in to comment.