diff --git a/sys/apis/ui/components/DropMenu.lua b/sys/apis/ui/components/DropMenu.lua index 98f92be..79f1a8a 100644 --- a/sys/apis/ui/components/DropMenu.lua +++ b/sys/apis/ui/components/DropMenu.lua @@ -24,6 +24,7 @@ function UI.DropMenu:setParent() for _,child in ipairs(self.children) do child.width = maxWidth + 2 if child.spacer then + child.inactive = true child.text = string.rep('-', child.width - 2) end end diff --git a/sys/apis/ui/components/MenuBar.lua b/sys/apis/ui/components/MenuBar.lua index 34ee7b9..4c239c0 100644 --- a/sys/apis/ui/components/MenuBar.lua +++ b/sys/apis/ui/components/MenuBar.lua @@ -25,8 +25,6 @@ UI.MenuBar.defaults = { showBackButton = false, buttonClass = 'MenuItem', } -UI.MenuBar.spacer = { spacer = true, text = 'spacer', inactive = true } - function UI.MenuBar:postInit() self:addButtons(self.buttons) end @@ -42,7 +40,7 @@ function UI.MenuBar:addButtons(buttons) else local buttonProperties = { x = self.lastx, - width = #button.text + self.spacing, + width = #(button.text or 'button') + self.spacing, centered = false, } self.lastx = self.lastx + buttonProperties.width diff --git a/sys/apps/Files.lua b/sys/apps/Files.lua index 3c1dd4f..855aaa1 100644 --- a/sys/apps/Files.lua +++ b/sys/apps/Files.lua @@ -7,6 +7,7 @@ local colors = _G.colors local fs = _G.fs local multishell = _ENV.multishell local os = _G.os +local pastebin = _G.pastebin local shell = _ENV.shell local FILE = 1 @@ -45,7 +46,7 @@ local Browser = UI.Page { { text = 'Cloud edit c', event = 'cedit', flags = FILE }, { text = 'Pastebin put p', event = 'cedit', flags = FILE }, { text = 'Shell s', event = 'shell' }, - UI.MenuBar.spacer, + { spacer = true }, { text = 'Quit q', event = 'quit' }, } }, { text = 'Edit', dropdown = { @@ -53,10 +54,10 @@ local Browser = UI.Page { { text = 'Copy ^c', event = 'copy' }, { text = 'Copy path ', event = 'copy_path' }, { text = 'Paste ^v', event = 'paste' }, - UI.MenuBar.spacer, + { spacer = true }, { text = 'Mark m', event = 'mark' }, { text = 'Unmark all u', event = 'unmark' }, - UI.MenuBar.spacer, + { spacer = true }, { text = 'Delete del', event = 'delete' }, } }, { text = 'View', dropdown = { @@ -365,6 +366,7 @@ function Browser:eventHandler(event) if file and not file.isDir then local s, m = pastebin.put(file.fullName) if s then + os.queueEvent('clipboard_copy', s) self.notification:success(string.format('Uploaded as %s', m), 0) else self.notification:error(m) diff --git a/sys/apps/Network.lua b/sys/apps/Network.lua index eeb00bf..8b7b7b2 100644 --- a/sys/apps/Network.lua +++ b/sys/apps/Network.lua @@ -33,7 +33,7 @@ local page = UI.Page { { text = 'Connect', dropdown = { { text = 'Telnet t', event = 'telnet' }, { text = 'VNC v', event = 'vnc' }, - UI.MenuBar.spacer, + { spacer = true }, { text = 'Reboot r', event = 'reboot' }, } }, { text = 'Trust', dropdown = { @@ -44,7 +44,7 @@ local page = UI.Page { x = -3, dropdown = { { text = 'Port Status', event = 'ports', modem = true }, - UI.MenuBar.spacer, + { spacer = true }, { text = 'Help', event = 'help', noCheck = true }, }, }, diff --git a/sys/apps/netdaemon.lua b/sys/apps/netdaemon.lua index ae51a19..cc14a7b 100644 --- a/sys/apps/netdaemon.lua +++ b/sys/apps/netdaemon.lua @@ -15,8 +15,8 @@ end print('Net daemon starting') -for _,file in pairs(fs.list('sys/network')) do - local fn, msg = Util.run(_ENV, 'sys/network/' .. file) +for _,file in pairs(fs.list('sys/apps/network')) do + local fn, msg = Util.run(_ENV, 'sys/apps/network/' .. file) if not fn then printError(msg) end diff --git a/sys/network/proxy.lua b/sys/apps/network/proxy.lua similarity index 100% rename from sys/network/proxy.lua rename to sys/apps/network/proxy.lua diff --git a/sys/network/redserver.lua b/sys/apps/network/redserver.lua similarity index 100% rename from sys/network/redserver.lua rename to sys/apps/network/redserver.lua diff --git a/sys/network/samba.lua b/sys/apps/network/samba.lua similarity index 100% rename from sys/network/samba.lua rename to sys/apps/network/samba.lua diff --git a/sys/network/snmp.lua b/sys/apps/network/snmp.lua similarity index 100% rename from sys/network/snmp.lua rename to sys/apps/network/snmp.lua diff --git a/sys/network/telnet.lua b/sys/apps/network/telnet.lua similarity index 100% rename from sys/network/telnet.lua rename to sys/apps/network/telnet.lua diff --git a/sys/network/transport.lua b/sys/apps/network/transport.lua similarity index 100% rename from sys/network/transport.lua rename to sys/apps/network/transport.lua diff --git a/sys/network/trust.lua b/sys/apps/network/trust.lua similarity index 100% rename from sys/network/trust.lua rename to sys/apps/network/trust.lua diff --git a/sys/network/vnc.lua b/sys/apps/network/vnc.lua similarity index 100% rename from sys/network/vnc.lua rename to sys/apps/network/vnc.lua diff --git a/sys/autorun/upgraded.lua b/sys/autorun/upgraded.lua index c23d1e9..7b30a1f 100644 --- a/sys/autorun/upgraded.lua +++ b/sys/autorun/upgraded.lua @@ -1,4 +1,6 @@ if fs.exists('sys/apps/shell') and fs.exists('sys/apps/shell.lua') then fs.delete('sys/apps/shell') end -if fs.exists('sys/etc/app.db') then fs.delete('sys/etc/app.db') end \ No newline at end of file +if fs.exists('sys/etc/app.db') then fs.delete('sys/etc/app.db') end +if fs.exists('sys/extensions') then fs.delete('sys/extensions') end +if fs.exists('sys/network') then fs.delete('sys/network') end diff --git a/sys/boot/opus.boot b/sys/boot/opus.boot index 69b90d3..7ba7a1d 100644 --- a/sys/boot/opus.boot +++ b/sys/boot/opus.boot @@ -58,7 +58,7 @@ else _G.requireInjector = runUrl('sys/apis/injector.lua') - runUrl('sys/extensions/2.vfs.lua') + runUrl('sys/init/2.vfs.lua') -- install file system fs.mount('', 'gitfs', GIT_REPO) diff --git a/sys/extensions/1.device.lua b/sys/init/1.device.lua similarity index 100% rename from sys/extensions/1.device.lua rename to sys/init/1.device.lua diff --git a/sys/extensions/2.vfs.lua b/sys/init/2.vfs.lua similarity index 100% rename from sys/extensions/2.vfs.lua rename to sys/init/2.vfs.lua diff --git a/sys/extensions/3.modules.lua b/sys/init/3.modules.lua similarity index 100% rename from sys/extensions/3.modules.lua rename to sys/init/3.modules.lua diff --git a/sys/extensions/4.label.lua b/sys/init/4.label.lua similarity index 100% rename from sys/extensions/4.label.lua rename to sys/init/4.label.lua diff --git a/sys/extensions/4.user.lua b/sys/init/4.user.lua similarity index 100% rename from sys/extensions/4.user.lua rename to sys/init/4.user.lua diff --git a/sys/extensions/5.network.lua b/sys/init/5.network.lua similarity index 100% rename from sys/extensions/5.network.lua rename to sys/init/5.network.lua diff --git a/sys/extensions/6.packages.lua b/sys/init/6.packages.lua similarity index 100% rename from sys/extensions/6.packages.lua rename to sys/init/6.packages.lua diff --git a/sys/extensions/6.tl3.lua b/sys/init/6.tl3.lua similarity index 100% rename from sys/extensions/6.tl3.lua rename to sys/init/6.tl3.lua diff --git a/sys/extensions/7.multishell.lua b/sys/init/7.multishell.lua similarity index 100% rename from sys/extensions/7.multishell.lua rename to sys/init/7.multishell.lua diff --git a/sys/kernel.lua b/sys/kernel.lua index 2f53ddf..ba092a2 100644 --- a/sys/kernel.lua +++ b/sys/kernel.lua @@ -279,7 +279,7 @@ local function init(...) local runLevel = #args > 0 and 6 or 7 print('Starting Opus OS') - local dir = 'sys/extensions' + local dir = 'sys/init' local files = fs.list(dir) table.sort(files) for _,file in ipairs(files) do