From 479f5f799523bffbcc83dff581a2299c047c6fff Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:44:01 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1157645 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kjsembed/jsconsolewidget.cpp | 80 ++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'kjsembed/jsconsolewidget.cpp') diff --git a/kjsembed/jsconsolewidget.cpp b/kjsembed/jsconsolewidget.cpp index 4816e335..b494f55d 100644 --- a/kjsembed/jsconsolewidget.cpp +++ b/kjsembed/jsconsolewidget.cpp @@ -17,11 +17,11 @@ * Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -50,11 +50,11 @@ class JSConsoleWidgetPrivate { }; -JSConsoleWidget::JSConsoleWidget( KJSEmbedPart *jspart, QWidget *parent, const char *name ) - : QFrame( parent, name ? name : "jsconsole_widget" ), +JSConsoleWidget::JSConsoleWidget( KJSEmbedPart *jspart, TQWidget *parent, const char *name ) + : TQFrame( parent, name ? name : "jsconsole_widget" ), js(jspart), proc(0), d(0) { - setFocusPolicy( QWidget::StrongFocus ); + setFocusPolicy( TQWidget::StrongFocus ); createView(); } @@ -64,8 +64,8 @@ JSConsoleWidget::~JSConsoleWidget() void JSConsoleWidget::createView() { - QPixmap px( KGlobal::iconLoader()->loadIcon("konsole", KIcon::NoGroup, KIcon::SizeSmall) ); - QPixmap pxl( KGlobal::iconLoader()->loadIcon("konsole", KIcon::NoGroup, KIcon::SizeLarge) ); + TQPixmap px( KGlobal::iconLoader()->loadIcon("konsole", KIcon::NoGroup, KIcon::SizeSmall) ); + TQPixmap pxl( KGlobal::iconLoader()->loadIcon("konsole", KIcon::NoGroup, KIcon::SizeLarge) ); setIcon( px ); KWin::setIcons( winId(), pxl, px ); @@ -77,32 +77,32 @@ void JSConsoleWidget::createView() log->setReadOnly( true ); log->setUndoRedoEnabled( false ); log->setTextFormat( Qt::RichText ); - log->setWrapPolicy( QTextEdit::Anywhere ); + log->setWrapPolicy( TQTextEdit::Anywhere ); log->setText( "
" );
-    log->setFocusPolicy( QWidget::NoFocus );
+    log->setFocusPolicy( TQWidget::NoFocus );
 
     // Command entry section
-    cmdBox = new QHBox( this, "cmd_box" );
+    cmdBox = new TQHBox( this, "cmd_box" );
     cmdBox->setSpacing( KDialog::spacingHint() );
 
-    QLabel *prompt = new QLabel( i18n("&KJS>"), cmdBox, "prompt" );
+    TQLabel *prompt = new TQLabel( i18n("&KJS>"), cmdBox, "prompt" );
     cmd = new KLineEdit( cmdBox, "cmd_edit" );
-    cmd->setFocusPolicy( QWidget::StrongFocus );
+    cmd->setFocusPolicy( TQWidget::StrongFocus );
     cmd->setFocus();
     prompt->setBuddy( cmd );
 
-    go = new QPushButton( i18n("&Run"), cmdBox, "run_button" );
+    go = new TQPushButton( i18n("&Run"), cmdBox, "run_button" );
     go->setFixedSize( go->sizeHint() );
 
-    connect( cmd, SIGNAL(returnPressed(const QString&)), go, SLOT( animateClick() ) );
-    connect( go, SIGNAL( clicked() ), SLOT( invoke() ) );
+    connect( cmd, TQT_SIGNAL(returnPressed(const TQString&)), go, TQT_SLOT( animateClick() ) );
+    connect( go, TQT_SIGNAL( clicked() ), TQT_SLOT( invoke() ) );
 
     // Setup completion
     KCompletion *comp = cmd->completionObject();
-    connect( cmd, SIGNAL(returnPressed(const QString&)), comp, SLOT(addItem(const QString&)) );
+    connect( cmd, TQT_SIGNAL(returnPressed(const TQString&)), comp, TQT_SLOT(addItem(const TQString&)) );
 
     // Layout
-    QVBoxLayout *vert = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() );
+    TQVBoxLayout *vert = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() );
     vert->addWidget( ttl );
     vert->addWidget( log );
     vert->addWidget( cmdBox );
@@ -110,17 +110,17 @@ void JSConsoleWidget::createView()
 
 void JSConsoleWidget::invoke()
 {
-    QString code( cmd->text() );
-    println( QString( "KJS> %1" ).arg( code ) );
+    TQString code( cmd->text() );
+    println( TQString( "KJS> %1" ).arg( code ) );
     execute( code );
 }
 
-bool JSConsoleWidget::execute( const QString &cmd )
+bool JSConsoleWidget::execute( const TQString &cmd )
 {
     return execute( cmd, KJS::Null() );
 }
 
-bool JSConsoleWidget::execute( const QString &cmd, const KJS::Value &self )
+bool JSConsoleWidget::execute( const TQString &cmd, const KJS::Value &self )
 {
     KJS::Completion jsres;
     bool ok = js->execute( jsres, cmd, self );
@@ -141,8 +141,8 @@ bool JSConsoleWidget::execute( const QString &cmd, const KJS::Value &self )
 	    return ok;
 	}
 
-	QString txt = s.qstring();
-	txt = txt.replace( QChar('\n'), "
" ); + TQString txt = s.qstring(); + txt = txt.replace( TQChar('\n'), "
" ); println( txt ); return ok; @@ -166,15 +166,15 @@ bool JSConsoleWidget::execute( const QString &cmd, const KJS::Value &self ) return ok; } -void JSConsoleWidget::println( const QString &msg ) +void JSConsoleWidget::println( const TQString &msg ) { log->append( msg ); log->scrollToBottom(); } -void JSConsoleWidget::warn( const QString &msg ) +void JSConsoleWidget::warn( const TQString &msg ) { - QString err( "%1" ); + TQString err( "%1" ); println( err.arg(msg) ); } @@ -182,7 +182,7 @@ void JSConsoleWidget::warn( const QString &msg ) // Process Handling // -bool JSConsoleWidget::run( const QString &cmd ) +bool JSConsoleWidget::run( const TQString &cmd ) { kdDebug(80001) << "JSConsoleWidget::run(" << cmd << ")" << endl; @@ -192,11 +192,11 @@ bool JSConsoleWidget::run( const QString &cmd ) proc = new KShellProcess("/bin/sh"); *proc << cmd; - connect( proc, SIGNAL( processExited(KProcess *) ), SLOT( childExited() ) ); - connect( proc, SIGNAL( receivedStdout(KProcess *, char *, int) ), - this, SLOT( receivedStdOutput(KProcess *, char *, int) ) ); - connect( proc, SIGNAL( receivedStderr(KProcess *, char *, int) ), - this, SLOT( receivedStdError(KProcess *, char *, int) ) ); + connect( proc, TQT_SIGNAL( processExited(KProcess *) ), TQT_SLOT( childExited() ) ); + connect( proc, TQT_SIGNAL( receivedStdout(KProcess *, char *, int) ), + this, TQT_SLOT( receivedStdOutput(KProcess *, char *, int) ) ); + connect( proc, TQT_SIGNAL( receivedStderr(KProcess *, char *, int) ), + this, TQT_SLOT( receivedStdError(KProcess *, char *, int) ) ); return proc->start( KProcess::NotifyOnExit, KProcess::Communication( KProcess::Stdout|KProcess::Stderr )); @@ -205,7 +205,7 @@ bool JSConsoleWidget::run( const QString &cmd ) void JSConsoleWidget::childExited() { - QString s; + TQString s; if ( proc->normalExit() ) { if ( proc->exitStatus() ) s = i18n( "[Exited with status %1]\n" ).arg( proc->exitStatus() ); @@ -224,14 +224,14 @@ void JSConsoleWidget::childExited() void JSConsoleWidget::receivedStdOutput( KProcess *, char *buffer, int buflen ) { - QCString buf = QCString( buffer, buflen+1 ); - println( QString(buf) ); + TQCString buf = TQCString( buffer, buflen+1 ); + println( TQString(buf) ); } void JSConsoleWidget::receivedStdError( KProcess *, char *buffer, int buflen ) { - QCString buf = QCString( buffer, buflen+1 ); - warn( QString(buf) ); + TQCString buf = TQCString( buffer, buflen+1 ); + warn( TQString(buf) ); } -- cgit v1.2.3