mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-09 01:30:17 +08:00
graphic setting view
This commit is contained in:
parent
eda936c2bf
commit
e5546d9283
@ -23,8 +23,13 @@ class MiraiGraphicalUIController : Controller(), MiraiConsoleUI {
|
||||
private val loginSolver = GraphicalLoginSolver()
|
||||
private val cache = mutableMapOf<Long, BotModel>()
|
||||
val mainLog = observableListOf<String>()
|
||||
|
||||
|
||||
val botList = observableListOf<BotModel>()
|
||||
val pluginList: ObservableList<PluginModel> by lazy(::getPluginsFromConsole)
|
||||
|
||||
val consoleConfig : Map<String, Any> by lazy(::getConfigFromConsole)
|
||||
|
||||
val consoleInfo = ConsoleInfo()
|
||||
|
||||
suspend fun login(qq: String, psd: String) {
|
||||
@ -78,6 +83,8 @@ class MiraiGraphicalUIController : Controller(), MiraiConsoleUI {
|
||||
// TODO
|
||||
return observableListOf<PluginModel>()
|
||||
}
|
||||
|
||||
private fun getConfigFromConsole() = MiraiConsole.MiraiProperties.config.asMap()
|
||||
}
|
||||
|
||||
class GraphicalLoginSolver : LoginSolver() {
|
||||
|
@ -69,15 +69,11 @@ class PrimaryView : View() {
|
||||
|
||||
center = jfxTabPane {
|
||||
|
||||
tab("Login") {
|
||||
this += find<LoginView>().root
|
||||
}
|
||||
tab("Login").content = find<LoginView>().root
|
||||
|
||||
tab("Plugins") {
|
||||
this += find<PluginsView>().root
|
||||
}
|
||||
tab("Plugins").content = find<PluginsView>().root
|
||||
|
||||
tab("Settings")
|
||||
tab("Settings").content = find<SettingsView>().root
|
||||
|
||||
logTab("Main", controller.mainLog)
|
||||
}
|
||||
|
@ -0,0 +1,23 @@
|
||||
package net.mamoe.mirai.console.graphical.view
|
||||
|
||||
import net.mamoe.mirai.console.graphical.controller.MiraiGraphicalUIController
|
||||
import net.mamoe.mirai.console.graphical.util.jfxTextfield
|
||||
import tornadofx.View
|
||||
import tornadofx.field
|
||||
import tornadofx.fieldset
|
||||
import tornadofx.form
|
||||
|
||||
class SettingsView : View() {
|
||||
|
||||
private val controller = find<MiraiGraphicalUIController>()
|
||||
|
||||
override val root = form {
|
||||
controller.consoleConfig.forEach {
|
||||
fieldset {
|
||||
field(it.key) {
|
||||
jfxTextfield(it.value.toString()) { isEditable = false }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user