mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
AppFwk: Remove NotificationCenter from SelectionManager
This commit is contained in:
parent
1a3f9e87ae
commit
8e53e2a3cf
@ -37,7 +37,6 @@
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include "cafNotificationCenter.h"
|
||||
#include "cafPdmReferenceHelper.h"
|
||||
#include "cafPdmUiFieldHandle.h"
|
||||
#include "cafPdmUiObjectHandle.h"
|
||||
@ -57,6 +56,14 @@ SelectionManager* SelectionManager::instance()
|
||||
return singleton;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Obsolete. Do not use this method.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::NotificationCenter* SelectionManager::notificationCenter()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -143,7 +150,6 @@ SelectionManager::SelectionManager()
|
||||
{
|
||||
m_selectionForRole.resize(UNDEFINED);
|
||||
|
||||
m_notificationCenter = nullptr;
|
||||
m_activeChildArrayFieldHandle = nullptr;
|
||||
}
|
||||
|
||||
@ -232,33 +238,12 @@ void SelectionManager::clear(int role)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void SelectionManager::notifySelectionChanged()
|
||||
{
|
||||
if (m_notificationCenter)
|
||||
{
|
||||
m_notificationCenter->notifyObserversOfSelectionChange();
|
||||
}
|
||||
|
||||
for (auto receiver: m_selectionReceivers)
|
||||
{
|
||||
receiver->onSelectionManagerSelectionChanged();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void SelectionManager::setNotificationCenter(NotificationCenter* notificationCenter)
|
||||
{
|
||||
m_notificationCenter = notificationCenter;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
NotificationCenter* SelectionManager::notificationCenter()
|
||||
{
|
||||
return m_notificationCenter;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -65,29 +65,29 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
static SelectionManager* instance();
|
||||
static SelectionManager* instance();
|
||||
|
||||
void setNotificationCenter(NotificationCenter* notificationCenter);
|
||||
NotificationCenter* notificationCenter();
|
||||
|
||||
void setActiveChildArrayFieldHandle(PdmChildArrayFieldHandle* childArray);
|
||||
PdmChildArrayFieldHandle* activeChildArrayFieldHandle();
|
||||
// OBSOLETE ! Remove when time to refactor the command system
|
||||
NotificationCenter* notificationCenter();
|
||||
|
||||
void setPdmRootObject(PdmObjectHandle* root);
|
||||
PdmObjectHandle* pdmRootObject() { return m_rootObject; }
|
||||
void setActiveChildArrayFieldHandle(PdmChildArrayFieldHandle* childArray);
|
||||
PdmChildArrayFieldHandle* activeChildArrayFieldHandle();
|
||||
|
||||
PdmUiItem* selectedItem(int role = SelectionManager::APPLICATION_GLOBAL);
|
||||
void setSelectedItem(PdmUiItem* item, int role = SelectionManager::APPLICATION_GLOBAL);
|
||||
void setPdmRootObject(PdmObjectHandle* root);
|
||||
PdmObjectHandle* pdmRootObject() { return m_rootObject; }
|
||||
|
||||
void selectedItems(std::vector<PdmUiItem*>& items, int role = SelectionManager::APPLICATION_GLOBAL);
|
||||
void setSelectedItems(const std::vector<PdmUiItem*>& items, int role = SelectionManager::APPLICATION_GLOBAL);
|
||||
PdmUiItem* selectedItem(int role = SelectionManager::APPLICATION_GLOBAL);
|
||||
void setSelectedItem(PdmUiItem* item, int role = SelectionManager::APPLICATION_GLOBAL);
|
||||
|
||||
void selectionAsReferences(std::vector<QString>& referenceList, int role = SelectionManager::APPLICATION_GLOBAL) const;
|
||||
void setSelectionFromReferences(const std::vector<QString>& referenceList, int role = SelectionManager::APPLICATION_GLOBAL);
|
||||
void selectedItems(std::vector<PdmUiItem*>& items, int role = SelectionManager::APPLICATION_GLOBAL);
|
||||
void setSelectedItems(const std::vector<PdmUiItem*>& items, int role = SelectionManager::APPLICATION_GLOBAL);
|
||||
|
||||
void clearAll();
|
||||
void clear(int role);
|
||||
void removeObjectFromAllSelections(PdmObjectHandle* pdmObject);
|
||||
void selectionAsReferences(std::vector<QString>& referenceList, int role = SelectionManager::APPLICATION_GLOBAL) const;
|
||||
void setSelectionFromReferences(const std::vector<QString>& referenceList, int role = SelectionManager::APPLICATION_GLOBAL);
|
||||
|
||||
void clearAll();
|
||||
void clear(int role);
|
||||
void removeObjectFromAllSelections(PdmObjectHandle* pdmObject);
|
||||
|
||||
template <typename T>
|
||||
void objectsByType(std::vector<T*>* typedObjects, int role = SelectionManager::APPLICATION_GLOBAL)
|
||||
@ -122,6 +122,7 @@ public:
|
||||
|
||||
private:
|
||||
SelectionManager();
|
||||
|
||||
void notifySelectionChanged();
|
||||
|
||||
friend class SelectionChangedReceiver;
|
||||
@ -131,7 +132,6 @@ private:
|
||||
private:
|
||||
std::vector < std::vector< std::pair<PdmPointer<PdmObjectHandle>, PdmUiItem*> > > m_selectionForRole;
|
||||
|
||||
NotificationCenter* m_notificationCenter;
|
||||
PdmChildArrayFieldHandle* m_activeChildArrayFieldHandle;
|
||||
PdmPointer<PdmObjectHandle> m_rootObject;
|
||||
|
||||
|
@ -110,10 +110,9 @@ public:
|
||||
PdmObjectHandle* pdmObjectFromModelIndex(const QModelIndex& mi);
|
||||
QTableView* tableView();
|
||||
|
||||
|
||||
protected:
|
||||
QWidget* createEditorWidget(QWidget * parent) override;
|
||||
QWidget* createLabelWidget(QWidget * parent) override;
|
||||
protected:
|
||||
virtual void configureAndUpdateUi(const QString& uiConfigName) override;
|
||||
|
||||
virtual void onSelectionManagerSelectionChanged() override;
|
||||
|
Loading…
Reference in New Issue
Block a user