Organize and prime the necessary fields for LoginWindow

This commit is contained in:
nelle 2024-02-16 04:04:32 -07:00
parent 0152ecba14
commit 0ddd8a35d5

View file

@ -6,7 +6,7 @@ import jexer.TWindow
import jexer.layout.StretchLayoutManager import jexer.layout.StretchLayoutManager
class LoginWindow private constructor(parent: TApplication, flags: Int) : class LoginWindow private constructor(parent: TApplication, flags: Int) :
TWindow(parent, "Login", 0, 0, 46, 10, flags) { TWindow(parent, "Login", 0, 0, 36, 16, flags) {
constructor(parent: TApplication) : this(parent, CENTERED) constructor(parent: TApplication) : this(parent, CENTERED)
init { init {
@ -17,11 +17,34 @@ class LoginWindow private constructor(parent: TApplication, flags: Int) :
) )
) )
addButton("Exit...", CENTERED + 28, CENTERED, addButton("Back...", CENTERED + 8, CENTERED + 8,
object : TAction() { object : TAction() {
override fun DO() { override fun DO() {
System.exit(0) TODO("Instead of full program exit, make it close the login window")
} }
} }
) )
}}
addButton("Login", CENTERED + 9, CENTERED + 6,
object : TAction() {
override fun DO() {
TODO("Once activated, start SSH login process")
}
}
)
/*
For api look at: https://git.ouroboros.group/limepotato/jexer/wiki/widget-tpasswordfield
*/
//Password
addLabel("Password", CENTERED + 9, CENTERED + 1)
//Once enter is pressed, activate login process.
addPasswordField(CENTERED + 5, CENTERED + 3, 16, false);
//Login
addLabel("Username", CENTERED + 9, CENTERED - 3)
// Once enter is pressed, switch to password field
addPasswordField(CENTERED + 5, CENTERED - 1, 16, false);
}}