mirror of
https://github.com/reactos/reactos.git
synced 2025-04-05 21:21:33 +00:00
[RAPPS] Don't download database at startup if appwiz mode (#6319)
Providing quick access of Control Panel "Add/Remove Programs". JIRA issue: CORE-19419 - Don't download the database if bAppwizMode in ParseCmdAndExecute function. - Add CAppDB::GetAvailableCount method. - Add CMainWindow::CheckAvailable method. - Use CMainWindow::CheckAvailable in some cases of TVN_SELCHANGED handling.
This commit is contained in:
parent
d3ae8258c2
commit
e694e24720
4 changed files with 46 additions and 30 deletions
|
@ -293,6 +293,16 @@ CMainWindow::UninstallSelectedApp(BOOL bModify)
|
|||
return InstalledApp->UninstallApplication(bModify);
|
||||
}
|
||||
|
||||
VOID
|
||||
CMainWindow::CheckAvailable()
|
||||
{
|
||||
if (m_Db->GetAvailableCount() == 0)
|
||||
{
|
||||
m_Db->RemoveCached();
|
||||
m_Db->UpdateAvailable();
|
||||
}
|
||||
}
|
||||
|
||||
BOOL
|
||||
CMainWindow::ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
|
||||
{
|
||||
|
@ -346,71 +356,71 @@ CMainWindow::ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lPa
|
|||
break;
|
||||
|
||||
case IDS_AVAILABLEFORINST:
|
||||
UpdateApplicationsList(ENUM_ALL_AVAILABLE);
|
||||
UpdateApplicationsList(ENUM_ALL_AVAILABLE, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_CAT_AUDIO:
|
||||
UpdateApplicationsList(ENUM_CAT_AUDIO);
|
||||
UpdateApplicationsList(ENUM_CAT_AUDIO, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_CAT_DEVEL:
|
||||
UpdateApplicationsList(ENUM_CAT_DEVEL);
|
||||
UpdateApplicationsList(ENUM_CAT_DEVEL, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_CAT_DRIVERS:
|
||||
UpdateApplicationsList(ENUM_CAT_DRIVERS);
|
||||
UpdateApplicationsList(ENUM_CAT_DRIVERS, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_CAT_EDU:
|
||||
UpdateApplicationsList(ENUM_CAT_EDU);
|
||||
UpdateApplicationsList(ENUM_CAT_EDU, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_CAT_ENGINEER:
|
||||
UpdateApplicationsList(ENUM_CAT_ENGINEER);
|
||||
UpdateApplicationsList(ENUM_CAT_ENGINEER, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_CAT_FINANCE:
|
||||
UpdateApplicationsList(ENUM_CAT_FINANCE);
|
||||
UpdateApplicationsList(ENUM_CAT_FINANCE, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_CAT_GAMES:
|
||||
UpdateApplicationsList(ENUM_CAT_GAMES);
|
||||
UpdateApplicationsList(ENUM_CAT_GAMES, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_CAT_GRAPHICS:
|
||||
UpdateApplicationsList(ENUM_CAT_GRAPHICS);
|
||||
UpdateApplicationsList(ENUM_CAT_GRAPHICS, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_CAT_INTERNET:
|
||||
UpdateApplicationsList(ENUM_CAT_INTERNET);
|
||||
UpdateApplicationsList(ENUM_CAT_INTERNET, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_CAT_LIBS:
|
||||
UpdateApplicationsList(ENUM_CAT_LIBS);
|
||||
UpdateApplicationsList(ENUM_CAT_LIBS, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_CAT_OFFICE:
|
||||
UpdateApplicationsList(ENUM_CAT_OFFICE);
|
||||
UpdateApplicationsList(ENUM_CAT_OFFICE, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_CAT_OTHER:
|
||||
UpdateApplicationsList(ENUM_CAT_OTHER);
|
||||
UpdateApplicationsList(ENUM_CAT_OTHER, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_CAT_SCIENCE:
|
||||
UpdateApplicationsList(ENUM_CAT_SCIENCE);
|
||||
UpdateApplicationsList(ENUM_CAT_SCIENCE, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_CAT_TOOLS:
|
||||
UpdateApplicationsList(ENUM_CAT_TOOLS);
|
||||
UpdateApplicationsList(ENUM_CAT_TOOLS, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_CAT_VIDEO:
|
||||
UpdateApplicationsList(ENUM_CAT_VIDEO);
|
||||
UpdateApplicationsList(ENUM_CAT_VIDEO, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_CAT_THEMES:
|
||||
UpdateApplicationsList(ENUM_CAT_THEMES);
|
||||
UpdateApplicationsList(ENUM_CAT_THEMES, FALSE, TRUE);
|
||||
break;
|
||||
|
||||
case IDS_SELECTEDFORINST:
|
||||
|
@ -591,10 +601,13 @@ CMainWindow::AddApplicationsToView(CAtlList<CAppInfo *> &List)
|
|||
}
|
||||
|
||||
VOID
|
||||
CMainWindow::UpdateApplicationsList(AppsCategories EnumType, BOOL bReload)
|
||||
CMainWindow::UpdateApplicationsList(AppsCategories EnumType, BOOL bReload, BOOL bCheckAvailable)
|
||||
{
|
||||
bUpdating = TRUE;
|
||||
|
||||
if (bCheckAvailable)
|
||||
CheckAvailable();
|
||||
|
||||
if (SelectedEnumType != EnumType)
|
||||
SelectedEnumType = EnumType;
|
||||
|
||||
|
|
|
@ -32,4 +32,9 @@ class CAppDB
|
|||
|
||||
BOOL
|
||||
RemoveInstalledAppFromRegistry(const CAppInfo *Info);
|
||||
|
||||
size_t GetAvailableCount() const
|
||||
{
|
||||
return m_Available.GetCount();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -90,6 +90,9 @@ class CMainWindow : public CWindowImpl<CMainWindow, CWindow, CFrameWinTraits>
|
|||
VOID
|
||||
OnSize(HWND hwnd, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
VOID
|
||||
CheckAvailable();
|
||||
|
||||
BOOL
|
||||
RemoveSelectedAppFromRegistry();
|
||||
BOOL
|
||||
|
@ -105,7 +108,7 @@ class CMainWindow : public CWindowImpl<CMainWindow, CWindow, CFrameWinTraits>
|
|||
UpdateStatusBarText();
|
||||
|
||||
VOID
|
||||
UpdateApplicationsList(AppsCategories EnumType, BOOL bReload = FALSE);
|
||||
UpdateApplicationsList(AppsCategories EnumType, BOOL bReload = FALSE, BOOL bCheckAvailable = FALSE);
|
||||
VOID
|
||||
AddApplicationsToView(CAtlList<CAppInfo *> &List);
|
||||
|
||||
|
|
|
@ -222,27 +222,22 @@ ParseCmdAndExecute(LPWSTR lpCmdLine, BOOL bIsFirstLaunch, int nCmdShow)
|
|||
{
|
||||
INT argc;
|
||||
LPWSTR *argv = CommandLineToArgvW(lpCmdLine, &argc);
|
||||
BOOL bAppwizMode = FALSE;
|
||||
|
||||
if (!argv)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
CStringW Directory;
|
||||
GetStorageDirectory(Directory);
|
||||
CAppDB db(Directory);
|
||||
|
||||
if (argc > 1 && MatchCmdOption(argv[1], CMD_KEY_APPWIZ))
|
||||
BOOL bAppwizMode = (argc > 1 && MatchCmdOption(argv[1], CMD_KEY_APPWIZ));
|
||||
if (!bAppwizMode)
|
||||
{
|
||||
bAppwizMode = TRUE;
|
||||
if (SettingsInfo.bUpdateAtStart || bIsFirstLaunch)
|
||||
db.RemoveCached();
|
||||
|
||||
db.UpdateAvailable();
|
||||
}
|
||||
|
||||
if (SettingsInfo.bUpdateAtStart || bIsFirstLaunch)
|
||||
{
|
||||
db.RemoveCached();
|
||||
}
|
||||
db.UpdateAvailable();
|
||||
db.UpdateInstalled();
|
||||
|
||||
if (argc == 1 || bAppwizMode) // RAPPS is launched without options or APPWIZ mode is requested
|
||||
|
|
Loading…
Reference in a new issue