Author: ashaposhnikov
Date: Thu Aug 24 23:48:10 2017
New Revision: 75664
URL:
http://svn.reactos.org/svn/reactos?rev=75664&view=rev
Log:
[RAPPS]
- HACKFIX for ReactOS in gui.cpp - prevent counting below zero
see explanation comment
- Fix for percentage being shown incorrectly
Modified:
branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/loaddlg.cpp
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp [iso-8859-1] Thu Aug
24 23:48:10 2017
@@ -1059,7 +1059,17 @@
if ((pnic->uNewState & LVIS_STATEIMAGEMASK) &&
!bUpdating)
{
BOOL checked = ListView_GetCheckState(pnic->hdr.hwndFrom,
pnic->iItem);
- nSelectedApps += (checked) ? 1 : -1;
+ /* FIXME: HAX!
+ - preventing decremention below zero as a safeguard for ReactOS
+ In ReactOS this action is triggered whenever user changes
*selection*, but should be only when *checkbox* state toggled
+ Maybe LVIS_STATEIMAGEMASK is set incorrectly
+ */
+ nSelectedApps +=
+ (checked)
+ ? 1
+ :((nSelectedApps > 0)
+ ? -1
+ : 0);
UpdateStatusBarText();
}
}
@@ -1290,7 +1300,7 @@
break;
case ID_INSTALL:
- if (nSelectedApps)
+ if (nSelectedApps > 0)
{
CDownloadManager::DownloadListOfApplications(m_ListView->GetCheckedItems());
UpdateApplicationsList(-1);
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/loaddlg.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/loaddlg.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/loaddlg.cpp [iso-8859-1] Thu
Aug 24 23:48:10 2017
@@ -163,9 +163,9 @@
m_UrlHasBeenCopied = TRUE;
}
- SetLastError(0);
+ SetLastError(ERROR_SUCCESS);
r = GetWindowLongPtrW(m_hDialog, GWLP_USERDATA);
- if (0 != r || 0 != GetLastError())
+ if (r || GetLastError() != ERROR_SUCCESS)
{
*m_pbCancelled = TRUE;
return E_ABORT;
@@ -432,7 +432,7 @@
case WM_CLOSE:
EndDialog(Dlg, 0);
- DestroyWindow(Dlg);
+ //DestroyWindow(Dlg);
return TRUE;
default:
@@ -719,6 +719,7 @@
if (hOut == INVALID_HANDLE_VALUE)
goto end;
+ dwCurrentBytesRead = 0;
do
{
if (!InternetReadFile(hFile, lpBuffer, _countof(lpBuffer),
&dwBytesRead))
@@ -734,7 +735,7 @@
}
dwCurrentBytesRead += dwBytesRead;
- dl->OnProgress(dwCurrentBytesRead, dwContentLen, 0,
pCurrentInfo->szUrlDownload);
+ dl->OnProgress(dwCurrentBytesRead, dwContentLen, 0,
pCurrentInfo->szUrlDownload.GetString());
} while (dwBytesRead && !bCancelled);
CloseHandle(hOut);
@@ -870,6 +871,5 @@
hMainWnd,
DownloadDlgProc);
}
-
}
// CDownloadManager