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 /k9author/k9menuedit.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 'k9author/k9menuedit.cpp')
-rw-r--r-- | k9author/k9menuedit.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/k9author/k9menuedit.cpp b/k9author/k9menuedit.cpp index 8ab0bc5..1cd5a81 100644 --- a/k9author/k9menuedit.cpp +++ b/k9author/k9menuedit.cpp @@ -16,37 +16,37 @@ #include "k9menu.h" #include "k9title.h" #include "k9newdvd.h" -#include <qwmatrix.h> -#include <qlayout.h> +#include <tqwmatrix.h> +#include <tqlayout.h> #include <kfontdialog.h> #include "k9menubutton.h" #include <kurlrequester.h> #include <kcolorbutton.h> -#include <qcombobox.h> +#include <tqcombobox.h> #include <klocale.h> -#include <qlabel.h> +#include <tqlabel.h> #include <kiconloader.h> -k9MenuEdit::k9MenuEdit(QWidget* parent, const char* name,QCanvas *_canvas) - : menuEdit(parent,name) { +k9MenuEdit::k9MenuEdit(TQWidget* tqparent, const char* name,TQCanvas *_canvas) + : menuEdit(tqparent,name) { bAddText->setPixmap (SmallIcon("add")); m_noUpdate=false; m_canvas=_canvas; m_format=PAL; m_imageHeight=576; - QGridLayout *grid=new QGridLayout(frame,1,1); + TQGridLayout *grid=new TQGridLayout(frame,1,1); m_menuEditor=new k9MenuEditor(*m_canvas,frame); grid->addWidget(m_menuEditor,0,0); m_canvas->resize(720,m_imageHeight); m_text=NULL; m_menuEditor->setMenu(this); - connect(m_menuEditor,SIGNAL(itemSelected()),this,SLOT(itemSelected())); + connect(m_menuEditor,TQT_SIGNAL(itemSelected()),this,TQT_SLOT(itemSelected())); cbPosTitle->setEnabled(false); } -void k9MenuEdit::updateTextPos(const QPoint &_point) { +void k9MenuEdit::updateTextPos(const TQPoint &_point) { emit updatePos(_point); } @@ -64,8 +64,8 @@ void k9MenuEdit::itemSelected() { urBackground->setEnabled(true); m_canvas->update(); } else if (m_menuEditor->getMoving()) { - if (m_menuEditor->getMoving()->rtti()==QCanvasItem::Rtti_Text) { - m_text=(QCanvasText*)m_menuEditor->getMoving(); + if (m_menuEditor->getMoving()->rtti()==TQCanvasItem::Rtti_Text) { + m_text=(TQCanvasText*)m_menuEditor->getMoving(); leTitle->setText(m_text->text()); cbColor->setColor(m_text->color()); cbPosTitle->setEnabled(false); @@ -90,17 +90,17 @@ k9MenuEdit::~k9MenuEdit() {} void k9MenuEdit::bFontClick() { if (m_menuEditor->getSelected()) { k9MenuButton *b=m_menuEditor->getSelected(); - QFont myFont(b->getFont()); + TQFont myFont(b->getFont()); int result = KFontDialog::getFont( myFont ); if ( result == KFontDialog::Accepted && m_menuEditor->getSelected() ) { - QPtrList <k9MenuButton> *l=m_menuEditor->getSelection(); + TQPtrList <k9MenuButton> *l=m_menuEditor->getSelection(); for (b=l->first();b;b=l->next()) { b->setFont(myFont); } } } else { if (m_text) { - QFont myFont(m_text->font()); + TQFont myFont(m_text->font()); int result = KFontDialog::getFont( myFont ); if ( result == KFontDialog::Accepted ) setFont(myFont); @@ -109,27 +109,27 @@ void k9MenuEdit::bFontClick() { } } -void k9MenuEdit::urBackgroundSelected(const QString &_fileName) { +void k9MenuEdit::urBackgroundSelected(const TQString &_fileName) { if ( m_menuEditor->getSelected() ) { //If a button is selected, set the button image ... k9MenuButton *b=(k9MenuButton*)m_menuEditor->getSelected(); - QImage img; + TQImage img; img.load(_fileName); b->setImage(img); } else { //...otherwise, set the menu background image - QImage img; + TQImage img; img.load(_fileName); - img=img.smoothScale(720,m_imageHeight,QImage::ScaleMax); + img=img.smoothScale(720,m_imageHeight,TQ_ScaleMax); setBackgroundImage(img); } } -void k9MenuEdit::cbColorChanged(const QColor &_color) { +void k9MenuEdit::cbColorChanged(const TQColor &_color) { if (m_noUpdate) return; if ( m_menuEditor->getSelected() ) { - QPtrList <k9MenuButton> *l=m_menuEditor->getSelection(); + TQPtrList <k9MenuButton> *l=m_menuEditor->getSelection(); for (k9MenuButton *b=l->first();b;b=l->next()) { b->setColor(_color); } @@ -144,27 +144,27 @@ void k9MenuEdit::cbPosTitleActivated(int _value) { if (m_noUpdate) return; if ( m_menuEditor->getSelected() ) { - QPtrList <k9MenuButton> *l=m_menuEditor->getSelection(); + TQPtrList <k9MenuButton> *l=m_menuEditor->getSelection(); for (k9MenuButton *b=l->first();b;b=l->next()) { b->setTextPosition((k9MenuButton::eTextPosition)(_value+1)); } } } -void k9MenuEdit::setBackgroundImage(const QImage &_image) { +void k9MenuEdit::setBackgroundImage(const TQImage &_image) { m_background=_image; - m_canvas->setBackgroundPixmap(QPixmap(_image)); + m_canvas->tqsetBackgroundPixmap(TQPixmap(_image)); emit backgroundImageChanged(_image); } -void k9MenuEdit::leTitleChanged(const QString &_value) { +void k9MenuEdit::leTitleChanged(const TQString &_value) { if (m_noUpdate) return; if ( m_menuEditor->getSelected() ) { - QPtrList <k9MenuButton> *l=m_menuEditor->getSelection(); + TQPtrList <k9MenuButton> *l=m_menuEditor->getSelection(); for (k9MenuButton *b=l->first();b;b=l->next()) { - QString c=_value; - b->setText(c.replace("%n",QString::number(b->getNum()))); + TQString c=_value; + b->setText(c.tqreplace("%n",TQString::number(b->getNum()))); } //m_menuEditor->getSelected()->setText(_value); } else { @@ -178,28 +178,28 @@ void k9MenuEdit::leTitleChanged(const QString &_value) { -void k9MenuEdit::setText(const QString &_value) { +void k9MenuEdit::setText(const TQString &_value) { if (m_text) m_text->setText(_value); m_canvas->update(); emit textChanged(_value); } -void k9MenuEdit::setFont(const QFont &_value) { +void k9MenuEdit::setFont(const TQFont &_value) { if (m_text) m_text->setFont(_value); m_canvas->update(); emit textFontChanged(_value); } -void k9MenuEdit::setColor(const QColor &_value) { +void k9MenuEdit::setColor(const TQColor &_value) { if (m_text) m_text->setColor(_value); m_canvas->update(); emit textColorChanged(_value); } -QCanvasText* k9MenuEdit::getText() const { +TQCanvasText* k9MenuEdit::getText() const { return m_text; } @@ -215,20 +215,20 @@ void k9MenuEdit::setFormat(const eFormat& _value) { m_imageHeight=480; else m_imageHeight=576; - QPixmap pix=m_canvas->backgroundPixmap(); - QImage img=pix.convertToImage().smoothScale(720,m_imageHeight); + TQPixmap pix=m_canvas->backgroundPixmap(); + TQImage img=pix.convertToImage().smoothScale(720,m_imageHeight); m_canvas->resize(720,m_imageHeight); - m_menuEditor->setMaximumSize(QSize(724,m_imageHeight+4)); - m_canvas->setBackgroundPixmap(QPixmap(img)); + m_menuEditor->setMaximumSize(TQSize(724,m_imageHeight+4)); + m_canvas->tqsetBackgroundPixmap(TQPixmap(img)); } -QCanvas *k9MenuEdit::getCanvas() { +TQCanvas *k9MenuEdit::getCanvas() { return m_canvas; } -void k9MenuEdit::setCanvas(QCanvas* _value) { +void k9MenuEdit::setCanvas(TQCanvas* _value) { m_canvas = _value; m_text=NULL; m_menuEditor->setCanvas(_value); @@ -238,11 +238,11 @@ void k9MenuEdit::setCanvas(QCanvas* _value) { } void k9MenuEdit::titleSelected(k9Title *_title) { - disconnect (this,SIGNAL(startScriptChanged(const QString&)),0,0); - disconnect (this,SIGNAL(endScriptChanged(const QString&)),0,0); + disconnect (this,TQT_SIGNAL(startScriptChanged(const TQString&)),0,0); + disconnect (this,TQT_SIGNAL(endScriptChanged(const TQString&)),0,0); cbEnd->setEnabled(true); m_menuEditor->clearSelection(); - lTitle->setText(i18n("Title %1 Menu").arg(_title->getNum()+1)); + lTitle->setText(i18n("Title %1 Menu").tqarg(_title->getNum()+1)); setCanvas(_title->getMenu()->getCanvas()); m_menuType=TITLEMENU; cbStart->clear(); @@ -257,30 +257,30 @@ void k9MenuEdit::titleSelected(k9Title *_title) { m_startScripts << "if (g1==0) {g1=1; jump title 1 chapter 1;}"; if (_title->getMenu()->getStartScript() !="") cbStart->setCurrentItem(cbStart->count()-1); - connect (this,SIGNAL(startScriptChanged(const QString&)),_title->getMenu(),SLOT(setStartScript(const QString&))); + connect (this,TQT_SIGNAL(startScriptChanged(const TQString&)),_title->getMenu(),TQT_SLOT(setStartScript(const TQString&))); cbEnd->insertItem(i18n("Play Root Menu")); m_endScripts << "g6=0; call vmgm menu;"; cbEnd->insertItem(i18n("Play Title Menu")); m_endScripts << "call menu;"; - k9NewDVD *newDVD=(k9NewDVD*)_title->parent() ; + k9NewDVD *newDVD=(k9NewDVD*)_title->tqparent() ; k9NewDVDItems *items=newDVD->getTitles(); for (k9Title *title=items->first();title;title=items->next()) { - cbEnd->insertItem(i18n("Play Title %1").arg(title->getNum()+1)); - QString script=QString("g6=%1; call vmgm menu;" ).arg(title->getNum()+1); + cbEnd->insertItem(i18n("Play Title %1").tqarg(title->getNum()+1)); + TQString script=TQString("g6=%1; call vmgm menu;" ).tqarg(title->getNum()+1); m_endScripts << script; } for (int i=0;i<m_endScripts.count();i++ ){ if (_title->getMenu()->getEndScript()== *(m_endScripts.at(i))) cbEnd->setCurrentItem(i); } - connect (this,SIGNAL(endScriptChanged(const QString&)),_title->getMenu(),SLOT(setEndScript(const QString&))); + connect (this,TQT_SIGNAL(endScriptChanged(const TQString&)),_title->getMenu(),TQT_SLOT(setEndScript(const TQString&))); } void k9MenuEdit::rootSelected(k9NewDVD *_newDVD) { - disconnect (this,SIGNAL(startScriptChanged(const QString&)),0,0); - disconnect (this,SIGNAL(endScriptChanged(const QString&)),0,0); + disconnect (this,TQT_SIGNAL(startScriptChanged(const TQString&)),0,0); + disconnect (this,TQT_SIGNAL(endScriptChanged(const TQString&)),0,0); cbEnd->setEnabled(false); m_menuEditor->clearSelection(); lTitle->setText(i18n("Root Menu")); @@ -292,18 +292,18 @@ void k9MenuEdit::rootSelected(k9NewDVD *_newDVD) { m_startScripts << ""; k9NewDVDItems *items=_newDVD->getTitles(); for (k9Title *title=items->first();title;title=items->next()) { - cbStart->insertItem(i18n("Play Title %1").arg(title->getNum()+1)); - // QString script=QString("if (g5==0) {g5=1; jump title %1;}" ).arg(title->getNum()+1); - QString script=QString("g6=%1;" ).arg(title->getNum()+1); + cbStart->insertItem(i18n("Play Title %1").tqarg(title->getNum()+1)); + // TQString script=TQString("if (g5==0) {g5=1; jump title %1;}" ).tqarg(title->getNum()+1); + TQString script=TQString("g6=%1;" ).tqarg(title->getNum()+1); m_startScripts << script; if (script==_newDVD->getRootMenu()->getStartScript()) cbStart->setCurrentItem(cbStart->count()-1); } - connect (this,SIGNAL(startScriptChanged(const QString&)),_newDVD->getRootMenu(),SLOT(setStartScript(const QString&))); + connect (this,TQT_SIGNAL(startScriptChanged(const TQString&)),_newDVD->getRootMenu(),TQT_SLOT(setStartScript(const TQString&))); } void k9MenuEdit::bAddTextClick() { - m_text=new QCanvasText(m_canvas); + m_text=new TQCanvasText(m_canvas); m_text->show(); m_menuEditor->setMoving(m_text); setText(leTitle->text()); |