diff --git a/launcher-gtk/src/main/kotlin/io/gitlab/jfronny/inceptum/gtk/GtkEnvBackend.kt b/launcher-gtk/src/main/kotlin/io/gitlab/jfronny/inceptum/gtk/GtkEnvBackend.kt index e069d0b..a8c672b 100644 --- a/launcher-gtk/src/main/kotlin/io/gitlab/jfronny/inceptum/gtk/GtkEnvBackend.kt +++ b/launcher-gtk/src/main/kotlin/io/gitlab/jfronny/inceptum/gtk/GtkEnvBackend.kt @@ -2,6 +2,7 @@ package io.gitlab.jfronny.inceptum.gtk import io.gitlab.jfronny.commons.StringFormatter import io.gitlab.jfronny.inceptum.common.Utils +import io.gitlab.jfronny.inceptum.gtk.util.I18n import io.gitlab.jfronny.inceptum.gtk.window.dialog.MicrosoftLoginDialog import io.gitlab.jfronny.inceptum.gtk.window.dialog.StringInputDialog import io.gitlab.jfronny.inceptum.launcher.LauncherEnv.EnvBackend @@ -78,6 +79,23 @@ object GtkEnvBackend : EnvBackend { dialog.message = title dialog.detail = markup dialog.modal = true + when { + cancel == null -> { + dialog.setButtons(arrayOf(I18n["ok"])) + dialog.defaultButton = 0 + dialog.cancelButton = -1 + } + ok == null -> { + dialog.setButtons(arrayOf("Cancel")) + dialog.defaultButton = -1 + dialog.cancelButton = 0 + } + else -> { + dialog.setButtons(arrayOf("OK", "Cancel")) + dialog.defaultButton = 0 + dialog.cancelButton = 1 + } + } dialog.choose(parent, Cancellable()) { _, res, _ -> val result = dialog.chooseFinish(res) val cancelIdx = dialog.cancelButton diff --git a/launcher-gtk/src/main/kotlin/io/gitlab/jfronny/inceptum/gtk/GtkMain.kt b/launcher-gtk/src/main/kotlin/io/gitlab/jfronny/inceptum/gtk/GtkMain.kt index ed0c393..e271718 100644 --- a/launcher-gtk/src/main/kotlin/io/gitlab/jfronny/inceptum/gtk/GtkMain.kt +++ b/launcher-gtk/src/main/kotlin/io/gitlab/jfronny/inceptum/gtk/GtkMain.kt @@ -37,7 +37,7 @@ object GtkMain { AccountManager.loadAccounts() GtkMenubar.create(this) val window = MainWindow(this) - window.show() + window.visible = true GtkEnvBackend.dialogParent = window window.onCloseRequest { GtkEnvBackend.dialogParent = null diff --git a/launcher-gtk/src/main/kotlin/io/gitlab/jfronny/inceptum/gtk/window/create/NewInstanceWindow.kt b/launcher-gtk/src/main/kotlin/io/gitlab/jfronny/inceptum/gtk/window/create/NewInstanceWindow.kt index d83bf1e..bc52ccb 100644 --- a/launcher-gtk/src/main/kotlin/io/gitlab/jfronny/inceptum/gtk/window/create/NewInstanceWindow.kt +++ b/launcher-gtk/src/main/kotlin/io/gitlab/jfronny/inceptum/gtk/window/create/NewInstanceWindow.kt @@ -62,8 +62,8 @@ class NewInstanceWindow(app: Application) : KAssistant(app) { val none = CheckButton.newWithLabel("None") val fabric = CheckButton.newWithLabel("Fabric") - none.onActivate { useFabric = false } - none.onActivate { useFabric = true } + none.onToggled { useFabric = false } + none.onToggled { useFabric = true } fabric.setGroup(none) append(none) val fabricVersionDropdown = KDropDown(versions, { it.loader.version }, def) @@ -175,6 +175,8 @@ class NewInstanceWindow(app: Application) : KAssistant(app) { status.setMarkup("The instance was successfully created. You can now launch it using the main menu") } } + + setComplete(true) } } }