[RAPPS] Refresh item info after installer completes (#7697)

- Refresh the details view of the item that was just installed.
- Hint update of uninstallers list is needed.
- Restore focus correctly after installer process finishes.

CORE-17677
This commit is contained in:
Whindmar Saksit 2025-02-07 21:33:19 +01:00 committed by GitHub
parent a610016952
commit 5bc6d59142
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 109 additions and 29 deletions

View file

@ -955,19 +955,22 @@ CAppInfoDisplay::Create(HWND hwndParent)
}
VOID
CAppInfoDisplay::ShowAppInfo(CAppInfo *Info)
CAppInfoDisplay::ShowAppInfo(CAppInfo &Info, bool OnlyUpdateText)
{
CStringW ScrnshotLocation;
if (Info->RetrieveScreenshot(ScrnshotLocation))
if (!OnlyUpdateText)
{
ScrnshotPrev->DisplayImage(ScrnshotLocation);
}
else
{
ScrnshotPrev->DisplayEmpty();
CStringW ScrnshotLocation;
if (Info.RetrieveScreenshot(ScrnshotLocation))
{
ScrnshotPrev->DisplayImage(ScrnshotLocation);
}
else
{
ScrnshotPrev->DisplayEmpty();
}
}
ResizeChildren();
Info->ShowAppInfo(RichEdit);
Info.ShowAppInfo(RichEdit);
}
void
@ -1805,6 +1808,22 @@ CApplicationView::SetRedraw(BOOL bRedraw)
m_ListView->SetRedraw(bRedraw);
}
void
CApplicationView::RefreshAvailableItem(PCWSTR PackageName)
{
if (ApplicationViewType != AppViewTypeAvailableApps || !PackageName)
return;
CAppInfo *pApp;
for (UINT i = 0; (pApp = (CAppInfo*)m_ListView->GetItemData(i)) != NULL; ++i)
{
if (pApp->szIdentifier.CompareNoCase(PackageName) == 0)
{
RefreshDetailsPane(*pApp, true);
break;
}
}
}
void
CApplicationView::SetFocusOnSearchBar()
{
@ -2134,6 +2153,12 @@ CApplicationView::RestoreListSelection(const RESTORELISTSELECTION &Restore)
}
}
VOID
CApplicationView::RefreshDetailsPane(CAppInfo &Info, bool OnlyUpdateText)
{
m_AppsInfo->ShowAppInfo(Info, OnlyUpdateText);
}
// this function is called when a item of listview get focus.
// CallbackParam is the param passed to listview when adding the item (the one getting focus now).
VOID
@ -2142,7 +2167,7 @@ CApplicationView::ItemGetFocus(LPVOID CallbackParam)
if (CallbackParam)
{
CAppInfo *Info = static_cast<CAppInfo *>(CallbackParam);
m_AppsInfo->ShowAppInfo(Info);
RefreshDetailsPane(*Info);
if (ApplicationViewType == AppViewTypeInstalledApps)
{