Skip to content

Commit

Permalink
TD renaming tools, part 2/2
Browse files Browse the repository at this point in the history
as discussed in https://forum.freecadweb.org/viewtopic.php?p=344899#p344800
we need a more consistent naming for the Wiki
  • Loading branch information
donovaly authored and WandererFan committed Nov 17, 2019
1 parent 914edfc commit 15e5b29
Show file tree
Hide file tree
Showing 28 changed files with 370 additions and 362 deletions.
86 changes: 42 additions & 44 deletions src/Mod/TechDraw/Gui/Command.cpp
Expand Up @@ -130,7 +130,7 @@ void CmdTechDrawPageDefault::activated(int iMsg)
commitCommand();
TechDraw::DrawPage* fp = dynamic_cast<TechDraw::DrawPage*>(getDocument()->getObject(PageName.c_str()));
if (!fp) {
throw Base::TypeError("CmdTechDrawNewPageDef fp not found\n");
throw Base::TypeError("CmdTechDrawPageDefault fp not found\n");
}

Gui::ViewProvider* vp = Gui::Application::Instance->getDocument(getDocument())->getViewProvider(fp);
Expand Down Expand Up @@ -164,7 +164,7 @@ CmdTechDrawPageTemplate::CmdTechDrawPageTemplate()
{
sAppModule = "TechDraw";
sGroup = QT_TR_NOOP("TechDraw");
sMenuText = QT_TR_NOOP("Insert Page using template");
sMenuText = QT_TR_NOOP("Insert Page using Template");
sToolTipText = sMenuText;
sWhatsThis = "TechDraw_PageTemplate";
sStatusTip = sToolTipText;
Expand Down Expand Up @@ -229,30 +229,30 @@ void CmdTechDrawPageTemplate::activated(int iMsg)
}
}

bool CmdTechDrawNewPage::isActive(void)
bool CmdTechDrawPageTemplate::isActive(void)
{
return hasActiveDocument();
}

//===========================================================================
// TechDraw_Redraw
// TechDraw_RedrawPage
//===========================================================================

DEF_STD_CMD_A(CmdTechDrawRedraw)
DEF_STD_CMD_A(CmdTechDrawRedrawPage)

CmdTechDrawRedraw::CmdTechDrawRedraw()
: Command("TechDraw_Redraw")
CmdTechDrawRedrawPage::CmdTechDrawRedrawPage()
: Command("TechDraw_RedrawPage")
{
sAppModule = "TechDraw";
sGroup = QT_TR_NOOP("TechDraw");
sMenuText = QT_TR_NOOP("Redraw a page");
sToolTipText = QT_TR_NOOP("Redraw a page");
sWhatsThis = "TechDraw_Redraw";
sMenuText = QT_TR_NOOP("Redraw Page");
sToolTipText = sMenuText;
sWhatsThis = "TechDraw_RedrawPage";
sStatusTip = sToolTipText;
sPixmap = "actions/techdraw-forceredraw";
sPixmap = "actions/techdraw-RedrawPage";
}

void CmdTechDrawRedraw::activated(int iMsg)
void CmdTechDrawRedrawPage::activated(int iMsg)
{
Q_UNUSED(iMsg);
TechDraw::DrawPage* page = DrawGuiUtil::findPage(this);
Expand All @@ -264,7 +264,7 @@ void CmdTechDrawRedraw::activated(int iMsg)
page->redrawCommand();
}

bool CmdTechDrawRedraw::isActive(void)
bool CmdTechDrawRedrawPage::isActive(void)
{
bool havePage = DrawGuiUtil::needPage(this);
bool haveView = DrawGuiUtil::needView(this,false);
Expand Down Expand Up @@ -384,7 +384,7 @@ CmdTechDrawActiveView::CmdTechDrawActiveView()
{
sAppModule = "TechDraw";
sGroup = QT_TR_NOOP("TechDraw");
sMenuText = QT_TR_NOOP("Insert ActiveView(3D) as View in Page");
sMenuText = QT_TR_NOOP("Insert Active View (3D View)");
sToolTipText = sMenuText;
sWhatsThis = "TechDraw_ActiveView";
sStatusTip = sToolTipText;
Expand All @@ -408,24 +408,24 @@ bool CmdTechDrawActiveView::isActive(void)
}

//===========================================================================
// TechDraw_ViewSection
// TechDraw_SectionView
//===========================================================================

DEF_STD_CMD_A(CmdTechDrawViewSection)
DEF_STD_CMD_A(CmdTechDrawSectionView)

CmdTechDrawViewSection::CmdTechDrawViewSection()
: Command("TechDraw_ViewSection")
CmdTechDrawSectionView::CmdTechDrawSectionView()
: Command("TechDraw_SectionView")
{
sAppModule = "TechDraw";
sGroup = QT_TR_NOOP("TechDraw");
sMenuText = QT_TR_NOOP("Insert Section View");
sToolTipText = sMenuText;
sWhatsThis = "TechDraw_Section";
sWhatsThis = "TechDraw_SectionView";
sStatusTip = sToolTipText;
sPixmap = "actions/techdraw-ViewSection";
sPixmap = "actions/techdraw-SectionView";
}

void CmdTechDrawViewSection::activated(int iMsg)
void CmdTechDrawSectionView::activated(int iMsg)
{
Q_UNUSED(iMsg);
TechDraw::DrawPage* page = DrawGuiUtil::findPage(this);
Expand Down Expand Up @@ -453,7 +453,7 @@ void CmdTechDrawViewSection::activated(int iMsg)
// App::DocumentObject *docObj = getDocument()->getObject(FeatName.c_str());
// TechDraw::DrawViewSection* dsv = dynamic_cast<TechDraw::DrawViewSection *>(docObj);
// if (!dsv) {
// throw Base::TypeError("CmdTechDrawViewSection DVS not found\n");
// throw Base::TypeError("CmdTechDrawSectionView DVS not found\n");
// }
// dsv->Source.setValues(dvp->Source.getValues());
// doCommand(Doc,"App.activeDocument().%s.BaseView = App.activeDocument().%s",FeatName.c_str(),BaseName.c_str());
Expand All @@ -466,7 +466,7 @@ void CmdTechDrawViewSection::activated(int iMsg)
commitCommand();
}

bool CmdTechDrawViewSection::isActive(void)
bool CmdTechDrawSectionView::isActive(void)
{
bool havePage = DrawGuiUtil::needPage(this);
bool haveView = DrawGuiUtil::needView(this);
Expand All @@ -478,24 +478,24 @@ bool CmdTechDrawViewSection::isActive(void)
}

//===========================================================================
// TechDraw_ViewDetail
// TechDraw_DetailView
//===========================================================================

DEF_STD_CMD_A(CmdTechDrawViewDetail)
DEF_STD_CMD_A(CmdTechDrawDetailView)

CmdTechDrawViewDetail::CmdTechDrawViewDetail()
: Command("TechDraw_ViewDetail")
CmdTechDrawDetailView::CmdTechDrawDetailView()
: Command("TechDraw_DetailView")
{
sAppModule = "TechDraw";
sGroup = QT_TR_NOOP("TechDraw");
sMenuText = QT_TR_NOOP("Insert Detail View");
sToolTipText = sMenuText;
sWhatsThis = "TechDraw_ViewDetail";
sWhatsThis = "TechDraw_DetailView";
sStatusTip = sToolTipText;
sPixmap = "actions/techdraw-ViewDetail";
sPixmap = "actions/techdraw-DetailView";
}

void CmdTechDrawViewDetail::activated(int iMsg)
void CmdTechDrawDetailView::activated(int iMsg)
{
Q_UNUSED(iMsg);
TechDraw::DrawPage* page = DrawGuiUtil::findPage(this);
Expand All @@ -521,7 +521,7 @@ void CmdTechDrawViewDetail::activated(int iMsg)
App::DocumentObject *docObj = getDocument()->getObject(FeatName.c_str());
TechDraw::DrawViewDetail* dvd = dynamic_cast<TechDraw::DrawViewDetail *>(docObj);
if (!dvd) {
throw Base::TypeError("CmdTechDrawViewDetail DVD not found\n");
throw Base::TypeError("CmdTechDrawDetailView DVD not found\n");
}
dvd->Source.setValues(dvp->Source.getValues());

Expand All @@ -533,7 +533,7 @@ void CmdTechDrawViewDetail::activated(int iMsg)
commitCommand();
}

bool CmdTechDrawNewViewDetail::isActive(void)
bool CmdTechDrawDetailView::isActive(void)
{
bool havePage = DrawGuiUtil::needPage(this);
bool haveView = DrawGuiUtil::needView(this);
Expand All @@ -544,8 +544,6 @@ bool CmdTechDrawNewViewDetail::isActive(void)
return (havePage && haveView && !taskInProgress);
}



//===========================================================================
// TechDraw_ProjectionGroup
//===========================================================================
Expand Down Expand Up @@ -720,7 +718,7 @@ bool CmdTechDrawProjectionGroup::isActive(void)
//}

//===========================================================================
// TechDraw_NewBalloon
// TechDraw_Balloon
//===========================================================================

//! common checks of Selection for Dimension commands
Expand Down Expand Up @@ -980,15 +978,15 @@ void CmdTechDrawClipGroupRemove::activated(int iMsg)
std::string ClipName = clip->getNameInDocument();
std::string ViewName = view->getNameInDocument();

openCommand("ClipMinus");
openCommand("ClipGroupRemove");
doCommand(Doc,"App.activeDocument().%s.ViewObject.Visibility = False",ViewName.c_str());
doCommand(Doc,"App.activeDocument().%s.removeView(App.activeDocument().%s)",ClipName.c_str(),ViewName.c_str());
doCommand(Doc,"App.activeDocument().%s.ViewObject.Visibility = True",ViewName.c_str());
updateActive();
commitCommand();
}

bool CmdTechDrawClipMinus::isActive(void)
bool CmdTechDrawClipGroupRemove::isActive(void)
{
bool havePage = DrawGuiUtil::needPage(this);
bool haveClip = false;
Expand Down Expand Up @@ -1069,7 +1067,7 @@ CmdTechDrawDraftView::CmdTechDrawDraftView()
{
// setting the Gui eye-candy
sGroup = QT_TR_NOOP("TechDraw");
sMenuText = QT_TR_NOOP("Insert a DraftWB object");
sMenuText = QT_TR_NOOP("Insert Draft Workbench Object");
sToolTipText = QT_TR_NOOP("Insert a View of a Draft Workbench object");
sWhatsThis = "TechDraw_NewDraft";
sStatusTip = sToolTipText;
Expand Down Expand Up @@ -1122,8 +1120,8 @@ CmdTechDrawArchView::CmdTechDrawArchView()
{
// setting the Gui eye-candy
sGroup = QT_TR_NOOP("TechDraw");
sMenuText = QT_TR_NOOP("Insert a Section Plane");
sToolTipText = QT_TR_NOOP("Inserts a view of a Section Plane from Arch Workbench");
sMenuText = QT_TR_NOOP("Insert Section Plane");
sToolTipText = QT_TR_NOOP("Insert a View of a Section Plane from Arch Workbench");
sWhatsThis = "TechDraw_NewArch";
sStatusTip = sToolTipText;
sPixmap = "actions/techdraw-ArchView";
Expand Down Expand Up @@ -1205,7 +1203,7 @@ void CmdTechDrawSpreadsheetView::activated(int iMsg)
commitCommand();
}

bool CmdTechDrawSpreadsheet::isActive(void)
bool CmdTechDrawSpreadsheetView::isActive(void)
{
//need a Page and a SpreadSheet::Sheet
bool havePage = DrawGuiUtil::needPage(this);
Expand Down Expand Up @@ -1336,11 +1334,11 @@ void CreateTechDrawCommands(void)

rcCmdMgr.addCommand(new CmdTechDrawPageDefault());
rcCmdMgr.addCommand(new CmdTechDrawPageTemplate());
rcCmdMgr.addCommand(new CmdTechDrawRedraw());
rcCmdMgr.addCommand(new CmdTechDrawRedrawPage());
rcCmdMgr.addCommand(new CmdTechDrawView());
rcCmdMgr.addCommand(new CmdTechDrawActiveView());
rcCmdMgr.addCommand(new CmdTechDrawViewSection());
rcCmdMgr.addCommand(new CmdTechDrawViewDetail());
rcCmdMgr.addCommand(new CmdTechDrawSectionView());
rcCmdMgr.addCommand(new CmdTechDrawDetailView());
rcCmdMgr.addCommand(new CmdTechDrawProjectionGroup());
rcCmdMgr.addCommand(new CmdTechDrawClipGroup());
rcCmdMgr.addCommand(new CmdTechDrawClipGroupAdd());
Expand Down

0 comments on commit 15e5b29

Please sign in to comment.