summaryrefslogtreecommitdiffstats
path: root/kjsembed/jsconsolewidget.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 15:55:57 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 15:55:57 -0600
commit9ba04742771370f59740e32e11c5f3a1e6a1b70a (patch)
treec81c34dae2b3b1ea73801bf18a960265dc4207f7 /kjsembed/jsconsolewidget.cpp
parent1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff)
downloadtdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz
tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip
Initial TQt conversion
Diffstat (limited to 'kjsembed/jsconsolewidget.cpp')
-rw-r--r--kjsembed/jsconsolewidget.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/kjsembed/jsconsolewidget.cpp b/kjsembed/jsconsolewidget.cpp
index f69ba6c5..f3c61c6c 100644
--- a/kjsembed/jsconsolewidget.cpp
+++ b/kjsembed/jsconsolewidget.cpp
@@ -50,11 +50,11 @@ class JSConsoleWidgetPrivate
{
};
-JSConsoleWidget::JSConsoleWidget( KJSEmbedPart *jspart, TQWidget *parent, const char *name )
- : TQFrame( parent, name ? name : "jsconsole_widget" ),
+JSConsoleWidget::JSConsoleWidget( KJSEmbedPart *jspart, TTQWidget *parent, const char *name )
+ : TTQFrame( parent, name ? name : "jsconsole_widget" ),
js(jspart), proc(0), d(0)
{
- setFocusPolicy( TQWidget::StrongFocus );
+ setFocusPolicy( TTQWidget::StrongFocus );
createView();
}
@@ -64,8 +64,8 @@ JSConsoleWidget::~JSConsoleWidget()
void JSConsoleWidget::createView()
{
- TQPixmap px( KGlobal::iconLoader()->loadIcon("konsole", KIcon::NoGroup, KIcon::SizeSmall) );
- TQPixmap pxl( KGlobal::iconLoader()->loadIcon("konsole", KIcon::NoGroup, KIcon::SizeLarge) );
+ TTQPixmap px( KGlobal::iconLoader()->loadIcon("konsole", KIcon::NoGroup, KIcon::SizeSmall) );
+ TTQPixmap pxl( KGlobal::iconLoader()->loadIcon("konsole", KIcon::NoGroup, KIcon::SizeLarge) );
setIcon( px );
KWin::setIcons( winId(), pxl, px );
@@ -76,33 +76,33 @@ void JSConsoleWidget::createView()
log = new KTextEdit( this, "log_widget" );
log->setReadOnly( true );
log->setUndoRedoEnabled( false );
- log->setTextFormat( Qt::RichText );
- log->setWrapPolicy( TQTextEdit::Anywhere );
+ log->setTextFormat( TQt::RichText );
+ log->setWrapPolicy( TTQTextEdit::Anywhere );
log->setText( "<qt><pre>" );
- log->setFocusPolicy( TQWidget::NoFocus );
+ log->setFocusPolicy( TTQWidget::NoFocus );
// Command entry section
- cmdBox = new TQHBox( this, "cmd_box" );
+ cmdBox = new TTQHBox( this, "cmd_box" );
cmdBox->setSpacing( KDialog::spacingHint() );
- TQLabel *prompt = new TQLabel( i18n("&KJS>"), cmdBox, "prompt" );
+ TTQLabel *prompt = new TTQLabel( i18n("&KJS>"), cmdBox, "prompt" );
cmd = new KLineEdit( cmdBox, "cmd_edit" );
- cmd->setFocusPolicy( TQWidget::StrongFocus );
+ cmd->setFocusPolicy( TTQWidget::StrongFocus );
cmd->setFocus();
prompt->setBuddy( cmd );
- go = new TQPushButton( i18n("&Run"), cmdBox, "run_button" );
+ go = new TTQPushButton( i18n("&Run"), cmdBox, "run_button" );
go->setFixedSize( go->sizeHint() );
- connect( cmd, TQT_SIGNAL(returnPressed(const TQString&)), go, TQT_SLOT( animateClick() ) );
+ connect( cmd, TQT_SIGNAL(returnPressed(const TTQString&)), go, TQT_SLOT( animateClick() ) );
connect( go, TQT_SIGNAL( clicked() ), TQT_SLOT( invoke() ) );
// Setup completion
KCompletion *comp = cmd->completionObject();
- connect( cmd, TQT_SIGNAL(returnPressed(const TQString&)), comp, TQT_SLOT(addItem(const TQString&)) );
+ connect( cmd, TQT_SIGNAL(returnPressed(const TTQString&)), comp, TQT_SLOT(addItem(const TTQString&)) );
// Layout
- TQVBoxLayout *vert = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() );
+ TTQVBoxLayout *vert = new TTQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() );
vert->addWidget( ttl );
vert->addWidget( log );
vert->addWidget( cmdBox );
@@ -110,17 +110,17 @@ void JSConsoleWidget::createView()
void JSConsoleWidget::invoke()
{
- TQString code( cmd->text() );
- println( TQString( "<b><font color=\"#888888\">KJS&gt;</font> %1</b>" ).arg( code ) );
+ TTQString code( cmd->text() );
+ println( TTQString( "<b><font color=\"#888888\">KJS&gt;</font> %1</b>" ).arg( code ) );
execute( code );
}
-bool JSConsoleWidget::execute( const TQString &cmd )
+bool JSConsoleWidget::execute( const TTQString &cmd )
{
return execute( cmd, KJS::Null() );
}
-bool JSConsoleWidget::execute( const TQString &cmd, const KJS::Value &self )
+bool JSConsoleWidget::execute( const TTQString &cmd, const KJS::Value &self )
{
KJS::Completion jsres;
bool ok = js->execute( jsres, cmd, self );
@@ -141,8 +141,8 @@ bool JSConsoleWidget::execute( const TQString &cmd, const KJS::Value &self )
return ok;
}
- TQString txt = s.qstring();
- txt = txt.replace( TQChar('\n'), "<br>" );
+ TTQString txt = s.qstring();
+ txt = txt.replace( TTQChar('\n'), "<br>" );
println( txt );
return ok;
@@ -166,15 +166,15 @@ bool JSConsoleWidget::execute( const TQString &cmd, const KJS::Value &self )
return ok;
}
-void JSConsoleWidget::println( const TQString &msg )
+void JSConsoleWidget::println( const TTQString &msg )
{
log->append( msg );
log->scrollToBottom();
}
-void JSConsoleWidget::warn( const TQString &msg )
+void JSConsoleWidget::warn( const TTQString &msg )
{
- TQString err( "<font color=\"red\"><b>%1</b></font>" );
+ TTQString err( "<font color=\"red\"><b>%1</b></font>" );
println( err.arg(msg) );
}
@@ -182,7 +182,7 @@ void JSConsoleWidget::warn( const TQString &msg )
// Process Handling
//
-bool JSConsoleWidget::run( const TQString &cmd )
+bool JSConsoleWidget::run( const TTQString &cmd )
{
kdDebug(80001) << "JSConsoleWidget::run(" << cmd << ")" << endl;
@@ -205,7 +205,7 @@ bool JSConsoleWidget::run( const TQString &cmd )
void JSConsoleWidget::childExited()
{
- TQString s;
+ TTQString s;
if ( proc->normalExit() ) {
if ( proc->exitStatus() )
s = i18n( "<b>[Exited with status %1]</b>\n" ).arg( proc->exitStatus() );
@@ -224,14 +224,14 @@ void JSConsoleWidget::childExited()
void JSConsoleWidget::receivedStdOutput( KProcess *, char *buffer, int buflen )
{
- TQCString buf = TQCString( buffer, buflen+1 );
- println( TQString(buf) );
+ TTQCString buf = TTQCString( buffer, buflen+1 );
+ println( TTQString(buf) );
}
void JSConsoleWidget::receivedStdError( KProcess *, char *buffer, int buflen )
{
- TQCString buf = TQCString( buffer, buflen+1 );
- warn( TQString(buf) );
+ TTQCString buf = TTQCString( buffer, buflen+1 );
+ warn( TTQString(buf) );
}