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

Make dialogs API more consistent #156

Open
dlyongemallo opened this issue Oct 30, 2023 · 3 comments
Open

Make dialogs API more consistent #156

dlyongemallo opened this issue Oct 30, 2023 · 3 comments
Labels
good first issue Good for newcomers Priority: Low Type: code organisation and standards Issue deals with how the code is structured or written

Comments

@dlyongemallo
Copy link
Contributor

In dialogs.py, the various dialogs don't always take a parent parameter consistently. In particular, show_error_msg doesn't take a parent at all, and error messages can sometimes show up behind the main window which is rendered inactive, which is a confusing state for the user.

Also: in other dialog-showing functions, the parent parameter is sometimes typed QWidget and sometimes typed MainWindow, and it's sometimes the first parameter and sometimes the last. The API would be nicer if this was made consistent.

@jvdwetering jvdwetering added Type: bug Something is not right good first issue Good for newcomers labels Oct 30, 2023
dlyongemallo added a commit to dlyongemallo/zxlive that referenced this issue Nov 10, 2023
Needed to update main window after settings change. Also see zxcalc#156.
valleyofblackpanther added a commit to valleyofblackpanther/zxlive that referenced this issue Jan 29, 2024
@valleyofblackpanther
Copy link
Contributor

Hi, @dlyongemallo @RazinShaikh check this commit commit

  1. I have modified the show_error_msg function to accept a parent parameter. This parameter is then used to specify the parent of the QMessageBox so that the error message box is modal to the parent.
  2. In each function that invokes show_error_msg, i ensured to pass the parent parameter. This means I added a parent argument to the signature of those fucntions if it's not already there. I did modification in the function import_diagram_from_file.

valleyofblackpanther added a commit to valleyofblackpanther/zxlive that referenced this issue Jan 31, 2024
RazinShaikh added a commit that referenced this issue Feb 2, 2024
Dialog Windows are sometimes hidden behind main window #156
dlyongemallo added a commit to dlyongemallo/zxlive that referenced this issue Apr 19, 2024
dlyongemallo added a commit to dlyongemallo/zxlive that referenced this issue May 5, 2024
Incidentally, make the warning dialogs modal (see issue zxcalc#156).
@RazinShaikh RazinShaikh changed the title dialog windows are sometimes hidden behind main window Make dialogs API more consistent Jun 29, 2024
@RazinShaikh
Copy link
Collaborator

The original problem of dialog windows being hidden behind the main window is now solved. I have renamed the issue as per @dlyongemallo 's suggestion. The following still needs to be updated:

In several dialog-showing functions, the parent parameter is sometimes typed QWidget and sometimes typed MainWindow, and it's sometimes the first parameter and sometimes the last. The API would be nicer if this was made consistent.

@jvdwetering
Copy link
Collaborator

In Qt, the parent is always the first parameter, so that is probably the way to go. I think in general the parent should be the closest QWidget above it, and so the type should be QWidget.

@RazinShaikh RazinShaikh added Type: code organisation and standards Issue deals with how the code is structured or written and removed Type: bug Something is not right labels Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Priority: Low Type: code organisation and standards Issue deals with how the code is structured or written
Projects
None yet
Development

No branches or pull requests

4 participants