Beispiel #1
0
RKContextHandler::RKContextHandler (QObject *parent, const QDomDocument &gui_xml, const QString &id) : QObject (parent), RKComponentBase (), KXMLGUIClient () {
	RK_TRACE (PLUGIN);

	setXMLGUIBuildDocument (gui_xml);

	RKComponentPropertyBase *incontext = new RKComponentPropertyBase (this, false);
	incontext->setValue (id);
	addChild ("context", incontext);
}
void RKComponentBase::setPropertyValues (QMap<QString, QString> *list, bool warn_internal) {
	RK_TRACE (PLUGIN);
	// TODO: visibility enabledness and requiredness should be excluded, as those are not directly user settable. Perhaps even mark up all properties as user settable or not.

	for (QMap<QString, QString>::const_iterator it = list->constBegin (); it != list->constEnd (); ++it) {
		QString mod;
		RKComponentBase *prop = lookupComponent (it.key (), &mod);
		if (mod.isEmpty () && prop->isProperty ()) {		// found a property
			RKComponentPropertyBase* p = static_cast<RKComponentPropertyBase*>(prop);
			RK_ASSERT (!(p->isInternal () && warn_internal));
			p->setValue (it.value ());
		}
	}
}
Beispiel #3
0
void RKImportDialog::accept () {
	RK_TRACE (DIALOGS);

	KFileDialog::accept ();

	int index = format_selector->combo->currentIndex ();
	QString cid = component_ids[index];
	RKComponentHandle *handle = RKComponentMap::getComponentHandle (cid);
	RKContextHandler *chandler = context->makeContextHandler (this, false);

	if (!(handle && chandler)) {
		RK_ASSERT (false);
	} else {
		RKComponentPropertyBase *filename = new RKComponentPropertyBase (chandler, false);
		filename->setValue (selectedFile ());
		chandler->addChild ("filename", filename);

		chandler->invokeComponent (handle);
	}

	deleteLater ();
}