⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 2.lua

📁 htc manila 2 sourcecode
💻 LUA
字号:
-- Decompiled using luadec 1.0 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l2 ;2;2,11,13;1,17-48;;2,26-55,28-55,68-127,70-127,186-215,207-215,222-249,243-249;18;; 53dcdccd_manila_1B78.luac 

OpenContactForSelectedIndex = function()
   local l_1_0 = CallLogGenerator.SelectedIndex
   if l_1_0 ~= -1 then
      OpenContact(CallLogGenerator:GetData(l_1_0))
   else
      trace("No item selected.\n")
   end
end

AddContactForSelectedIndex = function()
   local l_2_0 = CallLogGenerator.SelectedIndex
   if l_2_0 ~= -1 then
      trace("Adding contact for index...\n")
      local l_2_1 = CallLogGenerator:GetData(l_2_0)
      local l_2_2 = l_2_1:GetNumber()
      if l_2_2:HasValue() then
         trace("Saving number " .. l_2_2:GetValue() .. " to contact\n")
         ContactDatabase_Instance():SaveNumberToContact(l_2_2:GetValue())
      end
   end
end

CallLog_RightMenuSoftkeyCallback = function()
   local l_3_0 = nil
   if CallLogList:GetGenerator():GetCount() == 0 then
      l_3_0 = _application.DialogManager:GetDialog(URL("Manila://CallLogEmpty.dialog"))
   else
      local l_3_1 = CallLogGenerator
      l_3_1 = l_3_1.SelectedIndex
      if l_3_1 ~= -1 then
         local data = CallLogGenerator:GetData(l_3_1)
         if data:GetPoomContact():HasValue() then
            l_3_0 = _application.DialogManager:GetDialog(URL("Manila://CallLog_OpenContact.dialog"))
         else
            l_3_0 = _application.DialogManager:GetDialog(URL("Manila://CallLog_SaveContact.dialog"))
         end
      else
         l_3_0 = _application.DialogManager:GetDialog(URL("Manila://CallLog.dialog"))
      end
   end
   l_3_0.OnExit:connect(CallLog_MenuExitCallback)
   l_3_0:Show()
end

CallLog_LeftMenuSoftkeyCallback = function()
   Shell_NavigateTo(ShellLocation_MissedCallLog)
end

CallLog_MenuExitCallback = function(l_5_0)
   local l_5_1 = CallLogGenerator.SelectedIndex
   if l_5_0.Result.ExitType ~= DialogExitType_Cancel then
      trace("Menu Click: " .. l_5_0.Result.UserValue)
      if l_5_0.Result.UserValue == "Via SMS" then
         trace("SMS\n")
         if l_5_1 ~= -1 then
            local l_5_2 = CallLogGenerator:GetData(l_5_1)
            local l_5_3 = l_5_2:GetPoomContact()
            if l_5_3:HasValue() and l_5_3:GetValue().SMS:HasValue() then
               l_5_3:GetValue():ConnectVia(ContactPropertyID_SMS)
            else
               Shell_ComposeMessage("SMS", l_5_2:GetNumber():GetValue(), "", "")
            end
         end
       elseif l_5_0.Result.UserValue == "Via Email" then
          trace("Email\n")
          if l_5_1 ~= -1 then
             local l_5_4 = CallLogGenerator:GetData(l_5_1)
             local l_5_5 = l_5_4:GetPoomContact()
             if l_5_5:HasValue() then
                if l_5_5:GetValue().EmailAddress1:HasValue() then
                   l_5_5:GetValue():ConnectVia(ContactPropertyID_EmailAddress1)
                elseif l_5_5:GetValue().EmailAddress2:HasValue() then
                   l_5_5:GetValue():ConnectVia(ContactPropertyID_EmailAddress2)
                elseif l_5_5:GetValue().EmailAddress3:HasValue() then
                   l_5_5:GetValue():ConnectVia(ContactPropertyID_EmailAddress3)
                else
                   Shell_ComposeMessage("", "", "", "")
                end
             else
                Shell_ComposeMessage("", "", "", "")
             end
          end
        elseif l_5_0.Result.UserValue == "All" then
           FilterValue = CallLogWhereCondition_All
           UpdateQuery()
        elseif l_5_0.Result.UserValue == "Incoming" then
            FilterValue = CallLogWhereCondition_Incoming
            UpdateQuery()
        elseif l_5_0.Result.UserValue == "Outgoing" then
            FilterValue = CallLogWhereCondition_Outgoing
            UpdateQuery()
        elseif l_5_0.Result.UserValue == "Missed" then
            FilterValue = CallLogWhereCondition_Missed
            UpdateQuery()
        elseif l_5_0.Result.UserValue == "Save To Contacts" then
            AddContactForSelectedIndex()
        elseif l_5_0.Result.UserValue == "Open Contact" then
            OpenContactForSelectedIndex()
        elseif l_5_0.Result.UserValue == "Delete" then
          if l_5_1 ~= -1 then
               local l_5_6 = URL("Manila://Confirmation.dialog")
               l_5_6.Parameters:AddParameter("Title", Locale:GetString("IDS_CALLOG_DELETECALL"))
               l_5_6.Parameters:AddParameter("ContentString", Locale:GetString("IDS_CONFIRM_DELETE_TEXT"))
               local l_5_7 = _application.DialogManager:GetDialog(l_5_6)
               DeletingItemSelectedIndex = l_5_1
               l_5_7.OnExit:connect(CallLog_DeleteConfirmationCallback)
               l_5_7:Show()
            end
         elseif l_5_0.Result.UserValue == "Delete All Calls" then
               local l_5_8 = URL("Manila://Confirmation.dialog")
               l_5_8.Parameters:AddParameter("Title", Locale:GetString("IDS_CALLOG_DELETEALLCALLS"))
               l_5_8.Parameters:AddParameter("ContentString", Locale:GetString("IDS_CONFIRM_DELETEALL_TEXT"))
               local l_5_9 = _application.DialogManager:GetDialog(l_5_8)
               l_5_9.OnExit:connect(CallLog_DeleteAllConfirmationCallback)
               l_5_9:Show()
         end     
   end
   DialogRequestItem = nil
end

DeletingItemSelectedIndex = -1
CallLog_DeleteConfirmationCallback = function(l_6_0)
   l_6_0.OnExit:disconnect(CallLog_DeleteConfirmationCallback)
   if l_6_0.Result.ExitType == DialogExitType_Cancel then
      return 
   elseif DeletingItemSelectedIndex ~= -1 then
      local l_6_1 = CallLogGenerator:GetData(DeletingItemSelectedIndex)
      Database:Delete(l_6_1)
      UpdateQuery()
      DeletingItemSelectedIndex = -1
   end
end

CallLog_DeleteAllConfirmationCallback = function(l_7_0)
   l_7_0.OnExit:disconnect(CallLog_DeleteAllConfirmationCallback)
   if l_7_0.Result.ExitType == DialogExitType_Cancel then
      return 
   else
      Database:DeleteAll()
      UpdateQuery()
   end
end

if _config_os == "windowsmobile" then
   _application:SetLeftSoftkey(Softkey(Locale:GetString("IDS_ALL_CALLS"), CallLog_LeftMenuSoftkeyCallback))
   _application:SetRightSoftkey(Softkey(Locale:GetString("IDS_MENU"), CallLog_RightMenuSoftkeyCallback))
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -