Repository: FreeCAD/FreeCAD
File: src/Mod/BIM/ArchWall.py (Python)

Code before:
            self.alignGroup.buttonClicked.connect(self.setAlign)

            if obj.Align == "Left":
                self.alignLeft.setChecked(True)
            elif obj.Align == "Right":
                self.alignRight.setChecked(True)
            else:
                self.alignCenter.setChecked(True)

            layout.addRow(QtGui.QApplication.translate("Arch", "Alignment", None), self.alignLayout)

            # Wall Options first, then Components (inherited self.form)
            self.form = [self.wallWidget, self.form]

        def setAlign(self, button):
            if button == self.alignLeft:
                self.obj.Align = "Left"
            elif button == self.alignRight:
                self.obj.Align = "Right"
            else:
                self.obj.Align = "Center"
            self.obj.recompute()

        def getStandardButtons(self):
            # Necessary to map the Esc key to the reject() method
            return int(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel)

        def accept(self):
            self.obj.Length = self.length.text()
            self.obj.Width = self.width.text()
            self.obj.Height = self.height.text()
            FreeCAD.ActiveDocument.commitTransaction()
            if hasattr(self.obj, "Proxy") and hasattr(self.obj.Proxy, "InTransaction"):
                del self.obj.Proxy.InTransaction
            return ArchComponent.ComponentTaskPanel.accept(self)

        def reject(self):
            FreeCAD.ActiveDocument.abortTransaction()
            if hasattr(self.obj, "Proxy") and hasattr(self.obj.Proxy, "InTransaction"):
                del self.obj.Proxy.InTransaction
            FreeCADGui.ActiveDocument.resetEdit()
            return True


class _ViewProviderWall(ArchComponent.ViewProviderComponent):
    """The view provider for the wall object.

    Parameters
    ----------
    vobj: <Gui.ViewProviderDocumentObject>
        The view provider to turn into a wall view provider.

Review comment (suggestion):
```suggestion
            return QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel
```

Fix mistake in casting

Code after:
            self.height.setText(obj.Height.UserString)
            layout.addRow(translate("Arch", "Height"), self.height)

            self.alignLayout = QtGui.QHBoxLayout()
            self.alignLeft = QtGui.QRadioButton(translate("Arch", "Left"))
            self.alignCenter = QtGui.QRadioButton(translate("Arch", "Center"))
            self.alignRight = QtGui.QRadioButton(translate("Arch", "Right"))
            self.alignLayout.addWidget(self.alignLeft)
            self.alignLayout.addWidget(self.alignCenter)
            self.alignLayout.addWidget(self.alignRight)
            self.alignLayout.addStretch()

            self.alignGroup = QtGui.QButtonGroup(self.wallWidget)
            self.alignGroup.addButton(self.alignLeft)
            self.alignGroup.addButton(self.alignCenter)
            self.alignGroup.addButton(self.alignRight)
            self.alignGroup.buttonClicked.connect(self.setAlign)

            if obj.Align == "Left":
                self.alignLeft.setChecked(True)
            elif obj.Align == "Right":
                self.alignRight.setChecked(True)
            else:
                self.alignCenter.setChecked(True)

            layout.addRow(translate("Arch", "Alignment"), self.alignLayout)

            # Wall Options first, then Components (inherited self.form)
            self.form = [self.wallWidget, self.form]

        def setAlign(self, button):
            if button == self.alignLeft:
                self.obj.Align = "Left"
            elif button == self.alignRight:
                self.obj.Align = "Right"
            else:
                self.obj.Align = "Center"
            self.obj.recompute()

        def accept(self):
            self.obj.Length = self.length.text()
            self.obj.Width = self.width.text()
            self.obj.Height = self.height.text()
            return super().accept()


class _ViewProviderWall(ArchComponent.ViewProviderComponent):
    """The view provider for the wall object.

    Parameters
    ----------