Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IAddWorkspaceDialog moved to a common location and no longer a qobject #36624

Conversation

robertapplin
Copy link
Contributor

@robertapplin robertapplin commented Jan 8, 2024

Description of work

This PR moves the IAddWorkspaceDialog class to the MantidQtWidgetsCommon library, and also combines the functionality of the AddWorkspaceDialog class with the IndirectAddWorkspaceDialog class because they are essentially the same thing. This has meant I could remove the IndirectAddWorkspaceDialog class and just use the standard AddWorkspaceDialog class from the MantidQtWidgetsCommon library.

This PR also makes sure the IAddWorkspaceDialog class is no longer a QObject.

Fixes #36565
Fixes #36756

To test:

To test Fit Script Generator, follow the instructions on this page:
https://docs.mantidproject.org/nightly/interfaces/general/Fit%20Script%20Generator.html

To test Inelastic Data Analysis follow these instructions
https://developer.mantidproject.org/Testing/Inelastic/DataAnalysisTests.html

This does not require release notes because this is not a new feature or bug fix

Reviewer

Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.

Code Review

  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
  • Do the release notes conform to the release notes guide?

Functional Tests

  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

Gatekeeper

If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.

@robertapplin robertapplin added Maintenance Unassigned issues to be addressed in the next maintenance period. ISIS Team: Spectroscopy Issue and pull requests managed by the Spectroscopy subteam at ISIS Inelastic labels Jan 8, 2024
Copy link

github-actions bot commented Jan 9, 2024

👋 Hi, @robertapplin,

Conflicts have been detected against the base branch. Please rebase your branch against the base branch.

@github-actions github-actions bot added the Has Conflicts Used by the bot to label pull requests that have conflicts label Jan 9, 2024
@robertapplin robertapplin added this to the Release 6.9 milestone Jan 9, 2024
@robertapplin robertapplin force-pushed the 36565-iadd-workspace-dialog-not-qobject branch from cd0c7d2 to 185b908 Compare January 11, 2024 14:33
@robertapplin robertapplin removed the Has Conflicts Used by the bot to label pull requests that have conflicts label Jan 11, 2024
@robertapplin robertapplin marked this pull request as ready for review January 12, 2024 15:33
Copy link

👋 Hi, @robertapplin,

Conflicts have been detected against the base branch. Please rebase your branch against the base branch.

@github-actions github-actions bot added the Has Conflicts Used by the bot to label pull requests that have conflicts label Jan 15, 2024
@robertapplin robertapplin force-pushed the 36565-iadd-workspace-dialog-not-qobject branch from 8364c6d to f2490d9 Compare January 15, 2024 11:54
@robertapplin robertapplin removed the Has Conflicts Used by the bot to label pull requests that have conflicts label Jan 15, 2024
@adriazalvarez adriazalvarez self-assigned this Jan 16, 2024
Copy link
Contributor

@adriazalvarez adriazalvarez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have followed the test instructions and everything works fine, also some sneaky qt warnings that these FqFitWorkspaceDialogs were producing are not there anymore. this is another great step on improving quality of life for developers of indirect/inelastic. Thank you.
I have minor comments and a question and then it's good to approve.

dialog->updateSelectedSpectra();
dialog->show();

m_addWorkspaceDialog = dialog;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a question: I know lifetime of dialog is handled by qt classes, but seems you can create as many workspacedialogs as you want and the member m_addWorkspaceDialog would be pointing to the last one created. Can't that be a problem if multiple dialog instances are open at the same time and you try to add data from, say, the first opened workspaceDialog?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot, you are right, this will cause an issue. I haven't fixed this yet in the latest commits - I will fix it when I get back from A/L, so lets keep this PR open until then

Copy link
Contributor Author

@robertapplin robertapplin Jan 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also a problem on main and release-next, so I have opened an issue #36756 that can be used to track the issue for the current release. This PR fixes the problem, so we should maybe consider for this to go into release-next

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

Copy link

👋 Hi, @robertapplin,

Conflicts have been detected against the base branch. Please rebase your branch against the base branch.

@github-actions github-actions bot added the Has Conflicts Used by the bot to label pull requests that have conflicts label Jan 18, 2024
@robertapplin robertapplin force-pushed the 36565-iadd-workspace-dialog-not-qobject branch from f2490d9 to 3d05620 Compare January 19, 2024 16:06
@robertapplin robertapplin removed the Has Conflicts Used by the bot to label pull requests that have conflicts label Jan 19, 2024
@robertapplin robertapplin changed the base branch from main to release-next January 29, 2024 09:14
@robertapplin robertapplin force-pushed the 36565-iadd-workspace-dialog-not-qobject branch from 212ae17 to 0154344 Compare January 29, 2024 09:35
Copy link
Contributor

@adriazalvarez adriazalvarez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm testing it. But the dialogs for I(q,t) and MSD fit tabs of Data Analysis don't work. You see opening them in a blink and closing inmediately again. Can you check if you see the same?

@robertapplin
Copy link
Contributor Author

I'm testing it. But the dialogs for I(q,t) and MSD fit tabs of Data Analysis don't work. You see opening them in a blink and closing inmediately again. Can you check if you see the same?

🤦 Yes I get the same, it should be fixed now. Thanks!

Copy link
Contributor

@adriazalvarez adriazalvarez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for solving it quickly. It looks good and it also fixes #36710 .
It's a nice refactoring of workspace dialogs, happy to approve it.

@SilkeSchomann SilkeSchomann merged commit 1630012 into mantidproject:release-next Jan 30, 2024
9 checks passed
@robertapplin robertapplin added Indirect/Inelastic Issues and pull requests related to indirect or inelastic and removed Inelastic labels Feb 6, 2024
@robertapplin robertapplin deleted the 36565-iadd-workspace-dialog-not-qobject branch May 17, 2024 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Indirect/Inelastic Issues and pull requests related to indirect or inelastic ISIS Team: Spectroscopy Issue and pull requests managed by the Spectroscopy subteam at ISIS Maintenance Unassigned issues to be addressed in the next maintenance period.
Projects
Status: Merged
Status: Done
Development

Successfully merging this pull request may close these issues.

IAddWorkspaceDialog is a QDialog
3 participants