From 818e2b2841b9fab4a4e941bcd8c245c787917ae8 Mon Sep 17 00:00:00 2001 From: luz paz Date: Fri, 2 Dec 2022 17:55:44 -0500 Subject: [PATCH] Gui: fix trailing whitespace --- .../3Dconnexion/GuiNativeEventLinuxX11.cpp | 28 +-- src/Gui/3Dconnexion/GuiNativeEventWin32.cpp | 4 +- src/Gui/AxisOriginPy.xml | 14 +- src/Gui/DAGView/DAGFilter.cpp | 6 +- src/Gui/DAGView/DAGFilter.h | 4 +- src/Gui/DAGView/DAGModel.cpp | 230 +++++++++--------- src/Gui/DAGView/DAGModel.h | 30 +-- src/Gui/DAGView/DAGModelGraph.cpp | 4 +- src/Gui/DAGView/DAGModelGraph.h | 42 ++-- src/Gui/DAGView/DAGRectItem.cpp | 4 +- src/Gui/DAGView/DAGView.cpp | 2 +- src/Gui/DlgCreateNewPreferencePackImp.cpp | 2 +- src/Gui/DlgCreateNewPreferencePackImp.h | 6 +- src/Gui/DlgObjectSelection.cpp | 4 +- src/Gui/DlgObjectSelection.h | 6 +- src/Gui/DlgPreferencePackManagementImp.cpp | 2 +- src/Gui/DlgPreferencePackManagementImp.h | 6 +- src/Gui/DlgRevertToBackupConfigImp.cpp | 2 +- src/Gui/DlgSettings3DView.ui | 4 +- src/Gui/DlgSettingsLazyLoadedImp.cpp | 18 +- src/Gui/ExpressionCompleter.cpp | 4 +- src/Gui/ExpressionCompleter.h | 2 +- src/Gui/Inventor/SoAutoZoomTranslation.cpp | 2 +- src/Gui/LinkViewPy.xml | 26 +- src/Gui/PreferencePackManager.h | 44 ++-- .../PreferencePackTemplates/Arch_Colors.cfg | 2 +- .../Console_Colors.cfg | 2 +- .../PreferencePackTemplates/Draft_Colors.cfg | 2 +- .../PreferencePackTemplates/Editor_Colors.cfg | 2 +- .../PreferencePackTemplates/Editor_Font.cfg | 2 +- .../PreferencePackTemplates/Part_Colors.cfg | 2 +- .../PreferencePackTemplates/Path_Colors.cfg | 2 +- .../Sketcher_Colors.cfg | 2 +- .../PreferencePackTemplates/Start_Colors.cfg | 2 +- .../TechDraw_Colors.cfg | 2 +- .../PreferencePackTemplates/Window_Colors.cfg | 2 +- src/Gui/QuantitySpinBox_p.h | 4 +- src/Gui/Stylesheets/Behave-dark.qss | 10 +- src/Gui/Stylesheets/Dark-contrast.qss | 4 +- src/Gui/Stylesheets/ProDark.qss | 18 +- src/Gui/ViewProviderLink.cpp | 2 +- src/Gui/ViewProviderLinkPy.xml | 14 +- src/Gui/ViewProviderPart.cpp | 2 +- src/Gui/ViewProviderPart.h | 2 +- 44 files changed, 287 insertions(+), 287 deletions(-) diff --git a/src/Gui/3Dconnexion/GuiNativeEventLinuxX11.cpp b/src/Gui/3Dconnexion/GuiNativeEventLinuxX11.cpp index cf2711b352..5e28fc77c4 100644 --- a/src/Gui/3Dconnexion/GuiNativeEventLinuxX11.cpp +++ b/src/Gui/3Dconnexion/GuiNativeEventLinuxX11.cpp @@ -94,7 +94,7 @@ bool Gui::GuiNativeEvent::xcbEventFilter(void *xcb_void, long* result) return false; spnav_event navEvent; - + const xcb_client_message_event_t* xcb_ev = static_cast(xcb_void); // Qt4 used XEvents in native event filters, but Qt5 changed to XCB. The // SpaceNavigator API only works with XEvent, so we need to construct a @@ -169,15 +169,15 @@ bool Gui::GuiNativeEvent::x11EventFilter(XEvent *event) if (event->type == ClientMessage) { Atom message_type = event->xclient.message_type; - + if (message_type == motion_flush_event) { nMotionEvents--; if (nMotionEvents == 0) - { + { mainApp->postMotionEvent(motionDataArray); } - + return true; } // XEvent: motion_flush_event } // XEvent: ClientMessage @@ -185,7 +185,7 @@ bool Gui::GuiNativeEvent::x11EventFilter(XEvent *event) /* From here on we deal with spacenav events only: - motion: The event data is saved and a self addressed flush event - is sent through the window system (XEvent). + is sent through the window system (XEvent). In the case of an event flooding, the motion data is added up. - button: A Spaceball event is posted (QInputEvent). */ @@ -197,8 +197,8 @@ bool Gui::GuiNativeEvent::x11EventFilter(XEvent *event) { /* If the motion data of the preceding event has not been processed - through posting an Spaceball event (flooding situation), - the motion data provided by the incoming event is added to the saved data. + through posting an Spaceball event (flooding situation), + the motion data provided by the incoming event is added to the saved data. */ int dx, dy, dz, drx, dry, drz; @@ -220,36 +220,36 @@ bool Gui::GuiNativeEvent::x11EventFilter(XEvent *event) dry = motionDataArray[4]; drz = motionDataArray[5]; } - + motionDataArray[0] = -navEvent.motion.x; motionDataArray[1] = -navEvent.motion.z; motionDataArray[2] = -navEvent.motion.y; motionDataArray[3] = -navEvent.motion.rx; motionDataArray[4] = -navEvent.motion.rz; motionDataArray[5] = -navEvent.motion.ry; - + motionDataArray[0] += dx; motionDataArray[1] += dy; motionDataArray[2] += dz; motionDataArray[3] += drx; motionDataArray[4] += dry; motionDataArray[5] += drz; - + /* Send a self addressed flush event through the window system. This will trigger a Spaceball event if FreeCAD is ready to do so. */ nMotionEvents++; XClientMessageEvent flushEvent; - + flushEvent.display = display; flushEvent.window = event->xclient.window; flushEvent.type = ClientMessage; - flushEvent.format = 8; + flushEvent.format = 8; flushEvent.message_type = motion_flush_event; - + XSendEvent (display, flushEvent.window, False, 0, (XEvent*)&flushEvent); // siehe spnavd, False, 0 - + return true; } diff --git a/src/Gui/3Dconnexion/GuiNativeEventWin32.cpp b/src/Gui/3Dconnexion/GuiNativeEventWin32.cpp index b9a318610c..e07d27a8db 100644 --- a/src/Gui/3Dconnexion/GuiNativeEventWin32.cpp +++ b/src/Gui/3Dconnexion/GuiNativeEventWin32.cpp @@ -369,7 +369,7 @@ const I3dMouseParam& Gui::GuiNativeEvent::MouseParams() const void Gui::GuiNativeEvent::Move3d(HANDLE device, std::vector& motionData) { Q_UNUSED(device); - + motionDataArray[0] = -ceil(motionData[0]); motionDataArray[1] = ceil(motionData[1]); motionDataArray[2] = ceil(motionData[2]); @@ -388,7 +388,7 @@ void Gui::GuiNativeEvent::Move3d(HANDLE device, std::vector& motionData) void Gui::GuiNativeEvent::On3dmouseKeyDown(HANDLE device, int virtualKeyCode) { Q_UNUSED(device); - + mainApp->postButtonEvent(virtualKeyCode - 1, 1); } diff --git a/src/Gui/AxisOriginPy.xml b/src/Gui/AxisOriginPy.xml index 6844b4cc82..83c2d25b42 100644 --- a/src/Gui/AxisOriginPy.xml +++ b/src/Gui/AxisOriginPy.xml @@ -1,12 +1,12 @@ - getTypeId() == theType) return true; - + return false; } diff --git a/src/Gui/DAGView/DAGFilter.h b/src/Gui/DAGView/DAGFilter.h index 4a71408d0c..9b78af7308 100644 --- a/src/Gui/DAGView/DAGFilter.h +++ b/src/Gui/DAGView/DAGFilter.h @@ -48,7 +48,7 @@ namespace Gui bool enabled; Type type; }; - + /*! Hide all children of app::origin that are not * used by subsequent features */ @@ -58,7 +58,7 @@ namespace Gui FilterOrigin(); bool goFilter(const Vertex &vertexIn, const Graph &graphIn, const GraphLinkContainer &linkIn) const override; }; - + /*! Hide nodes of type*/ class FilterTyped : public FilterBase { diff --git a/src/Gui/DAGView/DAGModel.cpp b/src/Gui/DAGView/DAGModel.cpp index 406373d55e..f815d39eca 100644 --- a/src/Gui/DAGView/DAGModel.cpp +++ b/src/Gui/DAGView/DAGModel.cpp @@ -79,7 +79,7 @@ void LineEdit::keyPressEvent(QKeyEvent *eventIn) eventIn->accept(); return; } - + QLineEdit::keyPressEvent(eventIn); } @@ -98,31 +98,31 @@ Model::Model(QObject *parentIn, const Gui::Document &documentIn) : QGraphicsScen //turned off BSP as it was giving inconsistent discovery of items //underneath cursor. this->setItemIndexMethod(QGraphicsScene::NoIndex); - + theGraph = std::make_shared(); graphLink = std::make_shared(); setupViewConstants(); setupFilters(); - + graphDirty = false; currentPrehighlight = nullptr; - + ParameterGrp::handle group = App::GetApplication().GetUserParameter(). GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("DAGView"); selectionMode = static_cast(group->GetInt("SelectionMode", 0)); group->SetInt("SelectionMode", static_cast(selectionMode)); //ensure entry exists. - + QIcon temp(Gui::BitmapFactory().iconFromTheme("dagViewVisible")); visiblePixmapEnabled = temp.pixmap(iconSize, iconSize, QIcon::Normal, QIcon::On); visiblePixmapDisabled = temp.pixmap(iconSize, iconSize, QIcon::Disabled, QIcon::Off); - + QIcon passIcon(Gui::BitmapFactory().iconFromTheme("dagViewPass")); passPixmap = passIcon.pixmap(iconSize, iconSize); QIcon failIcon(Gui::BitmapFactory().iconFromTheme("dagViewFail")); failPixmap = failIcon.pixmap(iconSize, iconSize); QIcon pendingIcon(Gui::BitmapFactory().iconFromTheme("dagViewPending")); pendingPixmap = pendingIcon.pixmap(iconSize, iconSize); - + renameAction = new QAction(this); renameAction->setText(tr("Rename")); renameAction->setStatusTip(tr("Rename object")); @@ -130,13 +130,13 @@ Model::Model(QObject *parentIn, const Gui::Document &documentIn) : QGraphicsScen renameAction->setShortcut(Qt::Key_F2); #endif connect(renameAction, SIGNAL(triggered()), this, SLOT(onRenameSlot())); - + editingFinishedAction = new QAction(this); editingFinishedAction->setText(tr("Finish editing")); editingFinishedAction->setStatusTip(tr("Finish editing object")); connect(this->editingFinishedAction, SIGNAL(triggered()), this, SLOT(editingFinishedSlot())); - + connectNewObject = documentIn.signalNewObject.connect(boost::bind(&Model::slotNewObject, this, bp::_1)); connectDelObject = documentIn.signalDeletedObject.connect(boost::bind(&Model::slotDeleteObject, this, bp::_1)); connectChgObject = documentIn.signalChangedObject.connect(boost::bind(&Model::slotChangeObject, this, bp::_1, bp::_2)); @@ -162,7 +162,7 @@ Model::~Model() connectEdtObject.disconnect(); if(connectResObject.connected()) connectResObject.disconnect(); - + removeAllItems(); } @@ -177,7 +177,7 @@ void Model::setupViewConstants() { ParameterGrp::handle group = App::GetApplication().GetUserParameter(). GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("DAGView"); - + //get font point size. int fontPointSize = group->GetInt("FontPointSize", 0); group->SetInt("FontPointSize", fontPointSize); //ensure entry exists. @@ -187,13 +187,13 @@ void Model::setupViewConstants() tempFont.setPointSize(fontPointSize); this->setFont(tempFont); } - + //get direction direction = group->GetFloat("Direction", 1.0); if (direction != -1.0 && direction != 1.0) direction = 1.0; group->SetFloat("Direction", direction); //ensure entry exists. - + QFontMetrics fontMetric(this->font()); fontHeight = fontMetric.height(); verticalSpacing = 1.0; @@ -206,7 +206,7 @@ void Model::setupViewConstants() iconToText = iconSize / 2.0; rowPadding = fontHeight; backgroundBrushes = {this->palette().base(), this->palette().alternateBase()}; - forgroundBrushes = + forgroundBrushes = { QBrush(Qt::red), QBrush(Qt::darkRed), @@ -229,9 +229,9 @@ void Model::setupViewConstants() void Model::slotNewObject(const ViewProviderDocumentObject &VPDObjectIn) { Vertex virginVertex = boost::add_vertex(*theGraph); - + addVertexItemsToScene(virginVertex); - + GraphLinkRecord virginRecord; virginRecord.DObject = VPDObjectIn.getObject(); virginRecord.VPDObject = &VPDObjectIn; @@ -239,19 +239,19 @@ void Model::slotNewObject(const ViewProviderDocumentObject &VPDObjectIn) virginRecord.uniqueName = std::string(virginRecord.DObject->getNameInDocument()); virginRecord.vertex = virginVertex; graphLink->insert(virginRecord); - + //setup rectangle. auto rectangle = (*theGraph)[virginVertex].rectangle.get(); rectangle->setEditingBrush(QBrush(Qt::yellow)); - + auto icon = (*theGraph)[virginVertex].icon; icon->setPixmap(VPDObjectIn.getIcon().pixmap(iconSize, iconSize)); (*theGraph)[virginVertex].stateIcon->setPixmap(passPixmap); (*theGraph)[virginVertex].text->setFont(this->font()); - (*theGraph)[virginVertex].connChangeIcon = + (*theGraph)[virginVertex].connChangeIcon = const_cast(VPDObjectIn).signalChangeIcon.connect( boost::bind(&Model::slotChangeIcon, this, boost::cref(VPDObjectIn), icon)); - + graphDirty = true; lastAddedVertex = Graph::null_vertex(); } @@ -265,27 +265,27 @@ void Model::slotChangeIcon(const ViewProviderDocumentObject &VPDObjectIn, std::s void Model::slotDeleteObject(const ViewProviderDocumentObject &VPDObjectIn) { Vertex vertex = findRecord(&VPDObjectIn, *graphLink).vertex; - + //remove items from scene. removeVertexItemsFromScene(vertex); - - //remove connector items + + //remove connector items auto outRange = boost::out_edges(vertex, *theGraph); for (auto outEdgeIt = outRange.first; outEdgeIt != outRange.second; ++outEdgeIt) this->removeItem((*theGraph)[*outEdgeIt].connector.get()); auto inRange = boost::in_edges(vertex, *theGraph); for (auto inEdgeIt = inRange.first; inEdgeIt != inRange.second; ++inEdgeIt) this->removeItem((*theGraph)[*inEdgeIt].connector.get()); - + if (vertex == lastAddedVertex) lastAddedVertex = Graph::null_vertex(); (*theGraph)[vertex].connChangeIcon.disconnect(); - + //remove the actual vertex. boost::clear_vertex(vertex, *theGraph); boost::remove_vertex(vertex, *theGraph); - + eraseRecord(&VPDObjectIn, *graphLink); graphDirty = true; } @@ -296,11 +296,11 @@ void Model::slotChangeObject(const ViewProviderDocumentObject &VPDObjectIn, cons if (propertyIn.hasName()) name = propertyIn.getName(); assert(!name.empty()); - -// std::cout << std::endl << "inside changed object." << std::endl << + +// std::cout << std::endl << "inside changed object." << std::endl << // "Property name is: " << name << std::endl << // "Property type is: " << propertyIn.getTypeId().getName() << std::endl << std::endl; - + //renaming of objects. if (std::string("Label") == name) { @@ -334,23 +334,23 @@ void Model::selectionChanged(const SelectionChanges& msg) { //TODO: note that treeview uses set selection which sends a message with just a document name //and no object name. Have to explore further. - + auto getAllEdges = [this](const Vertex &vertexIn) { //is there really no function to get both in and out edges? std::vector out; - + OutEdgeIterator outIt, outItEnd; for (boost::tie(outIt, outItEnd) = boost::out_edges(vertexIn, *theGraph); outIt != outItEnd; ++outIt) out.push_back(*outIt); - + InEdgeIterator inIt, inItEnd; for (boost::tie(inIt, inItEnd) = boost::in_edges(vertexIn, *theGraph); inIt != inItEnd; ++inIt) out.push_back(*inIt); - + return out; }; - + auto highlightConnectorOn = [this, getAllEdges](const Vertex &vertexIn) { QColor color = (*theGraph)[vertexIn].text->defaultTextColor(); @@ -363,7 +363,7 @@ void Model::selectionChanged(const SelectionChanges& msg) (*theGraph)[edge].connector->setZValue(1.0); } }; - + auto highlightConnectorOff = [this, getAllEdges](const Vertex &vertexIn) { auto edges = getAllEdges(vertexIn); @@ -373,7 +373,7 @@ void Model::selectionChanged(const SelectionChanges& msg) (*theGraph)[edge].connector->setZValue(0.0); } }; - + //lambda for clearing selections. auto clearSelection = [this, highlightConnectorOff]() { @@ -385,7 +385,7 @@ void Model::selectionChanged(const SelectionChanges& msg) highlightConnectorOff(currentVertex); } }; - + //lambda for getting rectangle. auto getRectangle = [this](const char *in) { @@ -397,7 +397,7 @@ void Model::selectionChanged(const SelectionChanges& msg) assert(rect); return rect; }; - + if (msg.Type == SelectionChanges::AddSelection) { if (msg.pObjectName) @@ -419,7 +419,7 @@ void Model::selectionChanged(const SelectionChanges& msg) else if(msg.Type == SelectionChanges::SetSelection) { clearSelection(); - + auto selections = Gui::Selection().getSelection(msg.pDocName); for (const auto &selection : selections) { @@ -433,7 +433,7 @@ void Model::selectionChanged(const SelectionChanges& msg) { clearSelection(); } - + this->invalidate(); } @@ -451,13 +451,13 @@ void Model::updateSlot() { //empty outList means it is a root. //empty inList means it is a leaf. - + //NOTE: some of the following loops can/should be combined //for speed. Not doing yet, as I want a simple algorithm until //a more complete picture is formed. - + Base::TimeInfo startTime; - + //here we will cycle through the graph updating edges. //we have to do this first and in isolation because everything is dependent on an up to date graph. BGL_FORALL_VERTICES(currentVertex, *theGraph, Graph) @@ -479,7 +479,7 @@ void Model::updateSlot() } } } - + //apply filters. BGL_FORALL_VERTICES(currentVertex, *theGraph, Graph) { @@ -492,7 +492,7 @@ void Model::updateSlot() (*theGraph)[currentVertex].dagVisible = false; } } - //inclusion takes precedence. Separate loop because filters might probe + //inclusion takes precedence. Separate loop because filters might probe //children and parents. So we want to ensure all exclusions are done //before inclusions start. BGL_FORALL_VERTICES(currentVertex, *theGraph, Graph) @@ -505,7 +505,7 @@ void Model::updateSlot() (*theGraph)[currentVertex].dagVisible = true; } } - + //sync scene items to graph vertex dagVisible. BGL_FORALL_VERTICES(currentVertex, *theGraph, Graph) { @@ -514,20 +514,20 @@ void Model::updateSlot() if ((!(*theGraph)[currentVertex].dagVisible) && (*theGraph)[currentVertex].rectangle->scene()) removeVertexItemsFromScene(currentVertex); } - + //sync scene items for graph edge. BGL_FORALL_EDGES(currentEdge, *theGraph, Graph) { Vertex source = boost::source(currentEdge, *theGraph); Vertex target = boost::target(currentEdge, *theGraph); - + bool edgeVisible = (*theGraph)[source].dagVisible && (*theGraph)[target].dagVisible; if (edgeVisible && (!(*theGraph)[currentEdge].connector->scene())) this->addItem((*theGraph)[currentEdge].connector.get()); if ((!edgeVisible) && (*theGraph)[currentEdge].connector->scene()) this->removeItem((*theGraph)[currentEdge].connector.get()); } - + indexVerticesEdges(); Path sorted; try @@ -548,7 +548,7 @@ void Model::updateSlot() (*theGraph)[currentVertex].topoSortIndex = tempIndex; tempIndex++; } - + //draw graph(nodes and connectors). int currentRow = 0; int currentColumn = -1; //we know first column is going to be root so will be kicked up to 0. @@ -558,7 +558,7 @@ void Model::updateSlot() { if (!(*theGraph)[currentVertex].dagVisible) continue; - + if (boost::out_degree(currentVertex, *theGraph) == 0) currentColumn = 0; else @@ -572,7 +572,7 @@ void Model::updateSlot() for (;it != itEnd; ++it) { // std::cout << std::endl << "name: " << findRecord(currentVertex, *graphLink).DObject->Label.getValue() << std::endl; - + Vertex target = boost::target(*it, *theGraph); parentVertices.push_back(target); int currentParentIndex = (*theGraph)[target].topoSortIndex; @@ -584,23 +584,23 @@ void Model::updateSlot() for (it = start; it != end; ++it) { // std::cout << " parent: " << findRecord(*it, *graphLink).DObject->Label.getValue() << std::endl; - + columnMask |= (*theGraph)[*it].column; } farthestParentIndex = currentParentIndex; } } - + //have to create a smaller subset to get through std::cout. // std::bitset<8> testSet; // for (unsigned int index = 0; index < testSet.size(); ++index) // testSet[index]= columnMask[index]; // std::cout << "mask for " << findRecord(currentVertex, *graphLink).DObject->Label.getValue() << " " << // testSet.to_string() << std::endl; - + //now we should have a mask representing the columns that are being used. //this is from the lowest parent, in the topo sort, to last entry. - + //try to use the same column as one of the parents.(*theGraph)[*it].column int destinationColumn = 0; //default to first column for (const auto ¤tParent : parentVertices) @@ -629,9 +629,9 @@ void Model::updateSlot() currentColumn = destinationColumn; } - + assert(currentColumn < static_cast(ColumnMask().size())); //temp limitation. - + maxColumn = std::max(currentColumn, maxColumn); QBrush currentBrush(forgroundBrushes.at(currentColumn % forgroundBrushes.size())); @@ -639,26 +639,26 @@ void Model::updateSlot() rectangle->setRect(-rowPadding, 0.0, rowPadding, rowHeight); //calculate actual length later. rectangle->setTransform(QTransform::fromTranslate(0, rowHeight * currentRow)); rectangle->setBackgroundBrush(backgroundBrushes[currentRow % backgroundBrushes.size()]); - + auto point = (*theGraph)[currentVertex].point.get(); point->setRect(0.0, 0.0, pointSize, pointSize); point->setTransform(QTransform::fromTranslate(pointSpacing * currentColumn, rowHeight * currentRow + rowHeight / 2.0 - pointSize / 2.0)); point->setBrush(currentBrush); - + float cheat = 0.0; if (direction == -1) cheat = rowHeight; - + auto visiblePixmap = (*theGraph)[currentVertex].visibleIcon.get(); visiblePixmap->setTransform(QTransform::fromTranslate(0.0, rowHeight * currentRow + cheat)); //calculate x location later. - + auto statePixmap = (*theGraph)[currentVertex].stateIcon.get(); statePixmap->setTransform(QTransform::fromTranslate(0.0, rowHeight * currentRow + cheat)); //calculate x location later. - + auto pixmap = (*theGraph)[currentVertex].icon.get(); pixmap->setTransform(QTransform::fromTranslate(0.0, rowHeight * currentRow + cheat)); //calculate x location later. - + auto text = (*theGraph)[currentVertex].text.get(); text->setPlainText(QString::fromUtf8(findRecord(currentVertex, *graphLink).DObject->Label.getValue())); text->setDefaultTextColor(currentBrush.color()); @@ -666,11 +666,11 @@ void Model::updateSlot() text->setTransform(QTransform::fromTranslate (0.0, rowHeight * currentRow - verticalSpacing * 2.0 + cheat)); //calculate x location later. (*theGraph)[currentVertex].lastVisibleState = VisibilityState::None; //force visual update for color. - + //store column and row int the graph. use for connectors later. (*theGraph)[currentVertex].row = currentRow; (*theGraph)[currentVertex].column.reset().set((currentColumn)); - + //our list is topo sorted so all dependents should be located, so we can build the connectors. //will have some more logic for connector path, simple for now. float currentX = pointSpacing * currentColumn + pointSize / 2.0; @@ -685,7 +685,7 @@ void Model::updateSlot() float dependentX = pointSpacing * static_cast(columnFromMask((*theGraph)[target].column)) + pointSize / 2.0; //on center. columnFromMask((*theGraph)[target].column); float dependentY = rowHeight * (*theGraph)[target].row + rowHeight / 2.0; - + QGraphicsPathItem *pathItem = (*theGraph)[*it].connector.get(); pathItem->setBrush(Qt::NoBrush); QPainterPath path; @@ -696,9 +696,9 @@ void Model::updateSlot() { //connector with bend. float radius = pointSpacing / 1.9; //no zero length line. - + path.lineTo(currentX, dependentY + radius * direction); - + float yPosition; if (direction == -1.0) yPosition = dependentY - 2.0 * radius; @@ -720,10 +720,10 @@ void Model::updateSlot() } pathItem->setPath(path); } - + currentRow++; } - + //now that we have the graph drawn we know where to place icons and text. float columnSpacing = (maxColumn * pointSpacing); for (const auto ¤tVertex : sorted) @@ -733,32 +733,32 @@ void Model::updateSlot() auto visiblePixmap = (*theGraph)[currentVertex].visibleIcon.get(); QTransform visibleIconTransform = QTransform::fromTranslate(localCurrentX, 0.0); visiblePixmap->setTransform(visiblePixmap->transform() * visibleIconTransform); - + localCurrentX += iconSize + iconToIcon; auto statePixmap = (*theGraph)[currentVertex].stateIcon.get(); QTransform stateIconTransform = QTransform::fromTranslate(localCurrentX, 0.0); statePixmap->setTransform(statePixmap->transform() * stateIconTransform); - + localCurrentX += iconSize + iconToIcon; auto pixmap = (*theGraph)[currentVertex].icon.get(); QTransform iconTransform = QTransform::fromTranslate(localCurrentX, 0.0); pixmap->setTransform(pixmap->transform() * iconTransform); - + localCurrentX += iconSize + iconToText; auto text = (*theGraph)[currentVertex].text.get(); QTransform textTransform = QTransform::fromTranslate(localCurrentX, 0.0); text->setTransform(text->transform() * textTransform); - + auto rectangle = (*theGraph)[currentVertex].rectangle.get(); QRectF rect = rectangle->rect(); rect.setWidth(localCurrentX + maxTextLength + 2.0 * rowPadding); rectangle->setRect(rect); } - + //Modeling_Challenge_Casting_ta4 with 59 features: "Initialize DAG View time: 0.007" //keeping algo simple with extra loops only added 0.002 to above number. // std::cout << "Initialize DAG View time: " << Base::TimeInfo::diffTimeF(startTime, Base::TimeInfo()) << std::endl; - + // outputGraphviz(*theGraph, "./graphviz.dot"); graphDirty = false; } @@ -766,7 +766,7 @@ void Model::updateSlot() void Model::indexVerticesEdges() { std::size_t index = 0; - + //index vertices. VertexIterator it, itEnd; for(boost::tie(it, itEnd) = boost::vertices(*theGraph); it != itEnd; ++it) @@ -791,7 +791,7 @@ void Model::removeAllItems() { BGL_FORALL_VERTICES(currentVertex, *theGraph, Graph) removeVertexItemsFromScene(currentVertex); - + BGL_FORALL_EDGES(currentEdge, *theGraph, Graph) { if ((*theGraph)[currentEdge].connector->scene()) @@ -830,11 +830,11 @@ void Model::updateStates() { //not sure I want to use the same pixmap merge for failing feature icons. //thinking maybe red background or another column of icons for state? - + BGL_FORALL_VERTICES(currentVertex, *theGraph, Graph) { const GraphLinkRecord &record = findRecord(currentVertex, *graphLink); - + auto visiblePixmap = (*theGraph)[currentVertex].visibleIcon.get(); VisibilityState currentVisibilityState = (record.VPDObject->isShow()) ? (VisibilityState::On) : (VisibilityState::Off); if @@ -849,7 +849,7 @@ void Model::updateStates() visiblePixmap->setPixmap(visiblePixmapDisabled); (*theGraph)[currentVertex].lastVisibleState = currentVisibilityState; } - + FeatureState currentFeatureState = FeatureState::Pass; if (record.DObject->isError()) currentFeatureState = FeatureState::Fail; @@ -889,7 +889,7 @@ RectItem* Model::getRectFromPosition(const QPointF& position) rect = dynamic_cast(currentItem); if (rect) break; } - + return rect; } @@ -903,22 +903,22 @@ void Model::mouseMoveEvent(QGraphicsSceneMouseEvent* event) currentPrehighlight = nullptr; } }; - + RectItem *rect = getRectFromPosition(event->scenePos()); if (!rect) { clearPrehighlight(); return; } - + if (rect == currentPrehighlight) return; - + clearPrehighlight(); rect->preHighlightOn(); currentPrehighlight = rect; invalidate(); - + QGraphicsScene::mouseMoveEvent(event); } @@ -938,7 +938,7 @@ void Model::mousePressEvent(QGraphicsSceneMouseEvent* event) selectionRecord.DObject->getNameInDocument()); } }; - + auto toggleSelect = [](const App::DocumentObject *dObjectIn, RectItem *rectIn) { if (rectIn->isSelected()) @@ -946,17 +946,17 @@ void Model::mousePressEvent(QGraphicsSceneMouseEvent* event) else Gui::Selection().addSelection(dObjectIn->getDocument()->getName(), dObjectIn->getNameInDocument()); }; - + if (proxy) renameAcceptedSlot(); - + if (event->button() == Qt::LeftButton) { RectItem *rect = getRectFromPosition(event->scenePos()); if (rect) { const GraphLinkRecord &record = findRecord(rect, *graphLink); - + //don't like that I am doing this again here after getRectFromPosition call. QGraphicsItem *item = itemAt(event->scenePos(), QTransform()); auto pixmapItem = dynamic_cast(item); @@ -967,10 +967,10 @@ void Model::mousePressEvent(QGraphicsSceneMouseEvent* event) const_cast(record.VPDObject)->show(); //const hack else const_cast(record.VPDObject)->hide(); //const hack - + return; } - + const App::DocumentObject *dObject = record.DObject; if (selectionMode == SelectionMode::Single) { @@ -1008,7 +1008,7 @@ void Model::mousePressEvent(QGraphicsSceneMouseEvent* event) Gui::Selection().clearSelection(); //get document name? } } - + QGraphicsScene::mousePressEvent(event); } @@ -1026,7 +1026,7 @@ void Model::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) getMainWindow()->setActiveWindow(view); const_cast(record.VPDObject)->doubleClicked(); } - + QGraphicsScene::mouseDoubleClickEvent(event); } @@ -1034,13 +1034,13 @@ void Model::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) std::vector Model::getAllSelected() { std::vector out; - + BGL_FORALL_VERTICES(currentVertex, *theGraph, Graph) { if ((*theGraph)[currentVertex].rectangle->isSelected()) out.push_back(currentVertex); } - + return out; } @@ -1050,7 +1050,7 @@ void Model::contextMenuEvent(QGraphicsSceneContextMenuEvent* event) if (rect) { const GraphLinkRecord &record = findRecord(rect, *graphLink); - + //don't like that I am doing this again here after getRectFromPosition call. QGraphicsItem *item = itemAt(event->scenePos(), QTransform()); auto pixmapItem = dynamic_cast(item); @@ -1059,7 +1059,7 @@ void Model::contextMenuEvent(QGraphicsSceneContextMenuEvent* event) visiblyIsolate(record.vertex); return; } - + if (!rect->isSelected()) { Gui::Selection().clearSelection(record.DObject->getDocument()->getName()); @@ -1067,12 +1067,12 @@ void Model::contextMenuEvent(QGraphicsSceneContextMenuEvent* event) lastPickValid = true; lastPick = event->scenePos(); } - + MenuItem view; Gui::Application::Instance->setupContextMenu("Tree", &view); QMenu contextMenu; MenuManager::getInstance()->setupContextMenu(&view, contextMenu); - + //actions for only one selection. std::vector selections = getAllSelected(); if (selections.size() == 1) @@ -1085,11 +1085,11 @@ void Model::contextMenuEvent(QGraphicsSceneContextMenuEvent* event) else contextMenu.addAction(editingFinishedAction); } - + if (contextMenu.actions().count() > 0) contextMenu.exec(event->screenPos()); } - + QGraphicsScene::contextMenuEvent(event); } @@ -1098,32 +1098,32 @@ void Model::onRenameSlot() assert(!proxy); std::vector selections = getAllSelected(); assert(selections.size() == 1); - + auto lineEdit = new LineEdit(); auto text = (*theGraph)[selections.front()].text.get(); lineEdit->setText(text->toPlainText()); connect(lineEdit, SIGNAL(acceptedSignal()), this, SLOT(renameAcceptedSlot())); connect(lineEdit, SIGNAL(rejectedSignal()), this, SLOT(renameRejectedSlot())); - + proxy = this->addWidget(lineEdit); proxy->setGeometry(text->sceneBoundingRect()); - + lineEdit->selectAll(); - QTimer::singleShot(0, lineEdit, SLOT(setFocus())); + QTimer::singleShot(0, lineEdit, SLOT(setFocus())); } void Model::renameAcceptedSlot() { assert(proxy); - + std::vector selections = getAllSelected(); assert(selections.size() == 1); const GraphLinkRecord &record = findRecord(selections.front(), *graphLink); - + auto lineEdit = dynamic_cast(proxy->widget()); assert(lineEdit); const_cast(record.DObject)->Label.setValue(lineEdit->text().toUtf8().constData()); //const hack - + finishRename(); } @@ -1181,10 +1181,10 @@ void Model::visiblyIsolate(Gui::DAG::Vertex sourceIn) if (type != Base::Type::badType()) out.push_back(type); type = Base::Type::fromName("PartDesign::Body"); if (type != Base::Type::badType()) out.push_back(type); - + return out; }; - + auto testSkipType = [](const App::DocumentObject *dObject, const std::vector &types) { for (const auto ¤tType : types) @@ -1194,13 +1194,13 @@ void Model::visiblyIsolate(Gui::DAG::Vertex sourceIn) } return false; }; - + indexVerticesEdges(); Path connectedVertices; ConnectionVisitor visitor(connectedVertices); boost::breadth_first_search(*theGraph, sourceIn, boost::visitor(visitor)); boost::breadth_first_search(boost::make_reverse_graph(*theGraph), sourceIn, boost::visitor(visitor)); - + //note source vertex is added twice to Path. Once for each search. static std::vector skipTypes = buildSkipTypes(); for (const auto ¤tVertex : connectedVertices) @@ -1210,7 +1210,7 @@ void Model::visiblyIsolate(Gui::DAG::Vertex sourceIn) continue; const_cast(record.VPDObject)->hide(); //const hack } - + const GraphLinkRecord &sourceRecord = findRecord(sourceIn, *graphLink); if (!testSkipType(sourceRecord.DObject, skipTypes)) const_cast(sourceRecord.VPDObject)->show(); //const hack diff --git a/src/Gui/DAGView/DAGModel.h b/src/Gui/DAGView/DAGModel.h index fa8e2cff25..624fed7818 100644 --- a/src/Gui/DAGView/DAGModel.h +++ b/src/Gui/DAGView/DAGModel.h @@ -45,7 +45,7 @@ namespace Gui class Document; class ViewProviderDocumentObject; class SelectionChanges; - + namespace DAG { class LineEdit : public QLineEdit @@ -59,7 +59,7 @@ namespace Gui protected: void keyPressEvent(QKeyEvent*) override; }; - + class Model : public QGraphicsScene { Q_OBJECT @@ -68,13 +68,13 @@ namespace Gui ~Model() override; void awake(); //!< hooked up to event dispatcher for update when idle. void selectionChanged(const SelectionChanges& msg); - + protected: void mouseMoveEvent(QGraphicsSceneMouseEvent* event) override; void mousePressEvent(QGraphicsSceneMouseEvent* event) override; void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) override; void contextMenuEvent(QGraphicsSceneContextMenuEvent* event) override; - + private Q_SLOTS: void updateSlot(); void onRenameSlot(); @@ -82,7 +82,7 @@ namespace Gui void renameRejectedSlot(); void editingStartSlot(); void editingFinishedSlot(); - + private: Model(){} //documentObject slots. @@ -102,20 +102,20 @@ namespace Gui void slotInEdit(const Gui::ViewProviderDocumentObject &VPDObjectIn); void slotResetEdit(const Gui::ViewProviderDocumentObject &VPDObjectIn); void slotChangeIcon(const Gui::ViewProviderDocumentObject &VPDObjectIn, std::shared_ptr icon); - + std::shared_ptr graphLink; std::shared_ptr theGraph; bool graphDirty; - + void indexVerticesEdges(); void removeAllItems(); void addVertexItemsToScene(const Vertex &vertexIn); void removeVertexItemsFromScene(const Vertex &vertexIn); void updateStates(); std::size_t columnFromMask(const ColumnMask&); - + RectItem* getRectFromPosition(const QPointF &position); //!< can be nullptr - + //! @name View Constants for spacing //@{ float fontHeight; //!< height of the current qApp default font. @@ -133,9 +133,9 @@ namespace Gui std::vector forgroundBrushes; //!< brushes to paint points, connectors, text. void setupViewConstants(); //@} - + RectItem *currentPrehighlight; - + enum class SelectionMode { Single, @@ -144,22 +144,22 @@ namespace Gui SelectionMode selectionMode; std::vector getAllSelected(); void visiblyIsolate(Vertex sourceIn); //!< hide any connected feature and turn on sourceIn. - + QPointF lastPick; bool lastPickValid = false; - + QPixmap visiblePixmapEnabled; QPixmap visiblePixmapDisabled; QPixmap passPixmap; QPixmap failPixmap; QPixmap pendingPixmap; Vertex lastAddedVertex = Graph::null_vertex(); //!< needed because python objects are not ready. - + QAction *renameAction; QAction *editingFinishedAction; QGraphicsProxyWidget *proxy = nullptr; void finishRename(); - + //filters void setupFilters(); using FilterContainer = std::vector >; diff --git a/src/Gui/DAGView/DAGModelGraph.cpp b/src/Gui/DAGView/DAGModelGraph.cpp index bb98e97a23..86c29bec51 100644 --- a/src/Gui/DAGView/DAGModelGraph.cpp +++ b/src/Gui/DAGView/DAGModelGraph.cpp @@ -28,9 +28,9 @@ using namespace Gui; using namespace DAG; -VertexProperty::VertexProperty() : +VertexProperty::VertexProperty() : rectangle(new RectItem()), - point(new QGraphicsEllipseItem()), + point(new QGraphicsEllipseItem()), visibleIcon(new QGraphicsPixmapItem()), stateIcon(new QGraphicsPixmapItem()), icon(new QGraphicsPixmapItem()), diff --git a/src/Gui/DAGView/DAGModelGraph.h b/src/Gui/DAGView/DAGModelGraph.h index 1283ca0370..e4b65c9363 100644 --- a/src/Gui/DAGView/DAGModelGraph.h +++ b/src/Gui/DAGView/DAGModelGraph.h @@ -45,7 +45,7 @@ namespace App{class DocumentObject;} namespace Gui { class ViewProviderDocumentObject; - + namespace DAG { enum class VisibilityState @@ -54,7 +54,7 @@ namespace Gui On, //; - + /*! @brief Graph vertex information * * My data stored for each vertex; @@ -98,7 +98,7 @@ namespace Gui boost::vertex_index_t, std::size_t, boost::property >; - + /*! @brief Graph edge information * * My data stored for each edge; @@ -119,7 +119,7 @@ namespace Gui }; /*! @brief needed to create an internal index for graph edges. needed for setS.*/ using edge_prop = boost::property; - + using Graph = boost::adjacency_list; using Vertex = boost::graph_traits::vertex_descriptor; using Edge = boost::graph_traits::edge_descriptor; @@ -130,7 +130,7 @@ namespace Gui using VertexAdjacencyIterator = boost::graph_traits::adjacency_iterator; using GraphReversed = boost::reverse_graph; using Path = std::vector; //!< a path or any array of vertices - + template class Edge_writer { public: @@ -145,7 +145,7 @@ namespace Gui private: const GraphEW &graphEW; }; - + template class Vertex_writer { public: @@ -154,13 +154,13 @@ namespace Gui void operator()(std::ostream& out, const VertexW& vertexW) const { out << "[label=\""; - out << graphVW[vertexW].text->toPlainText().toLatin1().data(); + out << graphVW[vertexW].text->toPlainText().toLatin1().data(); out << "\"]"; } private: const GraphVW &graphVW; }; - + template void outputGraphviz(const GraphIn &graphIn, const std::string &filePath) { @@ -168,7 +168,7 @@ namespace Gui boost::write_graphviz(file, graphIn, Vertex_writer(graphIn), Edge_writer(graphIn)); } - + //! get all the leaves of the templated graph. Not used right now. template class RakeLeaves @@ -190,7 +190,7 @@ namespace Gui private: const GraphIn &graph; }; - + //! get all the roots of the templated graph. Not used right now. template class DigRoots @@ -212,24 +212,24 @@ namespace Gui private: const GraphIn &graph; }; - + /*! @brief Get connected components. */ class ConnectionVisitor : public boost::default_bfs_visitor { public: explicit ConnectionVisitor(std::vector &verticesIn) : vertices(verticesIn){} - + template void discover_vertex(TVertex vertex, TGraph &graph) { - Q_UNUSED(graph); + Q_UNUSED(graph); vertices.push_back(vertex); } private: std::vector &vertices; }; - + /*! Multi_index record. */ struct GraphLinkRecord { @@ -238,17 +238,17 @@ namespace Gui const RectItem *rectItem; //!< qgraphics item. std::string uniqueName; //!< name for document object. Vertex vertex; //!< vertex in graph. - + //@{ //! used as tags. struct ByDObject{}; - struct ByVPDObject{}; - struct ByRectItem{}; + struct ByVPDObject{}; + struct ByRectItem{}; struct ByUniqueName{}; struct ByVertex{}; //@} }; - + namespace BMI = boost::multi_index; using GraphLinkContainer = boost::multi_index_container < @@ -282,7 +282,7 @@ namespace Gui > > >; - + bool hasRecord(const App::DocumentObject* dObjectIn, const GraphLinkContainer &containerIn); const GraphLinkRecord& findRecord(Vertex vertexIn, const GraphLinkContainer &containerIn); const GraphLinkRecord& findRecord(const App::DocumentObject* dObjectIn, const GraphLinkContainer &containerIn); diff --git a/src/Gui/DAGView/DAGRectItem.cpp b/src/Gui/DAGView/DAGRectItem.cpp index b65462ff2b..3247e3c0ff 100644 --- a/src/Gui/DAGView/DAGRectItem.cpp +++ b/src/Gui/DAGView/DAGRectItem.cpp @@ -43,8 +43,8 @@ RectItem::RectItem(QGraphicsItem* parent) : QGraphicsRectItem(parent) void RectItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) { - Q_UNUSED(option); - Q_UNUSED(widget); + Q_UNUSED(option); + Q_UNUSED(widget); painter->save(); QStyleOptionViewItem styleOption; diff --git a/src/Gui/DAGView/DAGView.cpp b/src/Gui/DAGView/DAGView.cpp index a6dafa8d89..d099669d28 100644 --- a/src/Gui/DAGView/DAGView.cpp +++ b/src/Gui/DAGView/DAGView.cpp @@ -52,7 +52,7 @@ View::View(QWidget* parentIn): QGraphicsView(parentIn) this->setRenderHint(QPainter::TextAntialiasing, true); conActive = Application::Instance->signalActiveDocument.connect(boost::bind(&View::slotActiveDocument, this, bp::_1)); conDelete = Application::Instance->signalDeleteDocument.connect(boost::bind(&View::slotDeleteDocument, this, bp::_1)); - + //just update the dagview when the gui process is idle. connect(QAbstractEventDispatcher::instance(), SIGNAL(awake()), this, SLOT(awakeSlot())); } diff --git a/src/Gui/DlgCreateNewPreferencePackImp.cpp b/src/Gui/DlgCreateNewPreferencePackImp.cpp index 0ba0cd3e7a..c53e6bee0f 100644 --- a/src/Gui/DlgCreateNewPreferencePackImp.cpp +++ b/src/Gui/DlgCreateNewPreferencePackImp.cpp @@ -158,7 +158,7 @@ void Gui::Dialog::DlgCreateNewPreferencePackImp::accept() // Ensure that the chosen name is either unique, or that the user actually wants to overwrite the old one if (auto chosenName = ui->lineEdit->text().toStdString(); std::find(_existingPackNames.begin(), _existingPackNames.end(), chosenName) != _existingPackNames.end()) { - auto result = QMessageBox::warning(this, tr("Pack already exists"), + auto result = QMessageBox::warning(this, tr("Pack already exists"), tr("A preference pack with that name already exists. Do you want to overwrite it?"), QMessageBox::Yes | QMessageBox::Cancel); if (result == QMessageBox::Cancel) diff --git a/src/Gui/DlgCreateNewPreferencePackImp.h b/src/Gui/DlgCreateNewPreferencePackImp.h index 0b2103cb03..9e4211b414 100644 --- a/src/Gui/DlgCreateNewPreferencePackImp.h +++ b/src/Gui/DlgCreateNewPreferencePackImp.h @@ -40,9 +40,9 @@ class Ui_DlgCreateNewPreferencePack; /** * \class DlgCreateNewPreferencePackImp - * - * A dialog to request a preferencePack name and a set of preferencePack templates. - * + * + * A dialog to request a preferencePack name and a set of preferencePack templates. + * * \author Chris Hennes */ class GuiExport DlgCreateNewPreferencePackImp : public QDialog diff --git a/src/Gui/DlgObjectSelection.cpp b/src/Gui/DlgObjectSelection.cpp index e34675a1d6..bed72a5af7 100644 --- a/src/Gui/DlgObjectSelection.cpp +++ b/src/Gui/DlgObjectSelection.cpp @@ -166,7 +166,7 @@ void DlgObjectSelection::init(const std::vector &objs, this, SLOT(onDepItemChanged(QTreeWidgetItem*,int))); connect(ui->treeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(onItemSelectionChanged())); - connect(useOriginalsBtn, SIGNAL(clicked()), + connect(useOriginalsBtn, SIGNAL(clicked()), this, SLOT(onUseOriginalsBtnClicked())); connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept())); @@ -611,7 +611,7 @@ void DlgObjectSelection::onItemSelectionChanged() { for (auto obj : inlist) createDepItem(ui->inList, obj); } - + if (enabled) ui->depList->setSortingEnabled(true); if (enabled2) diff --git a/src/Gui/DlgObjectSelection.h b/src/Gui/DlgObjectSelection.h index 2cf17723bb..fb1abf136a 100644 --- a/src/Gui/DlgObjectSelection.h +++ b/src/Gui/DlgObjectSelection.h @@ -75,7 +75,7 @@ public: /// Options for getSelections() enum class SelectionOptions { - /// Invert the selection, i.e. return the unselected objects + /// Invert the selection, i.e. return the unselected objects Invert = 1, /// Sort the returned object in depending order Sort = 2, @@ -126,8 +126,8 @@ private: std::map depMap; std::map inMap; std::map itemChanged; - QTreeWidgetItem *allItem = nullptr; - + QTreeWidgetItem *allItem = nullptr; + QPushButton* useOriginalsBtn; bool returnOriginals = false; diff --git a/src/Gui/DlgPreferencePackManagementImp.cpp b/src/Gui/DlgPreferencePackManagementImp.cpp index dde897ca7d..54365de62a 100644 --- a/src/Gui/DlgPreferencePackManagementImp.cpp +++ b/src/Gui/DlgPreferencePackManagementImp.cpp @@ -176,7 +176,7 @@ std::vector DlgPreferencePackManagementImp::getPacksFromDirectory(c void DlgPreferencePackManagementImp::deleteUserPack(const std::string& name) { // Do the deletion here... - auto result = QMessageBox::warning(this, tr("Delete saved preference pack?"), + auto result = QMessageBox::warning(this, tr("Delete saved preference pack?"), tr("Are you sure you want to delete the preference pack named '%1'? This cannot be undone.").arg(QString::fromStdString(name)), QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); if (result == QMessageBox::Yes) { diff --git a/src/Gui/DlgPreferencePackManagementImp.h b/src/Gui/DlgPreferencePackManagementImp.h index fce25e4b3f..0e3ab1ea9a 100644 --- a/src/Gui/DlgPreferencePackManagementImp.h +++ b/src/Gui/DlgPreferencePackManagementImp.h @@ -39,9 +39,9 @@ class Ui_DlgPreferencePackManagement; /** * \class DlgCreateNewPreferencePackImp - * - * A dialog to request a preferencePack name and a set of preferencePack templates. - * + * + * A dialog to request a preferencePack name and a set of preferencePack templates. + * * \author Chris Hennes */ class GuiExport DlgPreferencePackManagementImp : public QDialog diff --git a/src/Gui/DlgRevertToBackupConfigImp.cpp b/src/Gui/DlgRevertToBackupConfigImp.cpp index d7ed22d7ad..8afa5c766e 100644 --- a/src/Gui/DlgRevertToBackupConfigImp.cpp +++ b/src/Gui/DlgRevertToBackupConfigImp.cpp @@ -53,7 +53,7 @@ DlgRevertToBackupConfigImp::~DlgRevertToBackupConfigImp() void Gui::Dialog::DlgRevertToBackupConfigImp::onItemSelectionChanged() { auto items = ui->listWidget->selectedItems(); - if (items.count() == 1) + if (items.count() == 1) ui->buttonBox->button(QDialogButtonBox::StandardButton::Ok)->setEnabled(true); else ui->buttonBox->button(QDialogButtonBox::StandardButton::Ok)->setEnabled(false); diff --git a/src/Gui/DlgSettings3DView.ui b/src/Gui/DlgSettings3DView.ui index 1674cfe53e..c947251286 100644 --- a/src/Gui/DlgSettings3DView.ui +++ b/src/Gui/DlgSettings3DView.ui @@ -186,7 +186,7 @@ A VBO is an OpenGL feature that provides methods for uploading vertex data (position, normal vector, color, etc.) to the graphics card. VBOs offer substantial performance gains because the data resides in the graphics memory rather than the system memory and so it -can be rendered directly by GPU. +can be rendered directly by GPU. Note: Sometimes this feature may lead to a host of different issues ranging from graphical anomalies to GPU crash bugs. Remember to @@ -222,7 +222,7 @@ report this setting as enabled when seeking support on the FreeCAD forums 'Render Caching' is another way to say 'Rendering Acceleration'. -There are 3 options available to achieve this: +There are 3 options available to achieve this: 1) 'Auto' (default), let Coin3D decide where to cache. 2) 'Distributed', manually turn on cache for all view provider root node. 3) 'Centralized', manually turn off cache in all nodes of all view provider, and diff --git a/src/Gui/DlgSettingsLazyLoadedImp.cpp b/src/Gui/DlgSettingsLazyLoadedImp.cpp index 886c1efcda..ce9fbe93aa 100644 --- a/src/Gui/DlgSettingsLazyLoadedImp.cpp +++ b/src/Gui/DlgSettingsLazyLoadedImp.cpp @@ -41,7 +41,7 @@ const uint DlgSettingsLazyLoadedImp::WorkbenchNameRole = Qt::UserRole; /* TRANSLATOR Gui::Dialog::DlgSettingsLazyLoadedImp */ /** - * Constructs a DlgSettingsLazyLoadedImp + * Constructs a DlgSettingsLazyLoadedImp */ DlgSettingsLazyLoadedImp::DlgSettingsLazyLoadedImp( QWidget* parent ) : PreferencePage( parent ) @@ -74,7 +74,7 @@ void DlgSettingsLazyLoadedImp::saveSettings() void DlgSettingsLazyLoadedImp::loadSettings() { - // There are two different "autoload" settings: the first, in FreeCAD since 2004, + // There are two different "autoload" settings: the first, in FreeCAD since 2004, // controls the module the user sees first when starting FreeCAD, and defaults to the Start workbench std::string start = App::Application::Config()["StartWorkbench"]; _startupModule = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/General")-> @@ -111,7 +111,7 @@ void DlgSettingsLazyLoadedImp::buildUnloadedWorkbenchList() { QStringList workbenches = Application::Instance->workbenches(); workbenches.sort(); - + ui->workbenchTable->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft); ui->workbenchTable->setRowCount(0); _autoloadCheckboxes.clear(); // setRowCount(0) just invalidated all of these pointers @@ -146,14 +146,14 @@ void DlgSettingsLazyLoadedImp::buildUnloadedWorkbenchList() auto textLabel = new QLabel(wbDisplayName); textLabel->setToolTip(wbTooltip); ui->workbenchTable->setCellWidget(rowNumber, 1, textLabel); - + // Column 3: Autoloaded checkbox - // + // // To get the checkbox centered, we have to jump through some hoops... auto checkWidget = new QWidget(this); auto autoloadCheckbox = new QCheckBox(this); - autoloadCheckbox->setToolTip(tr("If checked") + - QString::fromUtf8(", ") + wbDisplayName + QString::fromUtf8(" ") + + autoloadCheckbox->setToolTip(tr("If checked") + + QString::fromUtf8(", ") + wbDisplayName + QString::fromUtf8(" ") + tr("will be loaded automatically when FreeCAD starts up")); auto checkLayout = new QHBoxLayout(checkWidget); checkLayout->addWidget(autoloadCheckbox); @@ -175,13 +175,13 @@ void DlgSettingsLazyLoadedImp::buildUnloadedWorkbenchList() _autoloadCheckboxes.insert(std::make_pair(wbName, autoloadCheckbox)); } ui->workbenchTable->setCellWidget(rowNumber, 2, checkWidget); - + // Column 4: Load button/loaded indicator if (WorkbenchManager::instance()->getWorkbench(wbName.toStdString())) { auto label = new QLabel(tr("Loaded")); label->setAlignment(Qt::AlignCenter); ui->workbenchTable->setCellWidget(rowNumber, 3, label); - } + } else { auto button = new QPushButton(tr("Load now")); connect(button, &QPushButton::clicked, this, [this,wbName]() { onLoadClicked(wbName); }); diff --git a/src/Gui/ExpressionCompleter.cpp b/src/Gui/ExpressionCompleter.cpp index 72dc442610..f64ab6fe59 100644 --- a/src/Gui/ExpressionCompleter.cpp +++ b/src/Gui/ExpressionCompleter.cpp @@ -255,7 +255,7 @@ public: if(count) *count = propSize; } - if(v) + if(v) *v = QString::fromLatin1(propName); return; } @@ -336,7 +336,7 @@ private: * @param parent Parent object owning the completer. */ -ExpressionCompleter::ExpressionCompleter(const App::DocumentObject * currentDocObj, +ExpressionCompleter::ExpressionCompleter(const App::DocumentObject * currentDocObj, QObject *parent, bool noProperty, bool checkInList) : QCompleter(parent), currentObj(currentDocObj) , noProperty(noProperty), checkInList(checkInList) diff --git a/src/Gui/ExpressionCompleter.h b/src/Gui/ExpressionCompleter.h index 3cafbf9e92..7007630595 100644 --- a/src/Gui/ExpressionCompleter.h +++ b/src/Gui/ExpressionCompleter.h @@ -48,7 +48,7 @@ class GuiExport ExpressionCompleter : public QCompleter { Q_OBJECT public: - ExpressionCompleter(const App::DocumentObject * currentDocObj, + ExpressionCompleter(const App::DocumentObject * currentDocObj, QObject *parent = nullptr, bool noProperty = false, bool checkInList = true); void getPrefixRange(int &start, int &end) const { diff --git a/src/Gui/Inventor/SoAutoZoomTranslation.cpp b/src/Gui/Inventor/SoAutoZoomTranslation.cpp index 241fe47516..dcc773c041 100644 --- a/src/Gui/Inventor/SoAutoZoomTranslation.cpp +++ b/src/Gui/Inventor/SoAutoZoomTranslation.cpp @@ -114,7 +114,7 @@ void SoAutoZoomTranslation::doAction(SoAction * action) // scaleFactor.setValue(SbVec3f(sf,sf,sf)); // //this->enableNotify ( true ); // //scaleFactor.setDirty (true); -// +// //} void SoAutoZoomTranslation::getMatrix(SoGetMatrixAction * action) diff --git a/src/Gui/LinkViewPy.xml b/src/Gui/LinkViewPy.xml index 14c01bfb83..9341090f85 100644 --- a/src/Gui/LinkViewPy.xml +++ b/src/Gui/LinkViewPy.xml @@ -1,12 +1,12 @@ - setChildren([obj...],vis=[],type=0) -Group a list of children objects. Note, this mode of operation is incompatible +Group a list of children objects. Note, this mode of operation is incompatible with link array. Calling this function will deactivate link array. And calling setSize() will reset all linked children. vis: initial visibility status of the children -type: children linking type, - 0: override transformation and visibility, - 1: override visibility, +type: children linking type, + 0: override transformation and visibility, + 1: override visibility, 2: override none. diff --git a/src/Gui/PreferencePackManager.h b/src/Gui/PreferencePackManager.h index 305a14a069..c8dc0f1da9 100644 --- a/src/Gui/PreferencePackManager.h +++ b/src/Gui/PreferencePackManager.h @@ -20,8 +20,8 @@ * * ***************************************************************************/ -#ifndef BASE_PREFERENCEPACKMANAGER_H -#define BASE_PREFERENCEPACKMANAGER_H +#ifndef BASE_PREFERENCEPACKMANAGER_H +#define BASE_PREFERENCEPACKMANAGER_H #include #include @@ -78,10 +78,10 @@ namespace Gui { /** * \class PreferencePackManager handles storable and loadable collections of user preferences - * + * * This class provides some additional utility functions for allowing users to save their current * preferences as a PreferencePack based on a set of template files provided either in the main - * FreeCAD distribution, or inside various installed mods. + * FreeCAD distribution, or inside various installed mods. */ class PreferencePackManager { public: @@ -129,36 +129,36 @@ namespace Gui { /** - * \struct TemplateFile A file containing a set of preferences that can be saved into + * \struct TemplateFile A file containing a set of preferences that can be saved into * a PreferencePack * - * PreferencePacks can contain any parameters at all, but inside FreeCAD there is no - * centralized list of all of these parameters, and at any given time the user.cfg file - * usually does not store a value for all possible parameters. Instead, it simply allows - * calling code to use whatever default values that code sets. This is all completely + * PreferencePacks can contain any parameters at all, but inside FreeCAD there is no + * centralized list of all of these parameters, and at any given time the user.cfg file + * usually does not store a value for all possible parameters. Instead, it simply allows + * calling code to use whatever default values that code sets. This is all completely * hidden from the users: FreeCAD behaves as though those values exist in the config file. - * - * When a user saves their current configuration as a pack, they likely expect that saved - * configuration to include those default values, so that if they later apply their saved - * configuration those defaults are restored. To enable this a set of template files - * listing default values for various types of parameters can be used. Each file is - * presented to the user as a checkable box when saving a new preferences pack, and the - * intention is that these files will list out the various user-facing parameters that + * + * When a user saves their current configuration as a pack, they likely expect that saved + * configuration to include those default values, so that if they later apply their saved + * configuration those defaults are restored. To enable this a set of template files + * listing default values for various types of parameters can be used. Each file is + * presented to the user as a checkable box when saving a new preferences pack, and the + * intention is that these files will list out the various user-facing parameters that * someone might want to save into a preferences pack. - * + * * These files are themselves valid user.cfg files, that if loaded and applied will result - * in the default values of their contained variables being set. For this to work, these - * files should be kept up-to-date with the default values set in the code. They are not + * in the default values of their contained variables being set. For this to work, these + * files should be kept up-to-date with the default values set in the code. They are not * required to contain an exhaustive listing of all possible parameters: in most cases it * is enough that they list the variables that a user would expect for a given name. For * example, "Sketcher Colors.cfg" should list out all of the default colors used in * Sketcher that a user can set in Preferences, but it is not necessary that it contain any - * color that is only used internally, and it should not include things like fonts, or + * color that is only used internally, and it should not include things like fonts, or * behavior information. - * + * * The base FreeCAD installation includes default templates in: * $INSTALL_DIR/data/Gui/PreferencePackTemplates/ - * + * * External add-ons are also searched for any directory called PreferencePackTemplates or * preference_pack_templates -- either of which is expected to contain appearance and/or * behavior subdirectories. In this way external add-ons can allow a user to easily save diff --git a/src/Gui/PreferencePackTemplates/Arch_Colors.cfg b/src/Gui/PreferencePackTemplates/Arch_Colors.cfg index 9b7d90987c..305fe87d57 100644 --- a/src/Gui/PreferencePackTemplates/Arch_Colors.cfg +++ b/src/Gui/PreferencePackTemplates/Arch_Colors.cfg @@ -16,6 +16,6 @@ - + diff --git a/src/Gui/PreferencePackTemplates/Console_Colors.cfg b/src/Gui/PreferencePackTemplates/Console_Colors.cfg index 7e4f4c2d20..a61ba064da 100644 --- a/src/Gui/PreferencePackTemplates/Console_Colors.cfg +++ b/src/Gui/PreferencePackTemplates/Console_Colors.cfg @@ -10,6 +10,6 @@ - + diff --git a/src/Gui/PreferencePackTemplates/Draft_Colors.cfg b/src/Gui/PreferencePackTemplates/Draft_Colors.cfg index 7f68a8e53c..b45bffa8ab 100644 --- a/src/Gui/PreferencePackTemplates/Draft_Colors.cfg +++ b/src/Gui/PreferencePackTemplates/Draft_Colors.cfg @@ -12,6 +12,6 @@ - + diff --git a/src/Gui/PreferencePackTemplates/Editor_Colors.cfg b/src/Gui/PreferencePackTemplates/Editor_Colors.cfg index 93ecd1cff1..eac4ff06c3 100644 --- a/src/Gui/PreferencePackTemplates/Editor_Colors.cfg +++ b/src/Gui/PreferencePackTemplates/Editor_Colors.cfg @@ -21,6 +21,6 @@ - + diff --git a/src/Gui/PreferencePackTemplates/Editor_Font.cfg b/src/Gui/PreferencePackTemplates/Editor_Font.cfg index a0ec5481fd..995eb17b98 100644 --- a/src/Gui/PreferencePackTemplates/Editor_Font.cfg +++ b/src/Gui/PreferencePackTemplates/Editor_Font.cfg @@ -8,6 +8,6 @@ Courier - + diff --git a/src/Gui/PreferencePackTemplates/Part_Colors.cfg b/src/Gui/PreferencePackTemplates/Part_Colors.cfg index eb4c32a70e..ab4e262038 100644 --- a/src/Gui/PreferencePackTemplates/Part_Colors.cfg +++ b/src/Gui/PreferencePackTemplates/Part_Colors.cfg @@ -11,6 +11,6 @@ - + diff --git a/src/Gui/PreferencePackTemplates/Path_Colors.cfg b/src/Gui/PreferencePackTemplates/Path_Colors.cfg index 0780cf0255..7afb818a36 100644 --- a/src/Gui/PreferencePackTemplates/Path_Colors.cfg +++ b/src/Gui/PreferencePackTemplates/Path_Colors.cfg @@ -16,6 +16,6 @@ - + diff --git a/src/Gui/PreferencePackTemplates/Sketcher_Colors.cfg b/src/Gui/PreferencePackTemplates/Sketcher_Colors.cfg index 44b4d9f535..994b1dfd8c 100644 --- a/src/Gui/PreferencePackTemplates/Sketcher_Colors.cfg +++ b/src/Gui/PreferencePackTemplates/Sketcher_Colors.cfg @@ -27,6 +27,6 @@ - + diff --git a/src/Gui/PreferencePackTemplates/Start_Colors.cfg b/src/Gui/PreferencePackTemplates/Start_Colors.cfg index 2465eae672..ffd944526e 100644 --- a/src/Gui/PreferencePackTemplates/Start_Colors.cfg +++ b/src/Gui/PreferencePackTemplates/Start_Colors.cfg @@ -15,6 +15,6 @@ - + diff --git a/src/Gui/PreferencePackTemplates/TechDraw_Colors.cfg b/src/Gui/PreferencePackTemplates/TechDraw_Colors.cfg index 7a1525ad91..72a00fd25b 100644 --- a/src/Gui/PreferencePackTemplates/TechDraw_Colors.cfg +++ b/src/Gui/PreferencePackTemplates/TechDraw_Colors.cfg @@ -26,6 +26,6 @@ - + diff --git a/src/Gui/PreferencePackTemplates/Window_Colors.cfg b/src/Gui/PreferencePackTemplates/Window_Colors.cfg index 90ac23a715..ddb0281427 100644 --- a/src/Gui/PreferencePackTemplates/Window_Colors.cfg +++ b/src/Gui/PreferencePackTemplates/Window_Colors.cfg @@ -31,6 +31,6 @@ - + diff --git a/src/Gui/QuantitySpinBox_p.h b/src/Gui/QuantitySpinBox_p.h index ec475a30e4..07569b2656 100644 --- a/src/Gui/QuantitySpinBox_p.h +++ b/src/Gui/QuantitySpinBox_p.h @@ -33,9 +33,9 @@ public: ExpressionLabel(QWidget * parent) : QLabel(parent) { } void setExpressionText(const QString& text) { - if (text.isEmpty()) + if (text.isEmpty()) this->setToolTip(genericFormulaEditorTooltip); - else + else this->setToolTip(formulaEditorTooltipPrefix + text); } diff --git a/src/Gui/Stylesheets/Behave-dark.qss b/src/Gui/Stylesheets/Behave-dark.qss index 76ecd5ee8c..058e28a3ce 100644 --- a/src/Gui/Stylesheets/Behave-dark.qss +++ b/src/Gui/Stylesheets/Behave-dark.qss @@ -30,13 +30,13 @@ If you would like to change the overall look/style of the theme, just find and r ! If you find not matching or unreadable sections in FreeCAD please tell Chrismettal or open up a PR yourself ! BACKGROUND (darker to lighter) - #65A2E5 + #65A2E5 #1e1e1e #3c3c3c #434D5B #232932 = top menu background etc #646464 - #232932 = main background color + #232932 = main background color #787878 #8c8c8c #a0a0a0 @@ -45,7 +45,7 @@ If you would like to change the overall look/style of the theme, just find and r #232932 = console color #d2d2d2 #588AC1 = top menu item - #588AC2 + #588AC2 white SELECTION (darker to lighter) @@ -138,8 +138,8 @@ Sub windows ==================================================================================================*/ QMdiSubWindow { border:1px solid #121512; - margin-top: 30px; - margin-left: 4px; + margin-top: 30px; + margin-left: 4px; margin-right: 4px; margin-bottom:4px; } diff --git a/src/Gui/Stylesheets/Dark-contrast.qss b/src/Gui/Stylesheets/Dark-contrast.qss index 2d0d6dd3f5..abe54fc887 100644 --- a/src/Gui/Stylesheets/Dark-contrast.qss +++ b/src/Gui/Stylesheets/Dark-contrast.qss @@ -105,8 +105,8 @@ Sub windows ==================================================================================================*/ QMdiSubWindow { border:1px solid #333333; - margin-top: 30px; - margin-left: 4px; + margin-top: 30px; + margin-left: 4px; margin-right: 4px; margin-bottom:4px; } diff --git a/src/Gui/Stylesheets/ProDark.qss b/src/Gui/Stylesheets/ProDark.qss index fe1cd94406..1cb29c6d97 100644 --- a/src/Gui/Stylesheets/ProDark.qss +++ b/src/Gui/Stylesheets/ProDark.qss @@ -7,7 +7,7 @@ based on the stock theme from FreeCAD by Pablo Gil Fernández KNOWN BUGS and TO DO ============================================================================================================ -Please, follow the link to get updated information: +Please, follow the link to get updated information: https://forum.freecadweb.org/viewtopic.php?f=34&t=55134&sid=0466734fc3349eccd8921eb356f70ad7 LICENSE @@ -24,9 +24,9 @@ INSTALLATION WINDOWS = C:/[INSTALLATION_PATH]/FreeCAD/data/Gui/Stylesheets/ LINUX = /home/[YOUR_USER_NAME]/.FreeCAD/Gui/Stylesheets/ -============================================================================================================ +============================================================================================================ THESE COLOURS WERE USED AS TEMP SCRATCHPAD FOR DESIGNING. PLEASE DISREGARD! - + BACKGROUND (darker to lighter) black #1e1e1e @@ -112,8 +112,8 @@ Sub windows ==================================================================================================*/ QMdiSubWindow { border:1px solid #333333; - margin-top: 30px; - margin-left: 4px; + margin-top: 30px; + margin-left: 4px; margin-right: 4px; margin-bottom:4px; } @@ -575,7 +575,7 @@ QTabWidget::tab-bar:right { QTabBar { qproperty-drawBase: 0; /* important */ - background-color: transparent; /* Hack for Undocked white background - was transparent*/ + background-color: transparent; /* Hack for Undocked white background - was transparent*/ } /* Workaround for QTabBars created from docked QDockWidgets which don't draw the border if not set and reset as follows: */ @@ -1214,7 +1214,7 @@ QSint--ActionGroup QFrame[class="content"] > QWidget > QPushButton { margin: 0px; } -/* Fix for lists inside task panels */ /* sketcher constraints list */ +/* Fix for lists inside task panels */ /* sketcher constraints list */ QSint--ActionGroup QFrame[class="content"] QTreeView, QSint--ActionGroup QFrame[class="content"] QListView, QSint--ActionGroup QFrame[class="content"] QTableView { @@ -1770,8 +1770,8 @@ QDialog QToolButton:focus { QDialog QToolButton:disabled, QDialog QToolButton:disabled:checked { color: #f5f5f5; - background-color: #2a2a2a; - border: 1px solid #2a2a2a; + background-color: #2a2a2a; + border: 1px solid #2a2a2a; } QDialog QToolButton:pressed { diff --git a/src/Gui/ViewProviderLink.cpp b/src/Gui/ViewProviderLink.cpp index 14a66256ad..17a2ab4c54 100644 --- a/src/Gui/ViewProviderLink.cpp +++ b/src/Gui/ViewProviderLink.cpp @@ -2114,7 +2114,7 @@ std::vector ViewProviderLink::claimChildren() const { } } else if(hasElements(ext) || isGroup(ext)) { ret = ext->getElementListValue(); - if (ext->_getElementCountValue() + if (ext->_getElementCountValue() && ext->getLinkClaimChildValue() && ext->getLinkedObjectValue()) ret.insert(ret.begin(), ext->getLinkedObjectValue()); diff --git a/src/Gui/ViewProviderLinkPy.xml b/src/Gui/ViewProviderLinkPy.xml index 8ce280b73d..2d3f30ae18 100644 --- a/src/Gui/ViewProviderLinkPy.xml +++ b/src/Gui/ViewProviderLinkPy.xml @@ -1,12 +1,12 @@ - diff --git a/src/Gui/ViewProviderPart.cpp b/src/Gui/ViewProviderPart.cpp index a2d3f2fad4..1e581f9d4b 100644 --- a/src/Gui/ViewProviderPart.cpp +++ b/src/Gui/ViewProviderPart.cpp @@ -116,7 +116,7 @@ QIcon ViewProviderPart::getIcon() const const char* pixmap = sPixmap; // if it's flagged as an Assembly in its Type, it gets another icon if (part->Type.getStrValue() == "Assembly") { pixmap = aPixmap; } - + return mergeGreyableOverlayIcons (Gui::BitmapFactory().pixmap(pixmap)); } diff --git a/src/Gui/ViewProviderPart.h b/src/Gui/ViewProviderPart.h index 85f322479f..5cd942feca 100644 --- a/src/Gui/ViewProviderPart.h +++ b/src/Gui/ViewProviderPart.h @@ -43,7 +43,7 @@ public: bool doubleClicked() override; void setupContextMenu(QMenu* menu, QObject* receiver, const char* member) override; - + /// deliver the icon shown in the tree view /// override from ViewProvider.h QIcon getIcon() const override;