You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.8 KiB
64 lines
1.8 KiB
15 years ago
|
#include <kde_terminal_interface.h>
|
||
12 years ago
|
#include <tdeparts/part.h>
|
||
15 years ago
|
#include <ktrader.h>
|
||
|
#include <klibloader.h>
|
||
12 years ago
|
#include <tdemainwindow.h>
|
||
12 years ago
|
#include <tdeaboutdata.h>
|
||
|
#include <tdecmdlineargs.h>
|
||
|
#include <tdeapplication.h>
|
||
15 years ago
|
#include <tqdir.h>
|
||
15 years ago
|
#include <assert.h>
|
||
12 years ago
|
#include <tdemessagebox.h>
|
||
15 years ago
|
#include <cassert>
|
||
|
#include "main.h"
|
||
|
#include "main.moc"
|
||
|
|
||
|
Win::Win()
|
||
|
{
|
||
|
KLibFactory* factory = KLibLoader::self()->factory( "libkonsolepart" );
|
||
|
assert( factory );
|
||
14 years ago
|
KParts::Part* p = static_cast<KParts::Part*>( factory->create( this, "tralala", TQOBJECT_OBJECT_NAME_STRING, "KParts::ReadOnlyPart" ) );
|
||
15 years ago
|
setCentralWidget( p->widget() );
|
||
|
|
||
14 years ago
|
TerminalInterface* t = ::tqqt_cast<TerminalInterface*>( p );
|
||
15 years ago
|
t->showShellInDir( TQDir::home().path() );
|
||
|
// TQStrList l;
|
||
15 years ago
|
// l.append( "python" );
|
||
15 years ago
|
// t->startProgram( TQString::fromUtf8( "/usr/bin/python" ), l );
|
||
15 years ago
|
|
||
15 years ago
|
connect( p, TQT_SIGNAL( processExited( int ) ),
|
||
|
this, TQT_SLOT( pythonExited( int ) ) );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
int main( int argc, char** argv )
|
||
|
{
|
||
12 years ago
|
TDEAboutData* about = new TDEAboutData( "tetest", "TETest", "0.1" );
|
||
12 years ago
|
TDECmdLineArgs::init( argc, argv, about );
|
||
12 years ago
|
TDEApplication a;
|
||
15 years ago
|
Win* win = new Win();
|
||
|
win->show();
|
||
|
return a.exec();
|
||
|
};
|
||
|
|
||
|
#include <iostream>
|
||
|
|
||
|
void Win::pythonExited()
|
||
|
{
|
||
|
std::cerr << "hee, " << p << std::endl;
|
||
14 years ago
|
std::cerr << ( ::tqqt_cast<TerminalInterface>(p) ) << std::endl;
|
||
15 years ago
|
// KMessageBox::sorry( this, TQString::fromUtf8( "Exited, status was %1" ).arg( status ) );
|
||
|
disconnect(p, TQT_SIGNAL( processExited() ),
|
||
|
this, TQT_SLOT( pythonExited() ));
|
||
14 years ago
|
TerminalInterface* t = ::tqqt_cast<TerminalInterface*>( p );
|
||
15 years ago
|
TQStrList l;
|
||
15 years ago
|
l.append( "echo" );
|
||
|
l.append( "hello world" );
|
||
15 years ago
|
t->startProgram( TQString::fromUtf8( "/bin/echo" ), l );
|
||
15 years ago
|
}
|
||
|
|
||
|
void Win::forked()
|
||
|
{
|
||
|
std::cerr << "hello from the child process!" << std::endl;
|
||
|
}
|