VirtualBox

Changeset 65154 in vbox


Ignore:
Timestamp:
Jan 5, 2017 1:41:32 PM (8 years ago)
Author:
vboxsync
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
Files:
4 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';
  • trunk/src/VBox/ValidationKit/testmanager/htdocs/css/common.css

    r65145 r65154  
    2525 */
    2626
     27@charset "UTF-8";
    2728
    2829/*
     
    332333}
    333334
     335.tm-side-filter-union-input {
     336    float:          right;
     337}
     338
     339/* The following is for the element of / not element of checkbox, supplying text and hiding the actual box. */
     340input.tm-side-filter-union-input {
     341    display:        none;
     342}
     343input.tm-side-filter-union-input + label {
     344    vertical-align: middle;
     345}
     346input.tm-side-filter-union-input:checked + label::after {
     347    content:        '∉'; /* U+2209: not an element of. */
     348}
     349input.tm-side-filter-union-input + label::after {
     350    content:        '∈'; /* U+2208: element of. */
     351}
    334352
    335353/* Webkit: Pretty scroll bars on the menu body as well as inside filter criteria. */
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuimain.py

    r65145 r65154  
    948948                    sChar  = '&#9654;';
    949949
    950                 sHtml += u'  <dt class="%s"><a href="javascript:void(0)" onclick="toggleCollapsibleDtDd(this);">%s'\
    951                          u' %s</a></dt>\n' \
     950                sHtml += u'  <dt class="%s"><a href="javascript:void(0)" onclick="toggleCollapsibleDtDd(this);">%s %s</a> ' \
     951                       % (sClass, sChar, webutils.escapeElem(oCrit.sName),);
     952                if oCrit.sInvVarNm is not None:
     953                    sHtml += u'<input  id="sf-union-%s" class="tm-side-filter-union-input" ' \
     954                             u'name="%s" value="1" type="checkbox"%s />' \
     955                             u'<label for="sf-union-%s" class="tm-side-filter-union-input"/>' \
     956                           % ( oCrit.sInvVarNm, oCrit.sInvVarNm, ' checked' if oCrit.fInverted else '', oCrit.sInvVarNm,);
     957                sHtml += u'</dt>\n' \
    952958                         u'  <dd class="%s">\n' \
    953959                         u'   <ul>\n' \
    954                          % (sClass, sChar, webutils.escapeElem(oCrit.sName), sClass);
     960                         % (sClass, );
    955961
    956962                for oDesc in oCrit.aoPossible:
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