diff --git a/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/settings/GlobalSettings.kt b/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/settings/GlobalSettings.kt index f6273ea4b..260788898 100644 --- a/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/settings/GlobalSettings.kt +++ b/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/settings/GlobalSettings.kt @@ -42,7 +42,7 @@ class GlobalSettings(guiProps: GuiProps, apiProperties: ApiProperties, component val homeReset = BalloonTipButton(null,guiProps.resetIcon,"Reset to default value",guiProps) { homeSetting.file = apiProperties.defaultHomeDirectory() } val homeChoose = BalloonTipButton(null,guiProps.folderIcon,"Select directory",guiProps) { val homeChooser = HomeDirChooser(apiProperties,"Home Directory Chooser") - if (homeChooser.showSaveDialog(mainFrame.frame) == JFileChooser.SAVE_DIALOG) { + if (homeChooser.showSaveDialog(mainFrame.frame) == JFileChooser.APPROVE_OPTION) { homeSetting.file = homeChooser.selectedFile.absoluteFile } } @@ -54,7 +54,7 @@ class GlobalSettings(guiProps: GuiProps, apiProperties: ApiProperties, component val javaReset = BalloonTipButton(null,guiProps.resetIcon,"Reset to default value",guiProps) { javaSetting.file = File(apiProperties.acquireJavaPath()).absoluteFile } val javaChoose = BalloonTipButton(null,guiProps.folderIcon,"Select executable",guiProps) { val javaChooser = JavaChooser(apiProperties,"Java Executable Chooser") - if (javaChooser.showSaveDialog(mainFrame.frame) == JFileChooser.SAVE_DIALOG) { + if (javaChooser.showSaveDialog(mainFrame.frame) == JFileChooser.APPROVE_OPTION) { javaSetting.file = javaChooser.selectedFile.absoluteFile } } @@ -66,7 +66,7 @@ class GlobalSettings(guiProps: GuiProps, apiProperties: ApiProperties, component val serverPacksReset = BalloonTipButton(null,guiProps.resetIcon,"Reset to default value",guiProps) { serverPacksSetting.file = apiProperties.defaultServerPacksDirectory() } val serverPacksChoose = BalloonTipButton(null,guiProps.folderIcon,"Select directory",guiProps) { val serverPackDirChooser = ServerPackDirChooser(apiProperties,"Server Pack Directory Chooser") - if (serverPackDirChooser.showSaveDialog(mainFrame.frame) == JFileChooser.SAVE_DIALOG) { + if (serverPackDirChooser.showSaveDialog(mainFrame.frame) == JFileChooser.APPROVE_OPTION) { serverPacksSetting.file = serverPackDirChooser.selectedFile.absoluteFile } } @@ -96,7 +96,7 @@ class GlobalSettings(guiProps: GuiProps, apiProperties: ApiProperties, component val scriptReset = BalloonTipButton(null,guiProps.resetIcon,"Reset to default value",guiProps) { scriptSetting.text = apiProperties.defaultScriptTemplates().joinToString(", ") } val scriptChoose = BalloonTipButton(null,guiProps.folderIcon,"Select directory",guiProps) { val scriptChooser = ScriptTemplatesChooser(apiProperties,"Script Template Chooser") - if (scriptChooser.showSaveDialog(mainFrame.frame) == JFileChooser.SAVE_DIALOG) { + if (scriptChooser.showSaveDialog(mainFrame.frame) == JFileChooser.APPROVE_OPTION) { scriptSetting.text = scriptChooser.selectedFiles.joinToString(", ") { it.absolutePath } } } diff --git a/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/settings/WebserviceSettings.kt b/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/settings/WebserviceSettings.kt index 134106ad3..ee98a56db 100644 --- a/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/settings/WebserviceSettings.kt +++ b/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/settings/WebserviceSettings.kt @@ -37,7 +37,7 @@ class WebserviceSettings(guiProps: GuiProps, apiProperties: ApiProperties, mainF val artemisDataDirectoryReset = BalloonTipButton(null,guiProps.resetIcon,"Reset to default value",guiProps) { artemisDataDirectorySetting.file = apiProperties.defaultArtemisDataDirectory().absoluteFile } val artemisDataDirectoryChoose = BalloonTipButton(null,guiProps.folderIcon,"Select directory",guiProps) { val artemisChooser = ArtemisDataDirChooser(apiProperties,"Artemis Data Directory Chooser") - if (artemisChooser.showSaveDialog(mainFrame.frame) == JFileChooser.SAVE_DIALOG) { + if (artemisChooser.showSaveDialog(mainFrame.frame) == JFileChooser.APPROVE_OPTION) { artemisDataDirectorySetting.file = artemisChooser.selectedFile.absoluteFile } } @@ -55,7 +55,7 @@ class WebserviceSettings(guiProps: GuiProps, apiProperties: ApiProperties, mainF val databaseFileReset = BalloonTipButton(null,guiProps.resetIcon,"Reset to default value",guiProps) { databaseFileSetting.file = apiProperties.defaultWebserviceDatabase().absoluteFile } val databaseFileChoose = BalloonTipButton(null,guiProps.folderIcon,"Select directory",guiProps) { val webserviceChooser = WebserviceDBDirChooser(apiProperties,"Webservice Database Directory Chooser") - if (webserviceChooser.showSaveDialog(mainFrame.frame) == JFileChooser.SAVE_DIALOG) { + if (webserviceChooser.showSaveDialog(mainFrame.frame) == JFileChooser.APPROVE_OPTION) { databaseFileSetting.file = File(webserviceChooser.selectedFile.absoluteFile,"serverpackcreator.db").absoluteFile } } @@ -73,7 +73,7 @@ class WebserviceSettings(guiProps: GuiProps, apiProperties: ApiProperties, mainF val logDirectoryReset = BalloonTipButton(null,guiProps.resetIcon,"Reset to default value",guiProps) { logDirectorySetting.file = apiProperties.defaultTomcatLogsDirectory().absoluteFile } val logDirectoryChoose = BalloonTipButton(null,guiProps.folderIcon,"Select directory",guiProps) { val logDirectoryChooser = TomcatLogDirChooser(apiProperties,"Tomcat Log Directory Chooser") - if (logDirectoryChooser.showSaveDialog(mainFrame.frame) == JFileChooser.SAVE_DIALOG) { + if (logDirectoryChooser.showSaveDialog(mainFrame.frame) == JFileChooser.APPROVE_OPTION) { logDirectorySetting.file = logDirectoryChooser.selectedFile.absoluteFile } } @@ -85,7 +85,7 @@ class WebserviceSettings(guiProps: GuiProps, apiProperties: ApiProperties, mainF val baseDirReset = BalloonTipButton(null,guiProps.resetIcon,"Reset to default value",guiProps) { baseDirSetting.file = apiProperties.defaultTomcatBaseDirectory().absoluteFile } val baseDirChoose = BalloonTipButton(null,guiProps.folderIcon,"Select directory",guiProps) { val baseDirChooser = TomcatBaseDirChooser(apiProperties,"Tomcat Base Directory Chooser") - if (baseDirChooser.showSaveDialog(mainFrame.frame) == JFileChooser.SAVE_DIALOG) { + if (baseDirChooser.showSaveDialog(mainFrame.frame) == JFileChooser.APPROVE_OPTION) { baseDirSetting.file = baseDirChooser.selectedFile.absoluteFile } }