From 60cd25c677867a4c3dcd4c470a52d671c07f8244 Mon Sep 17 00:00:00 2001 From: NicJA Date: Thu, 16 Mar 2017 01:57:58 +0000 Subject: [PATCH] wip layout correction. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@54142 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/tools/SysExplorer/enum_gfx.c | 1 + workbench/tools/SysExplorer/enum_storage.c | 13 ++++++++++++- workbench/tools/SysExplorer/enums.h | 2 ++ workbench/tools/SysExplorer/main.c | 15 ++++++++++++++- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/workbench/tools/SysExplorer/enum_gfx.c b/workbench/tools/SysExplorer/enum_gfx.c index a54cc0a47c..1371f5fc13 100644 --- a/workbench/tools/SysExplorer/enum_gfx.c +++ b/workbench/tools/SysExplorer/enum_gfx.c @@ -44,6 +44,7 @@ static void addGgfxDisplay(OOP_Object *obj, struct MUI_NListtree_TreeNode *paren OOP_GetAttr(obj, aHidd_Name, (IPTR *)&name); + sysExplGlobalCount++; DoMethod(hidd_tree, MUIM_NListtree_Insert, name, &msg, parent, MUIV_NListtree_Insert_PrevNode_Tail, 0); } diff --git a/workbench/tools/SysExplorer/enum_storage.c b/workbench/tools/SysExplorer/enum_storage.c index 8a93a2dc56..7173ee2dab 100644 --- a/workbench/tools/SysExplorer/enum_storage.c +++ b/workbench/tools/SysExplorer/enum_storage.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2015-2016, The AROS Development Team. + Copyright (C) 2015-2017, The AROS Development Team. $Id$ */ @@ -55,6 +55,8 @@ static void addATAUnit(OOP_Object *dev, ULONG attrID, struct MUI_NListtree_TreeN }; CONST_STRPTR name; + sysExplGlobalCount++; + OOP_GetAttr(unit, aHidd_ATAUnit_Model, (IPTR *)&name); DoMethod(hidd_tree, MUIM_NListtree_Insert, name, &msg, parent, MUIV_NListtree_Insert_PrevNode_Tail, 0); @@ -102,11 +104,15 @@ AROS_UFH3S(BOOL, storageenumFunc, if (objValid) { + int objnum; + /* This is either HW or HIDD subclass */ OOP_GetAttr(obj, aHW_ClassName, (IPTR *)&name); if (!name) OOP_GetAttr(obj, aHidd_HardwareName, (IPTR *)&name); + objnum = ++sysExplGlobalCount; + tn = (APTR)DoMethod(hidd_tree, MUIM_NListtree_Insert, name, &msg, parent, MUIV_NListtree_Insert_PrevNode_Sorted, flags); D(bug("Inserted TreeNode 0x%p <%s> UserData 0x%p\n", tn, tn->tn_Name, tn->tn_User)); @@ -114,6 +120,11 @@ AROS_UFH3S(BOOL, storageenumFunc, /* If we have enumerator for this class, call it now */ if (clHandlers && clHandlers->enumFunc && (flags & TNF_LIST)) clHandlers->enumFunc(obj, tn); + + if (objnum == sysExplGlobalCount) + { + tn->tn_Flags &= ~flags; + } } return FALSE; /* Continue enumeration */ diff --git a/workbench/tools/SysExplorer/enums.h b/workbench/tools/SysExplorer/enums.h index db352aca73..ee95d88101 100644 --- a/workbench/tools/SysExplorer/enums.h +++ b/workbench/tools/SysExplorer/enums.h @@ -1,4 +1,5 @@ + struct ObjectUserData { OOP_Object *obj; @@ -24,6 +25,7 @@ struct ClassHandlerNode }; extern Object *hidd_tree; +extern int sysExplGlobalCount; extern BOOL RegisterClassHandler(CONST_STRPTR, BYTE pri, struct MUI_CustomClass **, CLASS_ENUMFUNC enumfunc, CLASS_VALIDFUNC validfunc); extern struct ClassHandlerNode *FindClassHandler(CONST_STRPTR, struct List *); diff --git a/workbench/tools/SysExplorer/main.c b/workbench/tools/SysExplorer/main.c index 037ec47996..ff946e747d 100644 --- a/workbench/tools/SysExplorer/main.c +++ b/workbench/tools/SysExplorer/main.c @@ -54,6 +54,8 @@ const struct OOP_ABDescr abd[] = {NULL , NULL } }; +int sysExplGlobalCount; + /* * This lists contains handlers for known public classes. * It specifies information window class, as well as function @@ -94,18 +96,27 @@ AROS_UFH3S(BOOL, enumFunc, if (objValid) { + int objnum; + /* This is either HW or HIDD subclass */ OOP_GetAttr(obj, aHW_ClassName, (IPTR *)&name); if (!name) OOP_GetAttr(obj, aHidd_HardwareName, (IPTR *)&name); + objnum = ++sysExplGlobalCount; tn = (APTR)DoMethod(hidd_tree, MUIM_NListtree_Insert, name, &msg, parent, MUIV_NListtree_Insert_PrevNode_Sorted, flags); + D(bug("Inserted TreeNode 0x%p <%s> UserData 0x%p\n", tn, tn->tn_Name, tn->tn_User)); /* If we have enumerator for this class, call it now */ if (clHandlers && clHandlers->enumFunc && (flags & TNF_LIST)) clHandlers->enumFunc(obj, tn); + + if (objnum == sysExplGlobalCount) + { + tn->tn_Flags &= ~flags; + } } return FALSE; /* Continue enumeration */ @@ -240,7 +251,7 @@ AROS_UFH3S(void, propertyFunc, if (node == NULL) { - /* if we were called from menu we must 1st find the current entry */ + /* if we were called from menu we must first find the current entry */ node = (struct MUI_NListtree_TreeNode *)XGET(hidd_tree, MUIA_NListtree_Active); } @@ -341,6 +352,8 @@ static BOOL GUIinit() if (hwRoot) { + sysExplGlobalCount = 0; + /* This will kick our recursive enumeration into action */ CALLHOOKPKT((struct Hook *)&enum_hook, hwRoot, MUIV_NListtree_Insert_ListNode_Root); } -- 2.11.4.GIT