Skip to content

Parts Editor: "Close without saving" and "Keep working" buttons are reversed #4297

@NTsvetkov

Description

@NTsvetkov

Current Behaviour

When attempting to close the Parts Editor window with validation errors (e.g., empty 'family' property), a dialog appears with two options: "Close without saving" and "Keep working". However, the buttons behave opposite to their labels:

  • Clicking "Close without saving" → Dialog closes, but the Parts Editor window remains open
  • Clicking "Keep working" → Parts Editor closes and all work is lost
Image

Build:
Version 1.0.6 (CD-2239-0-04e5bb02 2025-10-07) 64 [Qt 6.5.3]

Operating System:
Windows 11

Steps to reproduce:

  • Open the Parts Editor (or create a new part)
  • Remove or leave blank the 'family' property in the Metadata view
  • Attempt to close the Parts Editor window (File → Close or click the window's close button)
  • A dialog appears: "This part cannot be saved as-is: The 'family' property can not be blank. Do you want to keep working or close without saving?"
  • Click "Close without saving" → Notice the dialog disappears but the editor stays open
  • Repeat steps 3-4
  • Click "Keep working" → Notice the editor closes immediately, discarding all changes

Expected Behaviour

The buttons should work as labeled:

  • Clicking "Close without saving" should close the Parts Editor window and discard any changes
  • Clicking "Keep working" should dismiss the dialog and keep the Parts Editor window open, allowing the user to continue editing

Technical Details: The bug is in src/partseditor/pemainwindow.cpp at line 404 in the closeEvent() method. The condition is inverted:

if (messageBox.clickedButton() != keepWorkingButton) {

should be

if (messageBox.clickedButton() == keepWorkingButton) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions