mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 17:42:58 +00:00
[RAPPS] Build up a minimal UI for RAPPS started in AppWiz mode (#6655)
- Only the "Installed/Applications/Updates" items are shown. - Delete the "Settings" item in the "File" menu. - Remove unnecessary toolbar buttons: ID_INSTALL, ID_CHECK_ALL, ID_RESETDB. - gui.cpp CMainWindow::ProcessWindowMessage(): Forbid the "Install" tree-view section to collapse. However, there is currently a bug in Wine's comctl32, which ignores the value returned from the TVN_ITEMEXPANDING notification handler to control the collapse/expansion behaviour. https://bugs.winehq.org/show_bug.cgi?id=53727 As a result, this feature doesn't work in ReactOS yet.
This commit is contained in:
parent
b1a3479500
commit
9835ea27d2
3 changed files with 123 additions and 6 deletions
|
@ -82,7 +82,7 @@ CSideTreeView::~CSideTreeView()
|
|||
|
||||
// **** CMainWindow ****
|
||||
|
||||
CMainWindow::CMainWindow(CAppDB *db, BOOL bAppwiz) : m_ClientPanel(NULL), m_Db(db), bAppwizMode(bAppwiz), SelectedEnumType(ENUM_ALL_INSTALLED)
|
||||
CMainWindow::CMainWindow(CAppDB *db, BOOL bAppwiz) : m_ClientPanel(NULL), m_Db(db), m_bAppwizMode(bAppwiz), SelectedEnumType(ENUM_ALL_INSTALLED)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -100,6 +100,10 @@ CMainWindow::InitCategoriesList()
|
|||
m_TreeView->AddCategory(hRootItemInstalled, IDS_APPLICATIONS, IDI_APPS);
|
||||
m_TreeView->AddCategory(hRootItemInstalled, IDS_UPDATES, IDI_APPUPD);
|
||||
|
||||
// Do not show any other categories in APPWIZ-mode.
|
||||
if (m_bAppwizMode)
|
||||
goto Finish;
|
||||
|
||||
m_TreeView->AddCategory(TVI_ROOT, IDS_SELECTEDFORINST, IDI_SELECTEDFORINST);
|
||||
|
||||
hRootItemAvailable = m_TreeView->AddCategory(TVI_ROOT, IDS_AVAILABLEFORINST, IDI_CATEGORY);
|
||||
|
@ -120,10 +124,12 @@ CMainWindow::InitCategoriesList()
|
|||
m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_THEMES, IDI_CAT_THEMES);
|
||||
m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_OTHER, IDI_CAT_OTHER);
|
||||
|
||||
Finish:
|
||||
m_TreeView->SetImageList();
|
||||
m_TreeView->Expand(hRootItemInstalled, TVE_EXPAND);
|
||||
m_TreeView->Expand(hRootItemAvailable, TVE_EXPAND);
|
||||
m_TreeView->SelectItem(bAppwizMode ? hRootItemInstalled : hRootItemAvailable);
|
||||
if (!m_bAppwizMode)
|
||||
m_TreeView->Expand(hRootItemAvailable, TVE_EXPAND);
|
||||
m_TreeView->SelectItem(m_bAppwizMode ? hRootItemInstalled : hRootItemAvailable);
|
||||
}
|
||||
|
||||
BOOL
|
||||
|
@ -337,6 +343,22 @@ CMainWindow::ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lPa
|
|||
|
||||
switch (data->code)
|
||||
{
|
||||
case TVN_ITEMEXPANDING:
|
||||
{
|
||||
if (data->hwndFrom == m_TreeView->m_hWnd)
|
||||
{
|
||||
// APPWIZ-mode: forbid item collapse.
|
||||
// FIXME: Prevent collapse (COMCTL32 is buggy)
|
||||
// https://bugs.winehq.org/show_bug.cgi?id=53727
|
||||
if (m_bAppwizMode && (((LPNMTREEVIEW)lParam)->action & TVE_TOGGLE) == TVE_COLLAPSE)
|
||||
{
|
||||
theResult = TRUE;
|
||||
return TRUE; // Handled
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case TVN_SELCHANGED:
|
||||
{
|
||||
if (data->hwndFrom == m_TreeView->m_hWnd)
|
||||
|
@ -612,6 +634,13 @@ CMainWindow::AddApplicationsToView(CAtlList<CAppInfo *> &List)
|
|||
VOID
|
||||
CMainWindow::UpdateApplicationsList(AppsCategories EnumType, BOOL bReload, BOOL bCheckAvailable)
|
||||
{
|
||||
// Only installed applications should be enumerated in APPWIZ-mode.
|
||||
if (m_bAppwizMode && !IsInstalledEnum(EnumType))
|
||||
{
|
||||
ATLASSERT(FALSE && "Should not be called in APPWIZ-mode");
|
||||
return;
|
||||
}
|
||||
|
||||
bUpdating = TRUE;
|
||||
|
||||
if (HCURSOR hCursor = LoadCursor(NULL, IDC_APPSTARTING))
|
||||
|
@ -650,6 +679,9 @@ CMainWindow::UpdateApplicationsList(AppsCategories EnumType, BOOL bReload, BOOL
|
|||
}
|
||||
else if (IsAvailableEnum(EnumType))
|
||||
{
|
||||
// We shouldn't get there in APPWIZ-mode.
|
||||
ATLASSERT(!m_bAppwizMode);
|
||||
|
||||
if (bReload)
|
||||
m_Db->UpdateAvailable();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue