author | llornkcor <llornkcor> | 2003-03-23 14:39:42 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-03-23 14:39:42 (UTC) |
commit | 376aa038c75b3fbccdcb2e81d5b2ac3de787a447 (patch) (unidiff) | |
tree | dfbcd8cfd1a6c37eb5d3b0f8f003a0c41154fd59 | |
parent | 47d6402958e3d95a49a116552979407b4b731670 (diff) | |
download | opie-376aa038c75b3fbccdcb2e81d5b2ac3de787a447.zip opie-376aa038c75b3fbccdcb2e81d5b2ac3de787a447.tar.gz opie-376aa038c75b3fbccdcb2e81d5b2ac3de787a447.tar.bz2 |
add stderr messagebox to oprocess
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 4 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 20 |
2 files changed, 20 insertions, 4 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index 3250a66..f31956c 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #define QT_QWS_OPIE | 15 | #define QT_QWS_OPIE |
16 | 16 | ||
17 | //#include <opie/otabwidget.h> | 17 | //#include <opie/otabwidget.h> |
18 | #include <opie/oprocess.h> | ||
18 | #include <qpe/ir.h> | 19 | #include <qpe/ir.h> |
19 | 20 | ||
20 | #include <qvariant.h> | 21 | #include <qvariant.h> |
@@ -163,7 +164,8 @@ private: | |||
163 | void removeCustomDir(); | 164 | void removeCustomDir(); |
164 | 165 | ||
165 | private slots: | 166 | private slots: |
166 | void processEnded(); | 167 | void processEnded(OProcess *); |
168 | void oprocessStderr(OProcess *, char *, int); | ||
167 | void gotoCustomDir(const QString &); | 169 | void gotoCustomDir(const QString &); |
168 | }; | 170 | }; |
169 | 171 | ||
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index a82d69a..eac13f6 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -724,22 +724,36 @@ void AdvancedFm::startProcess(const QString & cmd) | |||
724 | OProcess *process; | 724 | OProcess *process; |
725 | process = new OProcess(); | 725 | process = new OProcess(); |
726 | connect(process, SIGNAL(processExited(OProcess *)), | 726 | connect(process, SIGNAL(processExited(OProcess *)), |
727 | this, SLOT( processEnded())); | 727 | this, SLOT( processEnded(OProcess *))); |
728 | |||
729 | connect(process, SIGNAL( receivedStderr(OProcess *, char *, int)), | ||
730 | this, SLOT( oprocessStderr(OProcess *, char *, int))); | ||
728 | 731 | ||
729 | command << "/bin/sh"; | 732 | command << "/bin/sh"; |
730 | command << "-c"; | 733 | command << "-c"; |
731 | command << cmd.latin1(); | 734 | command << cmd.latin1(); |
732 | *process << command; | 735 | *process << command; |
733 | if(!process->start(OProcess::NotifyOnExit) ) | 736 | if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) |
734 | qDebug("could not start process"); | 737 | qDebug("could not start process"); |
735 | } | 738 | } |
736 | 739 | ||
737 | void AdvancedFm::processEnded() | 740 | void AdvancedFm::processEnded(OProcess *) |
738 | { | 741 | { |
739 | // populateLocalView(); | 742 | // populateLocalView(); |
740 | populateView(); | 743 | populateView(); |
741 | } | 744 | } |
742 | 745 | ||
746 | void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int buflen) { | ||
747 | qWarning("received stderrt %d bytes", buflen); | ||
748 | |||
749 | QString lineStr = buffer; | ||
750 | // lineStr=lineStr.left(lineStr.length()-1); | ||
751 | QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); | ||
752 | |||
753 | // OutputEdit->append(lineStr); | ||
754 | // OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | ||
755 | } | ||
756 | |||
743 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) | 757 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) |
744 | { | 758 | { |
745 | if ( o->inherits( "QLineEdit" ) ) | 759 | if ( o->inherits( "QLineEdit" ) ) |