Diffstat (limited to 'noncore/net/opietooth/manager/pppdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/pppdialog.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/noncore/net/opietooth/manager/pppdialog.cpp b/noncore/net/opietooth/manager/pppdialog.cpp index 11091c4..1df22a1 100644 --- a/noncore/net/opietooth/manager/pppdialog.cpp +++ b/noncore/net/opietooth/manager/pppdialog.cpp | |||
@@ -1,3 +1,12 @@ | |||
1 | 1 | /* $Id$ */ | |
2 | /* PPP/rfcomm connection dialog */ | ||
3 | /*************************************************************************** | ||
4 | * * | ||
5 | * This program is free software; you can redistribute it and/or modify * | ||
6 | * it under the terms of the GNU General Public License as published by * | ||
7 | * the Free Software Foundation; either version 2 of the License, or * | ||
8 | * (at your option) any later version. * | ||
9 | * * | ||
10 | ***************************************************************************/ | ||
2 | #include "pppdialog.h" | 11 | #include "pppdialog.h" |
3 | #include "rfcommhelper.h" | 12 | #include "rfcommhelper.h" |
@@ -8,4 +17,5 @@ | |||
8 | #include <qcombobox.h> | 17 | #include <qcombobox.h> |
9 | #include <qlabel.h> | 18 | #include <qlabel.h> |
19 | #include <qdir.h> | ||
10 | #include <opie2/oprocess.h> | 20 | #include <opie2/oprocess.h> |
11 | #include <opie2/odebug.h> | 21 | #include <opie2/odebug.h> |
@@ -22,5 +32,8 @@ PPPDialog::PPPDialog( const QString& device, int port, QWidget* parent, | |||
22 | : QDialog( parent, name, modal, fl ) { | 32 | : QDialog( parent, name, modal, fl ) { |
23 | int i; //Just an index variable | 33 | int i; //Just an index variable |
24 | 34 | QDir d("/etc/ppp/peers/"); //Dir we search files in | |
35 | d.setFilter( QDir::Files); | ||
36 | d.setSorting( QDir::Size | QDir::Reversed ); | ||
37 | |||
25 | if ( !name ) | 38 | if ( !name ) |
26 | setName( "PPPDialog" ); | 39 | setName( "PPPDialog" ); |
@@ -33,7 +46,8 @@ PPPDialog::PPPDialog( const QString& device, int port, QWidget* parent, | |||
33 | 46 | ||
34 | QLabel* info = new QLabel( this ); | 47 | QLabel* info = new QLabel( this ); |
35 | info->setText( tr("Enter an ppp script name:") ); | 48 | info->setText( tr("Enter a ppp script name:") ); |
36 | 49 | ||
37 | cmdLine = new QLineEdit( this ); | 50 | cmdLine = new QComboBox( this ); |
51 | cmdLine->setEditable(true); | ||
38 | 52 | ||
39 | outPut = new QMultiLineEdit( this ); | 53 | outPut = new QMultiLineEdit( this ); |
@@ -59,4 +73,6 @@ PPPDialog::PPPDialog( const QString& device, int port, QWidget* parent, | |||
59 | 73 | ||
60 | connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) ); | 74 | connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) ); |
75 | //And fill cmdLine with ppp script filenames | ||
76 | cmdLine->insertStringList(d.entryList()); | ||
61 | } | 77 | } |
62 | 78 | ||
@@ -73,5 +89,5 @@ void PPPDialog::connectToDevice() { | |||
73 | PPPDialog::conns[portNum].proc.clearArguments(); | 89 | PPPDialog::conns[portNum].proc.clearArguments(); |
74 | // vom popupmenu beziehen | 90 | // vom popupmenu beziehen |
75 | if (cmdLine->text().isEmpty()) {//Connect by rfcomm | 91 | if (cmdLine->currentText().isEmpty()) {//Connect by rfcomm |
76 | PPPDialog::conns[portNum].proc << "rfcomm" << "connect" | 92 | PPPDialog::conns[portNum].proc << "rfcomm" << "connect" |
77 | << QString::number(portNum) << m_device << QString::number(m_port); | 93 | << QString::number(portNum) << m_device << QString::number(m_port); |
@@ -81,5 +97,5 @@ void PPPDialog::connectToDevice() { | |||
81 | << tr("/dev/bluetooth/rfcomm/%1").arg(portNum) | 97 | << tr("/dev/bluetooth/rfcomm/%1").arg(portNum) |
82 | << "call" | 98 | << "call" |
83 | << cmdLine->text(); | 99 | << cmdLine->currentText(); |
84 | } | 100 | } |
85 | if (!PPPDialog::conns[portNum].proc.start(OProcess::NotifyOnExit, | 101 | if (!PPPDialog::conns[portNum].proc.start(OProcess::NotifyOnExit, |