Move App::Part to a separate global toolbar
This commit is contained in:
@@ -649,6 +649,7 @@ void Application::createStandardOperations()
|
||||
Gui::CreateMacroCommands();
|
||||
Gui::CreateViewStdCommands();
|
||||
Gui::CreateWindowStdCommands();
|
||||
Gui::CreateStructureCommands();
|
||||
Gui::CreateTestCommands();
|
||||
}
|
||||
|
||||
|
||||
@@ -397,6 +397,7 @@ SET(Command_CPP_SRCS
|
||||
CommandWindow.cpp
|
||||
CommandTest.cpp
|
||||
CommandView.cpp
|
||||
CommandStructure.cpp
|
||||
)
|
||||
SET(Command_SRCS
|
||||
${Command_CPP_SRCS}
|
||||
|
||||
@@ -61,6 +61,7 @@ void CreateFeatCommands(void);
|
||||
void CreateMacroCommands(void);
|
||||
void CreateViewStdCommands(void);
|
||||
void CreateWindowStdCommands(void);
|
||||
void CreateStructureCommands(void);
|
||||
void CreateTestCommands(void);
|
||||
|
||||
|
||||
|
||||
@@ -622,6 +622,12 @@ ToolBarItem* StdWorkbench::setupToolBars() const
|
||||
*view << "Std_ViewFitAll" << "Std_ViewFitSelection" << "Std_DrawStyle" << "Separator" << "Std_ViewAxo" << "Separator" << "Std_ViewFront"
|
||||
<< "Std_ViewTop" << "Std_ViewRight" << "Separator" << "Std_ViewRear" << "Std_ViewBottom"
|
||||
<< "Std_ViewLeft" << "Separator" << "Std_MeasureDistance" ;
|
||||
|
||||
// Structure
|
||||
ToolBarItem* structure = new ToolBarItem( root );
|
||||
structure->setCommand("Structure");
|
||||
*structure << "Std_Part";
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,50 +75,6 @@ App::Part* assertActivePart () {
|
||||
|
||||
} /* PartDesignGui */
|
||||
|
||||
//===========================================================================
|
||||
// PartDesign_Part
|
||||
//===========================================================================
|
||||
DEF_STD_CMD_A(CmdPartDesignPart);
|
||||
|
||||
CmdPartDesignPart::CmdPartDesignPart()
|
||||
: Command("PartDesign_Part")
|
||||
{
|
||||
sAppModule = "PartDesign";
|
||||
sGroup = QT_TR_NOOP("PartDesign");
|
||||
sMenuText = QT_TR_NOOP("Create part");
|
||||
sToolTipText = QT_TR_NOOP("Create a new part and make it active");
|
||||
sWhatsThis = "PartDesign_Part";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "Tree_Annotation";
|
||||
}
|
||||
|
||||
void CmdPartDesignPart::activated(int iMsg)
|
||||
{
|
||||
Q_UNUSED(iMsg);
|
||||
if ( !PartDesignGui::assureModernWorkflow( getDocument() ) )
|
||||
return;
|
||||
|
||||
openCommand("Add a part");
|
||||
std::string FeatName = getUniqueObjectName("Part");
|
||||
|
||||
std::string PartName;
|
||||
PartName = getUniqueObjectName("Part");
|
||||
doCommand(Doc,"App.activeDocument().Tip = App.activeDocument().addObject('App::Part','%s')",PartName.c_str());
|
||||
// TODO We really must to set label ourselfs? (2015-08-17, Fat-Zer)
|
||||
doCommand(Doc,"App.activeDocument().%s.Label = '%s'", PartName.c_str(),
|
||||
QObject::tr(PartName.c_str()).toUtf8().data());
|
||||
doCommand(Gui::Command::Gui, "Gui.activeView().setActiveObject('%s', App.activeDocument().%s)",
|
||||
PARTKEY, PartName.c_str());
|
||||
|
||||
updateActive();
|
||||
}
|
||||
|
||||
bool CmdPartDesignPart::isActive(void)
|
||||
{
|
||||
return hasActiveDocument() && !PartDesignGui::isLegacyWorkflow ( getDocument () );
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// PartDesign_Body
|
||||
//===========================================================================
|
||||
DEF_STD_CMD_A(CmdPartDesignBody);
|
||||
@@ -869,7 +825,6 @@ void CreatePartDesignBodyCommands(void)
|
||||
{
|
||||
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
|
||||
|
||||
rcCmdMgr.addCommand(new CmdPartDesignPart());
|
||||
rcCmdMgr.addCommand(new CmdPartDesignBody());
|
||||
rcCmdMgr.addCommand(new CmdPartDesignMigrate());
|
||||
rcCmdMgr.addCommand(new CmdPartDesignMoveTip());
|
||||
|
||||
@@ -341,7 +341,6 @@ void Workbench::activated()
|
||||
|
||||
const char* NoSel[] = {
|
||||
"PartDesign_Body",
|
||||
"PartDesign_Part",
|
||||
0};
|
||||
Watcher.push_back(new Gui::TaskView::TaskWatcherCommandsEmptySelection(
|
||||
NoSel,
|
||||
@@ -436,8 +435,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const
|
||||
Gui::MenuItem* part = new Gui::MenuItem;
|
||||
root->insertItem(item, part);
|
||||
part->setCommand("&Part Design");
|
||||
*part << "PartDesign_Part"
|
||||
<< "PartDesign_Body"
|
||||
*part << "PartDesign_Body"
|
||||
<< "PartDesign_NewSketch"
|
||||
<< "Sketcher_LeaveSketch"
|
||||
<< "Sketcher_ViewSketch"
|
||||
@@ -504,8 +502,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
|
||||
Gui::ToolBarItem* root = StdWorkbench::setupToolBars();
|
||||
Gui::ToolBarItem* part = new Gui::ToolBarItem(root);
|
||||
part->setCommand("Part Design Helper");
|
||||
*part << "PartDesign_Part"
|
||||
<< "PartDesign_Body"
|
||||
*part << "PartDesign_Body"
|
||||
<< "PartDesign_NewSketch"
|
||||
<< "Sketcher_EditSketch"
|
||||
<< "Sketcher_MapSketch"
|
||||
|
||||
Reference in New Issue
Block a user