From 051a6e9ddc38b689df1de4e74082a85c2d341d37 Mon Sep 17 00:00:00 2001 From: Griefed Date: Wed, 26 Jul 2023 19:54:37 +0200 Subject: [PATCH] fix: Use save-dialog instead of open-dialog for config save as --- .../serverpackcreator/gui/window/menu/file/SaveConfigAsItem.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/menu/file/SaveConfigAsItem.kt b/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/menu/file/SaveConfigAsItem.kt index 563d25e2f..0a10452bb 100644 --- a/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/menu/file/SaveConfigAsItem.kt +++ b/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/menu/file/SaveConfigAsItem.kt @@ -49,7 +49,8 @@ class SaveConfigAsItem( */ private fun saveAs() { val configChooser = ConfigChooser(apiProperties, Gui.menubar_gui_menuitem_saveas_title.toString()) - if (configChooser.showOpenDialog(mainFrame) == JFileChooser.APPROVE_OPTION) { + configChooser.dialogType = JFileChooser.SAVE_DIALOG + if (configChooser.showSaveDialog(mainFrame) == JFileChooser.APPROVE_OPTION) { if (configChooser.selectedFile.path.endsWith(".conf")) { tabbedConfigsTab.selectedEditor!!.getCurrentConfiguration().save( configChooser.selectedFile.absoluteFile