From 0f1c66724b5f024f704b49b1a030ef73ab7c86f1 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 21 Apr 2017 19:30:03 +0200 Subject: [PATCH] rename task panel class to be conform with the feature class --- src/Mod/Surface/Gui/AppSurfaceGui.cpp | 2 +- src/Mod/Surface/Gui/CMakeLists.txt | 8 +-- src/Mod/Surface/Gui/Command.cpp | 1 - ...aceFilling.cpp => TaskGeomFillSurface.cpp} | 64 +++++++++---------- ...SurfaceFilling.h => TaskGeomFillSurface.h} | 30 ++++----- ...rfaceFilling.ui => TaskGeomFillSurface.ui} | 4 +- 6 files changed, 54 insertions(+), 55 deletions(-) rename src/Mod/Surface/Gui/{SurfaceFilling.cpp => TaskGeomFillSurface.cpp} (90%) rename src/Mod/Surface/Gui/{SurfaceFilling.h => TaskGeomFillSurface.h} (86%) rename src/Mod/Surface/Gui/{SurfaceFilling.ui => TaskGeomFillSurface.ui} (96%) diff --git a/src/Mod/Surface/Gui/AppSurfaceGui.cpp b/src/Mod/Surface/Gui/AppSurfaceGui.cpp index a79c5fb2fd..187d01153b 100644 --- a/src/Mod/Surface/Gui/AppSurfaceGui.cpp +++ b/src/Mod/Surface/Gui/AppSurfaceGui.cpp @@ -34,7 +34,7 @@ #include #include "Workbench.h" -#include "SurfaceFilling.h" +#include "TaskGeomFillSurface.h" // use a different name to CreateCommand() void CreateSurfaceCommands(void); diff --git a/src/Mod/Surface/Gui/CMakeLists.txt b/src/Mod/Surface/Gui/CMakeLists.txt index 4f92a53814..f46265e99f 100644 --- a/src/Mod/Surface/Gui/CMakeLists.txt +++ b/src/Mod/Surface/Gui/CMakeLists.txt @@ -24,7 +24,7 @@ set(SurfaceGui_LIBS ) set(SurfaceGui_MOC_HDRS - SurfaceFilling.h + TaskGeomFillSurface.h ) fc_wrap_cpp(SurfaceGui_MOC_SRCS ${SurfaceGui_MOC_HDRS}) SOURCE_GROUP("Moc" FILES ${SurfaceGui_MOC_SRCS}) @@ -36,7 +36,7 @@ else() endif() SET(SurfaceGui_UIC_SRCS - SurfaceFilling.ui + TaskGeomFillSurface.ui ) if (BUILD_QT5) @@ -48,8 +48,8 @@ endif() SET(SurfaceGui_SRCS ${SurfaceGui_QRC_SRCS} ${SurfaceGui_UIC_HDRS} - SurfaceFilling.cpp - SurfaceFilling.h + TaskGeomFillSurface.cpp + TaskGeomFillSurface.h AppSurfaceGui.cpp Command.cpp PreCompiled.cpp diff --git a/src/Mod/Surface/Gui/Command.cpp b/src/Mod/Surface/Gui/Command.cpp index 24b305e9d0..aa6319974d 100644 --- a/src/Mod/Surface/Gui/Command.cpp +++ b/src/Mod/Surface/Gui/Command.cpp @@ -60,7 +60,6 @@ #include #include #include "Mod/Part/App/PartFeature.h" -#include "SurfaceFilling.h" //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/src/Mod/Surface/Gui/SurfaceFilling.cpp b/src/Mod/Surface/Gui/TaskGeomFillSurface.cpp similarity index 90% rename from src/Mod/Surface/Gui/SurfaceFilling.cpp rename to src/Mod/Surface/Gui/TaskGeomFillSurface.cpp index bd29d100c6..5f715825b2 100644 --- a/src/Mod/Surface/Gui/SurfaceFilling.cpp +++ b/src/Mod/Surface/Gui/TaskGeomFillSurface.cpp @@ -39,8 +39,8 @@ #include #include -#include "SurfaceFilling.h" -#include "ui_SurfaceFilling.h" +#include "TaskGeomFillSurface.h" +#include "ui_TaskGeomFillSurface.h" using namespace SurfaceGui; @@ -97,13 +97,13 @@ bool ViewProviderGeomFillSurface::setEdit(int ModNum) // start the edit dialog if (dlg) { - TaskSurfaceFilling* tDlg = qobject_cast(dlg); + TaskGeomFillSurface* tDlg = qobject_cast(dlg); if (tDlg) tDlg->setEditedObject(obj); Gui::Control().showDialog(dlg); } else { - Gui::Control().showDialog(new TaskSurfaceFilling(this, obj)); + Gui::Control().showDialog(new TaskGeomFillSurface(this, obj)); } return true; } @@ -162,9 +162,9 @@ void ViewProviderGeomFillSurface::highlightReferences(bool on) // ---------------------------------------------------------------------------- -SurfaceFilling::SurfaceFilling(ViewProviderGeomFillSurface* vp, Surface::GeomFillSurface* obj) +GeomFillSurface::GeomFillSurface(ViewProviderGeomFillSurface* vp, Surface::GeomFillSurface* obj) { - ui = new Ui_SurfaceFilling(); + ui = new Ui_GeomFillSurface(); ui->setupUi(this); selectionMode = None; this->vp = vp; @@ -182,14 +182,14 @@ SurfaceFilling::SurfaceFilling(ViewProviderGeomFillSurface* vp, Surface::GeomFil /* * Destroys the object and frees any allocated resources */ -SurfaceFilling::~SurfaceFilling() +GeomFillSurface::~GeomFillSurface() { // no need to delete child widgets, Qt does it all for us delete ui; } // stores object pointer, its old fill type and adjusts radio buttons according to it. -void SurfaceFilling::setEditedObject(Surface::GeomFillSurface* obj) +void GeomFillSurface::setEditedObject(Surface::GeomFillSurface* obj) { editedObject = obj; GeomFill_FillingStyle curtype = static_cast(editedObject->FillType.getValue()); @@ -233,7 +233,7 @@ void SurfaceFilling::setEditedObject(Surface::GeomFillSurface* obj) attachDocument(Gui::Application::Instance->getDocument(doc)); } -void SurfaceFilling::changeEvent(QEvent *e) +void GeomFillSurface::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { ui->retranslateUi(this); @@ -243,19 +243,19 @@ void SurfaceFilling::changeEvent(QEvent *e) } } -void SurfaceFilling::open() +void GeomFillSurface::open() { checkOpenCommand(); this->vp->highlightReferences(true); Gui::Selection().clearSelection(); } -void SurfaceFilling::clearSelection() +void GeomFillSurface::clearSelection() { Gui::Selection().clearSelection(); } -void SurfaceFilling::checkOpenCommand() +void GeomFillSurface::checkOpenCommand() { if (checkCommand && !Gui::Command::hasPendingCommand()) { std::string Msg("Edit "); @@ -265,17 +265,17 @@ void SurfaceFilling::checkOpenCommand() } } -void SurfaceFilling::slotUndoDocument(const Gui::Document&) +void GeomFillSurface::slotUndoDocument(const Gui::Document&) { checkCommand = true; } -void SurfaceFilling::slotRedoDocument(const Gui::Document&) +void GeomFillSurface::slotRedoDocument(const Gui::Document&) { checkCommand = true; } -bool SurfaceFilling::accept() +bool GeomFillSurface::accept() { this->vp->highlightReferences(false); selectionMode = None; @@ -309,7 +309,7 @@ bool SurfaceFilling::accept() return true; } -bool SurfaceFilling::reject() +bool GeomFillSurface::reject() { this->vp->highlightReferences(false); selectionMode = None; @@ -321,22 +321,22 @@ bool SurfaceFilling::reject() return true; } -void SurfaceFilling::on_fillType_stretch_clicked() +void GeomFillSurface::on_fillType_stretch_clicked() { changeFillType(GeomFill_StretchStyle); } -void SurfaceFilling::on_fillType_coons_clicked() +void GeomFillSurface::on_fillType_coons_clicked() { changeFillType(GeomFill_CoonsStyle); } -void SurfaceFilling::on_fillType_curved_clicked() +void GeomFillSurface::on_fillType_curved_clicked() { changeFillType(GeomFill_CurvedStyle); } -void SurfaceFilling::changeFillType(GeomFill_FillingStyle fillType) +void GeomFillSurface::changeFillType(GeomFill_FillingStyle fillType) { GeomFill_FillingStyle curtype = static_cast(editedObject->FillType.getValue()); if (curtype != fillType) { @@ -349,19 +349,19 @@ void SurfaceFilling::changeFillType(GeomFill_FillingStyle fillType) } } -void SurfaceFilling::on_buttonEdgeAdd_clicked() +void GeomFillSurface::on_buttonEdgeAdd_clicked() { selectionMode = Append; Gui::Selection().addSelectionGate(new EdgeSelection(true, editedObject)); } -void SurfaceFilling::on_buttonEdgeRemove_clicked() +void GeomFillSurface::on_buttonEdgeRemove_clicked() { selectionMode = Remove; Gui::Selection().addSelectionGate(new EdgeSelection(false, editedObject)); } -void SurfaceFilling::onSelectionChanged(const Gui::SelectionChanges& msg) +void GeomFillSurface::onSelectionChanged(const Gui::SelectionChanges& msg) { if (selectionMode == None) return; @@ -428,7 +428,7 @@ void SurfaceFilling::onSelectionChanged(const Gui::SelectionChanges& msg) } } -void SurfaceFilling::onDeleteEdge() +void GeomFillSurface::onDeleteEdge() { int row = ui->listWidget->currentRow(); QListWidgetItem* item = ui->listWidget->item(row); @@ -461,9 +461,9 @@ void SurfaceFilling::onDeleteEdge() // ---------------------------------------------------------------------------- -TaskSurfaceFilling::TaskSurfaceFilling(ViewProviderGeomFillSurface* vp, Surface::GeomFillSurface* obj) +TaskGeomFillSurface::TaskGeomFillSurface(ViewProviderGeomFillSurface* vp, Surface::GeomFillSurface* obj) { - widget = new SurfaceFilling(vp, obj); + widget = new GeomFillSurface(vp, obj); widget->setWindowTitle(QObject::tr("Surface")); taskbox = new Gui::TaskView::TaskBox( Gui::BitmapFactory().pixmap("BezSurf"), @@ -472,31 +472,31 @@ TaskSurfaceFilling::TaskSurfaceFilling(ViewProviderGeomFillSurface* vp, Surface: Content.push_back(taskbox); } -TaskSurfaceFilling::~TaskSurfaceFilling() +TaskGeomFillSurface::~TaskGeomFillSurface() { // automatically deleted in the sub-class } -void TaskSurfaceFilling::setEditedObject(Surface::GeomFillSurface* obj) +void TaskGeomFillSurface::setEditedObject(Surface::GeomFillSurface* obj) { widget->setEditedObject(obj); } -void TaskSurfaceFilling::open() +void TaskGeomFillSurface::open() { widget->open(); } -bool TaskSurfaceFilling::accept() +bool TaskGeomFillSurface::accept() { return widget->accept(); } -bool TaskSurfaceFilling::reject() +bool TaskGeomFillSurface::reject() { return widget->reject(); } } -#include "moc_SurfaceFilling.cpp" +#include "moc_TaskGeomFillSurface.cpp" diff --git a/src/Mod/Surface/Gui/SurfaceFilling.h b/src/Mod/Surface/Gui/TaskGeomFillSurface.h similarity index 86% rename from src/Mod/Surface/Gui/SurfaceFilling.h rename to src/Mod/Surface/Gui/TaskGeomFillSurface.h index 4956a5be53..ab099bc2ba 100644 --- a/src/Mod/Surface/Gui/SurfaceFilling.h +++ b/src/Mod/Surface/Gui/TaskGeomFillSurface.h @@ -20,8 +20,8 @@ * * ***************************************************************************/ -#ifndef SURFACE_GUI_SURFACE_H -#define SURFACE_GUI_SURFACE_H +#ifndef SURFACEGUI_TASKGEOMFILLSURFACE_H +#define SURFACEGUI_TASKGEOMFILLSURFACE_H #include #include @@ -54,7 +54,7 @@ private: Surface::GeomFillSurface* editedObject; }; -class Ui_SurfaceFilling; +class Ui_GeomFillSurface; class ViewProviderGeomFillSurface : public PartGui::ViewProviderSpline { @@ -67,9 +67,9 @@ public: void highlightReferences(bool on); }; -class SurfaceFilling : public QWidget, - public Gui::SelectionObserver, - public Gui::DocumentObserver +class GeomFillSurface : public QWidget, + public Gui::SelectionObserver, + public Gui::DocumentObserver { Q_OBJECT @@ -80,12 +80,12 @@ protected: bool checkCommand; private: - Ui_SurfaceFilling* ui; + Ui_GeomFillSurface* ui; ViewProviderGeomFillSurface* vp; public: - SurfaceFilling(ViewProviderGeomFillSurface* vp, Surface::GeomFillSurface* obj); - ~SurfaceFilling(); + GeomFillSurface(ViewProviderGeomFillSurface* vp, Surface::GeomFillSurface* obj); + ~GeomFillSurface(); void open(); void checkOpenCommand(); @@ -112,13 +112,13 @@ private Q_SLOTS: void clearSelection(); }; -class TaskSurfaceFilling : public Gui::TaskView::TaskDialog +class TaskGeomFillSurface : public Gui::TaskView::TaskDialog { Q_OBJECT public: - TaskSurfaceFilling(ViewProviderGeomFillSurface* vp, Surface::GeomFillSurface* obj); - ~TaskSurfaceFilling(); + TaskGeomFillSurface(ViewProviderGeomFillSurface* vp, Surface::GeomFillSurface* obj); + ~TaskGeomFillSurface(); void setEditedObject(Surface::GeomFillSurface* obj); public: @@ -130,10 +130,10 @@ public: { return QDialogButtonBox::Ok | QDialogButtonBox::Cancel; } private: - SurfaceFilling* widget; + GeomFillSurface* widget; Gui::TaskView::TaskBox* taskbox; }; -} //namespace Surface +} //namespace SurfaceGui -#endif // SURFACE_GUI_SURFACE_H +#endif // SURFACEGUI_TASKGEOMFILLSURFACE_H diff --git a/src/Mod/Surface/Gui/SurfaceFilling.ui b/src/Mod/Surface/Gui/TaskGeomFillSurface.ui similarity index 96% rename from src/Mod/Surface/Gui/SurfaceFilling.ui rename to src/Mod/Surface/Gui/TaskGeomFillSurface.ui index 7917dfe5f7..3a16aaed2c 100644 --- a/src/Mod/Surface/Gui/SurfaceFilling.ui +++ b/src/Mod/Surface/Gui/TaskGeomFillSurface.ui @@ -1,7 +1,7 @@ - SurfaceGui::SurfaceFilling - + SurfaceGui::GeomFillSurface + 0