VirtualBox

Ignore:
Timestamp:
Jan 5, 2017 1:41:32 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
112657
Message:

TestManager: Added clickable element-of / not-an-element-of on filters to avoid a lot of clicking just to remove a couple of items from the output.

Location:
trunk/src/VBox/ValidationKit/testmanager/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/core/base.py

    r65091 r65154  
    11801180    ## @name The kind of filtering.
    11811181    ## @{
    1182     ksKind_AnyOf = 'any-of';    ##< Any of the selected values are included (common).
    1183     ksKind_AllOf = 'all-of';    ##< All of the selected values must be matched (rare).
     1182    ## 'Element of' by default, 'not an element of' when fInverted is False.
     1183    ksKind_ElementOfOrNot = 'element-of-or-not';
     1184    ## The criterion is a special one and cannot be inverted.
     1185    ksKind_Special        = 'special';
    11841186    ## @}
    11851187
     
    11901192    ## @}
    11911193
    1192     def __init__(self, sName, sVarNm = None, sType = ksType_UInt, sState = ksState_NotSelected, sKind = ksKind_AnyOf,
     1194    def __init__(self, sName, sVarNm = None, sType = ksType_UInt, sState = ksState_NotSelected, sKind = ksKind_ElementOfOrNot,
    11931195                 sTable = None, sColumn = None, oSub = None):
    1194         assert len(sVarNm) in (2,3); # required by wuimain.py
     1196        assert len(sVarNm) == 2;    # required by wuimain.py for filtering.
    11951197        self.sName      = sName;
    11961198        self.sState     = sState;
    1197         self.sVarNm     = sVarNm if sVarNm is not None else sName;
    11981199        self.sType      = sType;
    11991200        self.sKind      = sKind;
    1200         self.aoSelected = [];       ##< Single value, any type.
     1201        self.sVarNm     = sVarNm;
     1202        self.aoSelected = [];       ##< User input from sVarNm. Single value, type according to sType.
     1203        self.sInvVarNm  = 'i' + sVarNm if sKind == self.ksKind_ElementOfOrNot else None;
     1204        self.fInverted  = False;    ##< User input from sInvVarNm. Inverts the operation (-> not an element of).
    12011205        self.aoPossible = [];       ##< type: list[FilterCriterionValueAndDescription]
    12021206        self.sTable     = sTable;
     
    12511255            assert False;
    12521256        if len(oCriterion.aoSelected) > 0:
    1253             oCriterion.sState     = FilterCriterion.ksState_Selected;
     1257            oCriterion.sState = FilterCriterion.ksState_Selected;
    12541258        else:
    1255             oCriterion.sState     = FilterCriterion.ksState_NotSelected;
     1259            oCriterion.sState = FilterCriterion.ksState_NotSelected;
     1260
     1261        if oCriterion.sKind == FilterCriterion.ksKind_ElementOfOrNot:
     1262            oCriterion.fInverted = oDisp.getBoolParam(oCriterion.sInvVarNm, fDefault = False);
    12561263
    12571264        if oCriterion.oSub is not None:
  • trunk/src/VBox/ValidationKit/testmanager/core/testresults.py

    r65096 r65154  
    720720        assert self.aCriteria[self.kiMemory] is oCrit;
    721721
    722         oCrit = FilterCriterion('Misc', sVarNm = 'cf', sTable = 'TestBoxesWithStrings', sColumn = 'it_is_complicated');
     722        oCrit = FilterCriterion('Misc', sVarNm = 'cf', sKind = FilterCriterion.ksKind_Special,
     723                                sTable = 'TestBoxesWithStrings', sColumn = 'it_is_complicated');
    723724        oCrit.aoPossible = [
    724725            FilterCriterionValueAndDescription(self.kiMisc_NestedPaging,      "req nested paging"),
     
    775776            else:
    776777                if iCrit == self.kiMemory:
    777                     sQuery += '%s   AND (%s.%s / 1024) IN (' % (sExtraIndent, oCrit.sTable, oCrit.sColumn,);
     778                    sQuery += '%s   AND (%s.%s / 1024)' % (sExtraIndent, oCrit.sTable, oCrit.sColumn,);
    778779                else:
    779                     sQuery += '%s   AND %s.%s IN (' % (sExtraIndent, oCrit.sTable, oCrit.sColumn,);
     780                    sQuery += '%s   AND %s.%s' % (sExtraIndent, oCrit.sTable, oCrit.sColumn,);
     781                if not oCrit.fInverted:
     782                    sQuery += ' IN (';
     783                else:
     784                    sQuery += ' NOT IN (';
    780785                if oCrit.sType == FilterCriterion.ksType_String:
    781786                    sQuery += ', '.join('\'%s\'' % (sValue,) for sValue in oCrit.aoSelected) + ')\n';
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette