Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
f41b8315
Commit
f41b8315
authored
Feb 23, 2020
by
ryoii
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Graphic refactor plugin list
parent
ca0e50a3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
19 deletions
+27
-19
mirai-console-graphical/src/main/kotlin/net/mamoe/mirai/console/graphical/controller/MiraiGraphicalUIController.kt
...onsole/graphical/controller/MiraiGraphicalUIController.kt
+4
-8
mirai-console-graphical/src/main/kotlin/net/mamoe/mirai/console/graphical/model/PluginModel.kt
...in/net/mamoe/mirai/console/graphical/model/PluginModel.kt
+8
-7
mirai-console-graphical/src/main/kotlin/net/mamoe/mirai/console/graphical/view/PluginsView.kt
...lin/net/mamoe/mirai/console/graphical/view/PluginsView.kt
+15
-4
No files found.
mirai-console-graphical/src/main/kotlin/net/mamoe/mirai/console/graphical/controller/MiraiGraphicalUIController.kt
View file @
f41b8315
...
...
@@ -13,10 +13,7 @@ import net.mamoe.mirai.console.graphical.model.VerificationCodeModel
import
net.mamoe.mirai.console.graphical.view.VerificationCodeFragment
import
net.mamoe.mirai.console.utils.MiraiConsoleUI
import
net.mamoe.mirai.utils.LoginSolver
import
tornadofx.Controller
import
tornadofx.Scope
import
tornadofx.find
import
tornadofx.observableListOf
import
tornadofx.*
class
MiraiGraphicalUIController
:
Controller
(),
MiraiConsoleUI
{
...
...
@@ -79,10 +76,9 @@ class MiraiGraphicalUIController : Controller(), MiraiConsoleUI {
override
fun
createLoginSolver
():
LoginSolver
=
loginSolver
private
fun
getPluginsFromConsole
():
ObservableList
<
PluginModel
>
{
// TODO
return
observableListOf
<
PluginModel
>()
}
private
fun
getPluginsFromConsole
():
ObservableList
<
PluginModel
>
=
MiraiConsole
.
pluginManager
.
getAllPluginDescriptions
().
map
(
::
PluginModel
).
toObservable
()
}
class
GraphicalLoginSolver
:
LoginSolver
()
{
...
...
mirai-console-graphical/src/main/kotlin/net/mamoe/mirai/console/graphical/model/PluginModel.kt
View file @
f41b8315
...
...
@@ -3,16 +3,17 @@ package net.mamoe.mirai.console.graphical.model
import
com.jfoenix.controls.datamodels.treetable.RecursiveTreeObject
import
javafx.beans.property.SimpleBooleanProperty
import
javafx.beans.property.SimpleStringProperty
import
net.mamoe.mirai.console.plugins.PluginDescription
import
tornadofx.getValue
import
tornadofx.setValue
class
PluginModel
:
RecursiveTreeObject
<
PluginModel
>()
{
val
nameProperty
=
SimpleStringProperty
(
this
,
"nameProperty"
)
val
name
by
nameProperty
val
descriptionProperty
=
SimpleStringProperty
(
this
,
"descriptionProperty"
)
val
description
by
descriptionProperty
class
PluginModel
(
val
name
:
String
,
val
version
:
String
,
val
author
:
String
,
val
description
:
String
)
:
RecursiveTreeObject
<
PluginModel
>()
{
constructor
(
plugin
:
PluginDescription
):
this
(
plugin
.
name
,
plugin
.
version
,
plugin
.
author
,
plugin
.
info
)
val
enabledProperty
=
SimpleBooleanProperty
(
this
,
"enabledProperty"
)
var
enabled
by
enabledProperty
...
...
mirai-console-graphical/src/main/kotlin/net/mamoe/mirai/console/graphical/view/PluginsView.kt
View file @
f41b8315
...
...
@@ -13,10 +13,21 @@ class PluginsView : View() {
override
val
root
=
jfxTreeTableView
(
plugins
)
{
columns
.
addAll
(
JFXTreeTableColumn
<
PluginModel
,
String
>(
"插件名"
).
apply
{
},
JFXTreeTableColumn
<
PluginModel
,
String
>(
"版本"
).
apply
{
},
JFXTreeTableColumn
<
PluginModel
,
String
>(
"作者"
).
apply
{
},
JFXTreeTableColumn
<
PluginModel
,
String
>(
"介绍"
).
apply
{
}
JFXTreeTableColumn
<
PluginModel
,
String
>(
"插件名"
).
apply
{
prefWidthProperty
().
bind
(
this
@
jfxTreeTableView
.
widthProperty
().
multiply
(
0.1
))
},
JFXTreeTableColumn
<
PluginModel
,
String
>(
"版本"
).
apply
{
prefWidthProperty
().
bind
(
this
@
jfxTreeTableView
.
widthProperty
().
multiply
(
0.1
))
},
JFXTreeTableColumn
<
PluginModel
,
String
>(
"作者"
).
apply
{
prefWidthProperty
().
bind
(
this
@
jfxTreeTableView
.
widthProperty
().
multiply
(
0.1
))
},
JFXTreeTableColumn
<
PluginModel
,
String
>(
"介绍"
).
apply
{
prefWidthProperty
().
bind
(
this
@
jfxTreeTableView
.
widthProperty
().
multiply
(
0.6
))
},
JFXTreeTableColumn
<
PluginModel
,
String
>(
"操作"
).
apply
{
prefWidthProperty
().
bind
(
this
@
jfxTreeTableView
.
widthProperty
().
multiply
(
0.08
))
}
)
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment