[TD]remove redundant edits from 9 Task dialogs
This commit is contained in:
committed by
WandererFan
parent
c3b46bad38
commit
cb280afbc4
@@ -72,12 +72,6 @@ TaskActiveView::TaskActiveView(TechDraw::DrawPage* pageFeat) :
|
||||
m_btnOK(nullptr),
|
||||
m_btnCancel(nullptr)
|
||||
{
|
||||
// Base::Console().Message("TAV::TAV() - create mode\n");
|
||||
if (m_pageFeat == nullptr) {
|
||||
//should be caught in CMD caller
|
||||
Base::Console().Error("TaskActiveView - bad parameters. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->qsbWidth->setUnit(Base::Unit::Length);
|
||||
|
||||
@@ -95,13 +95,9 @@ TaskCenterLine::TaskCenterLine(TechDraw::DrawViewPart* partFeat,
|
||||
BaseGeomPtr bg = geoms.at(m_geomIndex);
|
||||
std::string tag = bg->getCosmeticTag();
|
||||
m_cl = partFeat->getCenterLine(tag);
|
||||
if (m_cl == nullptr) { //checked by CommandAnnotate. Should never happen.
|
||||
Base::Console().Message("TCL::TCL() - no centerline found\n");
|
||||
}
|
||||
else {
|
||||
m_type = m_cl->m_type;
|
||||
m_mode = m_cl->m_mode;
|
||||
}
|
||||
//existence of m_cl is checked in CommandAnnotate
|
||||
m_type = m_cl->m_type;
|
||||
m_mode = m_cl->m_mode;
|
||||
|
||||
setUiEdit();
|
||||
// connect the dialog objects
|
||||
@@ -128,12 +124,7 @@ TaskCenterLine::TaskCenterLine(TechDraw::DrawViewPart* partFeat,
|
||||
m_mode(0), // 0 - vertical, 1 - horizontal, 2 - aligned
|
||||
m_editMode(editMode)
|
||||
{
|
||||
if ( (m_basePage == nullptr) ||
|
||||
(m_partFeat == nullptr) ) {
|
||||
//should be caught in CMD caller
|
||||
Base::Console().Error("TaskCenterLine - bad parameters. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
//existence of page and feature are checked by isActive method of calling command
|
||||
|
||||
ui->setupUi(this);
|
||||
std::string check = subNames.front();
|
||||
|
||||
@@ -88,12 +88,7 @@ TaskCosVertex::TaskCosVertex(TechDraw::DrawViewPart* baseFeat,
|
||||
m_pbTrackerState(TRACKERPICK),
|
||||
m_savePoint(QPointF(0.0, 0.0))
|
||||
{
|
||||
if ((m_basePage == nullptr) ||
|
||||
(m_baseFeat == nullptr)) {
|
||||
//should be caught in CMD caller
|
||||
Base::Console().Error("TaskCosVertex - bad parameters. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
//baseFeat and page existence checked in cosmetic vertex command (CommandAnnotate.cpp)
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
|
||||
@@ -84,11 +84,7 @@ TaskCosmeticLine::TaskCosmeticLine(TechDraw::DrawViewPart* partFeat,
|
||||
m_saveCE(nullptr),
|
||||
m_createMode(false)
|
||||
{
|
||||
if (m_partFeat == nullptr) {
|
||||
//should be caught in CMD caller
|
||||
Base::Console().Error("TaskCosmeticLine - bad parameters. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
//existence of partFeat is checked in calling command
|
||||
|
||||
m_ce = m_partFeat->getCosmeticEdgeBySelection(m_edgeName);
|
||||
if (m_ce == nullptr) {
|
||||
@@ -113,11 +109,7 @@ TaskCosmeticLine::TaskCosmeticLine(TechDraw::DrawViewPart* partFeat,
|
||||
m_is3d(is3d),
|
||||
m_createMode(true)
|
||||
{
|
||||
if (m_partFeat == nullptr) {
|
||||
//should be caught in CMD caller
|
||||
Base::Console().Error("TaskCosmeticLine - bad parameters. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
//existence of partFeat is checked in calling command
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
|
||||
@@ -96,12 +96,10 @@ TaskDetail::TaskDetail(TechDraw::DrawViewPart* baseFeat):
|
||||
m_mode(CREATEMODE),
|
||||
m_created(false)
|
||||
{
|
||||
if (m_baseFeat == nullptr) {
|
||||
//should be caught in CMD caller
|
||||
Base::Console().Error("TaskDetail - bad parameters - base feature. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
//existence of baseFeat checked in CmdTechDrawDetailView (Command.cpp)
|
||||
|
||||
m_basePage = m_baseFeat->findParentPage();
|
||||
//it is possible that the basePage could be unparented and have no corresponding Page
|
||||
if (m_basePage == nullptr) {
|
||||
Base::Console().Error("TaskDetail - bad parameters - base page. Can not proceed.\n");
|
||||
return;
|
||||
|
||||
@@ -96,11 +96,7 @@ TaskLeaderLine::TaskLeaderLine(TechDrawGui::ViewProviderLeader* leadVP) :
|
||||
m_saveY(0.0),
|
||||
m_haveMdi(false)
|
||||
{
|
||||
if (m_lineVP == nullptr) {
|
||||
//should be caught in CMD caller
|
||||
Base::Console().Error("TaskLeaderLine - bad parameters. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
//existence of leadVP is guaranteed by caller being ViewProviderLeaderLine.setEdit
|
||||
|
||||
m_lineFeat = m_lineVP->getFeature();
|
||||
|
||||
@@ -189,12 +185,7 @@ TaskLeaderLine::TaskLeaderLine(TechDraw::DrawView* baseFeat,
|
||||
m_saveY(0.0),
|
||||
m_haveMdi(false)
|
||||
{
|
||||
if ( (m_basePage == nullptr) ||
|
||||
(m_baseFeat == nullptr) ) {
|
||||
//should be caught in CMD caller
|
||||
Base::Console().Error("TaskLeaderLine - bad parameters. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
//existence of basePage and baseFeat is checked in CmdTechDrawLeaderLine (CommandAnnotate.cpp)
|
||||
|
||||
Gui::Document* activeGui = Gui::Application::Instance->getDocument(m_basePage->getDocument());
|
||||
Gui::ViewProvider* vp = activeGui->getViewProvider(m_basePage);
|
||||
|
||||
@@ -94,12 +94,7 @@ TaskRichAnno::TaskRichAnno(TechDrawGui::ViewProviderRichAnno* annoVP) :
|
||||
m_rte(nullptr),
|
||||
m_haveMdi(false)
|
||||
{
|
||||
// Base::Console().Message("TRA::TRA() - edit\n");
|
||||
if (m_annoVP == nullptr) {
|
||||
//should be caught in CMD caller
|
||||
Base::Console().Error("TaskRichAnno - bad parameters. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
//existence of annoVP is guaranteed by caller being ViewProviderRichAnno.setEdit
|
||||
|
||||
m_annoFeat = m_annoVP->getFeature();
|
||||
|
||||
@@ -170,12 +165,7 @@ TaskRichAnno::TaskRichAnno(TechDraw::DrawView* baseFeat,
|
||||
m_rte(nullptr),
|
||||
m_haveMdi(false)
|
||||
{
|
||||
// Base::Console().Message("TRA::TRA() - create\n");
|
||||
if (m_basePage == nullptr) {
|
||||
//should be caught in CMD caller
|
||||
Base::Console().Error("TaskRichAnno - bad parameters. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
//existence of baseFeat and page guaranteed by CmdTechDrawRichTextAnnotation (CommandAnnotate.cpp)
|
||||
|
||||
Gui::Document* activeGui = Gui::Application::Instance->getDocument(m_basePage->getDocument());
|
||||
Gui::ViewProvider* vp = activeGui->getViewProvider(m_basePage);
|
||||
@@ -186,9 +176,7 @@ TaskRichAnno::TaskRichAnno(TechDraw::DrawView* baseFeat,
|
||||
m_mdi = dvp->getMDIViewPage();
|
||||
if (m_mdi != nullptr) {
|
||||
m_view = m_mdi->getQGVPage();
|
||||
if (baseFeat != nullptr) {
|
||||
m_qgParent = m_view->findQViewForDocObj(baseFeat);
|
||||
}
|
||||
m_qgParent = m_view->findQViewForDocObj(baseFeat);
|
||||
} else {
|
||||
m_haveMdi = false;
|
||||
}
|
||||
|
||||
@@ -83,13 +83,8 @@ TaskSectionView::TaskSectionView(TechDraw::DrawViewPart* base) :
|
||||
m_saved(false),
|
||||
m_abort(false)
|
||||
{
|
||||
// Base::Console().Message("TSV::TSV() - create mode\n");
|
||||
if (m_base == nullptr) {
|
||||
//should be caught in CMD caller
|
||||
std::string msg = Base::Tools::toStdString(tr("TaskSectionView - bad parameters. Can not proceed."));
|
||||
Base::Console().Error((msg + "\n").c_str());
|
||||
return;
|
||||
}
|
||||
//existence of base is guaranteed by CmdTechDrawSectionView (Command.cpp)
|
||||
|
||||
m_sectionName = std::string();
|
||||
m_doc = m_base->getDocument();
|
||||
|
||||
@@ -118,13 +113,7 @@ TaskSectionView::TaskSectionView(TechDraw::DrawViewSection* section) :
|
||||
m_saved(false),
|
||||
m_abort(false)
|
||||
{
|
||||
|
||||
if (m_section == nullptr) {
|
||||
//should be caught in CMD caller
|
||||
std::string msg = Base::Tools::toStdString(tr("TaskSectionView - bad parameters. Can not proceed."));
|
||||
Base::Console().Error((msg + "\n").c_str());
|
||||
return;
|
||||
}
|
||||
//existence of section is guaranteed by ViewProviderViewSection.setEdit
|
||||
|
||||
m_doc = m_section->getDocument();
|
||||
m_sectionName = m_section->getNameInDocument();
|
||||
|
||||
@@ -92,12 +92,8 @@ TaskWeldingSymbol::TaskWeldingSymbol(TechDraw::DrawLeaderLine* leader) :
|
||||
m_otherDirty(false)
|
||||
{
|
||||
//TODO: why does DWS need DLL as parent?
|
||||
// Base::Console().Message("TWS::TWS() - create mode\n");
|
||||
if (m_leadFeat == nullptr) {
|
||||
//should be caught in CMD caller
|
||||
Base::Console().Error("TaskWeldingSymbol - bad parameters. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
//existence of leader is guaranteed by CmdTechDrawWeldSymbol (CommandAnnotate.cpp)
|
||||
ui->setupUi(this);
|
||||
|
||||
setUiPrimary();
|
||||
@@ -126,12 +122,8 @@ TaskWeldingSymbol::TaskWeldingSymbol(TechDraw::DrawWeldSymbol* weld) :
|
||||
m_createMode(false),
|
||||
m_otherDirty(false)
|
||||
{
|
||||
// Base::Console().Message("TWS::TWS() - edit mode\n");
|
||||
if (m_weldFeat == nullptr) {
|
||||
//should be caught in CMD caller
|
||||
Base::Console().Error("TaskWeldingSymbol - bad parameters. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
//existence of weld is guaranteed by CmdTechDrawWeldSymbol (CommandAnnotate.cpp)
|
||||
// or ViewProviderWeld.setEdit
|
||||
|
||||
App::DocumentObject* obj = m_weldFeat->Leader.getValue();
|
||||
if ( (obj != nullptr) &&
|
||||
|
||||
Reference in New Issue
Block a user