Beispiel #1
0
void idpReportError()
{
    ui.unlockButtons(); // allow user to click Retry or Next

    if(downloader.filesDownloaded() || (ui.errorDlgMode == DLG_NONE))
        ui.clickNextButton(); // go to next page
    else if(ui.errorDlgMode == DLG_SIMPLE)
    {
        if(ui.messageBox(ui.msg("Download failed") + _T(": ") + downloader.getLastErrorStr() + _T("\r\n") + (ui.allowContinue ?
                         ui.msg("Check your connection and click 'Retry' to try downloading the files again, or click 'Next' to continue installing anyway.") :
                         ui.msg("Check your connection and click 'Retry' to try downloading the files again, or click 'Cancel' to terminate setup.")),
                         ui.msg("Download failed"), MB_ICONWARNING | (ui.hasRetryButton ? MB_OK : MB_RETRYCANCEL)) == IDRETRY)
            idpStartDownload();
    }
    else
    {
        ui.dllHandle = idpDllHandle;

        switch(ui.errorDialog(&downloader))
        {
        case IDRETRY : idpStartDownload();   break;
        case IDIGNORE: ui.clickNextButton(); break;
        }
    }
}
Beispiel #2
0
void downloadFinished(Downloader *d, bool res)
{
	ui.unlockButtons(); // allow user to click Retry or Next

	if(res)
		ui.clickNextButton(); // go to next page
	else
	{	
		if(ui.hasRetryButton)
			ui.messageBox(ui.msg("Download failed") + _T(": ") + downloader.getLastErrorStr() + _T("\r\n") + (ui.allowContinue ?
			              ui.msg("Check your connection and click 'Retry' to try downloading the files again, or click 'Next' to continue installing anyway.") :
						  ui.msg("Check your connection and click 'Retry' to try downloading the files again, or click 'Cancel' to terminate setup.")),
						  ui.msg("Download failed"), MB_OK | MB_ICONWARNING);
		else
			if(ui.messageBox(ui.msg("Download failed") + _T(": ") + downloader.getLastErrorStr() + _T("\r\n") + (ui.allowContinue ?
			                 ui.msg("Check your connection and click 'Retry' to try downloading the files again, or click 'Next' to continue installing anyway.") :
						     ui.msg("Check your connection and click 'Retry' to try downloading the files again, or click 'Cancel' to terminate setup.")),
						     ui.msg("Download failed"), MB_OK | MB_ICONWARNING | MB_RETRYCANCEL) == IDRETRY)
				idpStartDownload();
	}
}
Beispiel #3
0
bool idpDownloadFilesCompUi()
{
    ui.lockButtons();
    downloader.ownMsgLoop = true;
    downloader.processMessages();
    downloader.setUi(&ui);
    downloader.setInternetOptions(internetOptions);
    
    bool res;

    while(true)
    {
        res = downloader.downloadFiles(true);

        TRACE(_T("idpDownloadFilesCompUi: ui.errorDlgMode == %d"), ui.errorDlgMode);

        if(res || (ui.errorDlgMode == DLG_NONE) || downloader.downloadCancelled)
            break; // go to next page
        else if(ui.errorDlgMode == DLG_SIMPLE)
        {
            int dlgRes = ui.messageBox(ui.msg("Download failed") + _T(": ") + downloader.getLastErrorStr() + _T("\r\n") + (ui.allowContinue ?
                                       ui.msg("Check your connection and click 'Retry' to try downloading the files again, or click 'Next' to continue installing anyway.") :
                                       ui.msg("Check your connection and click 'Retry' to try downloading the files again, or click 'Cancel' to terminate setup.")),
                                       ui.msg("Download failed"), MB_ICONWARNING | (ui.hasRetryButton ? MB_OK : MB_RETRYCANCEL));

            if     (dlgRes == IDRETRY)  continue;
            else if(dlgRes == IDCANCEL) break;
        }
        else
        {
            ui.dllHandle = idpDllHandle;

            int dlgRes = ui.errorDialog(&downloader);
            
            if     (dlgRes == IDRETRY)  continue;
            else if(dlgRes == IDABORT)  break;
            else if(dlgRes == IDIGNORE) break;
        }
    }

    ui.unlockButtons();
    return res;
}