00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #include <qseditor.h>
00038 #include <stdlib.h>
00039
00040 void eActionButton::Action_toggled( bool o )
00041 {
00042 Script->setChecked( !o );
00043
00044 }
00045
00046
00047 void eActionButton::Script_toggled( bool o )
00048 {
00049 Action->setChecked( !o );
00050 }
00051
00052 void eActionButton::setData( wActionButton *b )
00053 {
00054 if ( !b ) return;
00055 if ( b->isAction() ) Action->setChecked( TRUE );
00056 if ( b->isActionUpdate() ) cbUpdate->setChecked( TRUE );
00057 if ( b->isActionTurnOn() ) cbTurnon->setChecked( TRUE );
00058 if ( b->isActionClose() ) cbClose->setChecked( TRUE );
00059 if ( b->isScript() ) Script->setChecked( TRUE );
00060
00061
00062
00063 aWidget *wd = aWidget::parentContainer( b );
00064 if ( !strcmp(wd->name(),"Catalogue") )
00065 {
00066 cbTurnon->setChecked( false );
00067 cbTurnon->setHidden( TRUE );
00068
00069
00070 }
00071 aCfg *md = wd->getMd();
00072 QStringList l_name;
00073 aCfgItem parent = md->find(mdc_actions);
00074 l_id.clear();
00075 loadActions(&l_name, &l_id, parent, md);
00076 cbAction->clear();
00077 cbAction->insertStringList(l_name);
00078 cbAction->setCurrentItem( l_id.findIndex( QString("%1").arg(b->getActionId()) ) );
00079
00080 }
00081
00082
00083 void eActionButton::getData( wActionButton *button)
00084 {
00085 if ( !button ) return;
00086 button->setAction( Action->isChecked() );
00087 button->setActionUpdate( cbUpdate->isChecked() );
00088 button->setActionTurnOn( cbTurnon->isChecked() );
00089 button->setActionClose( cbClose->isChecked() );
00090 button->setScript( Script->isChecked() );
00091 button->setActionUpdate( cbUpdate->isChecked() );
00092 if(cbAction->isEnabled())
00093 {
00094
00095 button->setActionId ( atoi(l_id[cbAction->currentItem()].ascii()));
00096 }
00097 else
00098 {
00099 button->setActionId(0);
00100 }
00101
00102 }
00103
00104 void eActionButton::destroy()
00105 {
00106
00107 }
00108
00109
00110 void
00111 eActionButton::loadActions( QStringList *lst, QStringList *id, aCfgItem p, aCfg *md )
00112 {
00113 aCfgItem cobj;
00114 QString oclass;
00115 if(p.isNull())
00116 {
00117 p = md->find(mdc_actions);
00118
00119 }
00120
00121 if(p.isNull()) return;
00122 cobj = md->firstChild ( p );
00123 while ( !cobj.isNull() )
00124 {
00125 oclass = md->objClass ( cobj );
00126 if ( oclass == md_actiongroup )
00127 loadActions ( lst, id, cobj, md );
00128 if ( oclass == md_action )
00129 {
00130 lst->append(md->attr(cobj,mda_name));
00131 id->append(md->attr(cobj,mda_id));
00132 }
00133 cobj = md->nextSibling ( cobj );
00134 }
00135 }