From ccfed81938705d943463415608dbe9cb94d35397 Mon Sep 17 00:00:00 2001 From: Jerome Le Saux Date: Wed, 1 May 2024 23:49:49 +0200 Subject: [PATCH] fix: fix export in main ui --- ui/martine-ui/egx_export.go | 2 +- ui/martine-ui/egx_tab.go | 2 +- ui/martine-ui/export_dialog.go | 84 --------------------------------- ui/martine-ui/export_tilemap.go | 2 +- ui/martine-ui/tilemap_tab.go | 2 +- 5 files changed, 4 insertions(+), 88 deletions(-) delete mode 100644 ui/martine-ui/export_dialog.go diff --git a/ui/martine-ui/egx_export.go b/ui/martine-ui/egx_export.go index ab62c76..fc0a86f 100644 --- a/ui/martine-ui/egx_export.go +++ b/ui/martine-ui/egx_export.go @@ -110,7 +110,7 @@ func (m *MartineUI) exportEgxDialog(ie *menu.ImageExport, w fyne.Window) { func (m *MartineUI) ExportEgxImage(me *menu.DoubleImageMenu) { pi := wgt.NewProgressInfinite("Saving...., please wait.", m.window) pi.Show() - cfg := me.LeftImage.NewConfig(m.imageExport, true) + cfg := me.LeftImage.NewConfig(m.egxExport, true) if cfg == nil { pi.Hide() return diff --git a/ui/martine-ui/egx_tab.go b/ui/martine-ui/egx_tab.go index 535c3cf..c392747 100644 --- a/ui/martine-ui/egx_tab.go +++ b/ui/martine-ui/egx_tab.go @@ -68,7 +68,7 @@ func (m *MartineUI) MergeImages(di *menu.DoubleImageMenu) { palette = di.RightImage.Palette() secondIm = di.LeftImage } - cfg := im.NewConfig(m.imageExport, false) + cfg := im.NewConfig(m.egxExport, false) if cfg == nil { return } diff --git a/ui/martine-ui/export_dialog.go b/ui/martine-ui/export_dialog.go deleted file mode 100644 index 06bfb4c..0000000 --- a/ui/martine-ui/export_dialog.go +++ /dev/null @@ -1,84 +0,0 @@ -package ui - -// // nolint: funlen -// func (m *MartineUI) exportDialog(ie *menu.ImageExport, w fyne.Window) { -// m2host := widget.NewEntry() -// m2host.SetPlaceHolder("Set your M2 IP here.") -// ie.Reset() - -// cont := container.NewVBox( -// container.NewHBox( -// widget.NewCheck("import all file in Dsk", func(b bool) { -// ie.ExportDsk = b -// }), -// widget.NewCheck("export as Go1 and Go2 files", func(b bool) { -// ie.ExportAsGoFiles = b -// }), -// widget.NewCheck("export text file", func(b bool) { -// ie.ExportText = b -// }), -// widget.NewCheck("export Json file", func(b bool) { -// ie.ExportJson = b -// }), -// widget.NewCheck("add amsdos header", func(b bool) { -// ie.ExportWithAmsdosHeader = b -// }), -// widget.NewCheck("apply zigzag", func(b bool) { -// ie.ExportZigzag = b -// }), -// widget.NewCheck("export to M2", func(b bool) { -// ie.ExportToM2 = b -// ie.M2IP = m2host.Text -// }), -// ), - -// widget.NewLabel("Compression type:"), -// widget.NewSelect([]string{"none", "rle", "rle 16bits", "Lz4 Classic", "Lz4 Raw", "zx0 crunch"}, -// func(s string) { -// switch s { -// case "none": -// ie.ExportCompression = 0 -// case "rle": -// ie.ExportCompression = 1 -// case "rle 16bits": -// ie.ExportCompression = 2 -// case "Lz4 Classic": -// ie.ExportCompression = 3 -// case "Lz4 Raw": -// ie.ExportCompression = 4 -// case "zx0 crunch": -// ie.ExportCompression = 5 -// } -// }), -// m2host, -// widget.NewButtonWithIcon("Export into folder", theme.DocumentSaveIcon(), func() { -// fo := dialog.NewFolderOpen(func(lu fyne.ListableURI, err error) { -// if err != nil { -// dialog.ShowError(err, m.window) -// return -// } -// if lu == nil { -// // cancel button -// return -// } -// directory.SetExportDirectoryURI(lu) -// ie.ExportFolderPath = lu.Path() -// log.GetLogger().Infoln(ie.ExportFolderPath) -// // m.ExportOneImage(m.main) -// m.main.ExportImage(m.imageExport, m.window, m.main.NewConfig) -// // apply and export -// }, m.window) -// d, err := directory.ExportDirectoryURI() -// if err == nil { -// fo.SetLocation(d) -// } -// fo.Resize(savingDialogSize) - -// m.CheckAmsdosHeaderExport(m.imageExport.ExportDsk, m.imageExport.ExportWithAmsdosHeader, fo, m.window) -// }), -// ) - -// d := dialog.NewCustom("Export options", "Ok", cont, w) -// d.Resize(w.Canvas().Size()) -// d.Show() -// } diff --git a/ui/martine-ui/export_tilemap.go b/ui/martine-ui/export_tilemap.go index 61e80ed..8529bf1 100644 --- a/ui/martine-ui/export_tilemap.go +++ b/ui/martine-ui/export_tilemap.go @@ -122,7 +122,7 @@ func (m *MartineUI) exportTilemapDialog(w fyne.Window) { func (m *MartineUI) ExportTilemap(t *menu.TilemapMenu) { pi := wgt.NewProgressInfinite("Saving...., Please wait.", m.window) pi.Show() - cfg := t.ImageMenu.NewConfig(m.imageExport, true) + cfg := t.ImageMenu.NewConfig(m.tilemapExport, true) cfg.OutputPath = t.ExportFolderPath if m.IsClassicalTilemap(cfg.Size.Width, cfg.Size.Height) && !m.tilemap.IsSprite { filename := filepath.Base(t.OriginalImagePath()) diff --git a/ui/martine-ui/tilemap_tab.go b/ui/martine-ui/tilemap_tab.go index d6bc43b..baa61d3 100644 --- a/ui/martine-ui/tilemap_tab.go +++ b/ui/martine-ui/tilemap_tab.go @@ -39,7 +39,7 @@ func (m *MartineUI) IsClassicalTilemap(width, height int) bool { } func (m *MartineUI) TilemapApply(me *menu.TilemapMenu) { - cfg := me.ImageMenu.NewConfig(m.imageExport, true) + cfg := me.ImageMenu.NewConfig(m.tilemapExport, true) if cfg == nil { return }