summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2003-03-23 14:39:42 (UTC)
committer llornkcor <llornkcor>2003-03-23 14:39:42 (UTC)
commit376aa038c75b3fbccdcb2e81d5b2ac3de787a447 (patch) (side-by-side diff)
treedfbcd8cfd1a6c37eb5d3b0f8f003a0c41154fd59
parent47d6402958e3d95a49a116552979407b4b731670 (diff)
downloadopie-376aa038c75b3fbccdcb2e81d5b2ac3de787a447.zip
opie-376aa038c75b3fbccdcb2e81d5b2ac3de787a447.tar.gz
opie-376aa038c75b3fbccdcb2e81d5b2ac3de787a447.tar.bz2
add stderr messagebox to oprocess
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.h4
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp20
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
@@ -6,24 +6,25 @@
email : ljp@llornkcor.com
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef ADVANCEDFM_H
#define ADVANCEDFM_H
#define QTOPIA_INTERNAL_FSLP // to get access to fileproperties
#define QT_QWS_OPIE
//#include <opie/otabwidget.h>
+#include <opie/oprocess.h>
#include <qpe/ir.h>
#include <qvariant.h>
#include <qdialog.h>
#include <qmainwindow.h>
#include <qstringlist.h>
#include <qdir.h>
#include <qstring.h>
#include <qpoint.h>
#include <qtimer.h>
class OTabWidget;
@@ -154,17 +155,18 @@ private:
QString oldName;
QTimer menuTimer;
void startProcess(const QString &);
bool eventFilter( QObject * , QEvent * );
void cancelRename();
void doRename(QListView *);
void okRename();
void customDirsToMenu();
void addCustomDir();
void removeCustomDir();
private slots:
- void processEnded();
+ void processEnded(OProcess *);
+ void oprocessStderr(OProcess *, char *, int);
void gotoCustomDir(const QString &);
};
#endif // ADVANCEDFM_H
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
@@ -715,40 +715,54 @@ void AdvancedFm::selectAll()
// } else {
// Remote_View->selectAll(true);
// Remote_View->setSelected( Remote_View->firstChild(),false);
// }
}
void AdvancedFm::startProcess(const QString & cmd)
{
QStringList command;
OProcess *process;
process = new OProcess();
connect(process, SIGNAL(processExited(OProcess *)),
- this, SLOT( processEnded()));
+ this, SLOT( processEnded(OProcess *)));
+
+ connect(process, SIGNAL( receivedStderr(OProcess *, char *, int)),
+ this, SLOT( oprocessStderr(OProcess *, char *, int)));
command << "/bin/sh";
command << "-c";
command << cmd.latin1();
*process << command;
- if(!process->start(OProcess::NotifyOnExit) )
+ if(!process->start(OProcess::NotifyOnExit, OProcess::All) )
qDebug("could not start process");
}
-void AdvancedFm::processEnded()
+void AdvancedFm::processEnded(OProcess *)
{
// populateLocalView();
populateView();
}
+void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int buflen) {
+ qWarning("received stderrt %d bytes", buflen);
+
+ QString lineStr = buffer;
+// lineStr=lineStr.left(lineStr.length()-1);
+ QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") );
+
+// OutputEdit->append(lineStr);
+// OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
+}
+
bool AdvancedFm::eventFilter( QObject * o, QEvent * e )
{
if ( o->inherits( "QLineEdit" ) )
{
if ( e->type() == QEvent::KeyPress )
{
QKeyEvent *ke = (QKeyEvent*)e;
if ( ke->key() == Key_Return ||
ke->key() == Key_Enter )
{
okRename();
return true;