15 #include <internal/QmitkNodeSelectionConstants.h> 30 prefService->
GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID.c_str());
32 prefNode->Node(mitk::NodeSelectionConstants::VISIBLE_INSPECTORS_NODE_ID.c_str());
34 visNode->RemoveNode();
38 visNode = prefNode->Node(mitk::NodeSelectionConstants::VISIBLE_INSPECTORS_NODE_ID.c_str());
41 for (
const auto &inspector : inspectors)
43 std::ostringstream sstr;
44 sstr << inspector.first;
47 aNode->Put(mitk::NodeSelectionConstants::VISIBLE_INSPECTOR_ID.c_str(), inspector.second.c_str());
59 prefService->
GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID.c_str());
61 prefNode->Node(mitk::NodeSelectionConstants::VISIBLE_INSPECTORS_NODE_ID.c_str());
63 typedef QStringList NamesType;
64 NamesType names = visNode->ChildrenNames();
70 for (NamesType::const_iterator pos = names.begin(); pos != names.end(); ++pos)
76 mitkThrow() <<
"Error in preference interface. Cannot find preset node under given name. Name: " 77 << (*pos).toStdString();
80 std::istringstream isstr(pos->toStdString());
81 unsigned int order = 0;
84 auto id = aNode->Get(mitk::NodeSelectionConstants::VISIBLE_INSPECTOR_ID.c_str(),
"");
87 mitkThrow() <<
"Error in preference interface. ID of visible inspector is not set. Inspector position: " 91 visMap.insert(std::make_pair(order,
id.toStdString()));
102 prefService->
GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID.c_str());
104 auto id = prefNode->Get(mitk::NodeSelectionConstants::PREFERRED_INSPECTOR_ID.c_str(),
"");
115 prefService->
GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID.c_str());
117 prefNode->Put(mitk::NodeSelectionConstants::PREFERRED_INSPECTOR_ID.c_str(),
id.c_str());
126 prefService->
GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID.c_str());
128 prefNode->PutBool(mitk::NodeSelectionConstants::SHOW_FAVORITE_INSPECTOR.c_str(), show);
137 prefService->
GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID.c_str());
139 return prefNode->GetBool(mitk::NodeSelectionConstants::SHOW_FAVORITE_INSPECTOR.c_str(),
true);
147 prefService->
GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID.c_str());
149 prefNode->PutBool(mitk::NodeSelectionConstants::SHOW_HISTORY_INSPECTOR.c_str(), show);
158 prefService->
GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID.c_str());
160 return prefNode->GetBool(mitk::NodeSelectionConstants::SHOW_HISTORY_INSPECTOR.c_str(),
true);
std::string DataStorageInspectorIDType
void PutShowHistoryInspector(bool show)
void PutPreferredDataStorageInspector(const DataStorageInspectorIDType &id)
bool GetShowFavoritesInspector()
virtual SmartPointer< IPreferences > GetSystemPreferences()=0
bool GetShowHistoryInspector()
VisibleDataStorageInspectorMapType GetVisibleDataStorageInspectors()
DataStorageInspectorIDType GetPreferredDataStorageInspector()
void PutVisibleDataStorageInspectors(const VisibleDataStorageInspectorMapType &inspectors)
void PutShowFavoritesInspector(bool show)
std::map< unsigned int, DataStorageInspectorIDType > VisibleDataStorageInspectorMapType