mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
[RAPPS] Prevent download dialog placeholder from displaying
CORE-13915
This commit is contained in:
parent
82b12ef4cf
commit
ee019e12fa
1 changed files with 27 additions and 21 deletions
|
@ -393,6 +393,7 @@ INT_PTR CALLBACK CDownloadManager::DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM w
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
{
|
{
|
||||||
HICON hIconSm, hIconBg;
|
HICON hIconSm, hIconBg;
|
||||||
|
ATL::CStringW szTempCaption;
|
||||||
|
|
||||||
hIconBg = (HICON) GetClassLongW(hMainWnd, GCLP_HICON);
|
hIconBg = (HICON) GetClassLongW(hMainWnd, GCLP_HICON);
|
||||||
hIconSm = (HICON) GetClassLongW(hMainWnd, GCLP_HICONSM);
|
hIconSm = (HICON) GetClassLongW(hMainWnd, GCLP_HICONSM);
|
||||||
|
@ -423,11 +424,16 @@ INT_PTR CALLBACK CDownloadManager::DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM w
|
||||||
}
|
}
|
||||||
DownloadsListView.LoadList(AppsToInstallList);
|
DownloadsListView.LoadList(AppsToInstallList);
|
||||||
|
|
||||||
ShowWindow(Dlg, SW_SHOW);
|
|
||||||
|
|
||||||
// Get a dlg string for later use
|
// Get a dlg string for later use
|
||||||
GetWindowTextW(Dlg, szCaption, MAX_PATH);
|
GetWindowTextW(Dlg, szCaption, MAX_PATH);
|
||||||
|
|
||||||
|
// Hide a placeholder from displaying
|
||||||
|
szTempCaption = szCaption;
|
||||||
|
szTempCaption.Replace(L"%ls", L"");
|
||||||
|
SetWindowText(Dlg, szTempCaption.GetString());
|
||||||
|
|
||||||
|
ShowWindow(Dlg, SW_SHOW);
|
||||||
|
|
||||||
// Start download process
|
// Start download process
|
||||||
DownloadParam *param = new DownloadParam(Dlg, AppsToInstallList, szCaption);
|
DownloadParam *param = new DownloadParam(Dlg, AppsToInstallList, szCaption);
|
||||||
DWORD ThreadId;
|
DWORD ThreadId;
|
||||||
|
@ -580,6 +586,25 @@ DWORD WINAPI CDownloadManager::ThreadFunc(LPVOID param)
|
||||||
|
|
||||||
for (iAppId = 0; iAppId < InfoArray.GetSize(); ++iAppId)
|
for (iAppId = 0; iAppId < InfoArray.GetSize(); ++iAppId)
|
||||||
{
|
{
|
||||||
|
// Reset progress bar
|
||||||
|
Item = GetDlgItem(hDlg, IDC_DOWNLOAD_PROGRESS);
|
||||||
|
if (Item)
|
||||||
|
{
|
||||||
|
SendMessageW(Item, PBM_SETPOS, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Change caption to show the currently downloaded app
|
||||||
|
if (!bCab)
|
||||||
|
{
|
||||||
|
szNewCaption.Format(szCaption, InfoArray[iAppId].szName.GetString());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
szNewCaption.LoadStringW(IDS_DL_DIALOG_DB_DOWNLOAD_DISP);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetWindowTextW(hDlg, szNewCaption.GetString());
|
||||||
|
|
||||||
// build the path for the download
|
// build the path for the download
|
||||||
p = wcsrchr(InfoArray[iAppId].szUrl.GetString(), L'/');
|
p = wcsrchr(InfoArray[iAppId].szUrl.GetString(), L'/');
|
||||||
q = wcsrchr(InfoArray[iAppId].szUrl.GetString(), L'?');
|
q = wcsrchr(InfoArray[iAppId].szUrl.GetString(), L'?');
|
||||||
|
@ -626,25 +651,6 @@ DWORD WINAPI CDownloadManager::ThreadFunc(LPVOID param)
|
||||||
goto run;
|
goto run;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset progress bar
|
|
||||||
Item = GetDlgItem(hDlg, IDC_DOWNLOAD_PROGRESS);
|
|
||||||
if (Item)
|
|
||||||
{
|
|
||||||
SendMessageW(Item, PBM_SETPOS, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Change caption to show the currently downloaded app
|
|
||||||
if (!bCab)
|
|
||||||
{
|
|
||||||
szNewCaption.Format(szCaption, InfoArray[iAppId].szName.GetString());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
szNewCaption.LoadStringW(IDS_DL_DIALOG_DB_DOWNLOAD_DISP);
|
|
||||||
}
|
|
||||||
|
|
||||||
SetWindowTextW(hDlg, szNewCaption.GetString());
|
|
||||||
|
|
||||||
// Add the download URL
|
// Add the download URL
|
||||||
SetDlgItemTextW(hDlg, IDC_DOWNLOAD_STATUS, InfoArray[iAppId].szUrl.GetString());
|
SetDlgItemTextW(hDlg, IDC_DOWNLOAD_STATUS, InfoArray[iAppId].szUrl.GetString());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue