summaryrefslogtreecommitdiff
authorkorovkin <korovkin>2006-04-05 19:29:19 (UTC)
committer korovkin <korovkin>2006-04-05 19:29:19 (UTC)
commit6c1c44237a16dc8fed89905ae729e36eb9711c07 (patch) (unidiff)
treecfcb46f571669c0d8e57ee703c712b09ed8af185
parent31ea6e9f697d72a31ce319f7f42254fe90e48a36 (diff)
downloadopie-6c1c44237a16dc8fed89905ae729e36eb9711c07.zip
opie-6c1c44237a16dc8fed89905ae729e36eb9711c07.tar.gz
opie-6c1c44237a16dc8fed89905ae729e36eb9711c07.tar.bz2
Added combobox with ppp script names from /etc/ppp/peers.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/dundialog.cpp15
-rw-r--r--noncore/net/opietooth/manager/dundialog.h3
-rw-r--r--noncore/net/opietooth/manager/pppdialog.cpp28
-rw-r--r--noncore/net/opietooth/manager/pppdialog.h12
4 files changed, 47 insertions, 11 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
@@ -18,2 +18,4 @@
18#include <qstring.h> 18#include <qstring.h>
19#include <qcombobox.h>
20#include <qdir.h>
19#include <opie2/oprocess.h> 21#include <opie2/oprocess.h>
@@ -29,2 +31,6 @@ DunDialog::DunDialog( const QString& device, int port, QWidget* parent,
29 : QDialog( parent, name, modal, fl ) { 31 : QDialog( parent, name, modal, fl ) {
32 QDir d("/etc/ppp/peers/"); //Dir we search files in
33 d.setFilter( QDir::Files);
34 d.setSorting( QDir::Size | QDir::Reversed );
35
30 if ( !name ) 36 if ( !name )
@@ -42,3 +48,4 @@ DunDialog::DunDialog( const QString& device, int port, QWidget* parent,
42 48
43 cmdLine = new QLineEdit( this ); 49 cmdLine = new QComboBox( this );
50 cmdLine->setEditable(true);
44 51
@@ -67,2 +74,4 @@ DunDialog::DunDialog( const QString& device, int port, QWidget* parent,
67 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());
68} 77}
@@ -76,3 +85,3 @@ void DunDialog::connectToDevice() {
76 85
77 if (cmdLine->text() == "") 86 if (cmdLine->currentText() == "")
78 return; 87 return;
@@ -95,3 +104,3 @@ void DunDialog::connectToDevice() {
95 *m_dunConnect << tr("call") 104 *m_dunConnect << tr("call")
96 << cmdLine->text(); 105 << cmdLine->currentText();
97 if (!m_dunConnect->start(OProcess::NotifyOnExit, 106 if (!m_dunConnect->start(OProcess::NotifyOnExit,
diff --git a/noncore/net/opietooth/manager/dundialog.h b/noncore/net/opietooth/manager/dundialog.h
index a0d16ad..8310e40 100644
--- a/noncore/net/opietooth/manager/dundialog.h
+++ b/noncore/net/opietooth/manager/dundialog.h
@@ -22,2 +22,3 @@ class QLineEdit;
22class QCheckBox; 22class QCheckBox;
23class QComboBox;
23 24
@@ -40,3 +41,3 @@ namespace OpieTooth {
40 QVBoxLayout* layout; 41 QVBoxLayout* layout;
41 QLineEdit* cmdLine; 42 QComboBox* cmdLine;
42 QPushButton* connectButton; 43 QPushButton* connectButton;
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,2 +1,11 @@
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"
@@ -9,2 +18,3 @@
9#include <qlabel.h> 18#include <qlabel.h>
19#include <qdir.h>
10#include <opie2/oprocess.h> 20#include <opie2/oprocess.h>
@@ -23,3 +33,6 @@ PPPDialog::PPPDialog( const QString& device, int port, QWidget* parent,
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 )
@@ -34,5 +47,6 @@ PPPDialog::PPPDialog( const QString& device, int port, QWidget* parent,
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
@@ -60,2 +74,4 @@ PPPDialog::PPPDialog( const QString& device, int port, QWidget* parent,
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}
@@ -74,3 +90,3 @@ void PPPDialog::connectToDevice() {
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"
@@ -82,3 +98,3 @@ void PPPDialog::connectToDevice() {
82 << "call" 98 << "call"
83 << cmdLine->text(); 99 << cmdLine->currentText();
84 } 100 }
diff --git a/noncore/net/opietooth/manager/pppdialog.h b/noncore/net/opietooth/manager/pppdialog.h
index e0ffc7f..d55c15f 100644
--- a/noncore/net/opietooth/manager/pppdialog.h
+++ b/noncore/net/opietooth/manager/pppdialog.h
@@ -1 +1,11 @@
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 ***************************************************************************/
1#ifndef PPPDIALOG_H 11#ifndef PPPDIALOG_H
@@ -40,3 +50,3 @@ namespace OpieTooth {
40 QVBoxLayout* layout; 50 QVBoxLayout* layout;
41 QLineEdit* cmdLine; 51 QComboBox* cmdLine;
42 QPushButton* connectButton; 52 QPushButton* connectButton;