mirror of
https://github.com/kepler155c/opus
synced 2025-10-29 14:47:41 +00:00
spaces->tabs + cleanup + pathing fixes
This commit is contained in:
@@ -23,115 +23,115 @@ local packagesIntro = [[Setup Complete
|
||||
|
||||
local page = UI.Page {
|
||||
wizard = UI.Wizard {
|
||||
ey = -2,
|
||||
ey = -2,
|
||||
pages = {
|
||||
splash = UI.WizardPage {
|
||||
index = 1,
|
||||
intro = UI.TextArea {
|
||||
textColor = colors.yellow,
|
||||
inactive = true,
|
||||
x = 3, ex = -3, y = 2, ey = -2,
|
||||
value = string.format(splashIntro, Ansi.white),
|
||||
},
|
||||
},
|
||||
index = 1,
|
||||
intro = UI.TextArea {
|
||||
textColor = colors.yellow,
|
||||
inactive = true,
|
||||
x = 3, ex = -3, y = 2, ey = -2,
|
||||
value = string.format(splashIntro, Ansi.white),
|
||||
},
|
||||
},
|
||||
label = UI.WizardPage {
|
||||
index = 2,
|
||||
labelText = UI.Text {
|
||||
x = 3, y = 2,
|
||||
value = 'Label'
|
||||
},
|
||||
label = UI.TextEntry {
|
||||
x = 9, y = 2, ex = -3,
|
||||
limit = 32,
|
||||
value = os.getComputerLabel(),
|
||||
},
|
||||
intro = UI.TextArea {
|
||||
textColor = colors.yellow,
|
||||
inactive = true,
|
||||
x = 3, ex = -3, y = 4, ey = -3,
|
||||
value = string.format(labelIntro, Ansi.white),
|
||||
},
|
||||
},
|
||||
index = 2,
|
||||
labelText = UI.Text {
|
||||
x = 3, y = 2,
|
||||
value = 'Label'
|
||||
},
|
||||
label = UI.TextEntry {
|
||||
x = 9, y = 2, ex = -3,
|
||||
limit = 32,
|
||||
value = os.getComputerLabel(),
|
||||
},
|
||||
intro = UI.TextArea {
|
||||
textColor = colors.yellow,
|
||||
inactive = true,
|
||||
x = 3, ex = -3, y = 4, ey = -3,
|
||||
value = string.format(labelIntro, Ansi.white),
|
||||
},
|
||||
},
|
||||
password = UI.WizardPage {
|
||||
index = 3,
|
||||
passwordLabel = UI.Text {
|
||||
x = 3, y = 2,
|
||||
value = 'Password'
|
||||
},
|
||||
newPass = UI.TextEntry {
|
||||
x = 12, ex = -3, y = 2,
|
||||
limit = 32,
|
||||
mask = true,
|
||||
shadowText = 'password',
|
||||
},
|
||||
passwordLabel = UI.Text {
|
||||
x = 3, y = 2,
|
||||
value = 'Password'
|
||||
},
|
||||
newPass = UI.TextEntry {
|
||||
x = 12, ex = -3, y = 2,
|
||||
limit = 32,
|
||||
mask = true,
|
||||
shadowText = 'password',
|
||||
},
|
||||
--[[
|
||||
groupLabel = UI.Text {
|
||||
x = 3, y = 3,
|
||||
value = 'Group'
|
||||
},
|
||||
group = UI.TextEntry {
|
||||
x = 12, ex = -3, y = 3,
|
||||
limit = 32,
|
||||
shadowText = 'network group',
|
||||
},
|
||||
groupLabel = UI.Text {
|
||||
x = 3, y = 3,
|
||||
value = 'Group'
|
||||
},
|
||||
group = UI.TextEntry {
|
||||
x = 12, ex = -3, y = 3,
|
||||
limit = 32,
|
||||
shadowText = 'network group',
|
||||
},
|
||||
]]
|
||||
intro = UI.TextArea {
|
||||
textColor = colors.yellow,
|
||||
inactive = true,
|
||||
x = 3, ex = -3, y = 5, ey = -3,
|
||||
value = string.format(passwordIntro, Ansi.white),
|
||||
},
|
||||
intro = UI.TextArea {
|
||||
textColor = colors.yellow,
|
||||
inactive = true,
|
||||
x = 3, ex = -3, y = 5, ey = -3,
|
||||
value = string.format(passwordIntro, Ansi.white),
|
||||
},
|
||||
},
|
||||
packages = UI.WizardPage {
|
||||
index = 4,
|
||||
button = UI.Button {
|
||||
x = 3, y = -3,
|
||||
text = 'Open Package Manager',
|
||||
event = 'packages',
|
||||
},
|
||||
intro = UI.TextArea {
|
||||
textColor = colors.yellow,
|
||||
inactive = true,
|
||||
x = 3, ex = -3, y = 2, ey = -4,
|
||||
value = string.format(packagesIntro, Ansi.white),
|
||||
},
|
||||
button = UI.Button {
|
||||
x = 3, y = -3,
|
||||
text = 'Open Package Manager',
|
||||
event = 'packages',
|
||||
},
|
||||
intro = UI.TextArea {
|
||||
textColor = colors.yellow,
|
||||
inactive = true,
|
||||
x = 3, ex = -3, y = 2, ey = -4,
|
||||
value = string.format(packagesIntro, Ansi.white),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
notification = UI.Notification { },
|
||||
},
|
||||
notification = UI.Notification { },
|
||||
}
|
||||
|
||||
function page.wizard.pages.label:validate()
|
||||
os.setComputerLabel(self.label.value)
|
||||
return true
|
||||
os.setComputerLabel(self.label.value)
|
||||
return true
|
||||
end
|
||||
|
||||
function page.wizard.pages.password:validate()
|
||||
if #self.newPass.value > 0 then
|
||||
Security.updatePassword(SHA1.sha1(self.newPass.value))
|
||||
end
|
||||
--[[
|
||||
if #self.group.value > 0 then
|
||||
local config = Config.load('os')
|
||||
config.group = self.group.value
|
||||
Config.update('os', config)
|
||||
end
|
||||
]]
|
||||
return true
|
||||
if #self.newPass.value > 0 then
|
||||
Security.updatePassword(SHA1.sha1(self.newPass.value))
|
||||
end
|
||||
--[[
|
||||
if #self.group.value > 0 then
|
||||
local config = Config.load('os')
|
||||
config.group = self.group.value
|
||||
Config.update('os', config)
|
||||
end
|
||||
]]
|
||||
return true
|
||||
end
|
||||
|
||||
function page:eventHandler(event)
|
||||
if event.type == 'skip' then
|
||||
self.wizard:emit({ type = 'nextView' })
|
||||
if event.type == 'skip' then
|
||||
self.wizard:emit({ type = 'nextView' })
|
||||
|
||||
elseif event.type == 'view_enabled' then
|
||||
event.view:focusFirst()
|
||||
elseif event.type == 'view_enabled' then
|
||||
event.view:focusFirst()
|
||||
|
||||
elseif event.type == 'packages' then
|
||||
shell.openForegroundTab('PackageManager')
|
||||
elseif event.type == 'packages' then
|
||||
shell.openForegroundTab('PackageManager')
|
||||
|
||||
elseif event.type == 'wizard_complete' or event.type == 'cancel' then
|
||||
UI.exitPullEvents()
|
||||
elseif event.type == 'wizard_complete' or event.type == 'cancel' then
|
||||
UI.exitPullEvents()
|
||||
|
||||
else
|
||||
return UI.Page.eventHandler(self, event)
|
||||
|
||||
Reference in New Issue
Block a user