From 45e5b4135de7ce86eeeab8fdc52098ab8ec9a47e Mon Sep 17 00:00:00 2001 From: yorikvanhavre Date: Mon, 24 Oct 2011 17:06:03 +0000 Subject: [PATCH] + bugfixes in Draft TaskView mode git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5058 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d --- src/Mod/Draft/Resources/translations/Draft.ts | 264 +++++++++--------- src/Mod/Draft/draftGui.py | 26 +- src/Mod/Draft/draftTools.py | 20 +- 3 files changed, 156 insertions(+), 154 deletions(-) diff --git a/src/Mod/Draft/Resources/translations/Draft.ts b/src/Mod/Draft/Resources/translations/Draft.ts index 732fb5899..bda1072f4 100755 --- a/src/Mod/Draft/Resources/translations/Draft.ts +++ b/src/Mod/Draft/Resources/translations/Draft.ts @@ -3,12 +3,12 @@ Draft_AddPoint - + Add Point - + Adds a point to an existing wire/bspline @@ -16,28 +16,25 @@ Draft_AddToGroup - + Adds the selected object(s) to an existing group - + Add to group... - - Draft_Apply - Draft_ApplyStyle - + Apply Current Style - + Applies current line width and color to selected objects @@ -45,12 +42,12 @@ Draft_Arc - + Arc - + Creates an arc. CTRL to snap, SHIFT to constrain @@ -58,12 +55,12 @@ Draft_BSpline - + B-Spline - + Creates a multiple-point b-spline. CTRL to snap, SHIFT to constrain @@ -71,12 +68,12 @@ Draft_Circle - + Circle - + Creates a circle. CTRL to snap, ALT to select tangent objects @@ -84,12 +81,12 @@ Draft_CloseLine - + Close Line - + Closes the line being drawn @@ -97,12 +94,12 @@ Draft_DelPoint - + Remove Point - + Removes a point from an existing wire or bspline @@ -110,12 +107,12 @@ Draft_Dimension - + Dimension - + Creates a dimension. CTRL to snap, SHIFT to constrain, ALT to select a segment @@ -123,12 +120,12 @@ Draft_Downgrade - + Downgrade - + Explodes the selected objects into simpler objects, or subtract faces @@ -136,12 +133,12 @@ Draft_Drawing - + Drawing - + Puts the selected objects on a Drawing sheet. @@ -149,12 +146,12 @@ Draft_Edit - + Edit - + Edits the active object @@ -175,12 +172,12 @@ Draft_Line - + Line - + Creates a 2-point line. CTRL to snap, SHIFT to constrain @@ -188,12 +185,12 @@ Draft_Move - + Move - + Moves the selected objects between 2 points. CTRL to snap, SHIFT to constrain, ALT to copy @@ -201,12 +198,12 @@ Draft_Offset - + Offset - + Offsets the active object. CTRL to snap, SHIFT to constrain, ALT to copy @@ -214,12 +211,12 @@ Draft_Polygon - + Polygon - + Creates a regular polygon. CTRL to snap, SHIFT to constrain @@ -227,12 +224,12 @@ Draft_Rectangle - + Rectangle - + Creates a 2-point rectangle. CTRL to snap @@ -240,12 +237,12 @@ Draft_Rotate - + Rotate - + Rotates the selected objects. CTRL to snap, SHIFT to constrain, ALT creates a copy @@ -253,12 +250,12 @@ Draft_Scale - + Scale - + Scales the selected objects from a base point. CTRL to snap, SHIFT to constrain, ALT to copy @@ -266,12 +263,12 @@ Draft_SelectGroup - + Select group - + Selects all objects with the same parents as this group @@ -279,12 +276,12 @@ Draft_SelectPlane - + SelectPlane - + Select a working plane for geometry creation @@ -292,28 +289,25 @@ Draft_Shape2DView - + Shape 2D view - + Creates Shape 2D views of selected objects - - Draft_SwitchMode - Draft_Text - + Text - + Creates an annotation. CTRL to snap @@ -321,12 +315,12 @@ Draft_ToggleConstructionMode - + Toggle construcion Mode - + Toggles the Construction Mode for next objects. @@ -334,12 +328,12 @@ Draft_ToggleContinueMode - + Toggle continue Mode - + Toggles the Continue Mode for next commands. @@ -347,12 +341,12 @@ Draft_ToggleDisplayMode - + Toggle display mode - + Swaps display mode of selected objects between wireframe and flatlines @@ -360,12 +354,12 @@ Draft_Trimex - + Trimex - + Trims or extends the selected object, or extrudes single faces. CTRL snaps, SHIFT constrains to current segment or to normal, ALT inverts @@ -373,12 +367,12 @@ Draft_UndoLine - + Undo last segment - + Undoes the last drawn segment of the line being drawn @@ -386,12 +380,12 @@ Draft_Upgrade - + Upgrade - + Joins the selected objects into one, or converts closed wires to filled faces, or unite faces @@ -399,12 +393,12 @@ Draft_Wire - + Wire - + Creates a multiple-point wire. CTRL to snap, SHIFT to constrain @@ -412,12 +406,12 @@ Draft_WireToBSpline - + Wire to BSpline - + Converts between Wire and BSpline @@ -1059,7 +1053,7 @@ Values with differences below this value will be treated as same. - + Offset @@ -1179,157 +1173,157 @@ Values with differences below this value will be treated as same. - + Pick a face to define the drawing plane - + Pick first point: - + Pick next point: - + Pick next point, or (F)inish or (C)lose: - + Pick opposite point: - + Pick center point: - + Pick radius: - + Pick start angle: - + Pick aperture: - + Aperture angle: - + Pick location point: - + Select an object to move - + Pick start point: - + Pick end point: - + Select an object to rotate - + Pick rotation center: - + Pick base angle: - + Pick rotation angle: - + Select an object to offset - + Offset only works on one object at a time - + Pick distance: - + Select an object to upgrade - + Select an object to trim/extend - + Select an object to scale - + Pick base point: - + Pick scale factor: @@ -1370,133 +1364,133 @@ Values with differences below this value will be treated as same. - + Wire has been closed - + Last point has been removed - + Spline has been closed - + Edges don't intersect! - + Cannot offset this object type - + Found groups: closing each open object inside - + Found 2 objects: fusing them - + Found 1 non-parametric objects: draftifying it - + Found 1 closed sketch object: making a face from it - + Found closed wires: making faces - + Found 1 open wire: closing it - + Found several edges: wiring them - + Found several non-connected edges: making compound - + Found several non-treatable objects: making compound - + Found 1 parametric object: breaking its dependencies - + Found 2 objects: subtracting them - + Found several faces: splitting them - + Found several objects: subtracting them from the first one - + Found 1 face: extracting its wires - + Found only wires: extracting their edges - + This object type is not editable - + Active object must have more than two points/nodes @@ -1567,96 +1561,96 @@ Values with differences below this value will be treated as same. - + Create Wire - + Create BSpline - + Create Rectangle - + Create Circle - + Create Arc - + Create Polygon - + Create Text - + Create Dimension - + Delete Measurement - + Copy - + Move - + Change Style - + Rotate - + Found 1 solidificable object: solidifying it - + Found several objects or faces: making a parametric face - + Found objects containing curves: fusing them - + Found several objects: fusing them - + Scale diff --git a/src/Mod/Draft/draftGui.py b/src/Mod/Draft/draftGui.py index c80998719..9acda1587 100644 --- a/src/Mod/Draft/draftGui.py +++ b/src/Mod/Draft/draftGui.py @@ -301,9 +301,12 @@ class DraftToolBar: self.isCopy = self._checkbox("isCopy",self.layout,checked=False) # spacer - - spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, - QtGui.QSizePolicy.Minimum) + if not self.taskmode: + spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, + QtGui.QSizePolicy.Minimum) + else: + spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, + QtGui.QSizePolicy.Expanding) self.layout.addItem(spacerItem) QtCore.QObject.connect(self.xValue,QtCore.SIGNAL("returnPressed()"),self.checkx) @@ -553,6 +556,13 @@ class DraftToolBar: self.continueCmd.hide() self.occOffset.hide() + def trimUi(self,title=translate("draft","Trim")): + self.taskUi(title) + self.radiusUi() + self.labelRadius.setText(translate("draft","Distance")) + self.radiusValue.setFocus() + self.radiusValue.selectAll() + def radiusUi(self): self.labelx.hide() self.labely.hide() @@ -628,7 +638,7 @@ class DraftToolBar: self.delButton.show() self.finishButton.show() self.closeButton.show() - + def extUi(self): self.hasFill.show() self.continueCmd.show() @@ -637,6 +647,14 @@ class DraftToolBar: self.isCopy.show() self.continueCmd.show() + def vertUi(self,addmode=True): + self.addButton.setChecked(addmode) + self.delButton.setChecked(not(addmode)) + + def setEditButtons(self,mode): + self.addButton.setEnabled(mode) + self.delButton.setEnabled(mode) + def relocate(self): "relocates the right-aligned buttons depending on the toolbar size" if self.baseWidget.geometry().width() < 400: diff --git a/src/Mod/Draft/draftTools.py b/src/Mod/Draft/draftTools.py index 65c6c7eea..7d72d6ed2 100755 --- a/src/Mod/Draft/draftTools.py +++ b/src/Mod/Draft/draftTools.py @@ -3451,10 +3451,7 @@ class Trimex(Modifier): def proceed(self): if self.call: self.view.removeEventCallback("SoEvent",self.call) self.obj = Draft.getSelection()[0] - self.ui.radiusUi() - self.ui.labelRadius.setText("Distance") - self.ui.radiusValue.setFocus() - self.ui.radiusValue.selectAll() + self.ui.trimUi() self.linetrack = lineTracker() self.constraintrack = lineTracker(dotted=True) if not "Shape" in self.obj.PropertiesList: return @@ -3706,7 +3703,6 @@ class Trimex(Modifier): Modifier.finish(self) self.force = None if self.ui: - self.ui.labelRadius.setText("Distance") self.linetrack.finalize() self.constraintrack.finalize() if self.ghost: @@ -4000,13 +3996,9 @@ class Edit(Modifier): self.selectstate = self.obj.ViewObject.Selectable self.obj.ViewObject.Selectable = False if not Draft.getType(self.obj) in ["Wire","BSpline"]: - self.ui.addButton.setEnabled(False) - self.ui.delButton.setEnabled(False) + self.ui.setEditButtons(False) else: - self.ui.addButton.setEnabled(True) - self.ui.delButton.setEnabled(True) - # self.ui.addButton.setChecked(False) - # self.ui.delButton.setChecked(False) + self.ui.setEditButtons(True) self.editing = None self.editpoints = [] self.pl = None @@ -4324,8 +4316,7 @@ class AddPoint(Modifier): return False def Activated(self): - FreeCADGui.draftToolBar.addButton.setChecked(True) - FreeCADGui.draftToolBar.delButton.setChecked(False) + FreeCADGui.draftToolBar.vertUi(True) FreeCADGui.runCommand("Draft_Edit") @@ -4348,8 +4339,7 @@ class DelPoint(Modifier): return False def Activated(self): - FreeCADGui.draftToolBar.addButton.setChecked(False) - FreeCADGui.draftToolBar.delButton.setChecked(True) + FreeCADGui.draftToolBar.vertUi(False) FreeCADGui.runCommand("Draft_Edit")