Commit c2d876f6 authored by Mike Kremer's avatar Mike Kremer
Browse files

Notifiy plugins each time the state of an object (target, source) has changed....

Notifiy plugins each time the state of an object (target, source) has changed. Introduced UPDATE_STATE flag for UpdateType.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12094 383ad7c9-94d9-4d36-a494-682f7c89f535
parent a5d16c07
......@@ -197,6 +197,14 @@ void initializeUpdateTypes() {
updateTypeToTypeInfo[UPDATE_COLOR] = updateTypes.size();
updateTypes.push_back( UpdateTypeInfo(UPDATE_COLOR, "Color", true) );
stringToUpdateTypeInfo["Texture"] = updateTypes.size();
updateTypeToTypeInfo[UPDATE_TEXTURE] = updateTypes.size();
updateTypes.push_back( UpdateTypeInfo(UPDATE_TEXTURE, "Texture", true) );
stringToUpdateTypeInfo["State"] = updateTypes.size();
updateTypeToTypeInfo[UPDATE_STATE] = updateTypes.size();
updateTypes.push_back( UpdateTypeInfo(UPDATE_STATE, "State", true) );
updateTypeToString[UPDATE_ALL] = "All";
updateTypeToString[UPDATE_VISIBILITY] = "Visibility";
updateTypeToString[UPDATE_GEOMETRY] = "Geometry";
......@@ -208,6 +216,8 @@ void initializeUpdateTypes() {
updateTypeToString[UPDATE_SELECTION_FACES] = "FaceSelection";
updateTypeToString[UPDATE_SELECTION_KNOTS] = "KnotSelection";
updateTypeToString[UPDATE_COLOR] = "Color";
updateTypeToString[UPDATE_TEXTURE] = "Texture";
updateTypeToString[UPDATE_STATE] = "State";
}
/// Adds a updateType and returns the id for the new type
......
......@@ -162,8 +162,14 @@ const UpdateType UPDATE_COLOR( UpdateTypeSet(1) << 10 );
*/
const UpdateType UPDATE_TEXTURE( UpdateTypeSet(1) << 11 );
/** \brief State has changed
*
* The object's state (target, source) has changed
*/
const UpdateType UPDATE_STATE( UpdateTypeSet(1) << 12 );
/// marks the last used ID
const UpdateType UPDATE_UNUSED ( UpdateTypeSet(1) << 12 );
const UpdateType UPDATE_UNUSED ( UpdateTypeSet(1) << 13 );
/**@}*/
......
......@@ -58,6 +58,7 @@ void DataControlPlugin::slotContextMenuTarget( ) {
return;
object->target( targetAction_->isChecked() );
emit updatedObject(objectId, UPDATE_STATE);
}
void DataControlPlugin::slotContextMenuHide( ) {
......@@ -87,6 +88,7 @@ void DataControlPlugin::slotContextMenuSource( ) {
return;
object->source( sourceAction_->isChecked() );
emit updatedObject(objectId, UPDATE_STATE);
}
void DataControlPlugin::slotContextMenuRemove( ) {
......
......@@ -415,11 +415,13 @@ void DataControlPlugin::slotDataChanged ( int _id, int _column, const QVariant&
// source
case 2:
obj->source( _value.toBool() );
emit updatedObject(_id, UPDATE_STATE);
break;
// target
case 3:
obj->target( _value.toBool() );
emit updatedObject(_id, UPDATE_STATE);
break;
default:
......@@ -681,11 +683,13 @@ void DataControlPlugin::propagateUpwards(BaseObject* _obj, int _column ){
if (_obj->source() != value){
_obj->source( value );
emit updatedObject(_obj->id(), UPDATE_STATE);
changed = true;
}
if (_obj->target() != value2){
_obj->target( value2 );
emit updatedObject(_obj->id(), UPDATE_STATE);
changed = true;
}
......@@ -729,11 +733,13 @@ void DataControlPlugin::propagateDownwards(BaseObject* _obj, int _column ){
if ( current->source() != _obj->source() ){
current->source( _obj->source() );
emit updatedObject(_obj->id(), UPDATE_STATE);
changed = true;
}
if ( current->target() != _obj->target() ){
current->target( _obj->target() );
emit updatedObject(_obj->id(), UPDATE_STATE);
changed = true;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment