Diffstat (limited to 'noncore/apps/advancedfm/output.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/output.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/noncore/apps/advancedfm/output.cpp b/noncore/apps/advancedfm/output.cpp index 0bba1d8..16a0992 100644 --- a/noncore/apps/advancedfm/output.cpp +++ b/noncore/apps/advancedfm/output.cpp | |||
@@ -1,42 +1,44 @@ | |||
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 <qpe/qpeapplication.h> | 8 | #include <qpe/qpeapplication.h> |
9 | #include <qpe/applnk.h> | 9 | #include <qpe/applnk.h> |
10 | 10 | ||
11 | #include <qfile.h> | 11 | #include <qfile.h> |
12 | #include <qmultilineedit.h> | 12 | #include <qmultilineedit.h> |
13 | #include <qpushbutton.h> | 13 | #include <qpushbutton.h> |
14 | #include <qlayout.h> | 14 | #include <qlayout.h> |
15 | 15 | ||
16 | #include <errno.h> | 16 | #include <errno.h> |
17 | 17 | ||
18 | /* XPM */ | 18 | /* XPM */ |
19 | using namespace Opie::Core; | ||
20 | using namespace Opie::Core; | ||
19 | static char * filesave_xpm[] = { | 21 | static char * filesave_xpm[] = { |
20 | "16 16 78 1", | 22 | "16 16 78 1", |
21 | " c None", | 23 | " c None", |
22 | ". c #343434", | 24 | ". c #343434", |
23 | "+ c #A0A0A0", | 25 | "+ c #A0A0A0", |
24 | "@ c #565656", | 26 | "@ c #565656", |
25 | "# c #9E9E9E", | 27 | "# c #9E9E9E", |
26 | "$ c #525252", | 28 | "$ c #525252", |
27 | "% c #929292", | 29 | "% c #929292", |
28 | "& c #676767", | 30 | "& c #676767", |
29 | "* c #848484", | 31 | "* c #848484", |
30 | "= c #666666", | 32 | "= c #666666", |
31 | "- c #D8D8D8", | 33 | "- c #D8D8D8", |
32 | "; c #FFFFFF", | 34 | "; c #FFFFFF", |
33 | "> c #DBDBDB", | 35 | "> c #DBDBDB", |
34 | ", c #636363", | 36 | ", c #636363", |
35 | "' c #989898", | 37 | "' c #989898", |
36 | ") c #2D2D2D", | 38 | ") c #2D2D2D", |
37 | "! c #909090", | 39 | "! c #909090", |
38 | "~ c #AEAEAE", | 40 | "~ c #AEAEAE", |
39 | "{ c #EAEAEA", | 41 | "{ c #EAEAEA", |
40 | "] c #575757", | 42 | "] c #575757", |
41 | "^ c #585858", | 43 | "^ c #585858", |
42 | "/ c #8A8A8A", | 44 | "/ c #8A8A8A", |
@@ -120,55 +122,55 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name, | |||
120 | // cmmds=QStringList::split( " ", commands, false); | 122 | // cmmds=QStringList::split( " ", commands, false); |
121 | cmmds=commands; | 123 | cmmds=commands; |
122 | // qDebug("count %d", cmmds.count()); | 124 | // qDebug("count %d", cmmds.count()); |
123 | if ( !name ) | 125 | if ( !name ) |
124 | setName( tr("Output")); | 126 | setName( tr("Output")); |
125 | resize( 196, 269 ); | 127 | resize( 196, 269 ); |
126 | setCaption( name ); | 128 | setCaption( name ); |
127 | 129 | ||
128 | OutputLayout = new QGridLayout( this ); | 130 | OutputLayout = new QGridLayout( this ); |
129 | OutputLayout->setSpacing( 2); | 131 | OutputLayout->setSpacing( 2); |
130 | OutputLayout->setMargin( 2); | 132 | OutputLayout->setMargin( 2); |
131 | 133 | ||
132 | QPushButton *docButton; | 134 | QPushButton *docButton; |
133 | docButton = new QPushButton( QPixmap(( const char** ) filesave_xpm ) ,"",this,"saveButton"); | 135 | docButton = new QPushButton( QPixmap(( const char** ) filesave_xpm ) ,"",this,"saveButton"); |
134 | docButton->setFixedSize( QSize( 20, 20 ) ); | 136 | docButton->setFixedSize( QSize( 20, 20 ) ); |
135 | connect( docButton,SIGNAL(released()),this,SLOT( saveOutput() )); | 137 | connect( docButton,SIGNAL(released()),this,SLOT( saveOutput() )); |
136 | // docButton->setFlat(TRUE); | 138 | // docButton->setFlat(TRUE); |
137 | OutputLayout->addMultiCellWidget( docButton, 0,0,3,3 ); | 139 | OutputLayout->addMultiCellWidget( docButton, 0,0,3,3 ); |
138 | 140 | ||
139 | OutputEdit = new QMultiLineEdit( this, "OutputEdit" ); | 141 | OutputEdit = new QMultiLineEdit( this, "OutputEdit" ); |
140 | OutputLayout->addMultiCellWidget( OutputEdit, 1,1,0,3 ); | 142 | OutputLayout->addMultiCellWidget( OutputEdit, 1,1,0,3 ); |
141 | 143 | ||
142 | proc = new OProcess(); | 144 | proc = new OProcess(); |
143 | 145 | ||
144 | connect(proc, SIGNAL(processExited(OProcess*)), | 146 | connect(proc, SIGNAL(processExited(Opie::Core::OProcess*)), |
145 | this, SLOT( processFinished())); | 147 | this, SLOT( processFinished())); |
146 | 148 | ||
147 | connect(proc, SIGNAL(receivedStdout(OProcess*,char*,int)), | 149 | connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)), |
148 | this, SLOT(commandStdout(OProcess*,char*,int))); | 150 | this, SLOT(commandStdout(OProcess*,char*,int))); |
149 | 151 | ||
150 | connect(proc, SIGNAL(receivedStderr(OProcess*,char*,int)), | 152 | connect(proc, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)), |
151 | this, SLOT(commandStderr(OProcess*,char*,int))); | 153 | this, SLOT(commandStderr(OProcess*,char*,int))); |
152 | 154 | ||
153 | // connect( , SIGNAL(received(const QByteArray&)), | 155 | // connect( , SIGNAL(received(const QByteArray&)), |
154 | // this, SLOT(commandStdin(const QByteArray&))); | 156 | // this, SLOT(commandStdin(const QByteArray&))); |
155 | 157 | ||
156 | // * proc << commands.latin1(); | 158 | // * proc << commands.latin1(); |
157 | for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) { | 159 | for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) { |
158 | qDebug( "%s", (*it).latin1() ); | 160 | qDebug( "%s", (*it).latin1() ); |
159 | * proc << (*it).latin1(); | 161 | * proc << (*it).latin1(); |
160 | } | 162 | } |
161 | 163 | ||
162 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) { | 164 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) { |
163 | 165 | ||
164 | OutputEdit->append(tr("Process could not start") ); | 166 | OutputEdit->append(tr("Process could not start") ); |
165 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | 167 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); |
166 | perror("Error: "); | 168 | perror("Error: "); |
167 | QString errorMsg=tr("Error\n")+(QString)strerror(errno); | 169 | QString errorMsg=tr("Error\n")+(QString)strerror(errno); |
168 | OutputEdit->append( errorMsg); | 170 | OutputEdit->append( errorMsg); |
169 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | 171 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); |
170 | } | 172 | } |
171 | } | 173 | } |
172 | 174 | ||
173 | Output::~Output() { | 175 | Output::~Output() { |
174 | } | 176 | } |