예제 #1
0
파일: rkinput.cpp 프로젝트: KDE/rkward
void RKInput::textChanged (RKComponentPropertyBase *) {
	RK_TRACE (PLUGIN);

	if (updating) return;
	updating = true;

	RK_ASSERT (textedit || lineedit);
	if (textedit) textedit->setText (fetchStringValue (text));
	else lineedit->setText (fetchStringValue (text));

	updateColor ();

	updating = false;
	changed ();
}
예제 #2
0
RKComponent::UnserializeError RKComponentBase::unserializeState (const QStringList &state) {
	RK_TRACE (PLUGIN);

	QMap<QString, QString> props;

	for (int i = 0; i < state.count (); ++i) {
		QString line = state[i];
		int sep = line.indexOf ('=');
		if (sep < 0) return BadFormat;
		props.insert (RKCommonFunctions::unescape (line.left (sep)), RKCommonFunctions::unescape (line.mid (sep+1)));
	}

	setPropertyValues (&props);

	// verify
	UnserializeError error = NoError;
	for (QMap<QString, QString>::const_iterator it = props.constBegin (); it != props.constEnd (); ++it) {
		if (fetchStringValue (it.key ()) != it.value ()) {
			// COMPAT: In RKWard 0.5.1, the formatting of real numbers was different. Hence we compare the numeric values, instead
			QString dummy;
			RKComponentBase *prop = lookupComponent (it.key (), &dummy);
			if (dummy.isEmpty () && prop && prop->type () == PropertyDouble) {
				if (static_cast<RKComponentPropertyDouble*> (prop)->doubleValue () == it.value ().toDouble ()) {
					continue;
				}
			}

			RK_DO(qDebug ("Tried to apply value %s to property %s, but got %s", qPrintable (it.value ()), qPrintable (it.key ()), qPrintable (fetchStringValue (it.key ()))), PLUGIN, DL_WARNING);
			error = NotAllSettingsApplied;
		}
	}

	return error;
}
void RKPluginBrowser::textChanged (RKComponentPropertyBase *) {
	RK_TRACE (PLUGIN);

	if (updating) return;
	updating = true;

	selector->setLocation (fetchStringValue (selection));
	updateColor ();

	updating = false;
	changed ();
}
예제 #4
0
void RKMatrixInput::tsvPropertyChanged () {
	if (updating_tsv_data) return;
	updating_tsv_data = true;
	RK_TRACE (PLUGIN);

	columns.clear ();
	QStringList coldata = fetchStringValue (tsv_data).split ('\n', QString::KeepEmptyParts);
	for (int i = 0; i < coldata.size (); ++i) {
		setColumnValue (i, coldata[i]);
	}

	updating_tsv_data = false;
	updateAll ();
}
예제 #5
0
void RKVarSelector::objectSelectionChanged () {
	RK_TRACE (PLUGIN);

	selected->setObjectList (list_view->selectedObjects ());
	RK_DEBUG (PLUGIN, DL_DEBUG, "selected in varselector: %s", qPrintable (fetchStringValue (selected)));
}
bool RKPluginBrowser::isValid () {
	return (!(fetchStringValue (selection).isEmpty ()));
}
예제 #7
0
파일: rkinput.cpp 프로젝트: KDE/rkward
bool RKInput::isValid () {
	RK_TRACE (PLUGIN);

	return (!(fetchStringValue (text).isEmpty ()));
}