Diffstat (limited to 'noncore/settings/networksettings/ppp/general.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/general.cpp | 62 |
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 | |||
@@ -24,9 +24,17 @@ | |||
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> |
@@ -35,20 +43,10 @@ | |||
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 | ||
54 | ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) | 52 | ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) |
@@ -148,7 +146,8 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) | |||
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", |
@@ -170,7 +169,8 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) | |||
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]); |
@@ -190,7 +190,8 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) | |||
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 | } |
@@ -237,17 +238,20 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) | |||
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 | } |
@@ -273,9 +277,11 @@ ModemWidget::~ModemWidget() | |||
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 ); |
@@ -470,14 +476,16 @@ ModemWidget2::ModemWidget2( PPPData *pd, InterfacePPP *ip, QWidget *parent, | |||
470 | } | 476 | } |
471 | 477 | ||
472 | 478 | ||
473 | void ModemWidget2::modemcmdsbutton() { | 479 | void 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 | ||
480 | void ModemWidget2::query_modem() { | 487 | void ModemWidget2::query_modem() |
488 | { | ||
481 | ModemTransfer mt(_ifaceppp->modem(), this); | 489 | ModemTransfer mt(_ifaceppp->modem(), this); |
482 | mt.exec(); | 490 | mt.exec(); |
483 | } | 491 | } |