25 #include <tqtextstream.h>
27 #include <tdeaboutdata.h>
28 #include <tdeapplication.h>
30 #include <tdelocale.h>
31 #include <tdecmdlineargs.h>
32 #include <tdeprocess.h>
35 #include "testnewstuff.h"
36 #include "testnewstuff.moc"
40 bool TestNewStuff::install(
const TQString &fileName )
42 kdDebug() <<
"TestNewStuff::install(): " << fileName << endl;
44 if ( !f.open( IO_ReadOnly ) ) {
45 kdDebug() <<
"Error opening file." << endl;
48 TQTextStream ts( &f );
49 kdDebug() <<
"--BEGIN-NEW_STUFF--" << endl;
50 cout << ts.read().utf8();
51 kdDebug() <<
"---END-NEW_STUFF---" << endl;
55 bool TestNewStuff::createUploadFile(
const TQString &fileName )
58 p <<
"touch" << fileName;
59 p.start(TDEProcess::Block);
60 kdDebug() <<
"TestNewStuff::createUploadFile(): " << fileName << endl;
67 mNewStuff =
new TestNewStuff;
69 TQBoxLayout *topLayout =
new TQVBoxLayout(
this );
70 topLayout->setMargin( KDialog::marginHint() );
71 topLayout->setSpacing( KDialog::spacingHint() );
73 TQPushButton *downloadButton =
new TQPushButton(
"Download",
this );
74 topLayout->addWidget( downloadButton );
75 connect( downloadButton, TQ_SIGNAL( clicked() ), TQ_SLOT( download() ) );
77 TQPushButton *uploadButton =
new TQPushButton(
"Upload",
this );
78 topLayout->addWidget( uploadButton );
79 connect( uploadButton, TQ_SIGNAL( clicked() ), TQ_SLOT( upload() ) );
81 topLayout->addSpacing( 5 );
83 TQPushButton *closeButton =
new TQPushButton(
"Close",
this );
84 topLayout->addWidget( closeButton );
85 connect( closeButton, TQ_SIGNAL( clicked() ), kapp, TQ_SLOT( quit() ) );
93 void MyWidget::download()
95 kdDebug() <<
"MyWidget::download()" << endl;
97 mNewStuff->download();
100 void MyWidget::upload()
102 kdDebug() <<
"MyWidget::download()" << endl;
108 int main(
int argc,
char **argv)
110 TDEAboutData aboutData(
"knewstufftest",
"TDENewStuff Test",
"0.1");
111 TDECmdLineArgs::init(argc,argv,&aboutData);
116 app.setMainWidget( &wid );