Skip to content

Commit

Permalink
Made Redirect python output options True by default - fixes #2454
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Feb 26, 2016
1 parent a1f16ca commit 7675a8e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 9 deletions.
47 changes: 40 additions & 7 deletions src/Gui/DlgReportView.ui
Expand Up @@ -20,7 +20,16 @@
<string>Output</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<property name="leftMargin">
<number>11</number>
</property>
<property name="topMargin">
<number>11</number>
</property>
<property name="rightMargin">
<number>11</number>
</property>
<property name="bottomMargin">
<number>11</number>
</property>
<item row="0" column="0">
Expand Down Expand Up @@ -77,7 +86,16 @@
<string>Colors</string>
</property>
<layout class="QGridLayout">
<property name="margin">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<property name="spacing">
Expand All @@ -101,7 +119,16 @@
</item>
<item row="0" column="0">
<layout class="QGridLayout">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
Expand Down Expand Up @@ -147,7 +174,7 @@
<property name="text">
<string/>
</property>
<property name="color">
<property name="color" stdset="0">
<color>
<red>0</red>
<green>0</green>
Expand Down Expand Up @@ -202,7 +229,7 @@
<property name="text">
<string/>
</property>
<property name="color">
<property name="color" stdset="0">
<color>
<red>0</red>
<green>0</green>
Expand Down Expand Up @@ -257,7 +284,7 @@
<property name="text">
<string/>
</property>
<property name="color">
<property name="color" stdset="0">
<color>
<red>255</red>
<green>170</green>
Expand Down Expand Up @@ -312,7 +339,7 @@
<property name="text">
<string/>
</property>
<property name="color">
<property name="color" stdset="0">
<color>
<red>255</red>
<green>0</green>
Expand Down Expand Up @@ -343,6 +370,9 @@
<property name="text">
<string>Redirect internal Python output to report view</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>RedirectPythonOutput</cstring>
</property>
Expand All @@ -356,6 +386,9 @@
<property name="text">
<string>Redirect internal Python errors to report view</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>RedirectPythonErrors</cstring>
</property>
Expand Down
4 changes: 2 additions & 2 deletions src/Gui/Macro.cpp
Expand Up @@ -231,8 +231,8 @@ void MacroManager::run(MacroType eType,const char *sName)
try {
ParameterGrp::handle hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("OutputWindow");
PyObject* pyout = hGrp->GetBool("RedirectPythonOutput") ? new OutputStdout : 0;
PyObject* pyerr = hGrp->GetBool("RedirectPythonErrors") ? new OutputStderr : 0;
PyObject* pyout = hGrp->GetBool("RedirectPythonOutput",true) ? new OutputStdout : 0;
PyObject* pyerr = hGrp->GetBool("RedirectPythonErrors",true) ? new OutputStderr : 0;
PythonRedirector std_out("stdout",pyout);
PythonRedirector std_err("stderr",pyerr);
//The given path name is expected to be Utf-8
Expand Down

0 comments on commit 7675a8e

Please sign in to comment.