summaryrefslogtreecommitdiff
Unidiff
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
@@ -1,8 +1,8 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG = qt warn_on debug 2CONFIG = qt warn_on debug
3#CONFIG = qt warn_on release 3#CONFIG = qt warn_on release
4HEADERS = btconnectionitem.h btdeviceitem.h btserviceitem.h stdpopups.h popuphelper.h bluebase.h scandialog.h btlistitem.h hciconfwrapper.h bticonloader.h 4HEADERS = btconnectionitem.h btdeviceitem.h btserviceitem.h stdpopups.h popuphelper.h bluebase.h scandialog.h btlistitem.h hciconfwrapper.h bticonloader.h pppdialog.h
5SOURCES = btconnectionitem.cpp btdeviceitem.cpp btserviceitem.h stdpopups.cpp popuphelper.cpp main.cpp bluebase.cpp scandialog.cpp btlistitem.cpp hciconfwrapper.cpp bticonloader.cpp 5SOURCES = btconnectionitem.cpp btdeviceitem.cpp btserviceitem.h stdpopups.cpp popuphelper.cpp main.cpp bluebase.cpp scandialog.cpp btlistitem.cpp hciconfwrapper.cpp bticonloader.cpp pppdialog.cpp
6INCLUDEPATH += $(OPIEDIR)/include 6INCLUDEPATH += $(OPIEDIR)/include
7INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib 7INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib
8DEPENDPATH += $(OPIEDIR)/include 8DEPENDPATH += $(OPIEDIR)/include
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
@@ -3,7 +3,7 @@ Priority: optional
3Section: opie/applications 3Section: opie/applications
4Maintainer: Maximilian Reiß <max.reiss@gmx.de> 4Maintainer: Maximilian Reiß <max.reiss@gmx.de>
5Architecture: arm 5Architecture: arm
6Version: 0.3.4-$SUB_VERSION 6Version: 0.5.4-$SUB_VERSION
7Depends: opie-base ($QPE_VERSION) 7Depends: opie-base ($QPE_VERSION)
8License: GPL 8License: GPL
9Description: Bluetooth Manager application 9Description: Bluetooth Manager application
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 @@
1
2#include "pppdialog.h"
3#include <qpushbutton.h>
4#include <qmultilineedit.h>
5#include <qlineedit.h>
6#include <qlayout.h>
7#include <qlabel.h>
8#include <opie/oprocess.h>
9
10PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
11 : QDialog( parent, name, modal, fl ) {
12
13 if ( !name )
14 setName( "PPPDialog" );
15 setCaption( tr( "ppp connection " ) ) ;
16
17 layout = new QVBoxLayout( this );
18
19 QLabel* info = new QLabel( this );
20 info->setText( "Enter an ppp script name:" );
21
22 cmdLine = new QLineEdit( this );
23
24 outPut = new QMultiLineEdit( this );
25 QFont outPut_font( outPut->font() );
26 outPut_font.setPointSize( 8 );
27 outPut->setFont( outPut_font );
28 outPut->setWordWrap( QMultiLineEdit::WidgetWidth );
29
30 connectButton = new QPushButton( this );
31 connectButton->setText( tr( "Connect" ) );
32
33 layout->addWidget(info);
34 layout->addWidget(cmdLine);
35 layout->addWidget(outPut);
36 layout->addWidget(connectButton);
37
38 connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) );
39
40}
41
42PPPDialog::~PPPDialog() {
43}
44
45void PPPDialog::connectToDevice() {
46 outPut->clear();
47 // vom popupmenu beziehen
48 QString devName = "/dev/ttyU0";
49 QString connectScript = "/etc/ppp/peers/" + cmdLine->text();
50 OProcess* pppDial = new OProcess();
51 *pppDial << "pppd" << devName << "call" << connectScript;
52 connect( pppDial, SIGNAL(receivedStdout(OProcess*, char*, int ) ),
53 this, SLOT(fillOutPut(OProcess*, char*, int ) ) );
54 if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) {
55 qWarning("could not start");
56 delete pppDial;
57 }
58}
59
60void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) {
61 QCString str(cha, len );
62 outPut->insertLine( str );
63 delete pppDial;
64}
65
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 @@
1#ifndef PPPDIALOG_H
2#define PPPDIALOG_H
3
4
5#include <qdialog.h>
6#include <opie/oprocess.h>
7
8class QVBoxLayout;
9class QPushButton;
10class QMultiLineEdit;
11class QLineEdit;
12
13class PPPDialog : public QDialog {
14
15 Q_OBJECT
16
17public:
18 PPPDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);
19 ~PPPDialog();
20
21
22private slots:
23 void connectToDevice();
24 void fillOutPut( OProcess* pppDial, char* cha, int len );
25protected:
26 QVBoxLayout* layout;
27 QLineEdit* cmdLine;
28 QPushButton* connectButton;
29 QMultiLineEdit* outPut;
30
31};
32#endif