Skip to content

Commit

Permalink
Rename "Document" selection value to "Page"
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan authored and yorikvanhavre committed Oct 31, 2016
1 parent cd87af3 commit 6e7c4bc
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/Mod/TechDraw/App/DrawPage.cpp
Expand Up @@ -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();
}
}
Expand All @@ -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();
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/Mod/TechDraw/App/DrawProjGroup.cpp
Expand Up @@ -44,7 +44,7 @@

using namespace TechDraw;

const char* DrawProjGroup::ProjectionTypeEnums[] = {"Document",
const char* DrawProjGroup::ProjectionTypeEnums[] = {"Default",
"First Angle",
"Third Angle",
NULL};
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand All @@ -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");
Expand Down Expand Up @@ -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());
Expand Down
6 changes: 3 additions & 3 deletions src/Mod/TechDraw/App/DrawView.cpp
Expand Up @@ -53,7 +53,7 @@ using namespace TechDraw;
// DrawView
//===========================================================================

const char* DrawView::ScaleTypeEnums[]= {"Document",
const char* DrawView::ScaleTypeEnums[]= {"Page",
"Automatic",
"Custom",
NULL};
Expand Down Expand Up @@ -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());
}
Expand Down Expand Up @@ -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") ) {
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/TechDraw/App/DrawViewCollection.cpp
Expand Up @@ -168,15 +168,15 @@ 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;
if(docObj->getTypeId().isDerivedFrom(TechDraw::DrawView::getClassTypeId())) {
TechDraw::DrawView *view = static_cast<TechDraw::DrawView *>(*it);

// Set scale factor of each view
view->ScaleType.setValue("Document");
view->ScaleType.setValue("Page");
view->touch();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/TechDraw/Gui/TaskProjGroup.cpp
Expand Up @@ -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,
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/TechDraw/Gui/TaskProjGroup.ui
Expand Up @@ -62,7 +62,7 @@
</property>
<item>
<property name="text">
<string>Document</string>
<string>Page</string>
</property>
</item>
<item>
Expand Down Expand Up @@ -92,7 +92,7 @@
<widget class="QComboBox" name="cmbScaleType">
<item>
<property name="text">
<string>Document</string>
<string>Page</string>
</property>
</item>
<item>
Expand Down

0 comments on commit 6e7c4bc

Please sign in to comment.