mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added display of class names to preferences
Use flag in pdmUiTreeViewEditor to control display of class names
This commit is contained in:
@@ -88,6 +88,7 @@
|
|||||||
#include "RimMainPlotCollection.h"
|
#include "RimMainPlotCollection.h"
|
||||||
#include "RimWellLogPlotCollection.h"
|
#include "RimWellLogPlotCollection.h"
|
||||||
#include "RimWellLogPlot.h"
|
#include "RimWellLogPlot.h"
|
||||||
|
#include "cafPdmUiTreeView.h"
|
||||||
|
|
||||||
namespace caf
|
namespace caf
|
||||||
{
|
{
|
||||||
@@ -1364,12 +1365,16 @@ void RiaApplication::applyPreferences()
|
|||||||
caf::EffectGenerator::setRenderingMode(caf::EffectGenerator::FIXED_FUNCTION);
|
caf::EffectGenerator::setRenderingMode(caf::EffectGenerator::FIXED_FUNCTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (RiuMainWindow::instance() && RiuMainWindow::instance()->projectTreeView())
|
||||||
|
{
|
||||||
|
RiuMainWindow::instance()->projectTreeView()->enableAppendOfClassNameToUiItemText(m_preferences->appendClassNameToUiText());
|
||||||
|
}
|
||||||
|
|
||||||
if (this->project())
|
if (this->project())
|
||||||
{
|
{
|
||||||
this->project()->setScriptDirectories(m_preferences->scriptDirectories());
|
this->project()->setScriptDirectories(m_preferences->scriptDirectories());
|
||||||
this->project()->scriptCollection()->updateConnectedEditors();
|
this->project()->updateConnectedEditors();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ RiaPreferences::RiaPreferences(void)
|
|||||||
|
|
||||||
CAF_PDM_InitField(&useShaders, "useShaders", true, "Use Shaders", "", "", "");
|
CAF_PDM_InitField(&useShaders, "useShaders", true, "Use Shaders", "", "", "");
|
||||||
CAF_PDM_InitField(&showHud, "showHud", false, "Show 3D Information", "", "", "");
|
CAF_PDM_InitField(&showHud, "showHud", false, "Show 3D Information", "", "", "");
|
||||||
|
CAF_PDM_InitField(&appendClassNameToUiText, "appendClassNameToUiText", false, "[System] Show Class Names", "", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&lastUsedProjectFileName,"lastUsedProjectFileName", "Last Used Project File", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&lastUsedProjectFileName,"lastUsedProjectFileName", "Last Used Project File", "", "", "");
|
||||||
lastUsedProjectFileName.uiCapability()->setUiHidden(true);
|
lastUsedProjectFileName.uiCapability()->setUiHidden(true);
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ public: // Pdm Fields
|
|||||||
|
|
||||||
caf::PdmField<bool> useShaders;
|
caf::PdmField<bool> useShaders;
|
||||||
caf::PdmField<bool> showHud;
|
caf::PdmField<bool> showHud;
|
||||||
|
caf::PdmField<bool> appendClassNameToUiText;
|
||||||
|
|
||||||
caf::PdmField<QString> lastUsedProjectFileName;
|
caf::PdmField<QString> lastUsedProjectFileName;
|
||||||
|
|
||||||
|
|||||||
@@ -195,5 +195,13 @@ void PdmUiTreeView::setDragDropHandle(PdmUiDragDropHandle* dragDropHandle)
|
|||||||
m_treeViewEditor->setDragDropHandle(dragDropHandle);
|
m_treeViewEditor->setDragDropHandle(dragDropHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void PdmUiTreeView::enableAppendOfClassNameToUiItemText(bool enable)
|
||||||
|
{
|
||||||
|
m_treeViewEditor->enableAppendOfClassNameToUiItemText(enable);
|
||||||
|
}
|
||||||
|
|
||||||
} //End of namespace caf
|
} //End of namespace caf
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ public:
|
|||||||
|
|
||||||
void enableDefaultContextMenu(bool enable);
|
void enableDefaultContextMenu(bool enable);
|
||||||
void enableSelectionManagerUpdating(bool enable); // TODO: rename
|
void enableSelectionManagerUpdating(bool enable); // TODO: rename
|
||||||
|
void enableAppendOfClassNameToUiItemText(bool enable);
|
||||||
|
|
||||||
void setUiConfigurationName(QString uiConfigName);
|
void setUiConfigurationName(QString uiConfigName);
|
||||||
void setPdmItem(caf::PdmUiItem* object);
|
void setPdmItem(caf::PdmUiItem* object);
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ PdmUiTreeViewEditor::PdmUiTreeViewEditor()
|
|||||||
{
|
{
|
||||||
m_useDefaultContextMenu = false;
|
m_useDefaultContextMenu = false;
|
||||||
m_updateSelectionManager = false;
|
m_updateSelectionManager = false;
|
||||||
|
m_appendClassNameToUiItemText = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,5 +325,21 @@ void PdmUiTreeViewEditor::updateSelectionManager()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void PdmUiTreeViewEditor::enableAppendOfClassNameToUiItemText(bool enable)
|
||||||
|
{
|
||||||
|
m_appendClassNameToUiItemText = enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool PdmUiTreeViewEditor::isAppendOfClassNameToUiItemTextEnabled()
|
||||||
|
{
|
||||||
|
return m_appendClassNameToUiItemText;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // end namespace caf
|
} // end namespace caf
|
||||||
|
|||||||
@@ -86,6 +86,9 @@ public:
|
|||||||
void enableDefaultContextMenu(bool enable);
|
void enableDefaultContextMenu(bool enable);
|
||||||
void enableSelectionManagerUpdating(bool enable);
|
void enableSelectionManagerUpdating(bool enable);
|
||||||
|
|
||||||
|
void enableAppendOfClassNameToUiItemText(bool enable);
|
||||||
|
bool isAppendOfClassNameToUiItemTextEnabled();
|
||||||
|
|
||||||
QTreeView* treeView();
|
QTreeView* treeView();
|
||||||
|
|
||||||
void selectAsCurrentItem(PdmUiItem* uiItem);
|
void selectAsCurrentItem(PdmUiItem* uiItem);
|
||||||
@@ -133,6 +136,7 @@ private:
|
|||||||
|
|
||||||
bool m_useDefaultContextMenu;
|
bool m_useDefaultContextMenu;
|
||||||
bool m_updateSelectionManager;
|
bool m_updateSelectionManager;
|
||||||
|
bool m_appendClassNameToUiItemText;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -501,16 +501,15 @@ QVariant PdmUiTreeViewModel::data(const QModelIndex &index, int role ) const
|
|||||||
|
|
||||||
QString txt = v.toString();
|
QString txt = v.toString();
|
||||||
|
|
||||||
// Uncomment following to show class names of objects in property viewer
|
if (m_treeViewEditor->isAppendOfClassNameToUiItemTextEnabled())
|
||||||
//#define SHOW_CLASS_NAME_IN_TREE
|
{
|
||||||
#ifdef SHOW_CLASS_NAME_IN_TREE
|
|
||||||
PdmObjectHandle* pdmObjHandle = pdmUiObject->objectHandle();
|
PdmObjectHandle* pdmObjHandle = pdmUiObject->objectHandle();
|
||||||
if (pdmObjHandle)
|
if (pdmObjHandle)
|
||||||
{
|
{
|
||||||
txt += " - ";
|
txt += " - ";
|
||||||
txt += typeid(*pdmObjHandle).name();
|
txt += typeid(*pdmObjHandle).name();
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
return txt;
|
return txt;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user