📄 2.lua
字号:
-- Decompiled using luadec 0.7 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l ;;0,20;;;;;;;; 710a1147_manila_52E2.luac
require("theme")
trace("[MG New/Rename Playlist]\n")
if _config_os == "windowsmobile" then
require("audio_manager_svc")
gPlayer = MusicPlayer_Instance()
gOrder = nil
gActionMode = nil
end
OnMessageDialogExit = function(l_1_0)
_application.Navigation:NavigateBack()
end
ShowMessageDialog = function(l_2_0)
InputBox:SetShowWindowFlag(false)
InputBox.onPress:disconnect(InputBox_onPress)
InputBox.onKeyDown:disconnect(onInputBoxKeyDown)
_application:HideInputPanel()
local l_2_1 = URL("Manila://Confirmation.dialog")
l_2_1.Parameters:AddParameter("Title", Locale:GetString("IDS_MUSICTITLE"))
if gActionMode == "AddToPL" then
local str = string.format(Locale:GetString("IDS_MUSIC_CONFIRM_ADD_MSG"), l_2_0)
l_2_1.Parameters:AddParameter("ContentString", str)
elseif gActionMode == "CopyToPL" then
local str = string.format(Locale:GetString("IDS_MUSIC_CONFIRM_COPY_MSG"), l_2_0)
l_2_1.Parameters:AddParameter("ContentString", str)
end
l_2_1.Parameters:AddParameter("Type", "OK")
local dlg = _application.DialogManager:GetDialog(l_2_1)
dlg.OnExit:connect(OnMessageDialogExit)
dlg:Show()
end
RSKFunction = function()
_application.Navigation:NavigateBack()
end
LSKFunction = function()
local l_4_0 = InputBox.WindowText
trace("[MG-input] LSKFunction user input:[" .. l_4_0 .. "]")
if gOrder == "1" then
local np = gPlayer:Database():CreateNewPlaylist(l_4_0)
trace("[MG-input] New playlist UID: " .. np)
if gActionMode == "AddToPL" then
local mcs = MusicConfig_Instance():GetSetting(CONFIG_ADDTOPLAYLIST_FILEPATH)
if gPlayer:Database():AddtoPlaylist(mcs, np) == true then
ShowMessageDialog(l_4_0)
return
end
elseif gActionMode == "CopyToPL" then
local mcs = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST)
if gPlayer:Database():CopytoPlaylist(mcs, np) == true then
ShowMessageDialog(l_4_0)
return
end
end
else
local mcs = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST)
trace("[MG-input] Rename playlist UID: " .. mcs)
gPlayer:Database():RenamePlaylist(mcs, l_4_0)
MusicConfig_Instance():SetSetting(CONFIG_CURRENT_PLAYLIST_NAME, l_4_0)
end
_application.Navigation:NavigateBack()
end
OnNavigateOutTo = function(l_5_0)
InputBox:SetShowWindowFlag(false)
InputBox.onPress:disconnect(InputBox_onPress)
InputBox.onFocusOut:disconnect(FocusOutInputBox)
InputBox.onKeyDown:disconnect(onInputBoxKeyDown)
_request.NavigateOutTo:disconnect(OnNavigateOutTo)
Transition(l_5_0, "Out")
_application:HideInputPanel()
end
OnNavigateInFrom = function(l_6_0)
_request.NavigateInFrom:disconnect(OnNavigateInFrom)
Transition(l_6_0, "In")
_application:ShowInputPanel(0)
InputBox:SetShowWindowFlag(true)
if gOrder == "1" then
local x = gPlayer:Database():GetUserPlaylistsCount() + 1
InputBox:SetWindowText("Playlist" .. x)
else
local x = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST_NAME)
InputBox:SetWindowText(x)
end
end
if _config_os == "windowsmobile" then
_request.NavigateOutTo:connect(OnNavigateOutTo)
_request.NavigateInFrom:connect(OnNavigateInFrom)
gOrder = _request.URL.Parameters:GetParameter("order")
gActionMode = _request.URL.Parameters:GetParameter("actionmode")
trace("[MG-input]: gOrder: " .. gOrder .. ", gActionMode: " .. gActionMode)
if gOrder == "1" then
_application.Navigation.Title = Locale:GetString("IDS_INPUT_PLAYLISTNAME")
else
_application.Navigation.Title = Locale:GetString("IDS_INPUT_NEWNAME")
end
_application:SetLeftSoftkey(Softkey(Locale:GetString("IDS_MUSIC_EDIT_OK"), LSKFunction))
_application:SetRightSoftkey(Softkey(Locale:GetString("IDS_MUSIC_EDIT_CANCEL"), RSKFunction))
end
InputBox_onPress = function(l_7_0, l_7_1)
_application:ShowInputPanel(0)
l_7_0:SetShowWindowFlag(true)
l_7_0:Focus()
end
FocusOutInputBox = function()
_application:HideInputPanel()
end
onInputBoxKeyDown = function(l_9_0, l_9_1, l_9_2)
end
InputBox.onPress:connect(InputBox_onPress)
InputBox.onFocusOut:connect(FocusOutInputBox)
InputBox.onKeyDown:connect(onInputBoxKeyDown)
InputBox:Focus()
if _application.Store:GetStringValue(Lifetime_Permanent, "EnableLandscape") == "true" then
trace("[MG] : EnableLandscape")
require("Audio\\Music_Add_playlist_Landscape")
_MusicAddPlaylist_ScreenRotation = MusicAddPlaylist_ScreenRotation()
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -