From 147263e64cc15d3581df30b79b7feac1819f0df0 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 29 Feb 2012 11:58:54 +0100 Subject: [PATCH] Fix a couple of little issues --- src/Mod/Complete/Gui/Workbench.cpp | 6 +- src/Mod/Part/Gui/CommandSimple.cpp | 4 +- src/Mod/Raytracing/Gui/Command.cpp | 14 +- src/Mod/Raytracing/Gui/Makefile.am | 2 + .../Raytracing/Gui/Resources/Raytracing.qrc | 2 + .../icons/Raytrace_ExportProject.svg | 249 +++++++++++ .../icons/Raytrace_NewPartSegment.svg | 385 ++++++++++++++++++ src/Mod/Raytracing/Gui/Workbench.cpp | 53 ++- src/Mod/Raytracing/Gui/Workbench.h | 9 +- 9 files changed, 685 insertions(+), 39 deletions(-) create mode 100644 src/Mod/Raytracing/Gui/Resources/icons/Raytrace_ExportProject.svg create mode 100644 src/Mod/Raytracing/Gui/Resources/icons/Raytrace_NewPartSegment.svg diff --git a/src/Mod/Complete/Gui/Workbench.cpp b/src/Mod/Complete/Gui/Workbench.cpp index 5263f808e6..45a2faa030 100644 --- a/src/Mod/Complete/Gui/Workbench.cpp +++ b/src/Mod/Complete/Gui/Workbench.cpp @@ -528,7 +528,11 @@ Gui::ToolBarItem* Workbench::setupToolBars() const raytracing->setCommand("Raytracing"); *raytracing << "Raytracing_WriteView" << "Raytracing_WriteCamera" - << "Raytracing_WritePart"; + << "Raytracing_WritePart" + << "Separator" + << "Raytracing_NewPovrayProject" + << "Raytracing_NewPartSegment" + << "Raytracing_ExportProject"; // Drafting **************************************************************************************************** # ifdef COMPLETE_USE_DRAFTING diff --git a/src/Mod/Part/Gui/CommandSimple.cpp b/src/Mod/Part/Gui/CommandSimple.cpp index 5faee70f9a..252a3b1d09 100644 --- a/src/Mod/Part/Gui/CommandSimple.cpp +++ b/src/Mod/Part/Gui/CommandSimple.cpp @@ -227,7 +227,9 @@ void CmdPartRefineShape::activated(int iMsg) doCommand(Doc,"App.ActiveDocument.addObject('Part::Feature','%s').Shape=" "App.ActiveDocument.%s.Shape.removeSplitter()\n" "App.ActiveDocument.ActiveObject.Label=" - "App.ActiveDocument.%s.Label\n", + "App.ActiveDocument.%s.Label\n" + "Gui.ActiveDocument.%s.hide()\n", + (*it)->getNameInDocument(), (*it)->getNameInDocument(), (*it)->getNameInDocument(), (*it)->getNameInDocument()); diff --git a/src/Mod/Raytracing/Gui/Command.cpp b/src/Mod/Raytracing/Gui/Command.cpp index b049c083ab..ef2affe17b 100644 --- a/src/Mod/Raytracing/Gui/Command.cpp +++ b/src/Mod/Raytracing/Gui/Command.cpp @@ -349,7 +349,7 @@ bool CmdRaytracingNewPovrayProject::isActive(void) // Raytracing_NewPartView //=========================================================================== -DEF_STD_CMD(CmdRaytracingNewPartSegment); +DEF_STD_CMD_A(CmdRaytracingNewPartSegment); CmdRaytracingNewPartSegment::CmdRaytracingNewPartSegment() : Command("Raytracing_NewPartSegment") @@ -360,7 +360,7 @@ CmdRaytracingNewPartSegment::CmdRaytracingNewPartSegment() sToolTipText = QT_TR_NOOP("Insert a new part object into a Povray project"); sWhatsThis = "Raytracing_NewPartSegment"; sStatusTip = sToolTipText; - sPixmap = 0; + sPixmap = "Raytrace_NewPartSegment"; } void CmdRaytracingNewPartSegment::activated(int iMsg) @@ -406,6 +406,14 @@ void CmdRaytracingNewPartSegment::activated(int iMsg) commitCommand(); } +bool CmdRaytracingNewPartSegment::isActive(void) +{ + if (getActiveGuiDocument()) + return true; + else + return false; +} + //=========================================================================== // Raytracing_ExportProject //=========================================================================== @@ -421,7 +429,7 @@ CmdRaytracingExportProject::CmdRaytracingExportProject() sToolTipText = QT_TR_NOOP("Export the Povray project file"); sWhatsThis = "Raytracing_ExportProject"; sStatusTip = sToolTipText; - sPixmap = "Raytrace_Export"; + sPixmap = "Raytrace_ExportProject"; } void CmdRaytracingExportProject::activated(int iMsg) diff --git a/src/Mod/Raytracing/Gui/Makefile.am b/src/Mod/Raytracing/Gui/Makefile.am index 0672bbd33b..e6de6088f4 100644 --- a/src/Mod/Raytracing/Gui/Makefile.am +++ b/src/Mod/Raytracing/Gui/Makefile.am @@ -93,8 +93,10 @@ EXTRA_DIST = \ Resources/icons/preferences-raytracing.svg \ Resources/icons/Raytrace_Camera.svg \ Resources/icons/Raytrace_Export.svg \ + Resources/icons/Raytrace_ExportProject.svg \ Resources/icons/Raytrace_New.svg \ Resources/icons/Raytrace_Part.svg \ + Resources/icons/Raytrace_NewPartSegment.svg \ DlgSettingsRay.ui \ FreeCADpov \ Resources/Raytracing.qrc \ diff --git a/src/Mod/Raytracing/Gui/Resources/Raytracing.qrc b/src/Mod/Raytracing/Gui/Resources/Raytracing.qrc index 46ad1c8da9..a7420fd6c0 100644 --- a/src/Mod/Raytracing/Gui/Resources/Raytracing.qrc +++ b/src/Mod/Raytracing/Gui/Resources/Raytracing.qrc @@ -5,6 +5,8 @@ icons/Raytrace_Export.svg icons/Raytrace_New.svg icons/Raytrace_Part.svg + icons/Raytrace_ExportProject.svg + icons/Raytrace_NewPartSegment.svg translations/Raytracing_af.qm translations/Raytracing_de.qm translations/Raytracing_es.qm diff --git a/src/Mod/Raytracing/Gui/Resources/icons/Raytrace_ExportProject.svg b/src/Mod/Raytracing/Gui/Resources/icons/Raytrace_ExportProject.svg new file mode 100644 index 0000000000..393966a7c7 --- /dev/null +++ b/src/Mod/Raytracing/Gui/Resources/icons/Raytrace_ExportProject.svg @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Raytracing/Gui/Resources/icons/Raytrace_NewPartSegment.svg b/src/Mod/Raytracing/Gui/Resources/icons/Raytrace_NewPartSegment.svg new file mode 100644 index 0000000000..20fd4b2124 --- /dev/null +++ b/src/Mod/Raytracing/Gui/Resources/icons/Raytrace_NewPartSegment.svg @@ -0,0 +1,385 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Raytracing/Gui/Workbench.cpp b/src/Mod/Raytracing/Gui/Workbench.cpp index 5928ebc9c4..c5636b7d84 100644 --- a/src/Mod/Raytracing/Gui/Workbench.cpp +++ b/src/Mod/Raytracing/Gui/Workbench.cpp @@ -56,35 +56,30 @@ Gui::MenuItem* Workbench::setupMenuBar() const Gui::MenuItem* ray = new Gui::MenuItem; root->insertItem(item, ray); ray->setCommand("&Raytracing"); - *ray - << "Raytracing_WriteView" - << "Raytracing_WriteCamera" - << "Raytracing_WritePart" - << "Separator" - << "Raytracing_NewPovrayProject" - << "Raytracing_NewPartSegment" - << "Raytracing_ExportProject"; - + *ray + << "Raytracing_WriteView" + << "Raytracing_WriteCamera" + << "Raytracing_WritePart" + << "Separator" + << "Raytracing_NewPovrayProject" + << "Raytracing_NewPartSegment" + << "Raytracing_ExportProject"; + return root; } - -//Gui::ToolBarItem* Workbench::setupToolBars() const -//{ -// Gui::ToolBarItem* root = StdWorkbench::setupToolBars(); -// Gui::ToolBarItem* ray = new Gui::ToolBarItem(root); -// ray->setCommand("Raytracing tools"); -// *ray << "Raytracing_NewProject" << "Raytracing_WriteCamera" << "Raytracing_WritePart"; -// return root; -//} -// -//Gui::ToolBarItem* Workbench::setupCommandBars() const -//{ -// // Part tools -// Gui::ToolBarItem* root = new Gui::ToolBarItem; -// Gui::ToolBarItem* ray = new Gui::ToolBarItem( root ); -// ray->setCommand("Raytracing tools"); -// *ray << "Raytracing_NewProject" << "Raytracing_WriteCamera" << "Raytracing_WritePart"; -// return root; -//} - +Gui::ToolBarItem* Workbench::setupToolBars() const +{ + Gui::ToolBarItem* root = StdWorkbench::setupToolBars(); + Gui::ToolBarItem* ray = new Gui::ToolBarItem(root); + ray->setCommand("Raytracing tools"); + *ray + << "Raytracing_WriteView" + << "Raytracing_WriteCamera" + << "Raytracing_WritePart" + << "Separator" + << "Raytracing_NewPovrayProject" + << "Raytracing_NewPartSegment" + << "Raytracing_ExportProject"; + return root; +} diff --git a/src/Mod/Raytracing/Gui/Workbench.h b/src/Mod/Raytracing/Gui/Workbench.h index 22f048271e..a3b1b80873 100644 --- a/src/Mod/Raytracing/Gui/Workbench.h +++ b/src/Mod/Raytracing/Gui/Workbench.h @@ -36,13 +36,12 @@ class Workbench : public Gui::StdWorkbench TYPESYSTEM_HEADER(); public: - Workbench(); - virtual ~Workbench(); + Workbench(); + virtual ~Workbench(); protected: - Gui::MenuItem* setupMenuBar() const; - //Gui::ToolBarItem* setupToolBars() const; - //Gui::ToolBarItem* setupCommandBars() const; + Gui::MenuItem* setupMenuBar() const; + Gui::ToolBarItem* setupToolBars() const; }; } // namespace RaytracingGui