chore: clean up annotations and imports
This commit is contained in:
parent
e61df73dd3
commit
9fd5d870cf
|
@ -9,7 +9,8 @@ import io.gitlab.jfronny.inceptum.launcher.system.launch.*;
|
|||
import io.gitlab.jfronny.inceptum.launcher.system.setup.Steps;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class LaunchCommand extends BaseInstanceCommand {
|
||||
|
|
|
@ -12,7 +12,6 @@ import org.gnome.gtk.*
|
|||
import java.util.function.Consumer
|
||||
|
||||
object GtkEnvBackend : EnvBackend {
|
||||
@JvmField
|
||||
var dialogParent: Window? = null
|
||||
|
||||
override fun showError(message: String, title: String) {
|
||||
|
@ -66,7 +65,6 @@ object GtkEnvBackend : EnvBackend {
|
|||
cancel: Runnable?
|
||||
) = schedule { simpleDialog(dialogParent, markup, title, ok, cancel) }
|
||||
|
||||
@JvmStatic
|
||||
fun simpleDialog(
|
||||
parent: Window?,
|
||||
markup: String,
|
||||
|
|
|
@ -30,7 +30,6 @@ object GtkMain {
|
|||
})
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun showGui(args: Array<String>): Int = setupApplication(args) {
|
||||
//TODO update check
|
||||
AccountManager.loadAccounts()
|
||||
|
@ -45,7 +44,6 @@ object GtkMain {
|
|||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun setupApplication(args: Array<String>, onActivate: Application.() -> Unit): Int {
|
||||
val app = Application(ID, ApplicationFlags.FLAGS_NONE)
|
||||
app.onActivate {
|
||||
|
|
|
@ -30,14 +30,10 @@ import java.io.IOException
|
|||
import java.nio.file.Path
|
||||
|
||||
object GtkMenubar {
|
||||
@JvmField
|
||||
var newMenu: MenuBuilder? = null
|
||||
@JvmField
|
||||
var accountsMenu: MenuBuilder? = null
|
||||
@JvmField
|
||||
var launchMenu: MenuBuilder? = null
|
||||
|
||||
@JvmStatic
|
||||
fun create(app: Application) {
|
||||
val menu = MenuBuilder(app)
|
||||
val file = menu.submenu("file")
|
||||
|
@ -77,7 +73,6 @@ object GtkMenubar {
|
|||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun generateNewMenu(app: Application) {
|
||||
newMenu!!.clear()
|
||||
newMenu!!.button("new") { NewInstanceWindow(app).visible = true }
|
||||
|
@ -145,7 +140,6 @@ object GtkMenubar {
|
|||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun generateLaunchMenu(app: Application) {
|
||||
launchMenu!!.clear()
|
||||
try {
|
||||
|
@ -159,7 +153,6 @@ object GtkMenubar {
|
|||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun launch(instance: Instance, launchType: LaunchType) {
|
||||
if (instance.isSetupLocked) {
|
||||
LauncherEnv.showError(I18n["instance.launch.locked.setup"], I18n["instance.launch.locked"])
|
||||
|
@ -200,7 +193,6 @@ object GtkMenubar {
|
|||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun generateAccountsMenu(app: Application) {
|
||||
accountsMenu!!.clear()
|
||||
accountsMenu!!.button("new") { MicrosoftLoginDialog(GtkEnvBackend.dialogParent).visible = true }
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package io.gitlab.jfronny.inceptum.gtk.control
|
||||
|
||||
import io.gitlab.jfronny.inceptum.gtk.util.kText
|
||||
import org.gnome.gtk.Entry
|
||||
import java.util.function.Consumer
|
||||
|
||||
|
@ -8,7 +7,7 @@ class KEntry(value: String? = ""): Entry() {
|
|||
private val onChange = ArrayList<Consumer<String>>()
|
||||
|
||||
init {
|
||||
kText = value ?: ""
|
||||
text = value ?: ""
|
||||
onChanged { onChange.forEach { it.accept(text) } }
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package io.gitlab.jfronny.inceptum.gtk.control.settings
|
||||
|
||||
import io.gitlab.jfronny.inceptum.common.Utils
|
||||
import io.gitlab.jfronny.inceptum.gtk.util.I18n
|
||||
import io.gitlab.jfronny.inceptum.gtk.util.Log
|
||||
import org.gnome.adw.HeaderBar
|
||||
import org.gnome.adw.ViewStack
|
||||
import org.gnome.adw.ViewSwitcherBar
|
||||
|
|
|
@ -26,7 +26,6 @@ class MenuBuilder private constructor(map: ActionMap, menu: Menu, prefix: String
|
|||
groupName
|
||||
)
|
||||
|
||||
@JvmOverloads
|
||||
constructor(app: Application, menu: Menu = getRootMenu(app), prefix: String = "") : this(app, menu, prefix, "app.")
|
||||
|
||||
init {
|
||||
|
|
|
@ -2,7 +2,10 @@ package io.gitlab.jfronny.inceptum.gtk.util
|
|||
|
||||
import io.gitlab.jfronny.inceptum.gtk.control.ILabel
|
||||
import org.gnome.adw.ActionRow
|
||||
import org.gnome.gtk.*
|
||||
import org.gnome.gtk.EntryBuffer
|
||||
import org.gnome.gtk.Label
|
||||
import org.gnome.gtk.MessageDialog
|
||||
import org.gnome.gtk.Widget
|
||||
|
||||
var Widget.margin: Int
|
||||
set(value) {
|
||||
|
|
|
@ -23,7 +23,6 @@ class AboutWindow : AboutDialog() {
|
|||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun createAndShow() {
|
||||
AboutWindow().visible = true
|
||||
}
|
||||
|
|
|
@ -80,13 +80,11 @@ class ProcessStateWatcherDialog(
|
|||
}.start()
|
||||
}
|
||||
|
||||
@JvmRecord
|
||||
data class State(val msg: String, val progress: Float) {
|
||||
constructor(source: ProcessState) : this(source.currentStep, source.progress)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun show(
|
||||
parent: Window?,
|
||||
title: String,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package io.gitlab.jfronny.inceptum.gtk.window.dialog
|
||||
|
||||
import io.gitlab.jfronny.inceptum.gtk.util.kText
|
||||
import org.gnome.gtk.*
|
||||
|
||||
class StringInputDialog(parent: Window?, flags: DialogFlags, type: MessageType, buttons: ButtonsType, message: String, value: String) : MessageDialog(parent, flags, type, buttons, message) {
|
||||
|
@ -8,7 +7,7 @@ class StringInputDialog(parent: Window?, flags: DialogFlags, type: MessageType,
|
|||
|
||||
init {
|
||||
(messageArea as Box).append(entry)
|
||||
entry.kText = value
|
||||
entry.text = value
|
||||
}
|
||||
|
||||
val input: String get() = entry.text
|
||||
|
|
|
@ -147,7 +147,7 @@ class GeneralTab(window: InstanceSettingsWindow) : SectionedSettingsTab<Instance
|
|||
dialog.onResponse { responseId: Int ->
|
||||
if (responseId == ResponseType.ACCEPT.value) {
|
||||
val file = dialog.file!!.path
|
||||
if (file != null) entry.kText = file
|
||||
if (file != null) entry.text = file
|
||||
}
|
||||
}
|
||||
dialog.show()
|
||||
|
|
|
@ -4,7 +4,6 @@ import io.gitlab.jfronny.gson.compile.util.GList;
|
|||
import io.gitlab.jfronny.gson.stream.JsonReader;
|
||||
import io.gitlab.jfronny.inceptum.common.Net;
|
||||
import io.gitlab.jfronny.inceptum.launcher.model.modrinth.*;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
|
|
|
@ -3,7 +3,6 @@ package io.gitlab.jfronny.inceptum.launcher.model.inceptum;
|
|||
import io.gitlab.jfronny.commons.HashUtils;
|
||||
import io.gitlab.jfronny.commons.data.MutCollection;
|
||||
import io.gitlab.jfronny.commons.data.delegate.DelegateMap;
|
||||
import io.gitlab.jfronny.commons.serialize.gson.api.v1.Ignore;
|
||||
import io.gitlab.jfronny.gson.compile.annotations.GPrefer;
|
||||
import io.gitlab.jfronny.gson.compile.annotations.GSerializable;
|
||||
import io.gitlab.jfronny.inceptum.common.GsonPreset;
|
||||
|
@ -12,7 +11,6 @@ import io.gitlab.jfronny.inceptum.launcher.api.CurseforgeApi;
|
|||
import io.gitlab.jfronny.inceptum.launcher.api.ModrinthApi;
|
||||
import io.gitlab.jfronny.inceptum.launcher.gson.ModMetaSourcesAdapter;
|
||||
import io.gitlab.jfronny.inceptum.launcher.model.curseforge.response.FingerprintMatchesResponse;
|
||||
import io.gitlab.jfronny.inceptum.launcher.system.instance.Mod;
|
||||
import io.gitlab.jfronny.inceptum.launcher.system.source.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
|
Loading…
Reference in New Issue