Ejemplo n.º 1
0
//----------------------------------------------------------------------------------
// 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)
	{
		// Some of the text changes dynamically based on patch selection, update it.
		ResourceManager* pResMgr = GetCustomInfo()->GetResourceManager();

		// Informational (Main) text.
		GUIString sInfo = pResMgr->BuildInfoString(IDS_PATCH_DETAILS_DLG_INFO_1);
		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();
	}

	// Start ???
	//if (bShow && ! <???>)
	{
		// ?????
	}
}
//----------------------------------------------------------------------------------
// UpdateInfoText: Update the contents of the info text box.
//----------------------------------------------------------------------------------
void SelectHostCtrl::UpdateInfoText(void)
{
	// Some of the text changes dynamically based on patch selection, update it.
	ResourceManager* pResMgr = GetCustomInfo()->GetResourceManager();

	GUIString sInfo = pResMgr->BuildInfoString(SelectHost_WaitInfo1_String_Id);

	if (GetCustomInfo()->GetPatchList()->size())
	{
		sInfo = pResMgr->BuildInfoString(SelectHost_Info1_String_Id);

		if (m_bMixedPatches)
		{
			sInfo.append("\n\n");
			sInfo.append(pResMgr->GetFinishedString(SelectHost_InfoManual_String));
		}
	}

	m_pInfoText->Clear();
	m_pInfoText->AddFormatedText(sInfo);
	m_pInfoText->SetVertOffset(0); // Scroll to the top.
}
//----------------------------------------------------------------------------------
// 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 WebLaunchCtrl::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(VisitHost_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();
	}

	// No special threads for this dialog.
}
Ejemplo n.º 5
0
//----------------------------------------------------------------------------------
// 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.
}
//----------------------------------------------------------------------------------
// Show: Make this dialog visible (or invisible), and start (or stop) any threads 
// that are needed.
//----------------------------------------------------------------------------------
void DownloadCtrl::Show(bool bShow)
{
	SetVisible(bShow);

	if (bShow)
	{
		m_bPatchIsValid = false;
		m_bShownTimeoutWarning = false;
//		m_nReturnResult = SUR_UNKNOWN;
		GetMainControl()->SetReturnResult(SUR_UNKNOWN);

		CustomInfo* pCustInfo = GetCustomInfo();
		ResourceManager* pResMgr = pCustInfo->GetResourceManager();

		// Some of the text changes dynamically based on patch selection, update it.

		// Informational (Main) text.
		GUIString sInfo = pResMgr->BuildInfoString(Download_Info1_String_Id);
		m_pInfoText->Clear();
		m_pInfoText->AddFormatedText(sInfo);
		m_pInfoText->SetVertOffset(0); // Scroll to the top.

		// Visit Host prompt.
		m_pVisitHostLabel->SetText(pResMgr->GetFinishedString(Download_Host_String));
		m_pVisitHostLabel->SetDesiredSize();

		// Visit Host button.
		m_pVisitHostButton->SetText(pResMgr->GetFinishedString(Download_VisitHost_String));

		ResetProgressBar();

		// Make sure the Next button is the default button.
		m_pNextButton->RequestFocus();

		// Start the download clock.
		m_tDownloading = 0;
		m_bDownloadStarted = false;
		m_bPatchDownloadComplete = false;
		m_bPatchDownloadSucceeded = false;
		m_bBitmapDownloadComplete = false;
		m_bBitmapDownloadSucceeded = false;
		m_bAborted = false;
		RequestTimer(true);

		m_pVisitHostButton->SetVisible(true);
		m_pVisitHostImageButton->SetVisible(false);

		EnableControls();

		// Check to see if we are using a previously downloaded patch.
		if (pCustInfo->GetPatchFile() != "")
		{
			m_bPatchDownloadComplete = true;

			int nLower, nUpper;
			m_pProgressBar->GetRange(nLower, nUpper);
			UpdateProgressBar(nUpper, nUpper);

			ValidatePatch();  // Check it (we are paranoid).
			EnableControls();
		}
		else
			StartDownloads(); // Start the download itself.
	}
	else
	{
		// Turn off the timer.
		RequestTimer(false);

		// If the download is still in progress, kill it.
		KillThreads();
	}
}