author | zecke <zecke> | 2004-03-14 16:13:28 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-14 16:13:28 (UTC) |
commit | f3d284849df36ef281dcb5aa2d00f613e3a354d8 (patch) (unidiff) | |
tree | 65406b10a839ffa1ba683f59e61ef7227a0093d1 /noncore/net/opietooth/manager/pppdialog.cpp | |
parent | f12af18557c8f376f0c6c30e80a85737ff6c592e (diff) | |
download | opie-f3d284849df36ef281dcb5aa2d00f613e3a354d8.zip opie-f3d284849df36ef281dcb5aa2d00f613e3a354d8.tar.gz opie-f3d284849df36ef281dcb5aa2d00f613e3a354d8.tar.bz2 |
Fix up depends on LIBOPIE1
Proper signature for signal and slots and namespaces
Diffstat (limited to 'noncore/net/opietooth/manager/pppdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/pppdialog.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/noncore/net/opietooth/manager/pppdialog.cpp b/noncore/net/opietooth/manager/pppdialog.cpp index 870e7fd..78c1501 100644 --- a/noncore/net/opietooth/manager/pppdialog.cpp +++ b/noncore/net/opietooth/manager/pppdialog.cpp | |||
@@ -1,70 +1,69 @@ | |||
1 | 1 | ||
2 | #include "pppdialog.h" | 2 | #include "pppdialog.h" |
3 | #include <qpushbutton.h> | 3 | #include <qpushbutton.h> |
4 | #include <qmultilineedit.h> | 4 | #include <qmultilineedit.h> |
5 | #include <qlineedit.h> | 5 | #include <qlineedit.h> |
6 | #include <qlayout.h> | 6 | #include <qlayout.h> |
7 | #include <qlabel.h> | 7 | #include <qlabel.h> |
8 | #include <opie2/oprocess.h> | 8 | #include <opie2/oprocess.h> |
9 | 9 | ||
10 | using namespace OpieTooth; | 10 | using namespace OpieTooth; |
11 | 11 | ||
12 | using namespace Opie::Core; | 12 | using namespace Opie::Core; |
13 | using namespace Opie::Core; | ||
14 | PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device ) | 13 | PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device ) |
15 | : QDialog( parent, name, modal, fl ) { | 14 | : QDialog( parent, name, modal, fl ) { |
16 | 15 | ||
17 | if ( !name ) | 16 | if ( !name ) |
18 | setName( "PPPDialog" ); | 17 | setName( "PPPDialog" ); |
19 | setCaption( tr( "ppp connection " ) ) ; | 18 | setCaption( tr( "ppp connection " ) ) ; |
20 | 19 | ||
21 | m_device = device; | 20 | m_device = device; |
22 | 21 | ||
23 | layout = new QVBoxLayout( this ); | 22 | layout = new QVBoxLayout( this ); |
24 | 23 | ||
25 | QLabel* info = new QLabel( this ); | 24 | QLabel* info = new QLabel( this ); |
26 | info->setText( tr("Enter an ppp script name:") ); | 25 | info->setText( tr("Enter an ppp script name:") ); |
27 | 26 | ||
28 | cmdLine = new QLineEdit( this ); | 27 | cmdLine = new QLineEdit( this ); |
29 | 28 | ||
30 | outPut = new QMultiLineEdit( this ); | 29 | outPut = new QMultiLineEdit( this ); |
31 | QFont outPut_font( outPut->font() ); | 30 | QFont outPut_font( outPut->font() ); |
32 | outPut_font.setPointSize( 8 ); | 31 | outPut_font.setPointSize( 8 ); |
33 | outPut->setFont( outPut_font ); | 32 | outPut->setFont( outPut_font ); |
34 | outPut->setWordWrap( QMultiLineEdit::WidgetWidth ); | 33 | outPut->setWordWrap( QMultiLineEdit::WidgetWidth ); |
35 | 34 | ||
36 | connectButton = new QPushButton( this ); | 35 | connectButton = new QPushButton( this ); |
37 | connectButton->setText( tr( "Connect" ) ); | 36 | connectButton->setText( tr( "Connect" ) ); |
38 | 37 | ||
39 | layout->addWidget(info); | 38 | layout->addWidget(info); |
40 | layout->addWidget(cmdLine); | 39 | layout->addWidget(cmdLine); |
41 | layout->addWidget(outPut); | 40 | layout->addWidget(outPut); |
42 | layout->addWidget(connectButton); | 41 | layout->addWidget(connectButton); |
43 | 42 | ||
44 | connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) ); | 43 | connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) ); |
45 | 44 | ||
46 | } | 45 | } |
47 | 46 | ||
48 | PPPDialog::~PPPDialog() { | 47 | PPPDialog::~PPPDialog() { |
49 | } | 48 | } |
50 | 49 | ||
51 | void PPPDialog::connectToDevice() { | 50 | void PPPDialog::connectToDevice() { |
52 | outPut->clear(); | 51 | outPut->clear(); |
53 | // vom popupmenu beziehen | 52 | // vom popupmenu beziehen |
54 | QString connectScript = "/etc/ppp/peers/" + cmdLine->text(); | 53 | QString connectScript = "/etc/ppp/peers/" + cmdLine->text(); |
55 | OProcess* pppDial = new OProcess(); | 54 | OProcess* pppDial = new OProcess(); |
56 | *pppDial << "pppd" << m_device << "call" << connectScript; | 55 | *pppDial << "pppd" << m_device << "call" << connectScript; |
57 | connect( pppDial, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int) ), | 56 | connect( pppDial, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int) ), |
58 | this, SLOT(fillOutPut(OProcess*,char*,int) ) ); | 57 | this, SLOT(fillOutPut(Opie::Core::OProcess*,char*,int) ) ); |
59 | if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) { | 58 | if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) { |
60 | qWarning("could not start"); | 59 | qWarning("could not start"); |
61 | delete pppDial; | 60 | delete pppDial; |
62 | } | 61 | } |
63 | } | 62 | } |
64 | 63 | ||
65 | void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) { | 64 | void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) { |
66 | QCString str(cha, len ); | 65 | QCString str(cha, len ); |
67 | outPut->insertLine( str ); | 66 | outPut->insertLine( str ); |
68 | delete pppDial; | 67 | delete pppDial; |
69 | } | 68 | } |
70 | 69 | ||