[RAPPS] Open "Installed" section in Appwiz-mode when RAPPS already runs
authorStanislav Motylkov <x86corez@gmail.com>
Sun, 21 May 2023 22:40:56 +0000 (01:40 +0300)
committerStanislav Motylkov <x86corez@gmail.com>
Sat, 27 May 2023 12:38:01 +0000 (15:38 +0300)
CORE-18981

base/applications/rapps/gui.cpp
base/applications/rapps/include/gui.h
base/applications/rapps/include/resource.h
base/applications/rapps/unattended.cpp

index 9073b7b..9601a0c 100644 (file)
@@ -94,7 +94,7 @@ CMainWindow::~CMainWindow()
 VOID
 CMainWindow::InitCategoriesList()
 {
-    HTREEITEM hRootItemInstalled, hRootItemAvailable;
+    HTREEITEM hRootItemAvailable;
 
     hRootItemInstalled = m_TreeView->AddCategory(TVI_ROOT, IDS_INSTALLED, IDI_CATEGORY);
     m_TreeView->AddCategory(hRootItemInstalled, IDS_APPLICATIONS, IDI_APPS);
@@ -557,6 +557,11 @@ CMainWindow::OnCommand(WPARAM wParam, LPARAM lParam)
             case ID_CHECK_ALL:
                 m_ApplicationView->CheckAll();
                 break;
+
+            case ID_ACTIVATE_APPWIZ:
+                if (hRootItemInstalled)
+                    m_TreeView->SelectItem(hRootItemInstalled);
+                break;
         }
     }
 }
index 07a0735..e81b4eb 100644 (file)
@@ -58,6 +58,7 @@ class CMainWindow : public CWindowImpl<CMainWindow, CWindow, CFrameWinTraits>
 
     BOOL bUpdating = FALSE;
     BOOL bAppwizMode;
+    HTREEITEM hRootItemInstalled;
 
     CStringW szSearchPattern;
     AppsCategories SelectedEnumType;
index e85d2d3..c8a4e53 100644 (file)
@@ -85,6 +85,9 @@
 #define ID_CHECK_ALL             562
 #define ID_SEARCH                563
 
+/* Messages */
+#define ID_ACTIVATE_APPWIZ       600
+
 /* Strings */
 #define IDS_APPTITLE             100
 #define IDS_SEARCH_TEXT          101
index a8a21d6..1525e4b 100644 (file)
@@ -259,6 +259,8 @@ ParseCmdAndExecute(LPWSTR lpCmdLine, BOOL bIsFirstLaunch, int nCmdShow)
             /* Activate window */
             ShowWindow(hWindow, SW_SHOWNORMAL);
             SetForegroundWindow(hWindow);
+            if (bAppwizMode)
+                PostMessage(hWindow, WM_COMMAND, ID_ACTIVATE_APPWIZ, 0);
             return FALSE;
         }