summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/general.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/ppp/general.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/general.cpp62
1 files changed, 35 insertions, 27 deletions
diff --git a/noncore/settings/networksettings/ppp/general.cpp b/noncore/settings/networksettings/ppp/general.cpp
index 5540946..ff1b11b 100644
--- a/noncore/settings/networksettings/ppp/general.cpp
+++ b/noncore/settings/networksettings/ppp/general.cpp
@@ -21,37 +21,35 @@
21 * 21 *
22 * You should have received a copy of the GNU Library General Public 22 * You should have received a copy of the GNU Library General Public
23 * License along with this program; if not, write to the Free 23 * License along with this program; if not, write to the Free
24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */ 25 */
26 26
27#include <termios.h> 27#include "general.h"
28#include <string.h> 28#include "interfaceppp.h"
29#include "modeminfo.h"
30#include "modemcmds.h"
31#include "pppdata.h"
29 32
33/* OPIE */
34#include <qpe/config.h>
35#include <qpe/qpeapplication.h>
36
37/* QT */
30#include <qcheckbox.h> 38#include <qcheckbox.h>
31#include <qcombobox.h> 39#include <qcombobox.h>
32#include <qlabel.h> 40#include <qlabel.h>
33#include <qlayout.h> 41#include <qlayout.h>
34#include <qpushbutton.h> 42#include <qpushbutton.h>
35#include <qslider.h> 43#include <qslider.h>
36#include <qspinbox.h> 44#include <qspinbox.h>
37#include <qwhatsthis.h> 45#include <qwhatsthis.h>
38#include <qpe/config.h>
39// #include <qgroupbox.h>
40
41
42#include "general.h"
43#include "interfaceppp.h"
44//#include "miniterm.h"
45#include "modeminfo.h"
46#include "modemcmds.h"
47//#include "devices.h"
48#include "pppdata.h"
49//#include <klocale.h>
50
51 46
47/* STD */
48#include <termios.h>
49#include <string.h>
52 50
53 51
54ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) 52ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name )
55 : QWidget(parent, name), _pppdata(pd) 53 : QWidget(parent, name), _pppdata(pd)
56{ 54{
57 int k; 55 int k;
@@ -145,13 +143,14 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name )
145 143
146 QLabel *baud_label = new QLabel(tr("Co&nnection speed:"), this); 144 QLabel *baud_label = new QLabel(tr("Co&nnection speed:"), this);
147 tl->addWidget(baud_label, 4, 0); 145 tl->addWidget(baud_label, 4, 0);
148 baud_c = new QComboBox(this); 146 baud_c = new QComboBox(this);
149 baud_label->setBuddy(baud_c); 147 baud_label->setBuddy(baud_c);
150 148
151 static const char *baudrates[] = { 149 static const char *baudrates[] =
150 {
152 151
153#ifdef B460800 152#ifdef B460800
154 "460800", 153 "460800",
155#endif 154#endif
156 155
157#ifdef B230400 156#ifdef B230400
@@ -167,13 +166,14 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name )
167#endif 166#endif
168 167
169 "38400", 168 "38400",
170 "19200", 169 "19200",
171 "9600", 170 "9600",
172 "2400", 171 "2400",
173 0}; 172 0
173 };
174 174
175 for(k = 0; baudrates[k]; k++) 175 for(k = 0; baudrates[k]; k++)
176 baud_c->insertItem(baudrates[k]); 176 baud_c->insertItem(baudrates[k]);
177 177
178 baud_c->setCurrentItem(3); 178 baud_c->setCurrentItem(3);
179// connect(baud_c, SIGNAL(activated(int)), 179// connect(baud_c, SIGNAL(activated(int)),
@@ -187,13 +187,14 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name )
187 "no more than 115200 bits/sec (unless you know\n" 187 "no more than 115200 bits/sec (unless you know\n"
188 "that your serial port supports higher speeds)."); 188 "that your serial port supports higher speeds).");
189 189
190 QWhatsThis::add(baud_label,tmp); 190 QWhatsThis::add(baud_label,tmp);
191 QWhatsThis::add(baud_c,tmp); 191 QWhatsThis::add(baud_c,tmp);
192 192
193 for(int i=0; i <= enter->count()-1; i++) { 193 for(int i=0; i <= enter->count()-1; i++)
194 {
194 if(_pppdata->enter() == enter->text(i)) 195 if(_pppdata->enter() == enter->text(i))
195 enter->setCurrentItem(i); 196 enter->setCurrentItem(i);
196 } 197 }
197 198
198 tl->addRowSpacing(5, 10); 199 tl->addRowSpacing(5, 10);
199 200
@@ -234,23 +235,26 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name )
234 QWhatsThis::add(modemtimeout, 235 QWhatsThis::add(modemtimeout,
235 tr("This specifies how long <i>kppp</i> waits for a\n" 236 tr("This specifies how long <i>kppp</i> waits for a\n"
236 "<i>CONNECT</i> response from your modem. The\n" 237 "<i>CONNECT</i> response from your modem. The\n"
237 "recommended value is 30 seconds.")); 238 "recommended value is 30 seconds."));
238 239
239 //set stuff from gpppdata 240 //set stuff from gpppdata
240 for(int i=0; i <= enter->count()-1; i++) { 241 for(int i=0; i <= enter->count()-1; i++)
242 {
241 if(_pppdata->enter() == enter->text(i)) 243 if(_pppdata->enter() == enter->text(i))
242 enter->setCurrentItem(i); 244 enter->setCurrentItem(i);
243 } 245 }
244 246
245 for(int i=0; i <= modemdevice->count()-1; i++) { 247 for(int i=0; i <= modemdevice->count()-1; i++)
248 {
246 if(_pppdata->modemDevice() == modemdevice->text(i)) 249 if(_pppdata->modemDevice() == modemdevice->text(i))
247 modemdevice->setCurrentItem(i); 250 modemdevice->setCurrentItem(i);
248 } 251 }
249 252
250 for(int i=0; i <= flowcontrol->count()-1; i++) { 253 for(int i=0; i <= flowcontrol->count()-1; i++)
254 {
251 if(_pppdata->flowcontrol() == flowcontrol->text(i)) 255 if(_pppdata->flowcontrol() == flowcontrol->text(i))
252 flowcontrol->setCurrentItem(i); 256 flowcontrol->setCurrentItem(i);
253 } 257 }
254 258
255 //set the modem speed 259 //set the modem speed
256 for(int i=0; i < baud_c->count(); i++) 260 for(int i=0; i < baud_c->count(); i++)
@@ -270,15 +274,17 @@ ModemWidget::~ModemWidget()
270 s.simplifyWhiteSpace(); 274 s.simplifyWhiteSpace();
271 if (! s.isEmpty() ) devs << s; 275 if (! s.isEmpty() ) devs << s;
272 } 276 }
273 277
274 278
275 QString edited = modemdevice->currentText(); 279 QString edited = modemdevice->currentText();
276 if ( !( edited ).isEmpty() ) { 280 if ( !( edited ).isEmpty() )
281 {
277 edited.simplifyWhiteSpace(); 282 edited.simplifyWhiteSpace();
278 if ( devs.contains( edited ) == 0 ) { 283 if ( devs.contains( edited ) == 0 )
284 {
279 devs << edited; 285 devs << edited;
280 } 286 }
281 _pppdata->setModemDevice( edited ); 287 _pppdata->setModemDevice( edited );
282 } 288 }
283 289
284 290
@@ -467,20 +473,22 @@ ModemWidget2::ModemWidget2( PPPData *pd, InterfacePPP *ip, QWidget *parent,
467 SLOT(query_modem())); 473 SLOT(query_modem()));
468// connect(terminal_button, SIGNAL(clicked()), 474// connect(terminal_button, SIGNAL(clicked()),
469 // SLOT(terminal())); 475 // SLOT(terminal()));
470} 476}
471 477
472 478
473void ModemWidget2::modemcmdsbutton() { 479void ModemWidget2::modemcmdsbutton()
480{
474 ModemCommands mc(_ifaceppp->data(), this, "commands" , true, Qt::WStyle_ContextHelp); 481 ModemCommands mc(_ifaceppp->data(), this, "commands" , true, Qt::WStyle_ContextHelp);
475 mc.showMaximized(); 482
476 mc.exec(); 483 QPEApplication::execDialog( &mc );
477} 484}
478 485
479 486
480void ModemWidget2::query_modem() { 487void ModemWidget2::query_modem()
488{
481 ModemTransfer mt(_ifaceppp->modem(), this); 489 ModemTransfer mt(_ifaceppp->modem(), this);
482 mt.exec(); 490 mt.exec();
483} 491}
484 492
485 493
486// void ModemWidget2::terminal() { 494// void ModemWidget2::terminal() {