//---------------------------------------------------------------------------------- // Show: Make this dialog visible (or invisible), and start (or stop) any threads // that are needed. //---------------------------------------------------------------------------------- void PatchDetailsCtrl::Show(bool bShow) { SetVisible(bShow); if (bShow) { CustomInfo* pCI = GetCustomInfo(); // Check to see if we have already downloaded these patch details. if (m_bDownloadSucceeded && (m_sURL == pCI->GetPatchDescriptionUrl())) { // We already have the file, re-display it. LoadInfoTextFromFile(m_sInfoFile); // Make sure the Next button is the default button. m_pNextButton->RequestFocus(); return; } // Some of the text changes dynamically based on patch selection, update it. ResourceManager* pResMgr = GetCustomInfo()->GetResourceManager(); // Informational (Main) text. GUIString sInfo = pResMgr->BuildInfoString(PatchDetails_Info1_String_Id); m_pInfoText->Clear(); m_pInfoText->AddFormatedText(sInfo); m_pInfoText->SetVertOffset(0); // Scroll to the top. m_pInfoText->Invalidate(); // Reset the download variables. m_bDownloadStarted = false; m_bDownloadComplete = false; m_bDownloadSucceeded = false; m_bAborted = false; m_sURL = pCI->GetPatchDescriptionUrl(); EnableControls(); // Start the download itself. m_pBackButton->RequestFocus(); StartDownload(); } else { // If the download is still in progress, kill it. KillThreads(); } }
//---------------------------------------------------------------------------------- // Show: Make this dialog visible (or invisible), and start (or stop) any threads // that are needed. //---------------------------------------------------------------------------------- void OptionalPatchCtrl::Show(bool bShow) { SetVisible(bShow); if (bShow) { // Some of the text changes dynamically based on patch selection, update it. ResourceManager* pResMgr = GetCustomInfo()->GetResourceManager(); // Informational (Main) text. GUIString sInfo = pResMgr->BuildInfoString(OptionalPatch_Info1_String_Id); m_pInfoText->Clear(); m_pInfoText->AddFormatedText(sInfo); m_pInfoText->SetVertOffset(0); // Scroll to the top. // Make sure the Next button is the default button. m_pNextButton->RequestFocus(); CustomInfo* pCI = GetCustomInfo(); m_pPatchDetailsButton->Enable(pCI->GetPatchDescriptionUrl() != ""); } // No threads used in this dialog. }