Example #1
0
void QgsMapTool::setAction( QAction* action )
{
  if ( mAction )
    disconnect( mAction, SIGNAL( destroyed() ), this, SLOT( actionDestroyed() ) );
  mAction = action;
  connect( mAction, SIGNAL( destroyed() ), this, SLOT( actionDestroyed() ) );
}
Example #2
0
bool KviActionManager::unregisterAction(const QString &szName)
{
	KviAction * a = m_pActions->find(szName);
	if(!a)return false;
	disconnect(a,SIGNAL(destroyed()),this,SLOT(actionDestroyed()));
	a->unregisterAccelerator();
	return m_pActions->remove(szName);
}
Example #3
0
bool KviActionManager::registerAction(KviAction * a)
{
	if(m_pActions->find(a->name()))return false;
	connect(a,SIGNAL(destroyed()),this,SLOT(actionDestroyed()));
	m_pActions->insert(a->name(),a);
	if(g_pMainWindow)a->registerAccelerator(); // otherwise it is delayed!
	return true;
}
Example #4
0
KviActionManager::~KviActionManager()
{
	// the customizeToolBars dialog has been already
	// destroyed since the module manager has already
	// killed all the modules at this point...

	KviPointerHashTableIterator<QString, KviAction> it(*m_pActions);
	while(KviAction * a = it.current())
	{
		disconnect(a, SIGNAL(destroyed()), this, SLOT(actionDestroyed()));
		++it;
	}
	delete m_pActions;

	delete m_pCategories;
}