Diffstat (limited to 'noncore/apps/advancedfm/output.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/output.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/noncore/apps/advancedfm/output.cpp b/noncore/apps/advancedfm/output.cpp index a60cea6..33abdfc 100644 --- a/noncore/apps/advancedfm/output.cpp +++ b/noncore/apps/advancedfm/output.cpp | |||
@@ -1,34 +1,28 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** outputEdit.cpp | 2 | ** outputEdit.cpp |
3 | ** | 3 | ** |
4 | ** Copyright: Fri Apr 12 15:12:58 2002 L.J. Potter <ljp@llornkcor.com> | 4 | ** Copyright: Fri Apr 12 15:12:58 2002 L.J. Potter <ljp@llornkcor.com> |
5 | ****************************************************************************/ | 5 | ****************************************************************************/ |
6 | #include "output.h" | 6 | #include "output.h" |
7 | 7 | ||
8 | #include <opie/oprocess.h> | 8 | #include <opie/oprocess.h> |
9 | 9 | ||
10 | #include <qpe/filemanager.h> | ||
11 | #include <qpe/qpeapplication.h> | 10 | #include <qpe/qpeapplication.h> |
12 | #include <qpe/applnk.h> | 11 | #include <qpe/applnk.h> |
13 | 12 | ||
14 | #include <qmessagebox.h> | ||
15 | #include <qstringlist.h> | ||
16 | #include <qfile.h> | 13 | #include <qfile.h> |
17 | #include <qcstring.h> | ||
18 | #include <qlineedit.h> | ||
19 | #include <qmultilineedit.h> | 14 | #include <qmultilineedit.h> |
20 | #include <qpushbutton.h> | 15 | #include <qpushbutton.h> |
21 | #include <qlayout.h> | 16 | #include <qlayout.h> |
22 | #include <qvariant.h> | ||
23 | 17 | ||
24 | #include <errno.h> | 18 | #include <errno.h> |
25 | 19 | ||
26 | /* XPM */ | 20 | /* XPM */ |
27 | static char * filesave_xpm[] = { | 21 | static char * filesave_xpm[] = { |
28 | "16 16 78 1", | 22 | "16 16 78 1", |
29 | " c None", | 23 | " c None", |
30 | ". c #343434", | 24 | ". c #343434", |
31 | "+ c #A0A0A0", | 25 | "+ c #A0A0A0", |
32 | "@ c #565656", | 26 | "@ c #565656", |
33 | "# c #9E9E9E", | 27 | "# c #9E9E9E", |
34 | "$ c #525252", | 28 | "$ c #525252", |
@@ -160,28 +154,28 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name, | |||
160 | 154 | ||
161 | // connect( , SIGNAL(received(const QByteArray &)), | 155 | // connect( , SIGNAL(received(const QByteArray &)), |
162 | // this, SLOT(commandStdin(const QByteArray &))); | 156 | // this, SLOT(commandStdin(const QByteArray &))); |
163 | 157 | ||
164 | // * proc << commands.latin1(); | 158 | // * proc << commands.latin1(); |
165 | for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) { | 159 | for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) { |
166 | qDebug( "%s", (*it).latin1() ); | 160 | qDebug( "%s", (*it).latin1() ); |
167 | * proc << (*it).latin1(); | 161 | * proc << (*it).latin1(); |
168 | } | 162 | } |
169 | 163 | ||
170 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) { | 164 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) { |
171 | 165 | ||
172 | OutputEdit->append("Process could not start"); | 166 | OutputEdit->append(tr("Process could not start") ); |
173 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | 167 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); |
174 | perror("Error: "); | 168 | perror("Error: "); |
175 | QString errorMsg="Error\n"+(QString)strerror(errno); | 169 | QString errorMsg=tr("Error\n")+(QString)strerror(errno); |
176 | OutputEdit->append( errorMsg); | 170 | OutputEdit->append( errorMsg); |
177 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | 171 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); |
178 | } | 172 | } |
179 | } | 173 | } |
180 | 174 | ||
181 | Output::~Output() { | 175 | Output::~Output() { |
182 | } | 176 | } |
183 | 177 | ||
184 | void Output::saveOutput() { | 178 | void Output::saveOutput() { |
185 | 179 | ||
186 | InputDialog *fileDlg; | 180 | InputDialog *fileDlg; |
187 | fileDlg = new InputDialog(this,tr("Save output to file (name only)"),TRUE, 0); | 181 | fileDlg = new InputDialog(this,tr("Save output to file (name only)"),TRUE, 0); |
@@ -236,25 +230,25 @@ void Output::commandStdin( const QByteArray &data) { | |||
236 | void Output::commandStderr(OProcess*, char *buffer, int buflen) { | 230 | void Output::commandStderr(OProcess*, char *buffer, int buflen) { |
237 | qWarning("received stderrt %d bytes", buflen); | 231 | qWarning("received stderrt %d bytes", buflen); |
238 | 232 | ||
239 | QString lineStr = buffer; | 233 | QString lineStr = buffer; |
240 | // lineStr=lineStr.left(lineStr.length()-1); | 234 | // lineStr=lineStr.left(lineStr.length()-1); |
241 | OutputEdit->append(lineStr); | 235 | OutputEdit->append(lineStr); |
242 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | 236 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); |
243 | } | 237 | } |
244 | 238 | ||
245 | void Output::processFinished() { | 239 | void Output::processFinished() { |
246 | 240 | ||
247 | delete proc; | 241 | delete proc; |
248 | OutputEdit->append( "\nFinished\n"); | 242 | OutputEdit->append( tr("\nFinished\n") ); |
249 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | 243 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); |
250 | // close(); | 244 | // close(); |
251 | // disconnect( layer(), SIGNAL(received(const QByteArray &)), | 245 | // disconnect( layer(), SIGNAL(received(const QByteArray &)), |
252 | // this, SLOT(commandStdin(const QByteArray &))); | 246 | // this, SLOT(commandStdin(const QByteArray &))); |
253 | } | 247 | } |
254 | 248 | ||
255 | //============================== | 249 | //============================== |
256 | 250 | ||
257 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | 251 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) |
258 | : QDialog( parent, name, modal, fl ) | 252 | : QDialog( parent, name, modal, fl ) |
259 | { | 253 | { |
260 | if ( !name ) | 254 | if ( !name ) |