=== SetupSSHApplet.lua ================================================================== --- SetupSSHApplet.lua (revision 39684) +++ SetupSSHApplet.lua (local) @@ -52,13 +52,16 @@ self.window = window self.menu = menu + if sshEnabled then + self:_addHelpInfo() + end self:tieAndShowWindow(window) return window end -function _enableSSH(self, window) +function _addHelpInfo(self) local ipaddr = _getIPAddress() local password = "1234" @@ -67,12 +70,17 @@ self.howto = Textarea("help_text", self:string("SSH_HOWTO", tostring(password), tostring(ipaddr))) self.menu:setHeaderWidget(self.howto) + + self.window:focusWidget(self.menu) + +end + + +function _enableSSH(self, window) + + self:_addHelpInfo() self.menu:reLayout() - -- FIXME currently the last widget added to the window has focus, until this is fixed - -- pass events from the textarea to the menu. - self.howto:addListener(EVENT_ALL, function(event) return Framework:dispatchEvent(self.menu, event) end) - -- enable SSH _fileSub("/etc/inetd.conf", "^#ssh", "ssh") _sighup("/usr/sbin/inetd") @@ -83,10 +91,7 @@ function _disableSSH(self, window) - if self.howto then - self.window:removeWidget(self.howto) - self.howto = nil - end + self.howto = nil -- disable SSH _fileSub("/etc/inetd.conf", "^ssh", "#ssh")