author | korovkin <korovkin> | 2006-04-09 17:14:19 (UTC) |
---|---|---|
committer | korovkin <korovkin> | 2006-04-09 17:14:19 (UTC) |
commit | fb5daa581aee96edca0206f2f68d25c370692adb (patch) (unidiff) | |
tree | 04ddf2ff040a195d5ad6ae310a988457c7cc52a0 | |
parent | 6c1c44237a16dc8fed89905ae729e36eb9711c07 (diff) | |
download | opie-fb5daa581aee96edca0206f2f68d25c370692adb.zip opie-fb5daa581aee96edca0206f2f68d25c370692adb.tar.gz opie-fb5daa581aee96edca0206f2f68d25c370692adb.tar.bz2 |
Added empty string in the beginning of the list of ppp scripts.
-rw-r--r-- | noncore/net/opietooth/manager/pppdialog.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/net/opietooth/manager/pppdialog.cpp b/noncore/net/opietooth/manager/pppdialog.cpp index 1df22a1..4ab3738 100644 --- a/noncore/net/opietooth/manager/pppdialog.cpp +++ b/noncore/net/opietooth/manager/pppdialog.cpp | |||
@@ -44,64 +44,65 @@ PPPDialog::PPPDialog( const QString& device, int port, QWidget* parent, | |||
44 | 44 | ||
45 | layout = new QVBoxLayout( this ); | 45 | layout = new QVBoxLayout( this ); |
46 | 46 | ||
47 | QLabel* info = new QLabel( this ); | 47 | QLabel* info = new QLabel( this ); |
48 | info->setText( tr("Enter a ppp script name:") ); | 48 | info->setText( tr("Enter a ppp script name:") ); |
49 | 49 | ||
50 | cmdLine = new QComboBox( this ); | 50 | cmdLine = new QComboBox( this ); |
51 | cmdLine->setEditable(true); | 51 | cmdLine->setEditable(true); |
52 | 52 | ||
53 | outPut = new QMultiLineEdit( this ); | 53 | outPut = new QMultiLineEdit( this ); |
54 | QFont outPut_font( outPut->font() ); | 54 | QFont outPut_font( outPut->font() ); |
55 | outPut_font.setPointSize( 8 ); | 55 | outPut_font.setPointSize( 8 ); |
56 | outPut->setFont( outPut_font ); | 56 | outPut->setFont( outPut_font ); |
57 | outPut->setWordWrap( QMultiLineEdit::WidgetWidth ); | 57 | outPut->setWordWrap( QMultiLineEdit::WidgetWidth ); |
58 | 58 | ||
59 | connectButton = new QPushButton( this ); | 59 | connectButton = new QPushButton( this ); |
60 | connectButton->setText( tr( "Connect" ) ); | 60 | connectButton->setText( tr( "Connect" ) ); |
61 | 61 | ||
62 | serPort = new QComboBox(this); | 62 | serPort = new QComboBox(this); |
63 | for (i = 0; i < NCONNECTS; i++) { | 63 | for (i = 0; i < NCONNECTS; i++) { |
64 | if (!PPPDialog::conns[i].proc.isRunning()) | 64 | if (!PPPDialog::conns[i].proc.isRunning()) |
65 | serPort->insertItem(tr("rfcomm%1").arg(i)); | 65 | serPort->insertItem(tr("rfcomm%1").arg(i)); |
66 | } | 66 | } |
67 | 67 | ||
68 | layout->addWidget(info); | 68 | layout->addWidget(info); |
69 | layout->addWidget(cmdLine); | 69 | layout->addWidget(cmdLine); |
70 | layout->addWidget(serPort); | 70 | layout->addWidget(serPort); |
71 | layout->addWidget(outPut); | 71 | layout->addWidget(outPut); |
72 | layout->addWidget(connectButton); | 72 | layout->addWidget(connectButton); |
73 | 73 | ||
74 | connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) ); | 74 | connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) ); |
75 | //And fill cmdLine with ppp script filenames | 75 | //And fill cmdLine with ppp script filenames |
76 | cmdLine->insertItem(""); | ||
76 | cmdLine->insertStringList(d.entryList()); | 77 | cmdLine->insertStringList(d.entryList()); |
77 | } | 78 | } |
78 | 79 | ||
79 | PPPDialog::~PPPDialog() { | 80 | PPPDialog::~PPPDialog() { |
80 | } | 81 | } |
81 | 82 | ||
82 | void PPPDialog::connectToDevice() { | 83 | void PPPDialog::connectToDevice() { |
83 | int portNum = serPort->currentText().right(1).toInt(); | 84 | int portNum = serPort->currentText().right(1).toInt(); |
84 | if (PPPDialog::conns[portNum].proc.isRunning()) { | 85 | if (PPPDialog::conns[portNum].proc.isRunning()) { |
85 | outPut->append(tr("Work in progress")); | 86 | outPut->append(tr("Work in progress")); |
86 | return; | 87 | return; |
87 | } | 88 | } |
88 | outPut->clear(); | 89 | outPut->clear(); |
89 | PPPDialog::conns[portNum].proc.clearArguments(); | 90 | PPPDialog::conns[portNum].proc.clearArguments(); |
90 | // vom popupmenu beziehen | 91 | // vom popupmenu beziehen |
91 | if (cmdLine->currentText().isEmpty()) {//Connect by rfcomm | 92 | if (cmdLine->currentText().isEmpty()) {//Connect by rfcomm |
92 | PPPDialog::conns[portNum].proc << "rfcomm" << "connect" | 93 | PPPDialog::conns[portNum].proc << "rfcomm" << "connect" |
93 | << QString::number(portNum) << m_device << QString::number(m_port); | 94 | << QString::number(portNum) << m_device << QString::number(m_port); |
94 | } | 95 | } |
95 | else { | 96 | else { |
96 | PPPDialog::conns[portNum].proc << "pppd" | 97 | PPPDialog::conns[portNum].proc << "pppd" |
97 | << tr("/dev/bluetooth/rfcomm/%1").arg(portNum) | 98 | << tr("/dev/bluetooth/rfcomm/%1").arg(portNum) |
98 | << "call" | 99 | << "call" |
99 | << cmdLine->currentText(); | 100 | << cmdLine->currentText(); |
100 | } | 101 | } |
101 | if (!PPPDialog::conns[portNum].proc.start(OProcess::NotifyOnExit, | 102 | if (!PPPDialog::conns[portNum].proc.start(OProcess::NotifyOnExit, |
102 | OProcess::All)) { | 103 | OProcess::All)) { |
103 | outPut->append(tr("Couldn't start")); | 104 | outPut->append(tr("Couldn't start")); |
104 | } | 105 | } |
105 | else | 106 | else |
106 | { | 107 | { |
107 | PPPDialog::conns[portNum].proc.resume(); | 108 | PPPDialog::conns[portNum].proc.resume(); |