Rename "Document" selection value to "Page"

This commit is contained in:
WandererFan 2016-10-27 14:16:45 -04:00 committed by Yorik van Havre
parent cd87af3746
commit 6e7c4bc838
6 changed files with 17 additions and 17 deletions

View File

@ -113,7 +113,7 @@ void DrawPage::onChanged(const App::Property* prop)
const std::vector<App::DocumentObject*> &vals = Views.getValues();
for(std::vector<App::DocumentObject *>::const_iterator it = vals.begin(); it < vals.end(); ++it) {
TechDraw::DrawView *view = dynamic_cast<TechDraw::DrawView *>(*it);
if (view != NULL && view->ScaleType.isValue("Document")) {
if (view != NULL && view->ScaleType.isValue("Page")) {
view->Scale.touch();
}
}
@ -122,7 +122,7 @@ void DrawPage::onChanged(const App::Property* prop)
const std::vector<App::DocumentObject*> &vals = Views.getValues();
for(std::vector<App::DocumentObject *>::const_iterator it = vals.begin(); it < vals.end(); ++it) {
TechDraw::DrawProjGroup *view = dynamic_cast<TechDraw::DrawProjGroup *>(*it);
if (view != NULL && view->ProjectionType.isValue("Document")) {
if (view != NULL && view->ProjectionType.isValue("Default")) {
view->ProjectionType.touch();
}
}

View File

@ -44,7 +44,7 @@
using namespace TechDraw;
const char* DrawProjGroup::ProjectionTypeEnums[] = {"Document",
const char* DrawProjGroup::ProjectionTypeEnums[] = {"Default",
"First Angle",
"Third Angle",
NULL};
@ -397,7 +397,7 @@ void DrawProjGroup::arrangeViewPointers(DrawProjGroupItem *viewPtrs[10]) const
// Determine layout - should be either "First Angle" or "Third Angle"
const char* projType;
if (ProjectionType.isValue("Document")) {
if (ProjectionType.isValue("Default")) {
projType = findParentPage()->ProjectionType.getValueAsString();
} else {
projType = ProjectionType.getValueAsString();
@ -604,7 +604,7 @@ App::DocumentObjectExecReturn *DrawProjGroup::execute(void)
Scale.setValue(newScale);
}
}
} else if (ScaleType.isValue("Document")) {
} else if (ScaleType.isValue("Page")) {
newScale = page->Scale.getValue();
if(std::abs(Scale.getValue() - newScale) > FLT_EPSILON) {
resetPositions();
@ -631,8 +631,8 @@ void DrawProjGroup::updateChildren(double scale)
if (ScaleType.isValue("Automatic")) {
view->ScaleType.setValue("Custom");
view->Scale.setStatus(App::Property::ReadOnly,true);
} else if (ScaleType.isValue("Document")) {
view->ScaleType.setValue("Document");
} else if (ScaleType.isValue("Page")) {
view->ScaleType.setValue("Page");
view->Scale.setStatus(App::Property::ReadOnly,true);
} else if (ScaleType.isValue("Custom")) {
view->ScaleType.setValue("Custom");
@ -677,7 +677,7 @@ App::Enumeration DrawProjGroup::usedProjectionType(void)
{
//TODO: Would've been nice to have an Enumeration(const PropertyEnumeration &) constructor
App::Enumeration ret(ProjectionTypeEnums, ProjectionType.getValueAsString());
if (ret.isValue("Document")) {
if (ret.isValue("Default")) {
TechDraw::DrawPage * page = getPage();
if ( page != NULL ) {
ret.setValue(page->ProjectionType.getValueAsString());

View File

@ -53,7 +53,7 @@ using namespace TechDraw;
// DrawView
//===========================================================================
const char* DrawView::ScaleTypeEnums[]= {"Document",
const char* DrawView::ScaleTypeEnums[]= {"Page",
"Automatic",
"Custom",
NULL};
@ -88,7 +88,7 @@ App::DocumentObjectExecReturn *DrawView::execute(void)
{
TechDraw::DrawPage *page = findParentPage();
if(page) {
if (ScaleType.isValue("Document")) {
if (ScaleType.isValue("Page")) {
if(std::abs(page->Scale.getValue() - Scale.getValue()) > FLT_EPSILON) {
Scale.setValue(page->Scale.getValue());
}
@ -117,7 +117,7 @@ void DrawView::onChanged(const App::Property* prop)
if (!isRestoring()) {
//Base::Console().Message("TRACE - DV::onChanged(%s) - %s\n",prop->getName(),Label.getValue());
if (prop == &ScaleType) {
if (ScaleType.isValue("Document")) {
if (ScaleType.isValue("Page")) {
Scale.setStatus(App::Property::ReadOnly,true);
App::GetApplication().signalChangePropertyEditor(Scale);
} else if ( ScaleType.isValue("Custom") ) {

View File

@ -168,7 +168,7 @@ void DrawViewCollection::onChanged(const App::Property* prop)
App::DocumentObjectExecReturn *DrawViewCollection::execute(void)
{
if (ScaleType.isValue("Document")) {
if (ScaleType.isValue("Page")) {
const std::vector<App::DocumentObject *> &views = Views.getValues();
for(std::vector<App::DocumentObject *>::const_iterator it = views.begin(); it != views.end(); ++it) {
App::DocumentObject *docObj = *it;
@ -176,7 +176,7 @@ App::DocumentObjectExecReturn *DrawViewCollection::execute(void)
TechDraw::DrawView *view = static_cast<TechDraw::DrawView *>(*it);
// Set scale factor of each view
view->ScaleType.setValue("Document");
view->ScaleType.setValue("Page");
view->touch();
}
}

View File

@ -180,7 +180,7 @@ void TaskProjGroup::projectionTypeChanged(int index)
//layout per Page (Document)
Gui::Command::doCommand(Gui::Command::Doc,
"App.activeDocument().%s.ProjectionType = '%s'",
multiView->getNameInDocument(), "Document");
multiView->getNameInDocument(), "Default");
} else if(index == 1) {
// First Angle layout
Gui::Command::doCommand(Gui::Command::Doc,
@ -210,7 +210,7 @@ void TaskProjGroup::scaleTypeChanged(int index)
if(index == 0) {
// Document Scale Type
Gui::Command::doCommand(Gui::Command::Doc, "App.activeDocument().%s.ScaleType = '%s'", multiView->getNameInDocument()
, "Document");
, "Page");
} else if(index == 1) {
// Automatic Scale Type
Gui::Command::doCommand(Gui::Command::Doc, "App.activeDocument().%s.ScaleType = '%s'", multiView->getNameInDocument()

View File

@ -62,7 +62,7 @@
</property>
<item>
<property name="text">
<string>Document</string>
<string>Page</string>
</property>
</item>
<item>
@ -92,7 +92,7 @@
<widget class="QComboBox" name="cmbScaleType">
<item>
<property name="text">
<string>Document</string>
<string>Page</string>
</property>
</item>
<item>