Beispiel #1
0
void EditAction::readFrom()
{
	theRepeat->setChecked((*theAction).repeat());
	theAutoStart->setChecked((*theAction).autoStart());
	theDoBefore->setChecked((*theAction).doBefore());
	theDoAfter->setChecked((*theAction).doAfter());
	theDontSend->setChecked((*theAction).ifMulti() == IM_DONTSEND);
	theSendToTop->setChecked((*theAction).ifMulti() == IM_SENDTOTOP);
	theSendToBottom->setChecked((*theAction).ifMulti() == IM_SENDTOBOTTOM);
	theSendToAll->setChecked((*theAction).ifMulti() == IM_SENDTOALL);

	if((*theAction).isModeChange())
	{	// change mode
		theChangeMode->setChecked(true);
		if((*theAction).object().isEmpty())
			theModes->setCurrentText(i18n("[Exit current mode]"));
		else
			theModes->setCurrentText((*theAction).object());
	}
	else if((*theAction).isJustStart())
	{	// profile action
		theUseProfile->setChecked(true);
		const Profile *p = ProfileServer::profileServer()->profiles()[(*theAction).program()];
		theApplications->setCurrentText(p->name());
		updateFunctions();
		updateArguments();
		theJustStart->setChecked(true);
	}
	else if(ProfileServer::profileServer()->getAction((*theAction).program(), (*theAction).object(), (*theAction).method().prototype()))
	{	// profile action
		theUseProfile->setChecked(true);
		const ProfileAction *a = ProfileServer::profileServer()->getAction((*theAction).program(), (*theAction).object(), (*theAction).method().prototype());
		theApplications->setCurrentText(a->profile()->name());
		updateFunctions();
		theFunctions->setCurrentText(a->name());
		arguments = (*theAction).arguments();
		updateArguments();
		theNotJustStart->setChecked(true);
	}
	else
	{	// dcop action
		theUseDCOP->setChecked(true);
		theDCOPApplications->setCurrentText((*theAction).program());
		updateDCOPObjects();
		theDCOPObjects->setCurrentText((*theAction).object());
		updateDCOPFunctions();
		theDCOPFunctions->setCurrentText((*theAction).method().prototype());
		arguments = (*theAction).arguments();
		updateArguments();
	}
	updateOptions();
}
Beispiel #2
0
void EditAction::updateDCOPFunctions()
{
	theDCOPFunctions->clear();
	if(theDCOPApplications->currentText().isNull() || theDCOPApplications->currentText().isEmpty()) return;
	TQStringList functions = AddAction::getFunctions(nameProgramMap[theDCOPApplications->currentText()], theDCOPObjects->currentText());
	if(!functions.size() && theDCOPApplications->currentText() == (*theAction).program()) theDCOPFunctions->insertItem((*theAction).method().prototype());
	for(TQStringList::iterator i = functions.begin(); i != functions.end(); ++i)
		theDCOPFunctions->insertItem(*i);
	updateArguments();
}
bool RFunctionObject::updateStructure (RData *new_data) {
	RK_TRACE (OBJECTS);
	RK_ASSERT (new_data->getDataLength () >= 5);
	RK_ASSERT (new_data->getDataType () == RData::StructureVector);

	if (!RObject::updateStructure (new_data)) return false;

	if (updateArguments (new_data)) RKGlobals::tracker ()->objectMetaChanged (this);

	return true;
}
Beispiel #4
0
void EditAction::updateFunctions()
{
	ProfileServer *theServer = ProfileServer::profileServer();
	theFunctions->clear();
	functionMap.clear();
	if(theApplications->currentText().isNull() || theApplications->currentText().isEmpty()) return;

	const Profile *p = theServer->profiles()[applicationMap[theApplications->currentText()]];

	TQDict<ProfileAction> dict = p->actions();
	for(TQDictIterator<ProfileAction> i(dict); i.current(); ++i)
	{	theFunctions->insertItem(i.current()->name());
		functionMap[i.current()->name()] = i.currentKey();
	}
	updateArguments();
}