diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-27 23:37:00 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-27 23:37:00 +0000 |
commit | b0e912c8b3d02a518fedda28c3180eb4794a7520 (patch) | |
tree | 07d344862562fab58cbe2df39d13d16f2e4d2bea /src/k9mencodercmdgen.cpp | |
parent | 4d695ec81fe4d4335ee82c7a9346ad9c9e144ecc (diff) | |
download | k9copy-b0e912c8b3d02a518fedda28c3180eb4794a7520.tar.gz k9copy-b0e912c8b3d02a518fedda28c3180eb4794a7520.zip |
TQt4 convert k9copy
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k9copy@1233843 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/k9mencodercmdgen.cpp')
-rw-r--r-- | src/k9mencodercmdgen.cpp | 350 |
1 files changed, 175 insertions, 175 deletions
diff --git a/src/k9mencodercmdgen.cpp b/src/k9mencodercmdgen.cpp index 2681b82..6af03af 100644 --- a/src/k9mencodercmdgen.cpp +++ b/src/k9mencodercmdgen.cpp @@ -12,45 +12,45 @@ #include "k9mencodercmdgen.h" -#include <qscrollview.h> -#include <qtabwidget.h> -#include <qfile.h> -#include <qdom.h> -#include <qlabel.h> +#include <tqscrollview.h> +#include <tqtabwidget.h> +#include <tqfile.h> +#include <tqdom.h> +#include <tqlabel.h> #include <knuminput.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qframe.h> -#include <qwidgetstack.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqframe.h> +#include <tqwidgetstack.h> #include <klocale.h> -#include <qheader.h> -#include <qlayout.h> -#include <qvbox.h> -#include <qtooltip.h> -#include <qwhatsthis.h> +#include <tqheader.h> +#include <tqlayout.h> +#include <tqvbox.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> #include <kstandarddirs.h> #include <kapplication.h> -class _k9CheckListItem: public QCheckListItem { +class _k9CheckListItem: public TQCheckListItem { public: - _k9CheckListItem(QListViewItem *_item):QCheckListItem(_item,"",QCheckListItem::CheckBox) {}; - QString root; - QDomDocument doc; + _k9CheckListItem(TQListViewItem *_item):TQCheckListItem(_item,"",TQCheckListItem::CheckBox) {}; + TQString root; + TQDomDocument doc; int page; - QFrame *frame; + TQFrame *frame; int rtti () const {return 1001;} protected: void stateChange(bool _state); }; void _k9CheckListItem::stateChange(bool _state) { - QDomElement eRoot=doc.documentElement().elementsByTagName(root).item(0).toElement(); - QDomElement eCodec=eRoot.elementsByTagName(text()).item(0).toElement(); + TQDomElement eRoot=doc.documentElement().elementsByTagName(root).item(0).toElement(); + TQDomElement eCodec=eRoot.elementsByTagName(text()).item(0).toElement(); eCodec.setAttribute("selected",_state?"true":"false"); } -k9MencoderCmdGen::k9MencoderCmdGen(QWidget* parent, const QString &_cmd, bool modal, WFlags fl) -: MyDialog1(parent,"", modal,fl) +k9MencoderCmdGen::k9MencoderCmdGen(TQWidget* tqparent, const TQString &_cmd, bool modal, WFlags fl) +: MyDialog1(tqparent,"", modal,fl) { setCaption(kapp->makeStdCaption(i18n("MEncoder options"))); m_row=0; m_page=1; @@ -63,34 +63,34 @@ k9MencoderCmdGen::k9MencoderCmdGen(QWidget* parent, const QString &_cmd, bool mo void k9MencoderCmdGen::fillListView() { listView->clear(); listView->header()->hide(); - QListViewItem *item=new QListViewItem(listView); + TQListViewItem *item=new TQListViewItem(listView); item->setOpen(true); item->setText(0,i18n("Audio Codec")); - QDomElement root=m_doc.documentElement().elementsByTagName("AUDIO").item(0).toElement(); + TQDomElement root=m_doc.documentElement().elementsByTagName("AUDIO").item(0).toElement(); for (int i=0; i< root.childNodes().count();i++) { - QDomElement eChild=root.childNodes().item(i).toElement(); + TQDomElement eChild=root.childNodes().item(i).toElement(); _k9CheckListItem *child=new _k9CheckListItem(item); child->setText(0,eChild.nodeName()); child->root="AUDIO"; child->doc=m_doc; - QDomAttr attr=eChild.attributeNode("selected"); + TQDomAttr attr=eChild.attributeNode("selected"); if (!attr.isNull()) child->setOn(attr.value()=="true"); addWidgets(child, "AUDIO",eChild.nodeName()); } - item=new QListViewItem(listView); + item=new TQListViewItem(listView); item->setText(0,i18n("Video Codec")); item->setOpen(true); root=m_doc.documentElement().elementsByTagName("VIDEO").item(0).toElement(); for (int i=0; i< root.childNodes().count();i++) { - QDomElement eChild=root.childNodes().item(i).toElement(); + TQDomElement eChild=root.childNodes().item(i).toElement(); _k9CheckListItem *child=new _k9CheckListItem(item); child->setText(0,eChild.nodeName()); child->root="VIDEO"; child->doc=m_doc; - QDomAttr attr=eChild.attributeNode("selected"); + TQDomAttr attr=eChild.attributeNode("selected"); if (!attr.isNull()) child->setOn(attr.value()=="true"); @@ -99,17 +99,17 @@ void k9MencoderCmdGen::fillListView() { } - item=new QListViewItem(listView); + item=new TQListViewItem(listView); item->setText(0,i18n("Filters")); item->setOpen(true); root=m_doc.documentElement().elementsByTagName("FILTERS").item(0).toElement(); for (int i=0; i< root.childNodes().count();i++) { - QDomElement eChild=root.childNodes().item(i).toElement(); + TQDomElement eChild=root.childNodes().item(i).toElement(); _k9CheckListItem *child=new _k9CheckListItem(item); child->setText(0,eChild.nodeName()); child->root="FILTERS"; child->doc=m_doc; - QDomAttr attr=eChild.attributeNode("selected"); + TQDomAttr attr=eChild.attributeNode("selected"); if (!attr.isNull()) child->setOn(attr.value()=="true"); @@ -124,8 +124,8 @@ k9MencoderCmdGen::~k9MencoderCmdGen() /*$SPECIALIZATION$*/ -void k9MencoderCmdGen::listViewCurrentChanged(QListViewItem *_item) { - if (_item->parent() == NULL) +void k9MencoderCmdGen::listViewCurrentChanged(TQListViewItem *_item) { + if (_item->tqparent() == NULL) wsOptions->raiseWidget(0); else if (_item->rtti()==1001) { _k9CheckListItem *item=(_k9CheckListItem*) _item; @@ -136,7 +136,7 @@ void k9MencoderCmdGen::listViewCurrentChanged(QListViewItem *_item) { } void k9MencoderCmdGen::loadXml() { - QFile file(KGlobal::dirs()->findResource( "data", "k9copy/mencoder.xml")); + TQFile file(KGlobal::dirs()->findResource( "data", "k9copy/mencoder.xml")); if ( !file.open( IO_ReadOnly ) ) return; if ( !m_doc.setContent( &file ) ) { @@ -148,39 +148,39 @@ void k9MencoderCmdGen::loadXml() { } -void k9MencoderCmdGen::addWidgets(_k9CheckListItem *_listItem,QString _root,QString _cat) { +void k9MencoderCmdGen::addWidgets(_k9CheckListItem *_listItem,TQString _root,TQString _cat) { m_cpt=0; - QVBox *vbox=new QVBox(wsOptions); + TQVBox *vbox=new TQVBox(wsOptions); wsOptions->addWidget(vbox,m_page); _listItem->page=m_page; m_page++; - QFrame *fr=new QFrame(vbox); + TQFrame *fr=new TQFrame(vbox); _listItem->frame=fr; - QGridLayout *m_grid1=new QGridLayout(fr,1,1,0,0); - m_scrollView=new QScrollView(fr,0); + TQGridLayout *m_grid1=new TQGridLayout(fr,1,1,0,0); + m_scrollView=new TQScrollView(fr,0); m_scrollView->viewport()->setPaletteBackgroundColor(this->paletteBackgroundColor()); - m_scrollView->setVScrollBarMode(QScrollView::AlwaysOn); + m_scrollView->setVScrollBarMode(TQScrollView::AlwaysOn); m_grid1->addWidget(m_scrollView,0,0); - m_grid=new QGrid(2,m_scrollView->viewport()); + m_grid=new TQGrid(2,m_scrollView->viewport()); m_grid->setSpacing(2); m_scrollView->addChild(m_grid); //finds the VIDEO node - QDomElement eVideo=m_doc.documentElement().elementsByTagName(_root).item(0).toElement(); + TQDomElement eVideo=m_doc.documentElement().elementsByTagName(_root).item(0).toElement(); //gets the codec list - QDomNodeList lCodecs=eVideo.elementsByTagName(_cat); + TQDomNodeList lCodecs=eVideo.elementsByTagName(_cat); for (int i=0; i<lCodecs.count();i++) { - QDomElement eCodec=lCodecs.item(i).toElement(); + TQDomElement eCodec=lCodecs.item(i).toElement(); //gets codec options - QDomNodeList lOptions=eCodec.elementsByTagName("opt"); + TQDomNodeList lOptions=eCodec.elementsByTagName("opt"); for (int j=0;j<lOptions.count();j++) { - QDomElement eOpt=lOptions.item(j).toElement(); - QDomAttr aType=eOpt.attributeNode("type"); + TQDomElement eOpt=lOptions.item(j).toElement(); + TQDomAttr aType=eOpt.attributeNode("type"); if (aType.value() == "int") addInt(eOpt); else if(aType.value()=="float") @@ -195,30 +195,30 @@ void k9MencoderCmdGen::addWidgets(_k9CheckListItem *_listItem,QString _root,QStr } } -void k9MencoderCmdGen::addList(QDomElement _eOpt) { - QString sName=_eOpt.attributeNode("name").value(); +void k9MencoderCmdGen::addList(TQDomElement _eOpt) { + TQString sName=_eOpt.attributeNode("name").value(); bool bSel=false; - QDomAttr aSel=_eOpt.attributeNode("selected"); + TQDomAttr aSel=_eOpt.attributeNode("selected"); if (!aSel.isNull()) bSel=aSel.value()=="true"; - QCheckBox *ckLabel=new QCheckBox(sName,m_grid,QString("ck%1").arg(m_row++) ); + TQCheckBox *ckLabel=new TQCheckBox(sName,m_grid,TQString("ck%1").tqarg(m_row++) ); ckLabel->setChecked(bSel); - m_hbox=new QGrid(2,m_grid); - m_hbox->setFrameShape(QFrame::StyledPanel); - m_hbox->setFrameShadow(QFrame::Raised); + m_hbox=new TQGrid(2,m_grid); + m_hbox->setFrameShape(TQFrame::StyledPanel); + m_hbox->setFrameShadow(TQFrame::Raised); if ( !_eOpt.attributeNode("description").isNull()) { - QToolTip::add(ckLabel,_eOpt.attributeNode("description").value()); - QWhatsThis::add(ckLabel,_eOpt.attributeNode("description").value()); + TQToolTip::add(ckLabel,_eOpt.attributeNode("description").value()); + TQWhatsThis::add(ckLabel,_eOpt.attributeNode("description").value()); } - QDomNodeList lOption=_eOpt.elementsByTagName("subopt"); + TQDomNodeList lOption=_eOpt.elementsByTagName("subopt"); for (int i=0; i<lOption.count();i++) { - QDomElement eSubOpt=lOption.item(i).toElement(); - QDomAttr aType=eSubOpt.attributeNode("type"); + TQDomElement eSubOpt=lOption.item(i).toElement(); + TQDomAttr aType=eSubOpt.attributeNode("type"); if (aType.value() == "int") addInt(eSubOpt); else if(aType.value()=="float") @@ -234,8 +234,8 @@ void k9MencoderCmdGen::addList(QDomElement _eOpt) { } -void k9MencoderCmdGen::addInt(QDomElement _eOpt) { - QString sName=_eOpt.attributeNode("name").value(); +void k9MencoderCmdGen::addInt(TQDomElement _eOpt) { + TQString sName=_eOpt.attributeNode("name").value(); bool blist=false; if (_eOpt.nodeName()=="subopt") blist=true; @@ -244,29 +244,29 @@ void k9MencoderCmdGen::addInt(QDomElement _eOpt) { int iMax=_eOpt.attributeNode("max").value().toInt(); int iDefault=_eOpt.attributeNode("default").value().toInt(); - QWidget *parent; + TQWidget *tqparent; if (!blist) { - parent=m_grid; + tqparent=m_grid; } else - parent=m_hbox; + tqparent=m_hbox; bool bSel=false; - QDomAttr aSel=_eOpt.attributeNode("selected"); + TQDomAttr aSel=_eOpt.attributeNode("selected"); if (!aSel.isNull()) bSel=aSel.value()=="true"; - QCheckBox *ckLabel=new QCheckBox(sName,parent,QString("ck%1").arg(m_row++) ); + TQCheckBox *ckLabel=new TQCheckBox(sName,tqparent,TQString("ck%1").tqarg(m_row++) ); ckLabel->setChecked(bSel); - ckLabel->setBackgroundColor(parent->backgroundColor()); + ckLabel->setBackgroundColor(tqparent->backgroundColor()); if ( !_eOpt.attributeNode("description").isNull()) { - QToolTip::add(ckLabel,_eOpt.attributeNode("description").value()); - QWhatsThis::add(ckLabel,_eOpt.attributeNode("description").value()); + TQToolTip::add(ckLabel,_eOpt.attributeNode("description").value()); + TQWhatsThis::add(ckLabel,_eOpt.attributeNode("description").value()); } _eOpt.setAttribute("checkbox",ckLabel->name()); - KIntSpinBox *sb= new KIntSpinBox(iMin,iMax,1,iDefault,10,parent,QString("int%1").arg(m_row++)); + KIntSpinBox *sb= new KIntSpinBox(iMin,iMax,1,iDefault,10,tqparent,TQString("int%1").tqarg(m_row++)); if (iMax <1000) sb->setFixedWidth(50); else @@ -282,8 +282,8 @@ void k9MencoderCmdGen::addInt(QDomElement _eOpt) { //m_grid->addWidget(label,m_row++,0); } -void k9MencoderCmdGen::addFloat(QDomElement _eOpt) { - QString sName=_eOpt.attributeNode("name").value(); +void k9MencoderCmdGen::addFloat(TQDomElement _eOpt) { + TQString sName=_eOpt.attributeNode("name").value(); double dMin=_eOpt.attributeNode("min").value().toDouble(); double dMax=_eOpt.attributeNode("max").value().toDouble(); double dDefault=_eOpt.attributeNode("default").value().toDouble(); @@ -292,20 +292,20 @@ void k9MencoderCmdGen::addFloat(QDomElement _eOpt) { if (_eOpt.nodeName()=="subopt") blist=true; - QWidget *parent; + TQWidget *tqparent; if (!blist) { - parent=m_grid; + tqparent=m_grid; } else - parent=m_hbox; - QDomAttr aSel=_eOpt.attributeNode("selected"); + tqparent=m_hbox; + TQDomAttr aSel=_eOpt.attributeNode("selected"); if (!aSel.isNull()) bSel=aSel.value()=="true"; - QCheckBox *ckLabel=new QCheckBox(sName,parent,QString("ck%1").arg(m_row++)); + TQCheckBox *ckLabel=new TQCheckBox(sName,tqparent,TQString("ck%1").tqarg(m_row++)); ckLabel->setChecked(bSel); if ( !_eOpt.attributeNode("description").isNull()) { - QToolTip::add(ckLabel,_eOpt.attributeNode("description").value()); - QWhatsThis::add(ckLabel,_eOpt.attributeNode("description").value()); + TQToolTip::add(ckLabel,_eOpt.attributeNode("description").value()); + TQWhatsThis::add(ckLabel,_eOpt.attributeNode("description").value()); } _eOpt.setAttribute("checkbox",ckLabel->name()); @@ -317,7 +317,7 @@ void k9MencoderCmdGen::addFloat(QDomElement _eOpt) { if (!_eOpt.attributeNode("precision").isNull()) { iPrecision=_eOpt.attributeNode("precision").value().toInt(); } - KDoubleSpinBox *sb= new KDoubleSpinBox(dMin,dMax,dStep,dDefault,iPrecision,parent,QString("float%1").arg(m_row++)); + KDoubleSpinBox *sb= new KDoubleSpinBox(dMin,dMax,dStep,dDefault,iPrecision,tqparent,TQString("float%1").tqarg(m_row++)); if (dMax <1000) sb->setFixedWidth(80); else @@ -329,30 +329,30 @@ void k9MencoderCmdGen::addFloat(QDomElement _eOpt) { _eOpt.setAttribute("widget",sb->name()); } -void k9MencoderCmdGen::addBool(QDomElement _eOpt) { - QString sName=_eOpt.attributeNode("name").value(); +void k9MencoderCmdGen::addBool(TQDomElement _eOpt) { + TQString sName=_eOpt.attributeNode("name").value(); bool blist=false; if (_eOpt.nodeName()=="subopt") blist=true; bool bSel=false; - QWidget *parent; + TQWidget *tqparent; if (!blist) { - parent = m_grid; + tqparent = m_grid; } else - parent = m_hbox; + tqparent = m_hbox; - QDomAttr aSel=_eOpt.attributeNode("selected"); + TQDomAttr aSel=_eOpt.attributeNode("selected"); if (!aSel.isNull()) bSel=aSel.value()=="true"; - QCheckBox *ckLabel=new QCheckBox(sName,parent,QString("ck%1").arg(m_row++)); + TQCheckBox *ckLabel=new TQCheckBox(sName,tqparent,TQString("ck%1").tqarg(m_row++)); if ( !_eOpt.attributeNode("description").isNull()) { - QToolTip::add(ckLabel,_eOpt.attributeNode("description").value()); - QWhatsThis::add(ckLabel,_eOpt.attributeNode("description").value()); + TQToolTip::add(ckLabel,_eOpt.attributeNode("description").value()); + TQWhatsThis::add(ckLabel,_eOpt.attributeNode("description").value()); } - QWidget *w=new QWidget(parent); + TQWidget *w=new TQWidget(tqparent); if ((_eOpt.attributeNode("default").value()=="true") && bSel) ckLabel->setChecked(true); @@ -361,42 +361,42 @@ void k9MencoderCmdGen::addBool(QDomElement _eOpt) { } -void k9MencoderCmdGen::addString(QDomElement _eOpt) { - QString sName=_eOpt.attributeNode("name").value(); +void k9MencoderCmdGen::addString(TQDomElement _eOpt) { + TQString sName=_eOpt.attributeNode("name").value(); bool blist=false; if (_eOpt.nodeName()=="subopt") blist=true; - QString sDefault=_eOpt.attributeNode("default").value(); - QWidget *parent; + TQString sDefault=_eOpt.attributeNode("default").value(); + TQWidget *tqparent; if( !blist) { - parent=m_grid; + tqparent=m_grid; } else - parent=m_hbox; + tqparent=m_hbox; bool bSel=false; - QDomAttr aSel=_eOpt.attributeNode("selected"); + TQDomAttr aSel=_eOpt.attributeNode("selected"); if (!aSel.isNull()) bSel=aSel.value()=="true"; - QCheckBox *ckLabel=new QCheckBox(sName,parent,QString("ck%1").arg(m_row++)); + TQCheckBox *ckLabel=new TQCheckBox(sName,tqparent,TQString("ck%1").tqarg(m_row++)); ckLabel->setChecked(bSel); if ( !_eOpt.attributeNode("description").isNull()) { - QToolTip::add(ckLabel,_eOpt.attributeNode("description").value()); - QWhatsThis::add(ckLabel,_eOpt.attributeNode("description").value()); + TQToolTip::add(ckLabel,_eOpt.attributeNode("description").value()); + TQWhatsThis::add(ckLabel,_eOpt.attributeNode("description").value()); } _eOpt.setAttribute("checkbox",ckLabel->name()); - QComboBox *cb=new QComboBox(parent,QString("string%1").arg(m_row++)); + TQComboBox *cb=new TQComboBox(tqparent,TQString("string%1").tqarg(m_row++)); - QDomNodeList values=_eOpt.elementsByTagName("value"); + TQDomNodeList values=_eOpt.elementsByTagName("value"); int def=0; if (values.count()==0) { cb->setEditable(true); cb->setCurrentText(sDefault); } else { for (int i=0;i<values.count();i++) { - QDomElement e=values.item(i).toElement(); + TQDomElement e=values.item(i).toElement(); cb->insertItem(e.attributeNode("name").value()); if (e.attributeNode("name").value() ==sDefault) def=cb->count()-1; @@ -407,44 +407,44 @@ void k9MencoderCmdGen::addString(QDomElement _eOpt) { } -const QString & k9MencoderCmdGen::getCmd(const QString &_root) { - /* QString str; - QTextStream ts(&str,IO_WriteOnly); +const TQString & k9MencoderCmdGen::getCmd(const TQString &_root) { + /* TQString str; + TQTextStream ts(&str,IO_WriteOnly); m_doc.save(ts,4); - QFile f ("/home/jmp/doc.xml"); + TQFile f ("/home/jmp/doc.xml"); f.open(IO_WriteOnly); f.writeBlock(str.latin1(),str.length()); f.close(); */ m_cmd=""; - QString m_sepOpt=":"; - QString m_sepValues=","; + TQString m_sepOpt=":"; + TQString m_sepValues=","; //finds the VIDEO node - QDomElement eRoot=m_doc.documentElement().elementsByTagName(_root).item(0).toElement(); + TQDomElement eRoot=m_doc.documentElement().elementsByTagName(_root).item(0).toElement(); //gets the codec list - QDomNodeList lCodecs=eRoot.childNodes(); + TQDomNodeList lCodecs=eRoot.childNodes(); for (int i=0; i<lCodecs.count();i++) { - QString sCmd="",sCmd1=""; - QDomElement eCodec=lCodecs.item(i).toElement(); - QDomAttr eSep=eCodec.attributeNode("separator"); + TQString sCmd="",sCmd1=""; + TQDomElement eCodec=lCodecs.item(i).toElement(); + TQDomAttr eSep=eCodec.attributeNode("separator"); if (!eSep.isNull()) m_sepOpt=eSep.value(); - QDomAttr eAttr=eCodec.attributeNode("selected"); + TQDomAttr eAttr=eCodec.attributeNode("selected"); if (eAttr.isNull()) continue; if (eAttr.value()=="false") continue; //gets codec options - QDomNodeList lOptions=eCodec.elementsByTagName("opt"); + TQDomNodeList lOptions=eCodec.elementsByTagName("opt"); for (int j=0;j<lOptions.count();j++) { - QDomElement eOpt=lOptions.item(j).toElement(); - QDomAttr aType=eOpt.attributeNode("type"); - QDomAttr aCheckBox=eOpt.attributeNode("checkbox"); - QDomAttr aWidget=eOpt.attributeNode("widget"); - QCheckBox *ck=(QCheckBox*)this->child(aCheckBox.value().latin1()); + TQDomElement eOpt=lOptions.item(j).toElement(); + TQDomAttr aType=eOpt.attributeNode("type"); + TQDomAttr aCheckBox=eOpt.attributeNode("checkbox"); + TQDomAttr aWidget=eOpt.attributeNode("widget"); + TQCheckBox *ck=(TQCheckBox*)this->child(aCheckBox.value().latin1()); if (ck->isChecked()) { if (sCmd1.isEmpty()){ if (eCodec.attributeNode("options").isNull()) @@ -458,17 +458,17 @@ const QString & k9MencoderCmdGen::getCmd(const QString &_root) { eSep=eOpt.attributeNode("separator"); if (!eSep.isNull()) m_sepValues=eSep.value(); - QDomNodeList lSubOpt=eOpt.elementsByTagName("subopt"); - QString sCmd2=""; - QString sTmp=""; + TQDomNodeList lSubOpt=eOpt.elementsByTagName("subopt"); + TQString sCmd2=""; + TQString sTmp=""; for (int k=0;k<lSubOpt.count();k++) { - QDomElement eSOpt=lSubOpt.item(k).toElement(); - QDomAttr aSType=eSOpt.attributeNode("type"); - QDomAttr aSWidget=eSOpt.attributeNode("widget"); - QString sPrefix=""; + TQDomElement eSOpt=lSubOpt.item(k).toElement(); + TQDomAttr aSType=eSOpt.attributeNode("type"); + TQDomAttr aSWidget=eSOpt.attributeNode("widget"); + TQString sPrefix=""; if (!eSOpt.attributeNode("prefix").isNull()) sPrefix=eSOpt.attributeNode("prefix").value(); - QCheckBox *Sck=(QCheckBox*)this->child(eSOpt.attributeNode("checkbox").value().latin1()); + TQCheckBox *Sck=(TQCheckBox*)this->child(eSOpt.attributeNode("checkbox").value().latin1()); if(aSType.value()=="int" && Sck->isChecked()) { KIntSpinBox *isb=(KIntSpinBox*) this->child(aSWidget.value().latin1(),"KIntSpinBox"); if (!sCmd2.isEmpty()) @@ -479,10 +479,10 @@ const QString & k9MencoderCmdGen::getCmd(const QString &_root) { KDoubleSpinBox *isb=(KDoubleSpinBox*) this->child(aSWidget.value().latin1(),"KDoubleSpinBox"); if (!sCmd2.isEmpty()) sCmd2 +=m_sepValues; - sCmd2+=sTmp+sPrefix+isb->text().replace(",",".").stripWhiteSpace(); + sCmd2+=sTmp+sPrefix+isb->text().tqreplace(",",".").stripWhiteSpace(); sTmp=""; } else if(aSType.value()=="string" && Sck->isChecked()) { - QComboBox *cb=(QComboBox*) this->child(aSWidget.value().latin1(),"QComboBox"); + TQComboBox *cb=(TQComboBox*) this->child(aSWidget.value().latin1(),TQCOMBOBOX_OBJECT_NAME_STRING); if (!sCmd2.isEmpty() ) sCmd2 +=m_sepValues; // sCmd2+= cb->text(cb->currentItem()); @@ -509,9 +509,9 @@ const QString & k9MencoderCmdGen::getCmd(const QString &_root) { KDoubleSpinBox *isb=(KDoubleSpinBox*) this->child(aWidget.value().latin1(),"KDoubleSpinBox"); if (!sCmd.isEmpty()) sCmd +=m_sepOpt; - sCmd+= eOpt.attributeNode("name").value() + "=" + isb->text().replace(",","."); + sCmd+= eOpt.attributeNode("name").value() + "=" + isb->text().tqreplace(",","."); } else if(aType.value()=="string") { - QComboBox *cb=(QComboBox*) this->child(aWidget.value().latin1(),"QComboBox"); + TQComboBox *cb=(TQComboBox*) this->child(aWidget.value().latin1(),TQCOMBOBOX_OBJECT_NAME_STRING); if (!sCmd.isEmpty()) sCmd +=m_sepOpt; sCmd+= eOpt.attributeNode("name").value() + "=" + cb->currentText(); @@ -529,14 +529,14 @@ const QString & k9MencoderCmdGen::getCmd(const QString &_root) { return m_cmd; } -bool k9MencoderCmdGen::getMencoderOptions(QString &_cmd) { +bool k9MencoderCmdGen::getMencoderOptions(TQString &_cmd) { k9MencoderCmdGen * m_cmdGen=new k9MencoderCmdGen(NULL,_cmd); m_cmdGen->m_cmd=_cmd; bool res=m_cmdGen->exec(); if (res) { - QString m_video=m_cmdGen->getCmd("VIDEO").stripWhiteSpace(); - QString m_audio=m_cmdGen->getCmd("AUDIO").stripWhiteSpace(); - QString m_filters=m_cmdGen->getCmd("FILTERS").stripWhiteSpace(); + TQString m_video=m_cmdGen->getCmd("VIDEO").stripWhiteSpace(); + TQString m_audio=m_cmdGen->getCmd("AUDIO").stripWhiteSpace(); + TQString m_filters=m_cmdGen->getCmd("FILTERS").stripWhiteSpace(); if (!m_video.isEmpty()) m_video="-ovc "+m_video; if (!m_audio.isEmpty()) @@ -547,11 +547,11 @@ bool k9MencoderCmdGen::getMencoderOptions(QString &_cmd) { return res; } -void k9MencoderCmdGen::parseCmd(const QString &_cmd){ - QString cmd(_cmd); - cmd=cmd.replace("\n"," ").simplifyWhiteSpace(); - QStringList cmdList=QStringList::split(" ",cmd); - for (QStringList::iterator it=cmdList.begin();it!=cmdList.end();++it) { +void k9MencoderCmdGen::parseCmd(const TQString &_cmd){ + TQString cmd(_cmd); + cmd=cmd.tqreplace("\n"," ").simplifyWhiteSpace(); + TQStringList cmdList=TQStringList::split(" ",cmd); + for (TQStringList::iterator it=cmdList.begin();it!=cmdList.end();++it) { if (*it=="-ovc") { ++it; selectCodec("VIDEO",*it); @@ -563,15 +563,15 @@ void k9MencoderCmdGen::parseCmd(const QString &_cmd){ selectCodec("FILTERS","vf"); else if (*it=="-af") selectCodec("FILTERS","af"); - QDomNodeList lRoot=m_doc.documentElement().childNodes(); + TQDomNodeList lRoot=m_doc.documentElement().childNodes(); bool bFound=false; - QString sCodec=*it; + TQString sCodec=*it; for (int i=0;i<lRoot.count();i++) { - QDomElement eRoot=lRoot.item(i).toElement(); - QDomNodeList lCodec=eRoot.childNodes(); + TQDomElement eRoot=lRoot.item(i).toElement(); + TQDomNodeList lCodec=eRoot.childNodes(); for (int j=0;j<lCodec.count();j++) { - QDomElement eCodec=lCodec.item(j).toElement(); - QString sOptName=""; + TQDomElement eCodec=lCodec.item(j).toElement(); + TQString sOptName=""; if (eCodec.attributeNode("options").isNull()) sOptName="-"+eCodec.nodeName(); else @@ -589,60 +589,60 @@ void k9MencoderCmdGen::parseCmd(const QString &_cmd){ } } -void k9MencoderCmdGen::parseCodecOptions(const QString &_root,const QString &_codec,const QString & _options) { +void k9MencoderCmdGen::parseCodecOptions(const TQString &_root,const TQString &_codec,const TQString & _options) { - QString m_sepOpt=":"; - QString m_sepValues=","; + TQString m_sepOpt=":"; + TQString m_sepValues=","; - QDomElement eRoot=m_doc.documentElement().elementsByTagName(_root).item(0).toElement(); - QDomElement eCodec=eRoot.elementsByTagName(_codec).item(0).toElement(); + TQDomElement eRoot=m_doc.documentElement().elementsByTagName(_root).item(0).toElement(); + TQDomElement eCodec=eRoot.elementsByTagName(_codec).item(0).toElement(); if (! eCodec.attributeNode("separator").isNull()) m_sepOpt=eCodec.attributeNode("separator").value(); - QStringList slOptions=QStringList::split(m_sepOpt,_options); - QDomNodeList lOpt=eCodec.elementsByTagName("opt"); + TQStringList slOptions=TQStringList::split(m_sepOpt,_options); + TQDomNodeList lOpt=eCodec.elementsByTagName("opt"); for (int i=0;i <lOpt.count();i++) { - QDomElement eOpt=lOpt.item(i).toElement(); - QString sName=eOpt.attributeNode("name").value(); + TQDomElement eOpt=lOpt.item(i).toElement(); + TQString sName=eOpt.attributeNode("name").value(); if (! eOpt.attributeNode("separator").isNull()) m_sepValues=eOpt.attributeNode("separator").value(); //extract the option (optname=value) - QStringList sl=slOptions.grep(sName,false); - QString sOpt=""; - for (QStringList::iterator it=slOptions.begin();it !=slOptions.end();++it) + TQStringList sl=slOptions.grep(sName,false); + TQString sOpt=""; + for (TQStringList::iterator it=slOptions.begin();it !=slOptions.end();++it) if (*it==sName || (*it).startsWith(sName+"=")) sOpt=*it; if (sOpt!="") { - //QString sOpt=*(sl.at(0)); - QString value; + //TQString sOpt=*(sl.at(0)); + TQString value; if (eOpt.attributeNode("type").isNull()) { //it's a list of values - QString sValues=sOpt.replace("="+m_sepValues,"= "+m_sepValues).replace(m_sepValues+m_sepValues,m_sepValues+" "+m_sepValues).replace(m_sepValues+m_sepValues,m_sepValues+" "+m_sepValues).section("=",1); - QStringList slValues=QStringList::split(m_sepValues,sValues); + TQString sValues=sOpt.tqreplace("="+m_sepValues,"= "+m_sepValues).tqreplace(m_sepValues+m_sepValues,m_sepValues+" "+m_sepValues).tqreplace(m_sepValues+m_sepValues,m_sepValues+" "+m_sepValues).section("=",1); + TQStringList slValues=TQStringList::split(m_sepValues,sValues); //loop on values nodes - QDomNodeList lSOpt=eOpt.elementsByTagName("subopt"); + TQDomNodeList lSOpt=eOpt.elementsByTagName("subopt"); for (int j=0;j<lSOpt.count();j++) { - QDomElement eSOpt=lSOpt.item(j).toElement(); + TQDomElement eSOpt=lSOpt.item(j).toElement(); //if (eSOpt.attributeNode("type").value()=="int") { if (eSOpt.attributeNode("prefix").isNull()) { if (j< slValues.count() && *(slValues.at(j)) !=" " ) { - QString sVal=*(slValues.at(j)); + TQString sVal=*(slValues.at(j)); if (eSOpt.attributeNode("type").value()=="bool") sVal="true"; eSOpt.setAttribute("default",sVal); eSOpt.setAttribute("selected","true"); } } else { - QString sPrefix=eSOpt.attributeNode("prefix").value(); + TQString sPrefix=eSOpt.attributeNode("prefix").value(); for (int k=0;k<slValues.count();k++) { - QString s=*(slValues.at(k)); + TQString s=*(slValues.at(k)); if (s.startsWith(sPrefix)) { - eSOpt.setAttribute("default",s.replace(sPrefix,"")); + eSOpt.setAttribute("default",s.tqreplace(sPrefix,"")); eSOpt.setAttribute("selected","true"); } } @@ -658,9 +658,9 @@ void k9MencoderCmdGen::parseCodecOptions(const QString &_root,const QString &_co } } -void k9MencoderCmdGen::selectCodec(const QString &_root,const QString &_codec) { - QDomElement root=m_doc.documentElement().elementsByTagName(_root).item(0).toElement(); - QDomElement codec=root.elementsByTagName(_codec).item(0).toElement(); +void k9MencoderCmdGen::selectCodec(const TQString &_root,const TQString &_codec) { + TQDomElement root=m_doc.documentElement().elementsByTagName(_root).item(0).toElement(); + TQDomElement codec=root.elementsByTagName(_codec).item(0).toElement(); if (!codec.isNull()) codec.setAttribute("selected","true"); } |