[rkward-cvs] rkward/rkward/plugin Makefile.am,1.10,1.11 rkcheckbox.cpp,1.7,1.8 rkcheckbox.h,1.5,1.6 rkcomponent.cpp,1.6,1.7 rkcomponent.h,1.7,1.8 rkcomponentproperties.cpp,1.12,1.13 rkcomponentproperties.h,1.13,1.14 rkradio.cpp,1.8,1.9 rkstandardcomponent.cpp,1.9,1.10

Thomas Friedrichsmeier tfry at users.sourceforge.net
Fri Mar 17 13:27:20 UTC 2006


Update of /cvsroot/rkward/rkward/rkward/plugin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27411

Modified Files:
	Makefile.am rkcheckbox.cpp rkcheckbox.h rkcomponent.cpp 
	rkcomponent.h rkcomponentproperties.cpp 
	rkcomponentproperties.h rkradio.cpp rkstandardcomponent.cpp 
Log Message:
Moved over RKCheckBox. Slight rework of isValid/isSatisfied

Index: rkcomponent.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkcomponent.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** rkcomponent.h	17 Mar 2006 00:02:27 -0000	1.7
--- rkcomponent.h	17 Mar 2006 13:27:18 -0000	1.8
***************
*** 26,30 ****
  public:
  /** constructor */
! 	RKComponentBase () {};
  /** destructor */
  	virtual ~RKComponentBase () {};
--- 26,30 ----
  public:
  /** constructor */
! 	RKComponentBase () { required=true; };
  /** destructor */
  	virtual ~RKComponentBase () {};
***************
*** 45,48 ****
--- 45,53 ----
  		ComponentFormula = 2004,
  		ComponentRadio = 2005,
+ 		ComponentCheckBox = 2006,
+ 		ComponentSpinBox = 2007,
+ 		ComponentInput = 2008,
+ 		ComponentBrowser = 2009,
+ 		ComponentText = 2010,
  		ComponentUser = 3000	/**< for user expansion */
  	};
***************
*** 58,63 ****
  /** returns true, if this is a property */
  	bool isProperty () { return (type () <= PropertyEnd); };
! /** returns satisfaction state. default implementation returns true */
! 	virtual bool isSatisfied () { return true; }
  protected:
  	friend class RKComponentBuilder;
--- 63,72 ----
  /** returns true, if this is a property */
  	bool isProperty () { return (type () <= PropertyEnd); };
! /** returns satisfaction state. see setRequired () */
! 	virtual bool isSatisfied ();
! /** currently valid (i.e. satisfied, even if required)? default implementation always returns true */
! 	virtual bool isValid () { return true; };
! /** set to required: will only be satisfied if it is valid. Else: always satisfied (but subclasses might override to always be dissatisfied on really bad values. By default RKComponentBase is required at construction */
! 	void setRequired (bool require) { required = require; };
  protected:
  	friend class RKComponentBuilder;
***************
*** 65,68 ****
--- 74,78 ----
  	void addChild (const QString &id, RKComponentBase *child);
  	QDict<RKComponentBase> child_map;
+ 	bool required;
  };
  
***************
*** 80,86 ****
  	virtual ~RKComponent ();
  	int type () { return Component; };
  public slots:
! /** generally the valueChanged () signal of all RKComponentPropertys directly owned by this component should be connected to this (Qt-)slot, so the component can update itself accordingly. Default implementation handles changes in visibilty, enabledness and requiredness properties. If you reimplement this, you will most likely still want to call the default implementation to handle these. */
! 	virtual void propertyValueChanged (RKComponentPropertyBase *property);
  public:
  /** standard property controlling visibility */
--- 90,101 ----
  	virtual ~RKComponent ();
  	int type () { return Component; };
+ /** change notification mechanism. Call this, if something in the component changed that could result in a change in code/values/satisfaction state. Default implementation propagates the change upwards to parent components, if any, but does not do anything further. Reimplement, for instance, to regenerate code */
+ 	virtual void changed ();
+ /** reimplemented to only return true, if all children are satisfied */
+ 	bool isValid ();
  public slots:
! /** This handles changes in the default properties (enabledness, visibility, requiredness). You will use similar slots in derived classes to handle
! specialized properties */
! 	void propertyValueChanged (RKComponentPropertyBase *property);
  public:
  /** standard property controlling visibility */
***************
*** 101,110 ****
  	RKComponent *parentComponent () { return _parent; };
  
- /** check whether the component is satisfied (such as after a value change or requireness change). If statisfied state has changed, and silent==false, notfies parent. TODO: maybe statisfaction-state should be made a property as well! */
- 	virtual void checkSatisfied (bool silent=false);
- 
- /** returns satisfaction state. default implementation returns false, if any of the children is dis-satisfied, true otherwise */
- 	virtual bool isSatisfied ();
- 
  /** Is the component "ready"? I.e. it is up to date according to current settings. Does not imply it is also satisfied. Default implementation always returns true. TODO: maybe ready-state should be made a property as well! */
  	virtual bool isReady () { return true; };
--- 116,119 ----

Index: rkradio.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkradio.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** rkradio.cpp	17 Mar 2006 00:02:27 -0000	1.8
--- rkradio.cpp	17 Mar 2006 13:27:18 -0000	1.9
***************
*** 74,77 ****
--- 74,78 ----
  		++i;
  	}
+ 	updating = false;
  	number->setIntValue (checked);			// will also take care of checking the correct button
  	number->setMin (0);
***************
*** 80,85 ****
  	vbox->addWidget (group);
  	connect (group, SIGNAL (clicked (int)), this, SLOT (buttonClicked (int)));
- 
- 	updating = false;
  }
  
--- 81,84 ----

Index: rkcheckbox.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkcheckbox.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** rkcheckbox.h	26 Mar 2005 10:32:17 -0000	1.5
--- rkcheckbox.h	17 Mar 2006 13:27:18 -0000	1.6
***************
*** 3,7 ****
                               -------------------
      begin                : Fri Jul 30 2004
!     copyright            : (C) 2004 by Thomas Friedrichsmeier
      email                : tfry at users.sourceforge.net
   ***************************************************************************/
--- 3,7 ----
                               -------------------
      begin                : Fri Jul 30 2004
!     copyright            : (C) 2004, 2006 by Thomas Friedrichsmeier
      email                : tfry at users.sourceforge.net
   ***************************************************************************/
***************
*** 18,61 ****
  #define RKCHECKBOX_H
  
! #include <rkpluginwidget.h>
  
  #include <qstring.h>
  
- #define CHECKBOX_WIDGET 51 // comme le pastis
- 
- 
  class QCheckBox;
! 
  
  /**
! This RKPluginWidget provides a checkbox
  
  @author Thomas Friedrichsmeier
  */
! class RKCheckBox : public RKPluginWidget  {
  	Q_OBJECT
  public: 
! 	RKCheckBox (const QDomElement &element, QWidget *parent, RKPlugin *plugin);
  	~RKCheckBox ();
! 	int type() {return CHECKBOX_WIDGET ; };
! //  bool isOk ;
! 	void setEnabled(bool);
  public slots:
  	void changedState (int);
! 	void slotActive();
! 	void slotActive(bool);
! 
!   
  private:
  	QCheckBox *checkbox;
- 	QString value_if_checked;
- 	QString value_if_unchecked;
- 	QString depend;
- protected:
- /** Returns the value of the currently selected option. */
- 	QString value (const QString &modifier);
- 
- signals: // Signals
- 	void clicked();
  };
  
--- 18,47 ----
  #define RKCHECKBOX_H
  
! #include "rkcomponent.h"
  
+ #include "rkcomponentproperties.h"
  #include <qstring.h>
  
  class QCheckBox;
! class QDomElement;
  
  /**
! This RKComponent provides a checkbox
  
  @author Thomas Friedrichsmeier
  */
! class RKCheckBox : public RKComponent  {
  	Q_OBJECT
  public: 
! 	RKCheckBox (const QDomElement &element, RKComponent *parent_component, QWidget *parent_widget);
  	~RKCheckBox ();
! 	int type () { return ComponentCheckBox; };
! 	RKComponentPropertyBool *state;
  public slots:
  	void changedState (int);
! 	void changedState (RKComponentPropertyBase *);
  private:
+ 	bool updating;		// prevent recursion
  	QCheckBox *checkbox;
  };
  

Index: rkcomponent.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkcomponent.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** rkcomponent.cpp	15 Mar 2006 20:31:28 -0000	1.6
--- rkcomponent.cpp	17 Mar 2006 13:27:18 -0000	1.7
***************
*** 63,66 ****
--- 63,72 ----
  }
  
+ bool RKComponentBase::isSatisfied () {
+ 	RK_TRACE (PLUGIN);
+ 	if (!required) return true;
+ 	if (isValid ()) return true;
+ 	return false;		// never happens in RKComponentBase, but might in subclasses
+ }
  
  //############### RKComponent ########################
***************
*** 85,89 ****
  }
  
- /** generally the valueChanged () signal of all RKComponentPropertys directly owned by this component should be connected to this (Qt-)slot, so the component can update itself accordingly. Default implementation handles changes in visibilty, enabledness and requiredness properties. If you reimplement this, you will most likely still want to call the default implementation to handle these. */
  void RKComponent::propertyValueChanged (RKComponentPropertyBase *property) {
  	RK_TRACE (PLUGIN);
--- 91,94 ----
***************
*** 94,107 ****
  		setEnabled (enabledness_property->boolValue ());
  	} else if (property == requiredness_property) {
! 		checkSatisfied ();
  	}
  }
  
! void RKComponent::checkSatisfied (bool silent) {
! 	// TODO!
! 
! }
! 
! bool RKComponent::isSatisfied () {
  	RK_TRACE (PLUGIN);
  
--- 99,107 ----
  		setEnabled (enabledness_property->boolValue ());
  	} else if (property == requiredness_property) {
! 		changed ();
  	}
  }
  
! bool RKComponent::isValid () {
  	RK_TRACE (PLUGIN);
  
***************
*** 126,139 ****
--- 126,153 ----
  
  void RKComponent::setVisible (bool visible) {
+ 	RK_TRACE (PLUGIN);
+ 
  	visibilityProperty ()->setBoolValue (visible);
  }
  
  void RKComponent::setEnabled (bool enabled) {
+ 	RK_TRACE (PLUGIN);
+ 
  	enablednessProperty ()->setBoolValue (enabled);
  }
  
  void RKComponent::setRequired (bool required) {
+ 	RK_TRACE (PLUGIN);
+ 
  	requirednessProperty ()->setBoolValue (required);
  }
  
+ void RKComponent::changed () {
+ 	RK_TRACE (PLUGIN);
+ 
+ 	if (parentComponent ()) {
+ 		parentComponent ()->changed ();
+ 	}
+ }
+ 
  #include "rkcomponent.moc"

Index: Makefile.am
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/Makefile.am,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Makefile.am	17 Mar 2006 00:02:27 -0000	1.10
--- Makefile.am	17 Mar 2006 13:27:18 -0000	1.11
***************
*** 3,14 ****
  noinst_LIBRARIES =  libplugin.a
  libplugin_a_SOURCES = rkcomponentmap.cpp rkcomponentproperties.cpp rkcomponent.cpp \
! 	rkstandardcomponent.cpp rkvarselector.cpp rkvarslot.cpp rkformula.cpp rkradio.cpp
! # rkcheckbox.cpp rkplugin.cpp \
  #	rkpluginhandle.cpp rkpluginspinbox.cpp rkpluginwidget.cpp rktext.cpp \
  #	 rkinput.cpp rknote.cpp \
  #	rkpluginbrowser.cpp 
  noinst_HEADERS = rkcomponentmap.h rkcomponentproperties.h rkcomponent.h \
! 	rkstandardcomponent.h rkvarselector.h rkvarslot.h rkformula.h rkradio.h
! # rkcheckbox.h rkplugin.h rkpluginhandle.h \
  #	rkpluginspinbox.h rkpluginwidget.h rktext.h  \
  #	rkpluginbrowser.h rkinput.h rknote.h 
--- 3,16 ----
  noinst_LIBRARIES =  libplugin.a
  libplugin_a_SOURCES = rkcomponentmap.cpp rkcomponentproperties.cpp rkcomponent.cpp \
! 	rkstandardcomponent.cpp rkvarselector.cpp rkvarslot.cpp rkformula.cpp rkradio.cpp \
! 	rkcheckbox.cpp
! # rkplugin.cpp \
  #	rkpluginhandle.cpp rkpluginspinbox.cpp rkpluginwidget.cpp rktext.cpp \
  #	 rkinput.cpp rknote.cpp \
  #	rkpluginbrowser.cpp 
  noinst_HEADERS = rkcomponentmap.h rkcomponentproperties.h rkcomponent.h \
! 	rkstandardcomponent.h rkvarselector.h rkvarslot.h rkformula.h rkradio.h \
! 	rkcheckbox.h
! # rkplugin.h rkpluginhandle.h \
  #	rkpluginspinbox.h rkpluginwidget.h rktext.h  \
  #	rkpluginbrowser.h rkinput.h rknote.h 

Index: rkstandardcomponent.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkstandardcomponent.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** rkstandardcomponent.cpp	17 Mar 2006 00:02:27 -0000	1.9
--- rkstandardcomponent.cpp	17 Mar 2006 13:27:18 -0000	1.10
***************
*** 55,60 ****
  #include "rkformula.h"
  #include "rkradio.h"
- /*#include "rktext.h"
  #include "rkcheckbox.h"
  #include "rkpluginspinbox.h"
  #include "rknote.h"
--- 55,60 ----
  #include "rkformula.h"
  #include "rkradio.h"
  #include "rkcheckbox.h"
+ /*#include "rktext.h"
  #include "rkpluginspinbox.h"
  #include "rknote.h"
***************
*** 205,220 ****
  		} else if (e.tagName () == "radio") {
  			widget = new RKRadio (e, component (), parent_widget);
! /*		} else if (e.tagName () == "checkbox") {
! 			widget = new RKCheckBox (e, parent_component, parent_widget);
! 		} else if (e.tagName () == "spinbox") {
! 			widget = new RKPluginSpinBox (e, parent_component, parent_widget);
  //		} else if (e.tagName () == "note") {		//TODO: remove corresponding class
  //			widget = new RKNote (e, parent_widget, this);
  		} else if (e.tagName () == "browser") {
! 			widget = new RKPluginBrowser (e, parent_component, parent_widget);
  		} else if (e.tagName () == "input") {
! 			widget = new RKInput (e, parent_component, parent_widget);
  		} else if (e.tagName () == "text") {
! 			widget = new RKText (e, parent_component, parent_widget); */
  		} else {
  			xml->displayError (&e, QString ("Invalid tagname '%1'").arg (e.tagName ()), DL_ERROR);
--- 205,220 ----
  		} else if (e.tagName () == "radio") {
  			widget = new RKRadio (e, component (), parent_widget);
! 		} else if (e.tagName () == "checkbox") {
! 			widget = new RKCheckBox (e, component (), parent_widget);
! /*		} else if (e.tagName () == "spinbox") {
! 			widget = new RKPluginSpinBox (e, component (), parent_widget);
  //		} else if (e.tagName () == "note") {		//TODO: remove corresponding class
  //			widget = new RKNote (e, parent_widget, this);
  		} else if (e.tagName () == "browser") {
! 			widget = new RKPluginBrowser (e, component (), parent_widget);
  		} else if (e.tagName () == "input") {
! 			widget = new RKInput (e, component (), parent_widget);
  		} else if (e.tagName () == "text") {
! 			widget = new RKText (e, component (), parent_widget); */
  		} else {
  			xml->displayError (&e, QString ("Invalid tagname '%1'").arg (e.tagName ()), DL_ERROR);

Index: rkcomponentproperties.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkcomponentproperties.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** rkcomponentproperties.cpp	17 Mar 2006 00:02:27 -0000	1.12
--- rkcomponentproperties.cpp	17 Mar 2006 13:27:18 -0000	1.13
***************
*** 109,119 ****
  }
  
- bool RKComponentPropertyBase::isSatisfied () {
- 	RK_TRACE (PLUGIN);
- 	if (!required) return true;
- 	if (isValid ()) return true;
- 	return false;		// never happens in RKComponentPropertyBase, but might in subclasses
- }
- 
  void RKComponentPropertyBase::warnModifierNotRecognized (const QString &modifier) {
  	RK_TRACE (PLUGIN);
--- 109,112 ----
***************
*** 257,261 ****
  	if (default_value < lower) {
  		RK_DO (qDebug ("default value in integer property is lower than lower boundary"), PLUGIN, DL_DEBUG);	// actually this is ok. In this case the default is simply "invalid"
- 		default_value = lower;
  	}
  	if (current_value < lower) {
--- 250,253 ----
***************
*** 270,274 ****
  	if (default_value > upper) {
  		RK_DO (qDebug ("default value in integer property is larger than upper boundary"), PLUGIN, DL_DEBUG);	// see above
- 		default_value = upper;
  	}
  	if (current_value > upper) {
--- 262,265 ----
***************
*** 422,427 ****
  	validator->setBottom (lower);
  	if (default_value < lower) {
! 		RK_DO (qDebug ("default value in double property is lower than lower boundary"), PLUGIN, DL_WARNING);
! 		default_value = lower;
  	}
  	if (current_value < lower) {
--- 413,417 ----
  	validator->setBottom (lower);
  	if (default_value < lower) {
! 		RK_DO (qDebug ("default value in double property is lower than lower boundary"), PLUGIN, DL_DEBUG);	// actually this is ok. In this case the default is simply "invalid"
  	}
  	if (current_value < lower) {
***************
*** 435,440 ****
  	validator->setTop (upper);
  	if (default_value > upper) {
! 		RK_DO (qDebug ("default value in double property is larger than upper boundary"), PLUGIN, DL_WARNING);
! 		default_value = upper;
  	}
  	if (current_value > upper) {
--- 425,429 ----
  	validator->setTop (upper);
  	if (default_value > upper) {
! 		RK_DO (qDebug ("default value in double property is larger than upper boundary"), PLUGIN, DL_DEBUG);	// see above
  	}
  	if (current_value > upper) {

Index: rkcomponentproperties.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkcomponentproperties.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** rkcomponentproperties.h	15 Mar 2006 20:31:28 -0000	1.13
--- rkcomponentproperties.h	17 Mar 2006 13:27:18 -0000	1.14
***************
*** 45,53 ****
  	virtual bool isStringValid (const QString &) { return true; };
  /** current setting valid? */
! 	virtual bool isValid () { return is_valid; };
! /** set to required: will only be satisfied if it holds a valid value. Else: satisfied if valid *or empty* */
! 	void setRequired (bool require)  { required = require; };
! /** see setRequired () */
! 	bool isSatisfied ();
  /** for RTTI. see RKComponentBase::RKComponentTypes */
  	int type () { return PropertyBase; };
--- 45,49 ----
  	virtual bool isStringValid (const QString &) { return true; };
  /** current setting valid? */
! 	bool isValid () { return is_valid; };
  /** for RTTI. see RKComponentBase::RKComponentTypes */
  	int type () { return PropertyBase; };
***************
*** 65,69 ****
  protected:
  	void warnModifierNotRecognized (const QString &modifier);
- 	bool required;
  	bool is_valid;
  	QString _value;
--- 61,64 ----

Index: rkcheckbox.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkcheckbox.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** rkcheckbox.cpp	2 Oct 2005 17:19:02 -0000	1.7
--- rkcheckbox.cpp	17 Mar 2006 13:27:18 -0000	1.8
***************
*** 3,7 ****
                               -------------------
      begin                : Fri Jul 30 2004
!     copyright            : (C) 2004 by Thomas Friedrichsmeier
      email                : tfry at users.sourceforge.net
   ***************************************************************************/
--- 3,7 ----
                               -------------------
      begin                : Fri Jul 30 2004
!     copyright            : (C) 2004, 2006 by Thomas Friedrichsmeier
      email                : tfry at users.sourceforge.net
   ***************************************************************************/
***************
*** 17,46 ****
  #include "rkcheckbox.h"
  
- #include <qdom.h>
  #include <qlayout.h>
  #include <qcheckbox.h>
  
- #include "rkplugin.h"
  #include "../rkglobals.h"
  #include "../debug.h"
  
! RKCheckBox::RKCheckBox (const QDomElement &element, QWidget *parent, RKPlugin *plugin) : RKPluginWidget (element, parent, plugin) {
  	RK_TRACE (PLUGIN);
  
!   QVBoxLayout *vbox = new QVBoxLayout (this, RKGlobals::spacingHint ());
! 	checkbox = new QCheckBox (element.attribute ("label"), this);
! 	vbox->addWidget (checkbox);
!   isOk =false;
! 	value_if_checked = element.attribute ("value", "1");
! 	value_if_unchecked = element.attribute ("value_unchecked", QString::null);
! 	depend = element.attribute ("depend", QString::null);
! 	
! 	if (element.attribute ("checked") == "true") {
! 		checkbox->setChecked (true);
!     isOk =true ;
! 	}
  
  	connect (checkbox, SIGNAL (stateChanged (int)), this, SLOT (changedState (int)));
!   connect(checkbox,SIGNAL(clicked()),  SIGNAL(clicked()) );
  }
  
--- 17,46 ----
  #include "rkcheckbox.h"
  
  #include <qlayout.h>
  #include <qcheckbox.h>
  
  #include "../rkglobals.h"
+ #include "../misc/xmlhelper.h"
  #include "../debug.h"
  
! RKCheckBox::RKCheckBox (const QDomElement &element, RKComponent *parent_component, QWidget *parent_widget) : RKComponent (parent_component, parent_widget) {
  	RK_TRACE (PLUGIN);
  
! 	// get xml-helper
! 	XMLHelper *xml = XMLHelper::getStaticHelper ();
! 
! 	// create and add property
! 	addChild ("state", state = new RKComponentPropertyBool (this, true, xml->getStringAttribute (element, "value", "1", DL_WARNING), xml->getStringAttribute (element, "value_unchecked", QString::null, DL_INFO), xml->getBoolAttribute (element, "checked", false, DL_INFO)));
! 	connect (state, SIGNAL (valueChanged (RKComponentPropertyBase *)), this, SLOT (changedState (RKComponentPropertyBase *)));
  
+ 	// create checkbox
+ 	QVBoxLayout *vbox = new QVBoxLayout (this, RKGlobals::spacingHint ());
+ 	checkbox = new QCheckBox (xml->getStringAttribute (element, "label", QString::null, DL_WARNING), this);
+ 	vbox->addWidget (checkbox);
  	connect (checkbox, SIGNAL (stateChanged (int)), this, SLOT (changedState (int)));
! 
! 	// initialize
! 	updating = false;
! 	changedState (0);
  }
  
***************
*** 49,84 ****
  }
  
! 
! void RKCheckBox::setEnabled(bool checked){
  	RK_TRACE (PLUGIN);
-   checkbox->setEnabled(checked);
-   }
-   
  
! QString RKCheckBox::value (const QString &) {
! 	RK_TRACE (PLUGIN);
! 	if (checkbox->isChecked ()) {
! 		return value_if_checked;
! 	} else {
! 		return value_if_unchecked;
! 	}
  }
  
- 
  void RKCheckBox::changedState (int) {
  	RK_TRACE (PLUGIN);
- 	emit (changed ());
- }
- 
- void RKCheckBox::slotActive(bool isOk){
- 	RK_TRACE (PLUGIN);
- checkbox->setEnabled(isOk) ;
- }
  
! 
! void RKCheckBox::slotActive(){
! 	RK_TRACE (PLUGIN);
! bool isOk = checkbox->isEnabled();
! checkbox->setEnabled(! isOk) ;
  }
  
--- 49,65 ----
  }
  
! void RKCheckBox::changedState (RKComponentPropertyBase *) {
  	RK_TRACE (PLUGIN);
  
! 	if (updating) return;
! 	updating = true;
! 	checkbox->setChecked (state->boolValue ());
! 	updating = false;
  }
  
  void RKCheckBox::changedState (int) {
  	RK_TRACE (PLUGIN);
  
! 	state->setBoolValue (checkbox->isChecked ());
  }
  





More information about the rkward-tracker mailing list