[TD]add preference for progress reporting

This commit is contained in:
Wanderer Fan
2022-07-29 12:48:35 -04:00
committed by WandererFan
parent f12846599d
commit b1dd0bd2d0
5 changed files with 35 additions and 5 deletions

View File

@@ -582,8 +582,10 @@ void DrawView::requestPaint()
}
void DrawView::showProgressMessage(std::string featureName, std::string text)
{
signalProgressMessage(this, featureName, text);
{
if (Preferences::reportProgress()) {
signalProgressMessage(this, featureName, text);
}
}
PyObject *DrawView::getPyObject(void)

View File

@@ -339,3 +339,12 @@ double Preferences::GapASME()
double factor = hGrp->GetFloat("GapASME", 6.0);
return factor;
}
bool Preferences::reportProgress()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->
GetGroup("Mod/TechDraw/General");
bool report = hGrp->GetBool("ReportProgress", false);
return report;
}

View File

@@ -81,6 +81,7 @@ static std::string bitmapFill();
static double GapISO();
static double GapASME();
static bool reportProgress();
};
} //end namespace TechDraw

View File

@@ -242,7 +242,7 @@ can be a performance penalty in complex models.</string>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="minimumSize">
<size>
@@ -499,7 +499,23 @@ when hatching a face with a PAT pattern</string>
</property>
</widget>
</item>
</layout>
<item row="3" column="2">
<widget class="Gui::PrefCheckBox" name="cbReportProgress">
<property name="toolTip">
<string>Issue progress messages while building View geometry</string>
</property>
<property name="text">
<string>Report Progress</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>ReportProgress</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
@@ -513,7 +529,7 @@ when hatching a face with a PAT pattern</string>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=" font-weight:600;"&gt;Note:&lt;/span&gt; Items in &lt;span style=" font-style:italic;"&gt;italics&lt;/span&gt; are default values for new objects. They have no effect on existing objects.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Note:&lt;/span&gt; Items in &lt;span style=&quot; font-style:italic;&quot;&gt;italics&lt;/span&gt; are default values for new objects. They have no effect on existing objects.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>

View File

@@ -57,6 +57,7 @@ void DlgPrefsTechDrawAdvancedImp::saveSettings()
ui->cbEndCap->onSave();
ui->sbMaxTiles->onSave();
ui->sbMaxPat->onSave();
ui->cbReportProgress->onSave();
}
void DlgPrefsTechDrawAdvancedImp::loadSettings()
@@ -73,6 +74,7 @@ void DlgPrefsTechDrawAdvancedImp::loadSettings()
ui->cbEndCap->onRestore();
ui->sbMaxTiles->onRestore();
ui->sbMaxPat->onRestore();
ui->cbReportProgress->onRestore();
}
/**