summaryrefslogtreecommitdiffstats
path: root/interfaces/terminal/test/main.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-12-06 21:23:48 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-12-06 21:34:48 +0900
commit84498d97e27f79e7e919b42bbe54208a02856aaf (patch)
tree8a66f6e1a88bc2304b453796663ae75f20425490 /interfaces/terminal/test/main.cpp
parent8bc0bc7fc67437fbf757283604104e998ad2fda7 (diff)
downloadtdelibs-84498d97e27f79e7e919b42bbe54208a02856aaf.tar.gz
tdelibs-84498d97e27f79e7e919b42bbe54208a02856aaf.zip
Renaming of files in preparation for code style tools.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 4f99f868f09bbffa2e15733b8b7c78eba07a199e)
Diffstat (limited to 'interfaces/terminal/test/main.cpp')
-rw-r--r--interfaces/terminal/test/main.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/interfaces/terminal/test/main.cpp b/interfaces/terminal/test/main.cpp
new file mode 100644
index 000000000..8130f85d6
--- /dev/null
+++ b/interfaces/terminal/test/main.cpp
@@ -0,0 +1,63 @@
+#include <kde_terminal_interface.h>
+#include <tdeparts/part.h>
+#include <ktrader.h>
+#include <klibloader.h>
+#include <tdemainwindow.h>
+#include <tdeaboutdata.h>
+#include <tdecmdlineargs.h>
+#include <tdeapplication.h>
+#include <tqdir.h>
+#include <assert.h>
+#include <tdemessagebox.h>
+#include <cassert>
+#include "main.h"
+#include "main.moc"
+
+Win::Win()
+{
+ KLibFactory* factory = KLibLoader::self()->factory( "libkonsolepart" );
+ assert( factory );
+ KParts::Part* p = static_cast<KParts::Part*>( factory->create( this, "tralala", TQOBJECT_OBJECT_NAME_STRING, "KParts::ReadOnlyPart" ) );
+ setCentralWidget( p->widget() );
+
+ TerminalInterface* t = ::tqqt_cast<TerminalInterface*>( p );
+ t->showShellInDir( TQDir::home().path() );
+// TQStrList l;
+// l.append( "python" );
+// t->startProgram( TQString::fromUtf8( "/usr/bin/python" ), l );
+
+ connect( p, TQT_SIGNAL( processExited( int ) ),
+ this, TQT_SLOT( pythonExited( int ) ) );
+}
+
+
+int main( int argc, char** argv )
+{
+ TDEAboutData* about = new TDEAboutData( "tetest", "TETest", "0.1" );
+ TDECmdLineArgs::init( argc, argv, about );
+ TDEApplication a;
+ Win* win = new Win();
+ win->show();
+ return a.exec();
+};
+
+#include <iostream>
+
+void Win::pythonExited()
+{
+ std::cerr << "hee, " << p << std::endl;
+ std::cerr << ( ::tqqt_cast<TerminalInterface>(p) ) << std::endl;
+ // KMessageBox::sorry( this, TQString::fromUtf8( "Exited, status was %1" ).arg( status ) );
+ disconnect(p, TQT_SIGNAL( processExited() ),
+ this, TQT_SLOT( pythonExited() ));
+ TerminalInterface* t = ::tqqt_cast<TerminalInterface*>( p );
+ TQStrList l;
+ l.append( "echo" );
+ l.append( "hello world" );
+ t->startProgram( TQString::fromUtf8( "/bin/echo" ), l );
+}
+
+void Win::forked()
+{
+ std::cerr << "hello from the child process!" << std::endl;
+}