summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/dundialog.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opietooth/manager/dundialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/dundialog.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/noncore/net/opietooth/manager/dundialog.cpp b/noncore/net/opietooth/manager/dundialog.cpp
index c6d8619..872ab00 100644
--- a/noncore/net/opietooth/manager/dundialog.cpp
+++ b/noncore/net/opietooth/manager/dundialog.cpp
@@ -15,8 +15,10 @@
#include <qlayout.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qstring.h>
+#include <qcombobox.h>
+#include <qdir.h>
#include <opie2/oprocess.h>
#include <opie2/odebug.h>
using namespace Opie::Core;
@@ -26,8 +28,12 @@ using namespace Opie::Core;
DunDialog::DunDialog( const QString& device, int port, QWidget* parent,
const char* name, bool modal, WFlags fl )
: QDialog( parent, name, modal, fl ) {
+ QDir d("/etc/ppp/peers/"); //Dir we search files in
+ d.setFilter( QDir::Files);
+ d.setSorting( QDir::Size | QDir::Reversed );
+
if ( !name )
setName( "DUNDialog" );
setCaption( tr( "DUN connection " ) ) ;
@@ -39,9 +45,10 @@ DunDialog::DunDialog( const QString& device, int port, QWidget* parent,
QLabel* info = new QLabel( this );
info->setText( tr("Enter an ppp script name:") );
- cmdLine = new QLineEdit( this );
+ cmdLine = new QComboBox( this );
+ cmdLine->setEditable(true);
outPut = new QMultiLineEdit( this );
QFont outPut_font( outPut->font() );
outPut_font.setPointSize( 8 );
@@ -64,8 +71,10 @@ DunDialog::DunDialog( const QString& device, int port, QWidget* parent,
layout->addWidget(outPut);
layout->addWidget(connectButton);
connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) );
+ //And fill cmdLine with ppp script filenames
+ cmdLine->insertStringList(d.entryList());
}
DunDialog::~DunDialog() {
}
@@ -73,9 +82,9 @@ DunDialog::~DunDialog() {
void DunDialog::connectToDevice() {
bool doEnc = doEncryption->isChecked();
bool doPersist = persist->isChecked();
- if (cmdLine->text() == "")
+ if (cmdLine->currentText() == "")
return;
if (m_dunConnect) {
outPut->append(tr("Work in progress"));
return;
@@ -92,9 +101,9 @@ void DunDialog::connectToDevice() {
*m_dunConnect << tr("--encrypt");
if (doPersist)
*m_dunConnect << tr("--persist");
*m_dunConnect << tr("call")
- << cmdLine->text();
+ << cmdLine->currentText();
if (!m_dunConnect->start(OProcess::NotifyOnExit,
OProcess::All)) {
outPut->append(tr("Couldn't start"));
delete m_dunConnect;