[TD]Section dialogs minor fixes
- make simple and complex dialogs consistent - fix translation contexts
This commit is contained in:
@@ -176,7 +176,7 @@ void TaskComplexSection::setUiPrimary()
|
||||
//don't allow updates until a direction is picked
|
||||
ui->pbUpdateNow->setEnabled(false);
|
||||
ui->cbLiveUpdate->setEnabled(false);
|
||||
QString msgLiteral = QString::fromUtf8(QT_TRANSLATE_NOOP("TaskPojGroup", "No direction set"));
|
||||
QString msgLiteral = QString::fromUtf8(QT_TRANSLATE_NOOP("TaskComplexSection", "No direction set"));
|
||||
ui->lPendingUpdates->setText(msgLiteral);
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,8 @@ TaskSectionView::TaskSectionView(TechDraw::DrawViewPart* base) :
|
||||
m_doc(nullptr),
|
||||
m_createMode(true),
|
||||
m_saved(false),
|
||||
m_applyDeferred(0)
|
||||
m_applyDeferred(0),
|
||||
m_directionIsSet(false)
|
||||
{
|
||||
//existence of base is guaranteed by CmdTechDrawSectionView (Command.cpp)
|
||||
|
||||
@@ -90,7 +91,6 @@ TaskSectionView::TaskSectionView(TechDraw::DrawViewPart* base) :
|
||||
|
||||
m_applyDeferred = 0; //setting the direction widgets causes an increment of the deferred count,
|
||||
//so we reset the counter and the message.
|
||||
ui->lPendingUpdates->setText(QString());
|
||||
}
|
||||
|
||||
//ctor for edit
|
||||
@@ -102,7 +102,8 @@ TaskSectionView::TaskSectionView(TechDraw::DrawViewSection* section) :
|
||||
m_doc(nullptr),
|
||||
m_createMode(false),
|
||||
m_saved(false),
|
||||
m_applyDeferred(0)
|
||||
m_applyDeferred(0),
|
||||
m_directionIsSet(true)
|
||||
{
|
||||
//existence of section is guaranteed by ViewProviderViewSection.setEdit
|
||||
|
||||
@@ -148,6 +149,12 @@ void TaskSectionView::setUiPrimary()
|
||||
setUiCommon(origin);
|
||||
|
||||
m_viewDirectionWidget->setValue(Base::Vector3d(1.0, 0.0, 0.0));
|
||||
|
||||
//don't allow updates until a direction is picked
|
||||
ui->pbUpdateNow->setEnabled(false);
|
||||
ui->cbLiveUpdate->setEnabled(false);
|
||||
QString msgLiteral = QString::fromUtf8(QT_TRANSLATE_NOOP("TaskSectionView", "No direction set"));
|
||||
ui->lPendingUpdates->setText(msgLiteral);
|
||||
}
|
||||
|
||||
void TaskSectionView::setUiEdit()
|
||||
@@ -294,41 +301,36 @@ void TaskSectionView::slotChangeAngle(double newAngle)
|
||||
void TaskSectionView::onUpClicked()
|
||||
{
|
||||
// Base::Console().Message("TSV::onUpClicked()\n");
|
||||
m_compass->setToNorth();
|
||||
Base::Vector3d localUnit(0.0, 1.0, 0.0);
|
||||
m_viewDirectionWidget->setValue(localUnit);
|
||||
checkAll(false);
|
||||
applyAligned(localUnit);
|
||||
}
|
||||
m_compass->setToNorth();
|
||||
m_viewDirectionWidget->setValueNoNotify(Base::Vector3d(0.0, 1.0, 0.0));
|
||||
applyAligned(Base::Vector3d(0.0, 1.0, 0.0));}
|
||||
|
||||
void TaskSectionView::onDownClicked()
|
||||
{
|
||||
// Base::Console().Message("TSV::onDownClicked()\n");
|
||||
m_compass->setToSouth();
|
||||
Base::Vector3d localUnit(0.0, -1.0, 0.0);
|
||||
m_viewDirectionWidget->setValue(localUnit);
|
||||
checkAll(false);
|
||||
applyAligned(localUnit);
|
||||
m_compass->setToSouth();
|
||||
m_viewDirectionWidget->setValueNoNotify(Base::Vector3d(0.0, -1.0, 0.0));
|
||||
applyAligned(Base::Vector3d(0.0, -1.0, 0.0));
|
||||
}
|
||||
|
||||
void TaskSectionView::onLeftClicked()
|
||||
{
|
||||
// Base::Console().Message("TSV::onLeftClicked()\n");
|
||||
m_compass->setToWest();
|
||||
Base::Vector3d localUnit(-1.0, 0.0, 0.0);
|
||||
m_viewDirectionWidget->setValue(localUnit);
|
||||
checkAll(false);
|
||||
applyAligned(localUnit);
|
||||
m_compass->setToWest();
|
||||
m_viewDirectionWidget->setValueNoNotify(Base::Vector3d(-1.0, 0.0, 0.0));
|
||||
applyAligned(Base::Vector3d(-1.0, 0.0, 0.0));
|
||||
}
|
||||
|
||||
void TaskSectionView::onRightClicked()
|
||||
{
|
||||
// Base::Console().Message("TSV::onRightClicked()\n");
|
||||
m_compass->setToEast();
|
||||
Base::Vector3d localUnit(1.0, 0.0, 0.0);
|
||||
m_viewDirectionWidget->setValue(localUnit);
|
||||
checkAll(false);
|
||||
applyAligned(localUnit);
|
||||
m_compass->setToEast();
|
||||
m_viewDirectionWidget->setValueNoNotify(Base::Vector3d(1.0, 0.0, 0.0));
|
||||
applyAligned(Base::Vector3d(1.0, 0.0, 0.0));
|
||||
}
|
||||
|
||||
void TaskSectionView::onIdentifierChanged()
|
||||
@@ -483,6 +485,9 @@ void TaskSectionView::applyAligned(Base::Vector3d localUnit)
|
||||
m_dirName = "Aligned";
|
||||
m_localUnit = localUnit;
|
||||
enableAll(true);
|
||||
m_directionIsSet = true;
|
||||
ui->pbUpdateNow->setEnabled(true);
|
||||
ui->cbLiveUpdate->setEnabled(true);
|
||||
apply();
|
||||
}
|
||||
|
||||
|
||||
@@ -125,6 +125,7 @@ private:
|
||||
Base::Vector3d m_localUnit;
|
||||
CompassWidget* m_compass;
|
||||
VectorEditWidget* m_viewDirectionWidget;
|
||||
bool m_directionIsSet;
|
||||
};
|
||||
|
||||
class TaskDlgSectionView : public Gui::TaskView::TaskDialog
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="Gui::QuantitySpinBox" name="sbScale">
|
||||
<widget class="Gui::QuantitySpinBox" name="sbScale" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -140,19 +140,16 @@
|
||||
<property name="toolTip">
|
||||
<string>Scale factor for the section view</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<property name="keyboardTracking" stdset="0">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<property name="minimum" stdset="0">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<property name="maximum" stdset="0">
|
||||
<double>999.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<property name="value" stdset="0">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="decimals" stdset="0">
|
||||
@@ -365,7 +362,7 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="Gui::QuantitySpinBox" name="sbOrgX">
|
||||
<widget class="Gui::QuantitySpinBox" name="sbOrgX" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -378,10 +375,7 @@
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<property name="keyboardTracking" stdset="0">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="unit" stdset="0">
|
||||
@@ -409,7 +403,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="Gui::QuantitySpinBox" name="sbOrgY">
|
||||
<widget class="Gui::QuantitySpinBox" name="sbOrgY" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -422,10 +416,7 @@
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<property name="keyboardTracking" stdset="0">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="unit" stdset="0">
|
||||
@@ -453,7 +444,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="Gui::QuantitySpinBox" name="sbOrgZ">
|
||||
<widget class="Gui::QuantitySpinBox" name="sbOrgZ" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -466,10 +457,7 @@
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="keyboardTracking">
|
||||
<property name="keyboardTracking" stdset="0">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="unit" stdset="0">
|
||||
@@ -520,7 +508,7 @@
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lPendingUpdates">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
|
||||
Reference in New Issue
Block a user