Diffstat (limited to 'noncore/apps/advancedfm/output.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/output.cpp | 24 |
1 files changed, 9 insertions, 15 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 | |||
@@ -6,21 +6,15 @@ | |||
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 */ |
@@ -126,15 +120,15 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name, | |||
126 | { | 120 | { |
127 | QStringList cmmds; | 121 | QStringList cmmds; |
128 | // cmmds=QStringList::split( " ", commands, false); | 122 | // cmmds=QStringList::split( " ", commands, false); |
129 | cmmds=commands; | 123 | cmmds=commands; |
130 | // qDebug("count %d", cmmds.count()); | 124 | // qDebug("count %d", cmmds.count()); |
131 | if ( !name ) | 125 | if ( !name ) |
132 | setName( tr("Output")); | 126 | setName( tr("Output")); |
133 | resize( 196, 269 ); | 127 | resize( 196, 269 ); |
134 | setCaption( name ); | 128 | setCaption( name ); |
135 | 129 | ||
136 | OutputLayout = new QGridLayout( this ); | 130 | OutputLayout = new QGridLayout( this ); |
137 | OutputLayout->setSpacing( 2); | 131 | OutputLayout->setSpacing( 2); |
138 | OutputLayout->setMargin( 2); | 132 | OutputLayout->setMargin( 2); |
139 | 133 | ||
140 | QPushButton *docButton; | 134 | QPushButton *docButton; |
@@ -160,20 +154,20 @@ 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 | } |
@@ -186,9 +180,9 @@ void Output::saveOutput() { | |||
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); |
188 | fileDlg->exec(); | 182 | fileDlg->exec(); |
189 | if( fileDlg->result() == 1 ) { | 183 | if( fileDlg->result() == 1 ) { |
190 | QString filename = QPEApplication::documentDir(); | 184 | QString filename = QPEApplication::documentDir(); |
191 | if(filename.right(1).find('/') == -1) | 185 | if(filename.right(1).find('/') == -1) |
192 | filename+="/"; | 186 | filename+="/"; |
193 | QString name = fileDlg->LineEdit1->text(); | 187 | QString name = fileDlg->LineEdit1->text(); |
194 | filename+="text/plain/"+name; | 188 | filename+="text/plain/"+name; |
@@ -244,9 +238,9 @@ void Output::commandStderr(OProcess*, char *buffer, int buflen) { | |||
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 &))); |
@@ -258,9 +252,9 @@ InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags | |||
258 | : QDialog( parent, name, modal, fl ) | 252 | : QDialog( parent, name, modal, fl ) |
259 | { | 253 | { |
260 | if ( !name ) | 254 | if ( !name ) |
261 | setName( "InputDialog" ); | 255 | setName( "InputDialog" ); |
262 | resize( 234, 50 ); | 256 | resize( 234, 50 ); |
263 | setMaximumSize( QSize( 240, 50 ) ); | 257 | setMaximumSize( QSize( 240, 50 ) ); |
264 | setCaption( tr(name ) ); | 258 | setCaption( tr(name ) ); |
265 | 259 | ||
266 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); | 260 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); |