[rkward-cvs] rkward/rkward/plugin rkcheckbox.h,1.6,1.7 rkcomponent.cpp,1.8,1.9 rkcomponent.h,1.9,1.10 rkcomponentproperties.cpp,1.14,1.15 rkcomponentproperties.h,1.15,1.16 rkformula.h,1.7,1.8 rkinput.h,1.2,1.3 rkpluginbrowser.h,1.2,1.3 rkpluginspinbox.cpp,1.10,1.11 rkradio.cpp,1.10,1.11 rkradio.h,1.5,1.6 rkstandardcomponent.cpp,1.14,1.15 rkstandardcomponent.h,1.6,1.7 rktext.h,1.4,1.5 rkvarslot.cpp,1.19,1.20 rkvarslot.h,1.10,1.11
Thomas Friedrichsmeier
tfry at users.sourceforge.net
Sun Mar 19 16:41:28 UTC 2006
Update of /cvsroot/rkward/rkward/rkward/plugin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7193/rkward/plugin
Modified Files:
rkcheckbox.h rkcomponent.cpp rkcomponent.h
rkcomponentproperties.cpp rkcomponentproperties.h rkformula.h
rkinput.h rkpluginbrowser.h rkpluginspinbox.cpp rkradio.cpp
rkradio.h rkstandardcomponent.cpp rkstandardcomponent.h
rktext.h rkvarslot.cpp rkvarslot.h
Log Message:
RKStandardComponent code generation/display works
Index: rkcomponent.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkcomponent.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** rkcomponent.h 17 Mar 2006 15:18:38 -0000 1.9
--- rkcomponent.h 19 Mar 2006 16:41:26 -0000 1.10
***************
*** 56,64 ****
/** tries to locate a component (or property) described by identifier as a child (of any generation) of this RKComponentBase. If found, a pointer to this is returned. Also, the modifier parameter is set to hold any remaining modifier contained in the identifier.
@param identifier The identifier string to look for (including a potential modifier suffix).
! @param modifier If a non null pointer to QString is given, this will be set to the value of the remaining modifier (only if successful)
! @returns a pointer to the RKComponentBase, if found, or 0, if no such RKComponentBase exists as a child of this RKComponentBase. */
! virtual RKComponentBase* lookupComponent (const QString &identifier, QString *modifier);
/** Locate the component.subcomponent.property.value described by identifier and return its value as a string. Especially useful as a callback in code templates! Recursively walks subcomponents/properties until the requested value is found. @See RKComponentBase::lookupComponent */
QString fetchStringValue (const QString &identifier);
/** returns true, if this is a property */
bool isProperty () { return (type () <= PropertyEnd); };
--- 56,66 ----
/** tries to locate a component (or property) described by identifier as a child (of any generation) of this RKComponentBase. If found, a pointer to this is returned. Also, the modifier parameter is set to hold any remaining modifier contained in the identifier.
@param identifier The identifier string to look for (including a potential modifier suffix).
! @param remainder If a non null pointer to QString is given, this will be set to the value of the remaining modifier
! @returns a pointer to the RKComponentBase, if found, or the nearest parent that could be looked up */
! virtual RKComponentBase* lookupComponent (const QString &identifier, QString *remainder);
/** Locate the component.subcomponent.property.value described by identifier and return its value as a string. Especially useful as a callback in code templates! Recursively walks subcomponents/properties until the requested value is found. @See RKComponentBase::lookupComponent */
QString fetchStringValue (const QString &identifier);
+ /** returns the "value" of this component or property as a string. Properties generally return their value, components typically return the value of their "most important" property. Default implementation returns QString::null, and writes a debug message */
+ virtual QString value (const QString &modifier=QString::null);
/** returns true, if this is a property */
bool isProperty () { return (type () <= PropertyEnd); };
Index: rkcomponent.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkcomponent.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** rkcomponent.cpp 17 Mar 2006 15:18:38 -0000 1.8
--- rkcomponent.cpp 19 Mar 2006 16:41:26 -0000 1.9
***************
*** 22,26 ****
//############### RKComponentBase #####################
! RKComponentBase* RKComponentBase::lookupComponent (const QString &identifier, QString *modifier) {
RK_TRACE (PLUGIN);
--- 22,26 ----
//############### RKComponentBase #####################
! RKComponentBase* RKComponentBase::lookupComponent (const QString &identifier, QString *remainder) {
RK_TRACE (PLUGIN);
***************
*** 30,43 ****
RKComponentBase *child = child_map.find (identifier.section ("::", 0, 0));
if (!child) { // if we do not have such a child, return 0 unless this is a property
! if (isProperty ()) {
! if (modifier) {
! *modifier = identifier.section ("::", 1);
! }
! return this;
! }
! RK_DO (qDebug ("Failed component lookup"), PLUGIN, DL_WARNING);
! return 0;
} else { // else do recursive lookup
! return child->lookupComponent (identifier.section ("::", 1), modifier);
}
}
--- 30,37 ----
RKComponentBase *child = child_map.find (identifier.section ("::", 0, 0));
if (!child) { // if we do not have such a child, return 0 unless this is a property
! if (remainder) *remainder = identifier.section ("::", 1);
! return this;
} else { // else do recursive lookup
! return child->lookupComponent (identifier.section ("::", 1), remainder);
}
}
***************
*** 55,64 ****
RKComponentBase *prop = lookupComponent (identifier, &mod);
! if (prop && (prop->isProperty ())) {
! return (static_cast<RKComponentPropertyBase *> (prop)->value (mod));
! } else {
! RK_DO (qDebug ("Failed lookup or not a property: '%s'", identifier.latin1 ()), PLUGIN, DL_WARNING);
! return QString::null;
! }
}
--- 49,60 ----
RKComponentBase *prop = lookupComponent (identifier, &mod);
! return prop->value (mod);
! }
!
! QString RKComponentBase::value (const QString &modifier) {
! RK_TRACE (PLUGIN);
!
! RK_DO (qDebug ("Component type %d does not have a value. Remaining modifier is: '%s'", type (), modifier.latin1 ()), PLUGIN, DL_WARNING);
! return QString::null;
}
Index: rkradio.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkradio.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** rkradio.cpp 17 Mar 2006 16:46:25 -0000 1.10
--- rkradio.cpp 19 Mar 2006 16:41:26 -0000 1.11
***************
*** 81,84 ****
--- 81,87 ----
vbox->addWidget (group);
connect (group, SIGNAL (clicked (int)), this, SLOT (buttonClicked (int)));
+
+ // initialize
+ buttonClicked (group->selectedId ());
}
Index: rkpluginbrowser.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkpluginbrowser.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** rkpluginbrowser.h 17 Mar 2006 16:46:25 -0000 1.2
--- rkpluginbrowser.h 19 Mar 2006 16:41:26 -0000 1.3
***************
*** 41,44 ****
--- 41,45 ----
RKComponentPropertyBase *selection;
+ QString value (const QString &modifier) { return (selection->value (modifier)); };
public slots:
void textChanged ();
Index: rkvarslot.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkvarslot.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** rkvarslot.cpp 17 Mar 2006 17:27:25 -0000 1.19
--- rkvarslot.cpp 19 Mar 2006 16:41:26 -0000 1.20
***************
*** 77,81 ****
// make it look like a line-edit
list->header ()->hide ();
! list->setFixedHeight (20); // TODO: use true height of one line instead of constant!
list->setColumnWidthMode (0, QListView::Manual);
list->setColumnWidth (0, 0);
--- 77,81 ----
// make it look like a line-edit
list->header ()->hide ();
! list->setFixedHeight (list->fontMetrics ().height () + 2*list->itemMargin () + 4); // the height of a single line including margins
list->setColumnWidthMode (0, QListView::Manual);
list->setColumnWidth (0, 0);
Index: rktext.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rktext.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** rktext.h 17 Mar 2006 17:27:24 -0000 1.4
--- rktext.h 19 Mar 2006 16:41:26 -0000 1.5
***************
*** 37,40 ****
--- 37,41 ----
RKComponentPropertyBase *text;
+ QString value (const QString &modifier) { return (text->value (modifier)); };
public slots:
void textChanged (RKComponentPropertyBase *);
Index: rkstandardcomponent.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkstandardcomponent.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** rkstandardcomponent.h 15 Mar 2006 20:31:28 -0000 1.6
--- rkstandardcomponent.h 19 Mar 2006 16:41:26 -0000 1.7
***************
*** 38,51 ****
/** destructor */
~RKStandardComponent ();
! /** try to destruct the plugin */
! void tryDestruct ();
public slots:
void switchInterfaces ();
-
-
/** this gets called by the script-backend, when it's done. Might enable the
submit button or destruct the plugin. */
! // void backendIdle ();
! // void backendCommandDone (int flags);
/** return result of given call (string vector) to the R-backend */
// void getRVector (const QString &call);
--- 38,50 ----
/** destructor */
~RKStandardComponent ();
! /** reimplemented to update code on changes*/
! void changed ();
! /** reimplemented to return true only when the backend is idle*/
! bool isReady ();
public slots:
void switchInterfaces ();
/** this gets called by the script-backend, when it's done. Might enable the
submit button or destruct the plugin. */
! void backendIdle ();
/** return result of given call (string vector) to the R-backend */
// void getRVector (const QString &call);
***************
*** 53,57 ****
// void doRCall (const QString &call);
/** get a value for the backend */
! // void getValue (const QString &id);
private:
/** The property holding the generated code. TODO: maybe, de facto, this property should be controlled (but not owned) by the scriptbackend. This way, we'd need less twisted logic inside this class. */
--- 52,56 ----
// void doRCall (const QString &call);
/** get a value for the backend */
! void getValue (const QString &id);
private:
/** The property holding the generated code. TODO: maybe, de facto, this property should be controlled (but not owned) by the scriptbackend. This way, we'd need less twisted logic inside this class. */
***************
*** 64,67 ****
--- 63,67 ----
still busy cleaning stuff up. In that case this var is set and the plugin gets destroyed ASAP. */
bool destroyed;
+ bool created;
};
***************
*** 70,73 ****
--- 70,74 ----
class RKCommandEditor;
class QPushButton;
+ class QTimer;
/** contains the standard GUI elements for a top-level RKStandardComponent
***************
*** 76,83 ****
Q_OBJECT
public:
! RKStandardComponentGUI (RKStandardComponent *component);
~RKStandardComponentGUI ();
QWidget *mainWidget () { return main_widget; };
public slots:
void ok ();
--- 77,87 ----
Q_OBJECT
public:
! RKStandardComponentGUI (RKStandardComponent *component, RKComponentPropertyCode *code_property);
~RKStandardComponentGUI ();
QWidget *mainWidget () { return main_widget; };
+
+ void enableSubmit (bool enable);
+ void updateCode ();
public slots:
void ok ();
***************
*** 86,91 ****
--- 90,99 ----
void toggleCode ();
void help ();
+ void codeChanged (RKComponentPropertyBase *);
+ void updateCodeNow ();
private:
QWidget *main_widget;
+ RKComponentPropertyCode *code_property;
+ QTimer *code_update_timer;
// standard gui-elements
Index: rkcheckbox.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkcheckbox.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** rkcheckbox.h 17 Mar 2006 13:27:18 -0000 1.6
--- rkcheckbox.h 19 Mar 2006 16:41:26 -0000 1.7
***************
*** 38,41 ****
--- 38,42 ----
int type () { return ComponentCheckBox; };
RKComponentPropertyBool *state;
+ QString value (const QString &modifier) { return (state->value (modifier)); };
public slots:
void changedState (int);
Index: rkinput.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkinput.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** rkinput.h 17 Mar 2006 16:46:25 -0000 1.2
--- rkinput.h 19 Mar 2006 16:41:26 -0000 1.3
***************
*** 39,42 ****
--- 39,43 ----
RKComponentPropertyBase *text;
+ QString value (const QString &modifier) { return (text->value (modifier)); };
public slots:
void textChanged ();
Index: rkpluginspinbox.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkpluginspinbox.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** rkpluginspinbox.cpp 17 Mar 2006 16:46:25 -0000 1.10
--- rkpluginspinbox.cpp 19 Mar 2006 16:41:26 -0000 1.11
***************
*** 128,130 ****
--- 128,140 ----
}
+ QString RKPluginSpinBox::value (const QString &modifier) {
+ RK_TRACE (PLUGIN);
+
+ if (intmode) {
+ return intvalue->value (modifier);
+ } else {
+ return realvalue->value (modifier);
+ }
+ }
+
#include "rkpluginspinbox.moc"
Index: rkstandardcomponent.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkstandardcomponent.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** rkstandardcomponent.cpp 17 Mar 2006 17:28:37 -0000 1.14
--- rkstandardcomponent.cpp 19 Mar 2006 16:41:26 -0000 1.15
***************
*** 34,38 ****
//#include <qwidgetstack.h>
#include <qlabel.h>
! //#include <qtimer.h>
#include <qapplication.h>
--- 34,38 ----
//#include <qwidgetstack.h>
#include <qlabel.h>
! #include <qtimer.h>
#include <qapplication.h>
***************
*** 72,75 ****
--- 72,77 ----
backend = 0;
gui = 0;
+ created = false;
+ addChild ("code", code = new RKComponentPropertyCode (this, true));
// open the main description file for parsing
***************
*** 88,92 ****
QString dummy = QFileInfo (filename).dirPath () + "/" + xml->getStringAttribute (element, "file", "code.php", DL_WARNING);
backend = new PHPBackend ();
- connect (backend, SIGNAL (commandDone (int)), this, SLOT (backendCommandDone (int)));
connect (backend, SIGNAL (idle ()), this, SLOT (backendIdle ()));
connect (backend, SIGNAL (requestValue (const QString&)), this, SLOT (getValue (const QString&)));
--- 90,93 ----
***************
*** 94,98 ****
// connect (backend, SIGNAL (requestRVector (const QString&)), this, SLOT (getRVector (const QString&)));
connect (backend, SIGNAL (haveError ()), this, SLOT (tryDestruct ()));
! if (!backend->initialize (dummy)) return;
connect (qApp, SIGNAL (aboutToQuit ()), this, SLOT (tryDestruct ()));
--- 95,99 ----
// connect (backend, SIGNAL (requestRVector (const QString&)), this, SLOT (getRVector (const QString&)));
connect (backend, SIGNAL (haveError ()), this, SLOT (tryDestruct ()));
! if (!backend->initialize (dummy, code)) return;
connect (qApp, SIGNAL (aboutToQuit ()), this, SLOT (tryDestruct ()));
***************
*** 104,108 ****
// if top-level, construct standard elements
if (!parent_widget) {
! gui = new RKStandardComponentGUI (this);
parent_widget = gui->mainWidget ();
}
--- 105,109 ----
// if top-level, construct standard elements
if (!parent_widget) {
! gui = new RKStandardComponentGUI (this, code);
parent_widget = gui->mainWidget ();
}
***************
*** 120,124 ****
--- 121,127 ----
// done!
delete builder;
+ created = true;
if (gui) gui->show ();
+ changed ();
}
***************
*** 130,146 ****
}
! void RKStandardComponent::tryDestruct () {
RK_TRACE (PLUGIN);
if (gui) {
! gui->hide ();
}
- destroyed = true;
! // TODO!
}
! void RKStandardComponent::switchInterfaces () {
RK_TRACE (PLUGIN);
}
--- 133,179 ----
}
! void RKStandardComponent::switchInterfaces () {
! RK_TRACE (PLUGIN);
! }
!
! void RKStandardComponent::changed () {
RK_TRACE (PLUGIN);
+ if (!created) return;
+
+ backend->preprocess (0);
+ backend->calculate (0);
+ backend->printout (0);
+ backend->cleanup (0);
+
if (gui) {
! gui->updateCode ();
! gui->enableSubmit (isSatisfied ());
}
! RKComponent::changed ();
}
! bool RKStandardComponent::isReady () {
! RK_TRACE (PLUGIN);
! RK_ASSERT (backend);
!
! return (!(backend->isBusy ()));
! };
!
! void RKStandardComponent::backendIdle () {
! RK_TRACE (PLUGIN);
!
! if (gui) {
! gui->updateCode ();
! gui->enableSubmit (isSatisfied ());
! }
! }
!
! void RKStandardComponent::getValue (const QString &id) {
RK_TRACE (PLUGIN);
+ RK_ASSERT (backend);
+
+ backend->writeData (fetchStringValue (id));
}
***************
*** 265,272 ****
/////////////////////////////////////// RKStandardComponentGUI ////////////////////////////////////////////////
! RKStandardComponentGUI::RKStandardComponentGUI (RKStandardComponent *component) {
RK_TRACE (PLUGIN);
RKStandardComponentGUI::component = component;
QGridLayout *main_grid = new QGridLayout (this, 1, 1);
--- 298,307 ----
/////////////////////////////////////// RKStandardComponentGUI ////////////////////////////////////////////////
! RKStandardComponentGUI::RKStandardComponentGUI (RKStandardComponent *component, RKComponentPropertyCode *code_property) {
RK_TRACE (PLUGIN);
RKStandardComponentGUI::component = component;
+ RKStandardComponentGUI::code_property = code_property;
+ connect (code_property, SIGNAL (valueChanged (RKComponentPropertyBase *)), this, SLOT (codeChanged (RKComponentPropertyBase *)));
QGridLayout *main_grid = new QGridLayout (this, 1, 1);
***************
*** 323,326 ****
--- 358,365 ----
codeDisplay = new RKCommandEditor (lower_widget, true);
vbox->addWidget (codeDisplay);
+
+ // code update timer
+ code_update_timer = new QTimer (this);
+ connect (code_update_timer, SIGNAL (timeout ()), this, SLOT (updateCodeNow ()));
}
***************
*** 353,359 ****
e->accept ();
! component->tryDestruct ();
}
--- 392,427 ----
e->accept ();
! hide ();
! component->deleteLater ();
! }
!
! void RKStandardComponentGUI::enableSubmit (bool enable) {
! RK_TRACE (PLUGIN);
!
! okButton->setEnabled (enable);
}
+ void RKStandardComponentGUI::codeChanged (RKComponentPropertyBase *) {
+ RK_TRACE (PLUGIN);
+
+ updateCode ();
+ }
+
+ void RKStandardComponentGUI::updateCode () {
+ RK_TRACE (PLUGIN);
+
+ code_update_timer->start (0, true);
+ }
+
+ void RKStandardComponentGUI::updateCodeNow () {
+ RK_TRACE (PLUGIN);
+
+ if (!code_property->isValid ()) {
+ codeDisplay->setText (i18n ("Processing. Please wait"));
+ RK_DO (qDebug ("code not ready to be displayed: pre %d, cal %d, pri %d, cle %d", !code_property->preprocess ().isNull (), !code_property->calculate ().isNull (), !code_property->printout ().isNull (), !code_property->cleanup ().isNull ()), PLUGIN, DL_DEBUG);
+ } else {
+ codeDisplay->setText (code_property->preprocess () + code_property->calculate () + code_property->printout () + code_property->cleanup ());
+ }
+ }
Index: rkformula.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkformula.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** rkformula.h 17 Mar 2006 00:02:27 -0000 1.7
--- rkformula.h 19 Mar 2006 16:41:26 -0000 1.8
***************
*** 41,44 ****
--- 41,49 ----
~RKFormula ();
+ QString value (const QString &modifier) { return model->value (modifier); };
+ bool isSatisfied ();
+
+ /** RTTI */
+ int type () { return ComponentFormula; };
public slots:
void typeChange (int id);
***************
*** 91,99 ****
of interactions generated is stored in count */
Interaction *makeInteractions (int level, const RObjectPtr *source_vars, int source_count, int *count);
-
- bool isSatisfied ();
-
- /** RTTI */
- int type () { return ComponentFormula; };
};
--- 96,99 ----
Index: rkcomponentproperties.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkcomponentproperties.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** rkcomponentproperties.cpp 17 Mar 2006 15:18:38 -0000 1.14
--- rkcomponentproperties.cpp 19 Mar 2006 16:41:26 -0000 1.15
***************
*** 955,959 ****
RK_TRACE (PLUGIN);
! reset ();
}
--- 955,959 ----
RK_TRACE (PLUGIN);
! preprocess_code = calculate_code = printout_code = cleanup_code = QString::null;
}
***************
*** 962,971 ****
}
- void RKComponentPropertyCode::reset () {
- RK_TRACE (PLUGIN);
-
- preprocess_code = calculate_code = printout_code = cleanup_code = QString::null;
- have_preprocess = have_calculate = have_printout = have_cleanup = false;
- }
-
#include "rkcomponentproperties.moc"
--- 962,964 ----
Index: rkvarslot.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkvarslot.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** rkvarslot.h 15 Mar 2006 20:31:28 -0000 1.10
--- rkvarslot.h 19 Mar 2006 16:41:26 -0000 1.11
***************
*** 42,45 ****
--- 42,46 ----
~RKVarSlot ();
int type () {return ComponentVarSlot; };
+ QString value (const QString &modifier) { return (available->value (modifier)); };
public slots:
/** Called when the select-button is pressed */
Index: rkcomponentproperties.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkcomponentproperties.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** rkcomponentproperties.h 17 Mar 2006 15:18:38 -0000 1.15
--- rkcomponentproperties.h 19 Mar 2006 16:41:26 -0000 1.16
***************
*** 37,42 ****
/** destructor */
virtual ~RKComponentPropertyBase ();
! /** supplies the current value. Since more than one value may be supplied, modifier can be used to select a value. Default implementation only has a single string, however. */
! virtual QString value (const QString &modifier=QString::null);
/** set the value in string form.
@returns false if the value is illegal (in the base class, all strings are legal) */
--- 37,42 ----
/** destructor */
virtual ~RKComponentPropertyBase ();
! /** supplies the current value. Since more than one value may be supplied, modifier can be used to select a value. Default implementation only has a single string, however. Reimplemented from RKComponentBase */
! QString value (const QString &modifier=QString::null);
/** set the value in string form.
@returns false if the value is illegal (in the base class, all strings are legal) */
***************
*** 314,326 ****
QString value () { return (preprocess () + calculate () + printout () + cleanup ()); };
! void setPreprocess (const QString &code) { preprocess_code = code; };
! void setCalculate (const QString &code) { calculate_code = code; };
! void setPrintout (const QString &code) { printout_code = code; };
! void setCleanup (const QString &code) { cleanup_code = code; };
!
! /** Sets all code to null strings and satisfied to false */
! void reset ();
! bool isValid () { return (have_preprocess && have_calculate && have_printout && have_cleanup); };
/** RTTI */
--- 314,328 ----
QString value () { return (preprocess () + calculate () + printout () + cleanup ()); };
! /** set the preprocess code.
! @param code The code to set. If this is QString::null, the property is seen to lack preprocess code and hence is not valid (see isValid ()). In contrast, empty strings are seen as valid */
! void setPreprocess (const QString &code) { preprocess_code = code; emit (valueChanged (this)); };
! /** see setPreprocess () */
! void setCalculate (const QString &code) { calculate_code = code; emit (valueChanged (this)); };
! /** see setPreprocess () */
! void setPrintout (const QString &code) { printout_code = code; emit (valueChanged (this)); };
! /** see setPreprocess () */
! void setCleanup (const QString &code) { cleanup_code = code; emit (valueChanged (this)); };
! bool isValid () { return (!(preprocess_code.isNull () || calculate_code.isNull () || printout_code.isNull () || cleanup_code.isNull ())); };
/** RTTI */
***************
*** 331,339 ****
QString printout_code;
QString cleanup_code;
-
- bool have_preprocess;
- bool have_calculate;
- bool have_printout;
- bool have_cleanup;
};
--- 333,336 ----
Index: rkradio.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkradio.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** rkradio.h 17 Mar 2006 00:02:27 -0000 1.5
--- rkradio.h 19 Mar 2006 16:41:26 -0000 1.6
***************
*** 42,45 ****
--- 42,46 ----
@returns the id (0, 1, 2...) of the corresponding option, or -1 if not found */
int findOption (const QString &option_string);
+ QString value (const QString &modifier) { return (string->value (modifier)); };
public slots:
void buttonClicked (int id);
More information about the rkward-tracker
mailing list