summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-07-12 23:42:44 (UTC)
committer harlekin <harlekin>2002-07-12 23:42:44 (UTC)
commitd2e426b08b972ffc0aef0479bd3523df14e5f4e4 (patch) (side-by-side diff)
tree0de05a0ba4452ed2ce7e3627f58f69082822332a
parent04fc12b5275c5b5968f52f84c997fc2bdffb5781 (diff)
downloadopie-d2e426b08b972ffc0aef0479bd3523df14e5f4e4.zip
opie-d2e426b08b972ffc0aef0479bd3523df14e5f4e4.tar.gz
opie-d2e426b08b972ffc0aef0479bd3523df14e5f4e4.tar.bz2
dialog for dialing via ppp
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/manager.pro4
-rw-r--r--noncore/net/opietooth/manager/opie-toothmanager.control2
-rw-r--r--noncore/net/opietooth/manager/pppdialog.cpp65
-rw-r--r--noncore/net/opietooth/manager/pppdialog.h32
4 files changed, 100 insertions, 3 deletions
diff --git a/noncore/net/opietooth/manager/manager.pro b/noncore/net/opietooth/manager/manager.pro
index d36b8df2..2d8ebe3 100644
--- a/noncore/net/opietooth/manager/manager.pro
+++ b/noncore/net/opietooth/manager/manager.pro
@@ -2,6 +2,6 @@ TEMPLATE = app
CONFIG = qt warn_on debug
#CONFIG = qt warn_on release
-HEADERS = btconnectionitem.h btdeviceitem.h btserviceitem.h stdpopups.h popuphelper.h bluebase.h scandialog.h btlistitem.h hciconfwrapper.h bticonloader.h
-SOURCES = btconnectionitem.cpp btdeviceitem.cpp btserviceitem.h stdpopups.cpp popuphelper.cpp main.cpp bluebase.cpp scandialog.cpp btlistitem.cpp hciconfwrapper.cpp bticonloader.cpp
+HEADERS = btconnectionitem.h btdeviceitem.h btserviceitem.h stdpopups.h popuphelper.h bluebase.h scandialog.h btlistitem.h hciconfwrapper.h bticonloader.h pppdialog.h
+SOURCES = btconnectionitem.cpp btdeviceitem.cpp btserviceitem.h stdpopups.cpp popuphelper.cpp main.cpp bluebase.cpp scandialog.cpp btlistitem.cpp hciconfwrapper.cpp bticonloader.cpp pppdialog.cpp
INCLUDEPATH += $(OPIEDIR)/include
INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib
diff --git a/noncore/net/opietooth/manager/opie-toothmanager.control b/noncore/net/opietooth/manager/opie-toothmanager.control
index bc53569..ba48eae 100644
--- a/noncore/net/opietooth/manager/opie-toothmanager.control
+++ b/noncore/net/opietooth/manager/opie-toothmanager.control
@@ -4,5 +4,5 @@ Section: opie/applications
Maintainer: Maximilian Reiß <max.reiss@gmx.de>
Architecture: arm
-Version: 0.3.4-$SUB_VERSION
+Version: 0.5.4-$SUB_VERSION
Depends: opie-base ($QPE_VERSION)
License: GPL
diff --git a/noncore/net/opietooth/manager/pppdialog.cpp b/noncore/net/opietooth/manager/pppdialog.cpp
new file mode 100644
index 0000000..472da73
--- a/dev/null
+++ b/noncore/net/opietooth/manager/pppdialog.cpp
@@ -0,0 +1,65 @@
+
+#include "pppdialog.h"
+#include <qpushbutton.h>
+#include <qmultilineedit.h>
+#include <qlineedit.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <opie/oprocess.h>
+
+PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
+ : QDialog( parent, name, modal, fl ) {
+
+ if ( !name )
+ setName( "PPPDialog" );
+ setCaption( tr( "ppp connection " ) ) ;
+
+ layout = new QVBoxLayout( this );
+
+ QLabel* info = new QLabel( this );
+ info->setText( "Enter an ppp script name:" );
+
+ cmdLine = new QLineEdit( this );
+
+ outPut = new QMultiLineEdit( this );
+ QFont outPut_font( outPut->font() );
+ outPut_font.setPointSize( 8 );
+ outPut->setFont( outPut_font );
+ outPut->setWordWrap( QMultiLineEdit::WidgetWidth );
+
+ connectButton = new QPushButton( this );
+ connectButton->setText( tr( "Connect" ) );
+
+ layout->addWidget(info);
+ layout->addWidget(cmdLine);
+ layout->addWidget(outPut);
+ layout->addWidget(connectButton);
+
+ connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) );
+
+}
+
+PPPDialog::~PPPDialog() {
+}
+
+void PPPDialog::connectToDevice() {
+ outPut->clear();
+ // vom popupmenu beziehen
+ QString devName = "/dev/ttyU0";
+ QString connectScript = "/etc/ppp/peers/" + cmdLine->text();
+ OProcess* pppDial = new OProcess();
+ *pppDial << "pppd" << devName << "call" << connectScript;
+ connect( pppDial, SIGNAL(receivedStdout(OProcess*, char*, int ) ),
+ this, SLOT(fillOutPut(OProcess*, char*, int ) ) );
+ if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) {
+ qWarning("could not start");
+ delete pppDial;
+ }
+}
+
+void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) {
+ QCString str(cha, len );
+ outPut->insertLine( str );
+ delete pppDial;
+}
+
diff --git a/noncore/net/opietooth/manager/pppdialog.h b/noncore/net/opietooth/manager/pppdialog.h
new file mode 100644
index 0000000..2baecca
--- a/dev/null
+++ b/noncore/net/opietooth/manager/pppdialog.h
@@ -0,0 +1,32 @@
+#ifndef PPPDIALOG_H
+#define PPPDIALOG_H
+
+
+#include <qdialog.h>
+#include <opie/oprocess.h>
+
+class QVBoxLayout;
+class QPushButton;
+class QMultiLineEdit;
+class QLineEdit;
+
+class PPPDialog : public QDialog {
+
+ Q_OBJECT
+
+public:
+ PPPDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);
+ ~PPPDialog();
+
+
+private slots:
+ void connectToDevice();
+ void fillOutPut( OProcess* pppDial, char* cha, int len );
+protected:
+ QVBoxLayout* layout;
+ QLineEdit* cmdLine;
+ QPushButton* connectButton;
+ QMultiLineEdit* outPut;
+
+};
+#endif