Skip to content

Commit

Permalink
Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Aug 7, 2014
2 parents 1cd2dab + 3c0c72e commit 09b8b25
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 90 deletions.
4 changes: 4 additions & 0 deletions src/App/DocumentObjectPyImp.cpp
Expand Up @@ -98,6 +98,10 @@ Py::Object DocumentObjectPy::getViewObject(void) const
{
try {
Py::Module module(PyImport_ImportModule("FreeCADGui"),true);
if (!module.hasAttr("getDocument")) {
// in v0.14+, the GUI module can be loaded in console mode (but doesn't have all its document methods)
return Py::None();
}
Py::Callable method(module.getAttr("getDocument"));
Py::Tuple arg(1);
arg.setItem(0, Py::String(getDocumentObjectPtr()->getDocument()->getName()));
Expand Down
1 change: 0 additions & 1 deletion src/Mod/Draft/CMakeLists.txt
Expand Up @@ -15,7 +15,6 @@ SET(Draft_SRCS
importSVG.py
importDWG.py
importAirfoilDAT.py
macros.py
Draft_rc.py
TestDraft.py
)
Expand Down
29 changes: 1 addition & 28 deletions src/Mod/Draft/Draft.py
Expand Up @@ -4439,32 +4439,6 @@ def __init__(self,obj):
obj.Angle = 360
obj.Axis = Vector(0,0,1)

def onChanged(self,obj,prop):
if prop == "ArrayType":
if obj.ViewObject:
if obj.ArrayType == "ortho":
obj.ViewObject.setEditorMode('Axis',2)
obj.ViewObject.setEditorMode('NumberPolar',2)
obj.ViewObject.setEditorMode('Center',2)
obj.ViewObject.setEditorMode('Angle',2)
obj.ViewObject.setEditorMode('NumberX',0)
obj.ViewObject.setEditorMode('NumberY',0)
obj.ViewObject.setEditorMode('NumberZ',0)
obj.ViewObject.setEditorMode('IntervalX',0)
obj.ViewObject.setEditorMode('IntervalY',0)
obj.ViewObject.setEditorMode('IntervalZ',0)
else:
obj.ViewObject.setEditorMode('Axis',0)
obj.ViewObject.setEditorMode('NumberPolar',0)
obj.ViewObject.setEditorMode('Center',0)
obj.ViewObject.setEditorMode('Angle',0)
obj.ViewObject.setEditorMode('NumberX',2)
obj.ViewObject.setEditorMode('NumberY',2)
obj.ViewObject.setEditorMode('NumberY',2)
obj.ViewObject.setEditorMode('IntervalX',2)
obj.ViewObject.setEditorMode('IntervalY',2)
obj.ViewObject.setEditorMode('IntervalZ',2)

def execute(self,obj):
import DraftGeomUtils
if obj.Base:
Expand Down Expand Up @@ -4520,8 +4494,7 @@ def polarArray(self,shape,center,angle,num,axis,axisvector):
nshape.rotate(DraftVecUtils.tup(center), DraftVecUtils.tup(axis), currangle)
if axisvector:
if not DraftVecUtils.isNull(axisvector):
if i > 0:
nshape.translate(FreeCAD.Vector(axisvector).multiply(i))
nshape.translate(FreeCAD.Vector(axisvector).multiply(i+1))
base.append(nshape)
return Part.makeCompound(base)

Expand Down
8 changes: 4 additions & 4 deletions src/Mod/Draft/DraftTools.py
Expand Up @@ -3868,10 +3868,10 @@ def Activated(self):
for ob in sel:
for child in ob.OutList:
FreeCADGui.Selection.addSelection(child)
for parent in ob.InList:
FreeCADGui.Selection.addSelection(parent)
for child in parent.OutList:
FreeCADGui.Selection.addSelection(child)
for parent in ob.InList:
FreeCADGui.Selection.addSelection(parent)
for child in parent.OutList:
FreeCADGui.Selection.addSelection(child)


class Shape2DView(Modifier):
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Draft/InitGui.py
Expand Up @@ -95,7 +95,7 @@ def QT_TRANSLATE_NOOP(scope, text):

# import Draft tools, icons and macros menu
try:
import os,macros,Draft_rc,DraftTools, DraftGui
import os,Draft_rc,DraftTools, DraftGui
from DraftTools import translate
FreeCADGui.addLanguagePath(":/translations")
FreeCADGui.addIconPath(":/icons")
Expand Down
54 changes: 0 additions & 54 deletions src/Mod/Draft/macros.py

This file was deleted.

8 changes: 6 additions & 2 deletions src/Mod/Drawing/App/FeaturePage.cpp
Expand Up @@ -76,8 +76,12 @@ void FeaturePage::onChanged(const App::Property* prop)
if (!fi.exists())
return;
}
}
if (prop == &Template) {
} else if (prop == &EditableTexts) {
if (!this->isRestoring()) {
this->execute();
return;
}
} else if (prop == &Template) {
if (!this->isRestoring()) {
EditableTexts.setValues(getEditableTextsFromTemplate());
}
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Drawing/Gui/Command.cpp
Expand Up @@ -104,6 +104,7 @@ void CmdDrawingNewPage::activated(int iMsg)
openCommand("Drawing create page");
doCommand(Doc,"App.activeDocument().addObject('Drawing::FeaturePage','%s')",FeatName.c_str());
doCommand(Doc,"App.activeDocument().%s.Template = '%s'",FeatName.c_str(), (const char*)tfi.filePath().toUtf8());
doCommand(Doc,"App.activeDocument().recompute()");
commitCommand();
}
else {
Expand Down Expand Up @@ -231,6 +232,7 @@ void CmdDrawingNewA3Landscape::activated(int iMsg)
openCommand("Drawing create page");
doCommand(Doc,"App.activeDocument().addObject('Drawing::FeaturePage','%s')",FeatName.c_str());
doCommand(Doc,"App.activeDocument().%s.Template = 'A3_Landscape.svg'",FeatName.c_str());
doCommand(Doc,"App.activeDocument().recompute()");
commitCommand();
}

Expand Down

0 comments on commit 09b8b25

Please sign in to comment.