Skip to content

Commit

Permalink
Merge branch 'master' into feature/holding-tags-copy
Browse files Browse the repository at this point in the history
  • Loading branch information
mlampert committed Oct 20, 2019
2 parents 2b8248c + c903de8 commit 50c8af0
Show file tree
Hide file tree
Showing 20 changed files with 497 additions and 371 deletions.
285 changes: 174 additions & 111 deletions src/Base/Parameter.cpp

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion src/Base/Parameter.h
Expand Up @@ -22,6 +22,13 @@
* Juergen Riegel 2002 *
***************************************************************************/

/**
* \file Parameter.h
* \brief The classes defined here are used to interface with the XML-based
* FreeCAD config files: user.cfg and system.cfg files. It can parse, get,
* and store the parameters/configurations for the user's preferences.
* 3rd party Xerces-C++ XML parser is used to parse and write the XML.
*/

#ifndef BASE__PARAMETER_H
#define BASE__PARAMETER_H
Expand Down Expand Up @@ -93,7 +100,7 @@ class ParameterManager;
* kind of preferences and so on.
* @see ParameterManager
*/
class BaseExport ParameterGrp : public Base::Handled,public Base::Subject <const char*>
class BaseExport ParameterGrp : public Base::Handled,public Base::Subject <const char*>
{


Expand Down Expand Up @@ -236,6 +243,7 @@ class BaseExport ParameterGrp : public Base::Handled,public Base::Subject <cons
~ParameterGrp();
/// helper function for GetGroup
Base::Reference<ParameterGrp> _GetGroup(const char* Name);
bool ShouldRemove() const;

XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *FindNextElement(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *Prev, const char* Type) const;

Expand Down
2 changes: 1 addition & 1 deletion src/Base/swigpyrun.inl
Expand Up @@ -72,7 +72,7 @@ void cleanupSWIG_T(const char* TypeName)

PyObject *module, *dict;
PyInterpreterState *interp = PyThreadState_GET()->interp;
PyObject *modules = interp->modules;
PyObject *modules = PyImport_GetModuleDict();
module = PyDict_GetItemString(modules, "__builtin__");
if (module != NULL && PyModule_Check(module)) {
dict = PyModule_GetDict(module);
Expand Down
11 changes: 8 additions & 3 deletions src/Gui/DlgParameterImp.cpp
Expand Up @@ -404,16 +404,21 @@ void ParameterGroup::onDeleteSelectedItem()
QTreeWidgetItem* sel = currentItem();
if (isItemSelected(sel) && sel->parent())
{
if ( QMessageBox::question(this, tr("Remove group"), tr("Do really want to remove this parameter group?"),
if ( QMessageBox::question(this, tr("Remove group"), tr("Do you really want to remove this parameter group?"),
QMessageBox::Yes, QMessageBox::No|QMessageBox::Default|QMessageBox::Escape) ==
QMessageBox::Yes )
{
QTreeWidgetItem* parent = sel->parent();
int index = parent->indexOfChild(sel);
parent->takeChild(index);
ParameterGroupItem* para = static_cast<ParameterGroupItem*>(parent);
para->_hcGrp->RemoveGrp(sel->text(0).toLatin1());

std::string groupName = sel->text(0).toStdString();
// must delete the tree item here because it and its children still
// hold a reference to the parameter group
delete sel;

ParameterGroupItem* para = static_cast<ParameterGroupItem*>(parent);
para->_hcGrp->RemoveGrp(groupName.c_str());
}
}
}
Expand Down

0 comments on commit 50c8af0

Please sign in to comment.