=== SqueezeCenter/SqueezeCenterApplet.lua ================================================================== --- SqueezeCenter/SqueezeCenterApplet.lua (revision 38967) +++ SqueezeCenter/SqueezeCenterApplet.lua (local) @@ -667,6 +667,10 @@ self.confirmEjectWindow = nil end + if self.ejectWarningWindow then + self.ejectWarningWindow:hide() + self.ejectWarningWindow = nil + end -- clear device from self.mountedDevices if self.mountedDevices and self.mountedDevices[devName] then @@ -1138,38 +1142,37 @@ if item.SCDrive then - - -- Server status menu:addItem({ - text = self:string("SERVER_STATUS"), - iconStyle = 'hm_advancedSettings', + text = self:string("START"), sound = "WINDOWSHOW", callback = function() - self:settingsShow() + log:warn('!! Writing prefs.json file and starting scan') + self:_writeSCPrefsFile(devName) window:hide() + self:serverStatusMenu() + self:restartServer() end, }) + if self:_firmwarePresentInRootDir(devName) then + menu:addItem({ + text = self:string("UPDATE"), + style = 'item', + sound = "WINDOWSHOW", + callback = function() + window:hide() + appletManager:callService("showFirmwareUpgradeMenu") + end, + }) - -- My Music - --[[ FIXME: does not provide a positive user experience yet. Going to My Music when scan is just starting yields not good behavior + end menu:addItem({ - text = self:string("MY_MUSIC"), - iconStyle = 'hm_appletCustomizeHome', - sound = "WINDOWSHOW", + text = self:string("SKIP"), + style = 'item', + sound = "WINDOWSHOW", callback = function() - --Framework:pushAction("go_music_library") - --window:hide() - log:warn('my music!') - if jiveMain:getMenuTable()['_myMusic'] then - Framework:playSound("JUMP") - debug.dump(jiveMain:getMenuTable()['_myMusic']) - jiveMain:getMenuTable()['_myMusic'].callback(nil, nil, true) - else - log:warn('_myMusic not found') - end - end + window:hide() + end, }) - --]] -- Eject item local ejectToken = 'EJECT_CONFIRM_ITEM' @@ -1178,7 +1181,7 @@ end menu:addItem({ text = self:string(ejectToken), - iconStyle = 'hm_eject', + --iconStyle = 'hm_eject', sound = "WINDOWSHOW", callback = function() self:_confirmEject(devName) @@ -1198,18 +1201,75 @@ menu:setHeaderWidget(Textarea("help_text", self:string("EJECT_WARNING_INFO"))) window:addWidget(menu) + -- save this so we can hide it as needed after ejecting media + self.ejectWarningWindow = window self:tieAndShowWindow(window) - -- restart the server - if item.SCDrive then - log:warn('!! Writing prefs.json file and starting scan') - self:_writeSCPrefsFile(devName) - self:restartServer() - end return window end + +function serverStatusMenu(self) + + local window = Window("text_list", self:string("EJECT_WARNING")) + window:setAllowScreensaver(false) + window:setButtonAction("rbutton", nil) + + local menu = SimpleMenu("menu") + + -- Server status + menu:addItem({ + text = self:string("SERVER_STATUS"), + iconStyle = 'hm_advancedSettings', + sound = "WINDOWSHOW", + callback = function() + self:settingsShow() + window:hide() + end, + }) + -- My Music + menu:addItem({ + text = self:string("MY_MUSIC"), + iconStyle = 'hm_appletCustomizeHome', + sound = "WINDOWSHOW", + callback = function() + if jiveMain:getMenuTable()['_myMusic'] then + Framework:playSound("JUMP") + debug.dump(jiveMain:getMenuTable()['_myMusic']) + jiveMain:getMenuTable()['_myMusic'].callback(nil, nil, true) + else + log:warn('_myMusic not found') + Framework:playSound("BUMP") + window:bumpLeft() + end + end + }) + + window:addWidget(menu) + self:tieAndShowWindow(window) + +end + + +function _firmwarePresentInRootDir(self, devName) + + local firmwarePresent = false + local item = self:_getItemFromDevName(devName) + if item and item.mountPath then + log:warn(item.mountPath) + local pattern = "fab4.*\.bin" + for thisFile in lfs.dir(item.mountPath) do + if string.find(thisFile, pattern) then + log:info("firmware detected at ", item.mountPath, "/", thisFile) + firmwarePresent = true + end + end + end + return firmwarePresent +end + + function _writeSCPrefsFile(self, devName) local item = self:_getItemFromDevName(devName) if not item then === SqueezeCenter/strings.txt ================================================================== --- SqueezeCenter/strings.txt (revision 38967) +++ SqueezeCenter/strings.txt (local) @@ -47,6 +47,21 @@ RU Остановить Squeezebox Server? SV Vill du stoppa Squeezebox Server? +SQUEEZEBOX_SERVER + CS Squeezebox Server + DA Squeezebox Server + DE Squeezebox Server + EN Squeezebox Server + ES Squeezebox Server + FI Squeezebox Server + FR Squeezebox Server + IT Squeezebox Server + NL Squeezebox Server + NO Squeezebox Server + PL Squeezebox Server + RU Squeezebox Server + SV Squeezebox Server + WIPE_AND_RESTART EN Wipe and rescan @@ -1511,3 +1526,33 @@ RU Моя музыка SV Min musik +UPDATE + CS Aktualizace softwaru + DA Softwareopdatering + DE Software-Update + EN Software Update + ES Actualización de software + FI Ohjelmiston päivitys + FR Mise à jour du logiciel + IT Aggiornamento software + NL Software-update + NO Programvareoppdatering + PL Aktualizacja oprogramowania + RU Обновление ПО + SV Programvaruuppdatering + +SKIP + CS Přeskočit + DA Spring over + DE Überspringen + EN Skip + ES Omitir + FI Ohita + FR Ignorer + IT Salta + NL Overslaan + NO Hopp over + PL Pomiń + RU Пропустить + SV Hoppa över +