Ticket #7744 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Default values are not being shown when running algorithm dialog form script interpreter

Reported by: Arturs Bekasovs Owned by: Arturs Bekasovs
Priority: critical Milestone: Release 2.6.1
Component: GUI Keywords:
Cc: reuterma@… Blocked By: #7720
Blocking: Tester: Michael Reuter

Description

To reproduce:

  1. Run MantidPlot.
  2. Open Script Interpreter. (F4)
  3. Run LoadEventNexusDialog()
  4. Notice that LoadLogs checkbox is not checked, though it's default value is true.

Change History

comment:1 Changed 7 years ago by Arturs Bekasovs

So after spotting the problematic place and talking to Martyn, it turns out that the problem was actually here for some time.

The problem is in this piece of code:

if( !isForScript() )
  propWidget->setValue(value);
else
{
  //Need to check if this is the default value as we don't fill them in if they are
  if( m_python_arguments.contains(propName) || !property->isDefault() )
    propWidget->setValue(value);
}

The thing is, sometimes, we set a very big double values to some of the properties, to determine whether a user has touched the parameter. Obviously we don't want to display these values in the text fields. That's why, TextPropertyWidget is not showing anything if the property has it's default value. However, it's not the case for all the other PropertyWidgets, as we want them to respect default values.

However, from the code above, we can see that if dialog is run from a script it is ignoring default values for all the widgets.

comment:2 Changed 7 years ago by Arturs Bekasovs

  • Blocked By 7720 added

comment:3 Changed 7 years ago by Arturs Bekasovs

  • Status changed from new to inprogress

comment:4 Changed 7 years ago by Arturs Bekasovs

Make dialogs launched from script interpreter use default values.

Refs #7744

Changeset: f0875eb7add11630fb675eddc09852c16cedc0e5

comment:5 Changed 7 years ago by Arturs Bekasovs

Make custom dlg for SmoothNeghbours disable properties specified from script.

Small cosmetic fix touching dialog run from scripts as well, so done in this ticket.

Refs #7744

Changeset: 2069396be4bdb1e4630e92a014fcaee6b885bbfb

comment:6 Changed 7 years ago by Arturs Bekasovs

Tester:

Well, basically just test that the bug described in the ticket is not reproducible any more. Test that dialogs when run from scripts use specified values, e.g. LoadEventNexusDialog(LoadLogs=0), and that appropriate widgets are disabled then.

Please test that SmoothNeighboursDialog() as run from the script interpreter is now disabling all the properties specified as functions parameters. I.e. :

  1. Open Script Interpreter (F4)
  2. Run SmoothNeighboursDialog(PreserveEvents=0).
  3. Make sure that in the dialog opened PreserveEvents checkbox is unchecked and disabled.
Last edited 7 years ago by Arturs Bekasovs (previous) (diff)

comment:7 Changed 7 years ago by Arturs Bekasovs

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

comment:8 Changed 7 years ago by Michael Reuter

  • Status changed from verify to verifying
  • Tester set to Michael Reuter

comment:9 Changed 7 years ago by Michael Reuter

  • Status changed from verifying to closed

This seems to work correctly.

comment:10 Changed 7 years ago by Michael Reuter

Merge remote-tracking branch 'origin/bugfix/7744_script_dialog_defaults'

comment:11 Changed 7 years ago by Arturs Bekasovs

Make custom dlg for SmoothNeghbours disable properties specified from script.

Small cosmetic fix touching dialog run from scripts as well, so done in this ticket.

Refs #7744 (cherry picked from commit 2069396be4bdb1e4630e92a014fcaee6b885bbfb)

Changeset: c13b63cf962f5994f1c625fbc723798c2e5dbe71

comment:12 Changed 7 years ago by Arturs Bekasovs

Make dialogs launched from script interpreter use default values.

Refs #7744 (cherry picked from commit f0875eb7add11630fb675eddc09852c16cedc0e5)

Changeset: a00d5fb3b12f8718a7b65e1f36bcdde45abc7f29

comment:13 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8589

Note: See TracTickets for help on using tickets.