From aa3a1ca934bc541bddd3fa136a85f106f7da266e Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:25:18 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeadmin@1157635 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kpackage/kpTerm.cpp | 72 ++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'kpackage/kpTerm.cpp') diff --git a/kpackage/kpTerm.cpp b/kpackage/kpTerm.cpp index 0336da9..aab6ab8 100644 --- a/kpackage/kpTerm.cpp +++ b/kpackage/kpTerm.cpp @@ -27,7 +27,7 @@ #include "../config.h" -#include +#include #include #include @@ -38,8 +38,8 @@ ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -kpTerm::kpTerm(kpPty *pt, QWidget * parent, const char * name ) : - QTextEdit(parent,name) +kpTerm::kpTerm(kpPty *pt, TQWidget * parent, const char * name ) : + TQTextEdit(parent,name) { pty = pt; setFont(KGlobalSettings::fixedFont()); @@ -51,25 +51,25 @@ kpTerm::kpTerm(kpPty *pt, QWidget * parent, const char * name ) : void kpTerm::doConnect() { - connect(pty, SIGNAL(textIn(const QString &, bool)), this, - SLOT(textIn(const QString &, bool))); - connect(pty,SIGNAL(result(QStringList &, int)), - this,SLOT(slotResult(QStringList &, int))); - connect(this, SIGNAL(keyOut(char)), pty, - SLOT(keyOut(char))); + connect(pty, TQT_SIGNAL(textIn(const TQString &, bool)), this, + TQT_SLOT(textIn(const TQString &, bool))); + connect(pty,TQT_SIGNAL(result(TQStringList &, int)), + this,TQT_SLOT(slotResult(TQStringList &, int))); + connect(this, TQT_SIGNAL(keyOut(char)), pty, + TQT_SLOT(keyOut(char))); } void kpTerm::doUnconnect() { - disconnect(pty, SIGNAL(textIn(const QString &, bool)), this, - SLOT(textIn(const QString &, bool))); - disconnect(pty,SIGNAL(result(QStringList &, int)), - this,SLOT(slotResult(QStringList &, int))); - disconnect(this, SIGNAL(keyOut(char)), pty, - SLOT(keyOut(char))); + disconnect(pty, TQT_SIGNAL(textIn(const TQString &, bool)), this, + TQT_SLOT(textIn(const TQString &, bool))); + disconnect(pty,TQT_SIGNAL(result(TQStringList &, int)), + this,TQT_SLOT(slotResult(TQStringList &, int))); + disconnect(this, TQT_SIGNAL(keyOut(char)), pty, + TQT_SLOT(keyOut(char))); } -bool kpTerm::run(const QString &cmd, QStringList &r) +bool kpTerm::run(const TQString &cmd, TQStringList &r) { setReadOnly(FALSE); setFocus(); @@ -95,21 +95,21 @@ void kpTerm::done() clearFocus(); } -void kpTerm::keyPressEvent ( QKeyEvent * e ) +void kpTerm::keyPressEvent ( TQKeyEvent * e ) { // kdDebug() << "K=" << e->ascii() << "," << e->ascii() << "\n"; if (e->ascii()) { emit keyOut(e->ascii()); } else { - QTextEdit::keyPressEvent (e); + TQTextEdit::keyPressEvent (e); } setCursorPosition(9999,9999); } -void kpTerm::textIn(const QString &stext, bool bNewLine) +void kpTerm::textIn(const TQString &stext, bool bNewLine) { - QRegExp chrs("[\\010\\012\\015]"); - QString del = "\010"; + TQRegExp chrs("[\\010\\012\\015]"); + TQString del = "\010"; // kdDebug() << "Tin=[" << stext << "]\n"; if (stext.find(chrs) < 0) { insert( stext ); @@ -141,7 +141,7 @@ void kpTerm::textIn(const QString &stext, bool bNewLine) moveCursor(MoveEnd, false); } -void kpTerm::insert ( const QString & str, bool) { +void kpTerm::insert ( const TQString & str, bool) { int x,y; getCursorPosition(&y,&x); @@ -152,11 +152,11 @@ void kpTerm::insert ( const QString & str, bool) { getCursorPosition(&y,&x); // kdDebug() << "k=" << y << "," << x <<"\n"; } - QTextEdit::insert(str,(bool)FALSE); + TQTextEdit::insert(str,(bool)FALSE); } } -void kpTerm::slotResult(QStringList &rlist, int ret) +void kpTerm::slotResult(TQStringList &rlist, int ret) { emit result(rlist, ret); doUnconnect(); @@ -169,28 +169,28 @@ void kpTerm::slotResult(QStringList &rlist, int ret) // Dialog window for password prompt // ////////////////////////////////////////////////////////////////////////////// -kpRun::kpRun( QWidget *parent) - : KDialogBase(parent, "kpRun", true, QString::null, +kpRun::kpRun( TQWidget *parent) + : KDialogBase(parent, "kpRun", true, TQString::null, Cancel, Cancel, true ) { - QVBox *page = makeVBoxMainWidget(); - title = new QLabel("", page); - QFont f( KGlobalSettings::generalFont()); + TQVBox *page = makeVBoxMainWidget(); + title = new TQLabel("", page); + TQFont f( KGlobalSettings::generalFont()); f.setBold(true); f.setPointSize(f.pointSize()+4); title->setFont(f); term = new kpTerm(kpty,page); resize(600, 300); - connect(term,SIGNAL(result(QStringList &, int)), - this,SLOT(slotResult(QStringList &, int))); + connect(term,TQT_SIGNAL(result(TQStringList &, int)), + this,TQT_SLOT(slotResult(TQStringList &, int))); hide(); } -bool kpRun::run(QString cmd, QString msg) +bool kpRun::run(TQString cmd, TQString msg) { - QStringList r; + TQStringList r; title->setText(msg); if (!cmd.isEmpty()) { @@ -203,17 +203,17 @@ bool kpRun::run(QString cmd, QString msg) } } -void kpRun::addText(const QStringList &ret) +void kpRun::addText(const TQStringList &ret) { int last = ret.count()-1; int i = 0; - for ( QStringList::ConstIterator it = ret.begin(); it != ret.end(); ++it, ++i ) { + for ( TQStringList::ConstIterator it = ret.begin(); it != ret.end(); ++it, ++i ) { // kdDebug() << "ks=" << *it << "\n"; term->textIn(*it, (i != last)); } } -void kpRun::slotResult(QStringList &, int ret) +void kpRun::slotResult(TQStringList &, int ret) { if (ret == 0 || ret == 666) { term->clear(); -- cgit v1.2.1