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 @@ -21,37 +21,35 @@ * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <termios.h> -#include <string.h> +#include "general.h" +#include "interfaceppp.h" +#include "modeminfo.h" +#include "modemcmds.h" +#include "pppdata.h" +/* OPIE */ +#include <qpe/config.h> +#include <qpe/qpeapplication.h> + +/* QT */ #include <qcheckbox.h> #include <qcombobox.h> #include <qlabel.h> #include <qlayout.h> #include <qpushbutton.h> #include <qslider.h> #include <qspinbox.h> #include <qwhatsthis.h> -#include <qpe/config.h> -// #include <qgroupbox.h> - - -#include "general.h" -#include "interfaceppp.h" -//#include "miniterm.h" -#include "modeminfo.h" -#include "modemcmds.h" -//#include "devices.h" -#include "pppdata.h" -//#include <klocale.h> - +/* STD */ +#include <termios.h> +#include <string.h> ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) : QWidget(parent, name), _pppdata(pd) { int k; @@ -145,13 +143,14 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) QLabel *baud_label = new QLabel(tr("Co&nnection speed:"), this); tl->addWidget(baud_label, 4, 0); baud_c = new QComboBox(this); baud_label->setBuddy(baud_c); - static const char *baudrates[] = { + static const char *baudrates[] = + { #ifdef B460800 "460800", #endif #ifdef B230400 @@ -167,13 +166,14 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) #endif "38400", "19200", "9600", "2400", - 0}; + 0 + }; for(k = 0; baudrates[k]; k++) baud_c->insertItem(baudrates[k]); baud_c->setCurrentItem(3); // connect(baud_c, SIGNAL(activated(int)), @@ -187,13 +187,14 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) "no more than 115200 bits/sec (unless you know\n" "that your serial port supports higher speeds)."); QWhatsThis::add(baud_label,tmp); QWhatsThis::add(baud_c,tmp); - for(int i=0; i <= enter->count()-1; i++) { + for(int i=0; i <= enter->count()-1; i++) + { if(_pppdata->enter() == enter->text(i)) enter->setCurrentItem(i); } tl->addRowSpacing(5, 10); @@ -234,23 +235,26 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) QWhatsThis::add(modemtimeout, tr("This specifies how long <i>kppp</i> waits for a\n" "<i>CONNECT</i> response from your modem. The\n" "recommended value is 30 seconds.")); //set stuff from gpppdata - for(int i=0; i <= enter->count()-1; i++) { + for(int i=0; i <= enter->count()-1; i++) + { if(_pppdata->enter() == enter->text(i)) enter->setCurrentItem(i); } - for(int i=0; i <= modemdevice->count()-1; i++) { + for(int i=0; i <= modemdevice->count()-1; i++) + { if(_pppdata->modemDevice() == modemdevice->text(i)) modemdevice->setCurrentItem(i); } - for(int i=0; i <= flowcontrol->count()-1; i++) { + for(int i=0; i <= flowcontrol->count()-1; i++) + { if(_pppdata->flowcontrol() == flowcontrol->text(i)) flowcontrol->setCurrentItem(i); } //set the modem speed for(int i=0; i < baud_c->count(); i++) @@ -270,15 +274,17 @@ ModemWidget::~ModemWidget() s.simplifyWhiteSpace(); if (! s.isEmpty() ) devs << s; } QString edited = modemdevice->currentText(); - if ( !( edited ).isEmpty() ) { + if ( !( edited ).isEmpty() ) + { edited.simplifyWhiteSpace(); - if ( devs.contains( edited ) == 0 ) { + if ( devs.contains( edited ) == 0 ) + { devs << edited; } _pppdata->setModemDevice( edited ); } @@ -467,20 +473,22 @@ ModemWidget2::ModemWidget2( PPPData *pd, InterfacePPP *ip, QWidget *parent, SLOT(query_modem())); // connect(terminal_button, SIGNAL(clicked()), // SLOT(terminal())); } -void ModemWidget2::modemcmdsbutton() { +void ModemWidget2::modemcmdsbutton() +{ ModemCommands mc(_ifaceppp->data(), this, "commands" , true, Qt::WStyle_ContextHelp); - mc.showMaximized(); - mc.exec(); + + QPEApplication::execDialog( &mc ); } -void ModemWidget2::query_modem() { +void ModemWidget2::query_modem() +{ ModemTransfer mt(_ifaceppp->modem(), this); mt.exec(); } // void ModemWidget2::terminal() { |