Ticket #8849 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Use QValidators instead of popup boxes where possible for Muon Analysis user input

Reported by: Peter Parker Owned by: Arturs Bekasovs
Priority: trivial Milestone: Release 3.2
Component: Muon Keywords:
Cc: Blocked By:
Blocking: Tester: Keith Brown

Description

For example, in the settings tab for Muon Analysis we allow the user to enter alphabetic characters in a lot of the fields, when only numeric characters make sense. The user is presented with a popup box in this situation.

This is by no means the end of the world, but elsewhere within Mantid (including the Home tab of the Muon Analysis interface itself) we use QValidators so that the user is *forced* to only use numeric characters.

This is a better way of doing it and it would be nice to keep a uniform approach as much as possible.

Change History

comment:1 Changed 7 years ago by Arturs Bekasovs

  • Owner set to Arturs Bekasovs

comment:2 Changed 7 years ago by Arturs Bekasovs

  • Milestone changed from Backlog to Release 3.2

comment:3 Changed 7 years ago by Nick Draper

  • Status changed from new to assigned

Bulk move of tickets out of triage (new) to assigned at the introduction of the triage state

comment:4 Changed 7 years ago by Arturs Bekasovs

Validators do seem to be used everywhere now. Although they do not filter everything (you can still leave the field empty, or enter something like ".") and the reaction to such events is quite different from widget to widget. So in this ticket I'll tidy-up post-validation checking for all the input fields.

comment:5 Changed 7 years ago by Arturs Bekasovs

  • Status changed from assigned to inprogress

Refs #8849. Move common validating functionality to a method.

Changeset: b929dbb6fd7006d5b30576e6ef3a3cbba70780c6

comment:6 Changed 7 years ago by Arturs Bekasovs

Refs #8849. Default values as strings.

Plus a single time-zero default value.

Changeset: 061dccb7187e96ef278661324f89b0d693a0fabe

comment:7 Changed 7 years ago by Arturs Bekasovs

Refs #8849. Move all the Xmin/Xmax setting logic to functions.

Changeset: 72577236b4b1a44b63410460cf43f5bbb3819344

comment:8 Changed 7 years ago by Arturs Bekasovs

Refs #8849. Move option tab validation to the tab code.

Changeset: 09a7b111406f72eb7b2ad0e3e31662b806dd5b9b

comment:9 Changed 7 years ago by Arturs Bekasovs

Refs #8849. Constants for default values which are used in two places.

Changeset: 4ccb6695cfc0600dd68151b548527091b882f595

comment:10 Changed 7 years ago by Arturs Bekasovs

Refs #8849. Validation for Y min/max fields.

Changeset: 06b79ed3818c870ea9fbe898b007afed9647c1db

comment:11 Changed 7 years ago by Arturs Bekasovs

Refs #8849. Change the type of functions back for consistency.

Changeset: 7da3d0a94b44340e331abec167f00afeb1778bf8

comment:12 Changed 7 years ago by Arturs Bekasovs

Refs #8849. Move rebin parsing to options tab code and add validation.

Changeset: 7255fef2a4bb03637853cc538fa46820df97ef33

comment:13 Changed 7 years ago by Arturs Bekasovs

Refs #8849. Make some fields pass validation when empty.

We have some fields which are allowed to be empty, which means they will be calculated automatically. Make validator pass when they are empty.

Changeset: 14c666791e2fd7de50c8db506e08802f03079c13

comment:14 Changed 7 years ago by Arturs Bekasovs

Tester:

The changes have touched the following text-input fields:

  • Home tab:
    • FirstGoodData (mandatory)
    • TimeZero (mandatory)
  • Options tab:
    • Time start (mandatory)
    • Time finish (optional)
    • Y axis min (optional)
    • Y axis max (optional)
    • Rebin parameters fixed step (mandatory)
    • Rebin parameters variable string (mandatory)

Check the following for all the fields:

  • Field does have validator set, i.e. you couldn't be able type letters in. Doesn't apply to the last field, as it accepts a list of numbers.
  • Field does what it should when the value is sane.
  • Entering a value which is accepted by validator, but is still invalid (e.g. ".") resets the field to some sensible default value, showing appropriate warning.
  • If the field is mandatory, empty value has the same effect as invalid value.
  • If field is optional, empty value is accepted and the actual value used is calculated automatically. Invalid value is still reset though.
Last edited 7 years ago by Arturs Bekasovs (previous) (diff)

comment:16 Changed 7 years ago by Arturs Bekasovs

Refs #8849. Add missing Doxygen @param description

Changeset: a277a125327f0680762ab740da885257c052bbe3

comment:17 Changed 7 years ago by Arturs Bekasovs

  • Status changed from inprogress to verify
  • Resolution set to fixed

comment:18 Changed 7 years ago by Keith Brown

  • Status changed from verify to verifying
  • Tester set to Keith Brown

comment:19 Changed 7 years ago by Keith Brown

needs master merging into it

comment:20 Changed 7 years ago by Arturs Bekasovs

Refs #8849. Merge remote-tracking branch 'origin/master' into 8849

Conflicts:

Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MuonAnalysisOptionTab.h Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysisOptionTab.cpp

Changeset: 953185dff7e81002177c1e966917d6d07381fe9b

comment:21 Changed 7 years ago by Keith Brown

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/8849_muon_analysis_validators'

Full changeset: 581775dcf156496ab2439b8949f7775e24eb00ec

comment:22 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9693

Note: See TracTickets for help on using tickets.