Author: ashaposhnikov
Date: Sun Sep 3 21:10:24 2017
New Revision: 75761
URL:
http://svn.reactos.org/svn/reactos?rev=75761&view=rev
Log:
[RAPPS] Merged two Installed and Available enum values into one enum
Modified:
branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/defines.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/installed.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/installed.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/winmain.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] Sun Sep
3 21:10:24 2017
@@ -923,7 +923,7 @@
FreeLogs();
m_AvailableApps.FreeCachedEntries();
- if (IS_INSTALLED_ENUM(SelectedEnumType))
+ if (IsInstalledEnum(SelectedEnumType))
FreeInstalledAppList();
delete m_ClientPanel;
@@ -953,7 +953,7 @@
break;
case IDS_APPLICATIONS:
- UpdateApplicationsList(ENUM_APPLICATIONS);
+ UpdateApplicationsList(ENUM_INSTALLED_APPLICATIONS);
break;
case IDS_UPDATES:
@@ -1087,7 +1087,7 @@
(pnic->uNewState & LVIS_FOCUSED) &&
!(pnic->uOldState & LVIS_FOCUSED))
{
- if (IS_INSTALLED_ENUM(SelectedEnumType))
+ if (IsInstalledEnum(SelectedEnumType))
ShowInstalledAppInfo(ItemIndex);
if (IsAvailableEnum(SelectedEnumType))
CAvailableAppView::ShowAvailableAppInfo(ItemIndex);
@@ -1125,7 +1125,7 @@
{
if (data->hwndFrom == m_ListView->m_hWnd && ((LPNMLISTVIEW)
lParam)->iItem != -1)
{
- if (IS_INSTALLED_ENUM(SelectedEnumType))
+ if (IsInstalledEnum(SelectedEnumType))
ShowInstalledAppInfo(-1);
if (IsAvailableEnum(SelectedEnumType))
CAvailableAppView::ShowAvailableAppInfo(-1);
@@ -1502,7 +1502,7 @@
{
ATL::CStringW szBuffer1, szBuffer2;
HIMAGELIST hImageListView;
- BOOL bWasInInstalled = IS_INSTALLED_ENUM(SelectedEnumType);
+ BOOL bWasInInstalled = IsInstalledEnum(SelectedEnumType);
bUpdating = TRUE;
m_ListView->SetRedraw(FALSE);
@@ -1533,7 +1533,7 @@
ImageList_Destroy(hImageListBuf);
}
- if (IS_INSTALLED_ENUM(EnumType))
+ if (IsInstalledEnum(EnumType))
{
if (!bWasInInstalled)
{
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
---
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h [iso-8859-1]
(original)
+++
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h [iso-8859-1]
Sun Sep 3 21:10:24 2017
@@ -6,34 +6,6 @@
#include <atlcoll.h>
#include "misc.h"
-
-/* EnumType flags for EnumAvailableApplications */
-enum AvailableCategories
-{
- ENUM_ALL_AVAILABLE,
- ENUM_CAT_AUDIO,
- ENUM_CAT_VIDEO,
- ENUM_CAT_GRAPHICS,
- ENUM_CAT_GAMES,
- ENUM_CAT_INTERNET,
- ENUM_CAT_OFFICE,
- ENUM_CAT_DEVEL,
- ENUM_CAT_EDU,
- ENUM_CAT_ENGINEER,
- ENUM_CAT_FINANCE,
- ENUM_CAT_SCIENCE,
- ENUM_CAT_TOOLS,
- ENUM_CAT_DRIVERS,
- ENUM_CAT_LIBS,
- ENUM_CAT_OTHER,
- ENUM_AVAILABLE_MIN = ENUM_ALL_AVAILABLE,
- ENUM_AVAILABLE_MAX = ENUM_CAT_OTHER
-};
-
-inline BOOL IsAvailableEnum(INT x)
-{
- return (x >= AvailableCategories::ENUM_AVAILABLE_MIN && x <=
AvailableCategories::ENUM_AVAILABLE_MAX);
-}
enum LicenseType
{
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/defines.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
---
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/defines.h [iso-8859-1]
(original)
+++
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/defines.h [iso-8859-1]
Sun Sep 3 21:10:24 2017
@@ -31,4 +31,40 @@
#define APPLICATION_DATABASE_URL
L"https://svn.reactos.org/packages/rappmgr.cab"
#define MAX_STR_LEN 256
-#define ENUM_ALL_COMPONENTS 30
+
+enum AppsCategories
+{
+ ENUM_ALL_AVAILABLE,
+ ENUM_CAT_AUDIO,
+ ENUM_CAT_VIDEO,
+ ENUM_CAT_GRAPHICS,
+ ENUM_CAT_GAMES,
+ ENUM_CAT_INTERNET,
+ ENUM_CAT_OFFICE,
+ ENUM_CAT_DEVEL,
+ ENUM_CAT_EDU,
+ ENUM_CAT_ENGINEER,
+ ENUM_CAT_FINANCE,
+ ENUM_CAT_SCIENCE,
+ ENUM_CAT_TOOLS,
+ ENUM_CAT_DRIVERS,
+ ENUM_CAT_LIBS,
+ ENUM_CAT_OTHER,
+ ENUM_ALL_INSTALLED,
+ ENUM_INSTALLED_APPLICATIONS = 31,
+ ENUM_UPDATES = 32,
+ ENUM_INSTALLED_MIN = ENUM_ALL_INSTALLED,
+ ENUM_INSTALLED_MAX = ENUM_UPDATES,
+ ENUM_AVAILABLE_MIN = ENUM_ALL_AVAILABLE,
+ ENUM_AVAILABLE_MAX = ENUM_CAT_OTHER,
+};
+
+inline BOOL IsAvailableEnum(INT x)
+{
+ return (x >= AppsCategories::ENUM_AVAILABLE_MIN && x <=
AppsCategories::ENUM_AVAILABLE_MAX);
+}
+
+inline BOOL IsInstalledEnum(INT x)
+{
+ return (x >= AppsCategories::ENUM_INSTALLED_MIN && x <=
AppsCategories::ENUM_INSTALLED_MAX);
+}
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/installed.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
---
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/installed.h [iso-8859-1]
(original)
+++
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/installed.h [iso-8859-1]
Sun Sep 3 21:10:24 2017
@@ -2,14 +2,6 @@
#include <windef.h>
#include <atlstr.h>
-
-#define ENUM_APPLICATIONS 31
-#define ENUM_UPDATES 32
-
-#define ENUM_INSTALLED_MIN ENUM_ALL_COMPONENTS
-#define ENUM_INSTALLED_MAX ENUM_UPDATES
-
-#define IS_INSTALLED_ENUM(a) (a >= ENUM_INSTALLED_MIN && a <=
ENUM_INSTALLED_MAX)
struct INSTALLED_INFO
{
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/installed.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/installed.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/installed.cpp [iso-8859-1]
Sun Sep 3 21:10:24 2017
@@ -54,7 +54,7 @@
HKEY hKey;
PINSTALLED_INFO ItemInfo;
- if (!IS_INSTALLED_ENUM(SelectedEnumType))
+ if (!IsInstalledEnum(SelectedEnumType))
return FALSE;
if (Index == -1)
@@ -146,7 +146,7 @@
ATL::CStringW szMsgText, szMsgTitle;
INT ItemIndex = SendMessageW(hListView, LVM_GETNEXTITEM, -1, LVNI_FOCUSED);
- if (!IS_INSTALLED_ENUM(SelectedEnumType))
+ if (!IsInstalledEnum(SelectedEnumType))
return;
Info = (PINSTALLED_INFO) ListViewGetlParam(Index);
@@ -238,13 +238,13 @@
&dwSize) == ERROR_SUCCESS)
{
szDisplayName.ReleaseBuffer();
- if (EnumType < ENUM_ALL_COMPONENTS || EnumType > ENUM_UPDATES)
- EnumType = ENUM_ALL_COMPONENTS;
+ if (EnumType < ENUM_ALL_INSTALLED || EnumType > ENUM_UPDATES)
+ EnumType = ENUM_ALL_INSTALLED;
if (!bIsSystemComponent)
{
- if ((EnumType == ENUM_ALL_COMPONENTS) || /* All components */
- ((EnumType == ENUM_APPLICATIONS) && (!bIsUpdate)) || /*
Applications only */
+ if ((EnumType == ENUM_ALL_INSTALLED) || /* All components */
+ ((EnumType == ENUM_INSTALLED_APPLICATIONS) &&
(!bIsUpdate)) || /* Applications only */
((EnumType == ENUM_UPDATES) && (bIsUpdate))) /* Updates
only */
{
if (!lpEnumProc(ItemIndex, szDisplayName, &Info))
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/winmain.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/winmain.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/winmain.cpp [iso-8859-1] Sun
Sep 3 21:10:24 2017
@@ -15,7 +15,7 @@
HWND hMainWnd;
HINSTANCE hInst;
-INT SelectedEnumType = ENUM_ALL_COMPONENTS;
+INT SelectedEnumType = ENUM_ALL_INSTALLED;
SETTINGS_INFO SettingsInfo;
ATL::CStringW szSearchPattern;