/************************ListViews::setDataModel(DataModel<Folder>* dm)-----------> ** ** Parameters:- DataModel<Folder>* :- pointer to the data model to be used by all the ** views ** Returns :- void(Nothing) ** Description:-This method is used to set the datamodel to be used by the ** listview class to extract the data from the data-model ************************************************************************************/ void ListViews::setDataModel(DataModelGUI* pDM) { //First Disconnect updateCompleteView() and notifyView() from DataModelGUI if (mpDataModelGUI) { disconnect(mpDataModelGUI, SIGNAL(notifyView(ListViews::ObjectType, ListViews::Action, std::string)), this, SLOT(slotNotify(ListViews::ObjectType, ListViews::Action, std::string))); } mpDataModelGUI = pDM; mpTreeDM->setGuiDM(mpDataModelGUI); CCopasiDataModel* pDataModel = (*CCopasiRootContainer::getDatamodelList())[0]; assert(pDataModel != NULL); //Set Model for the TableView mpTreeDM->setCopasiDM(pDataModel); mpTreeView->expand(mpTreeSortDM->mapFromSource(mpTreeDM->index(0, 0, QModelIndex()))); if (mpDataModelGUI) { connect(mpDataModelGUI, SIGNAL(notifyView(ListViews::ObjectType, ListViews::Action, const std::string &)), this, SLOT(slotNotify(ListViews::ObjectType, ListViews::Action, const std::string &))); } ConstructNodeWidgets(); }
CoreParameter::CoreParameter(QObject *parent) : IModel(parent) { //_settings = BioTracker::Util::TypedSingleton<BioTracker::Core::Settings>::getInstance(CONFIGPARAM::CONFIG_INI_FILE); //_settings = new BioTracker::Core::Settings(CONFIGPARAM::CONFIG_INI_FILE); Q_EMIT notifyView(); }
bool DataModelGUI::notify(ListViews::ObjectType objectType, ListViews::Action action, const std::string & key) { // The GUI is inactive whenever a progress bar exist. We wait with updates // until then. if (mpProgressBar != NULL) return false; // update all initial value if (action != ListViews::RENAME) refreshInitialValues(); emit notifyView(objectType, action, key); return true; }
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ Project::pSubscription_type Project::subscribe(pProjectListener_type _pListener, pFilter_type _pFilter) { // Only the insert needs to be guarded. { Zen::Threading::CriticalSection lock(m_pSubscriptionsGuard); m_listeners.insert(_pListener); } std::cout << "Project::subscribe()" << std::endl; // Notify the listener of the current state of the project. notifyView(_pListener); return pSubscription_type(new ProjectSubscription_type(this, _pListener), &destroySubscription); }
bool DataModelGUI::notify(ListViews::ObjectType objectType, ListViews::Action action, const std::string & key) { // The GUI is inactive whenever a progress bar exist. We wait with updates // until then. if (mpProgressBar != NULL) return false; // update all initial value if (action != ListViews::RENAME && // not needed after rename !(action == ListViews::ADD && objectType == ListViews::MODEL) // not needed when model was loaded ) { refreshInitialValues(); } emit notifyView(objectType, action, key); return true; }
void CoreParameter::setTrackNumber(int number) { m_trackNumber = number; notifyView(); }