author | tille <tille> | 2003-05-30 15:06:17 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-30 15:06:17 (UTC) |
commit | 8699d02f6c152afed9490e7e7a4315044261e6e8 (patch) (unidiff) | |
tree | d2ee2ba401c7a9db0e33beaf0617a1456fe01d50 /noncore/settings/networksettings/ppp/pppconfig.cpp | |
parent | d8cec07fe5e54a68afe4feca574f9f4d2433e0c1 (diff) | |
download | opie-8699d02f6c152afed9490e7e7a4315044261e6e8.zip opie-8699d02f6c152afed9490e7e7a4315044261e6e8.tar.gz opie-8699d02f6c152afed9490e7e7a4315044261e6e8.tar.bz2 |
modem and pppdata is now member of interfaceppp
Diffstat (limited to 'noncore/settings/networksettings/ppp/pppconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppconfig.cpp | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/noncore/settings/networksettings/ppp/pppconfig.cpp b/noncore/settings/networksettings/ppp/pppconfig.cpp index 4c5f7aa..63f9335 100644 --- a/noncore/settings/networksettings/ppp/pppconfig.cpp +++ b/noncore/settings/networksettings/ppp/pppconfig.cpp | |||
@@ -1,77 +1,72 @@ | |||
1 | 1 | ||
2 | #include <qlayout.h> | 2 | #include <qlayout.h> |
3 | #include <qmessagebox.h> | 3 | #include <qmessagebox.h> |
4 | #include <qtabwidget.h> | 4 | #include <qtabwidget.h> |
5 | 5 | ||
6 | #include "accounts.h" | 6 | #include "accounts.h" |
7 | #include "general.h" | 7 | #include "general.h" |
8 | #include "interface.h" | 8 | #include "interfaceppp.h" |
9 | #include "modem.h" | 9 | #include "modem.h" |
10 | #include "pppconfig.h" | 10 | #include "pppconfig.h" |
11 | #include "pppdata.h" | 11 | #include "pppdata.h" |
12 | #include "runtests.h" | 12 | #include "runtests.h" |
13 | 13 | ||
14 | PPPConfigWidget::PPPConfigWidget( Interface* iface, QWidget *parent, | 14 | PPPConfigWidget::PPPConfigWidget( InterfacePPP* iface, QWidget *parent, |
15 | const char *name, | 15 | const char *name, |
16 | bool modal, WFlags fl ) | 16 | bool modal, WFlags fl ) |
17 | : QDialog(parent, name, modal, fl) | 17 | : QDialog(parent, name, modal, fl) |
18 | { | 18 | { |
19 | setCaption(tr("Configure Modem")); | 19 | setCaption(tr("Configure Modem")); |
20 | int result = runTests(); | 20 | int result = runTests(); |
21 | if(result == TEST_CRITICAL){ | 21 | if(result == TEST_CRITICAL){ |
22 | QMessageBox::critical(0, tr("Modem failure"), tr("A critical failure appeard while testing the modem") ); | 22 | QMessageBox::critical(0, tr("Modem failure"), tr("A critical failure appeard while testing the modem") ); |
23 | return; | 23 | return; |
24 | } | 24 | } |
25 | 25 | ||
26 | interface = iface; | 26 | interface = iface; |
27 | if (!PPPData::data()->setModemDevice( interface->getInterfaceName() )) | ||
28 | PPPData::data()->setModemDevice("/dev/modem"); | ||
29 | qDebug("PPPConfigWidget::PPPConfigWidget"); | 27 | qDebug("PPPConfigWidget::PPPConfigWidget"); |
30 | qDebug(" interface->getHardwareName >%s<", interface->getHardwareName().latin1()); | 28 | qDebug(" interface->getHardwareName >%s<", interface->getHardwareName().latin1()); |
31 | if (!PPPData::data()->setAccount( interface->getHardwareName() )) | ||
32 | PPPData::data()->setAccount( 0 ); | ||
33 | 29 | ||
34 | qDebug(" PPPData::data()->accname >%s<",PPPData::data()->accname().latin1()); | 30 | qDebug(" _pppdata->accname >%s<",interface->data()->accname().latin1()); |
35 | qDebug(" PPPData::data()->currentAccountID() >%i<",PPPData::data()->currentAccountID()); | 31 | qDebug(" _pppdata->currentAccountID() >%i<",interface->data()->currentAccountID()); |
36 | (void)new Modem; | ||
37 | 32 | ||
38 | QVBoxLayout *layout = new QVBoxLayout( this ); | 33 | QVBoxLayout *layout = new QVBoxLayout( this ); |
39 | layout->setSpacing( 0 ); | 34 | layout->setSpacing( 0 ); |
40 | layout->setMargin( 1 ); | 35 | layout->setMargin( 1 ); |
41 | tabWindow = new QTabWidget( this, "tabWidget" ); | 36 | tabWindow = new QTabWidget( this, "tabWidget" ); |
42 | layout->addWidget( tabWindow ); | 37 | layout->addWidget( tabWindow ); |
43 | 38 | ||
44 | accounts = new AccountWidget( tabWindow, "accounts" ); | 39 | accounts = new AccountWidget( interface->data(), tabWindow, "accounts" ); |
45 | tabWindow->addTab( accounts, tr("&Accounts") ); | 40 | tabWindow->addTab( accounts, tr("&Accounts") ); |
46 | modem1 = new ModemWidget( tabWindow, "modem1" ); | 41 | modem1 = new ModemWidget( interface, tabWindow, "modem1" ); |
47 | tabWindow->addTab( modem1, tr("&Device") ); | 42 | tabWindow->addTab( modem1, tr("&Device") ); |
48 | modem2 = new ModemWidget2( tabWindow, "modem2" ); | 43 | modem2 = new ModemWidget2( interface, tabWindow, "modem2" ); |
49 | tabWindow->addTab( modem2, tr("&Modem") ); | 44 | tabWindow->addTab( modem2, tr("&Modem") ); |
50 | // graph = new GraphSetup( tabWindow->addPage( tr("&Graph"), tr("Throughput Graph" ) ) ); | 45 | // graph = new GraphSetup( tabWindow->addPage( tr("&Graph"), tr("Throughput Graph" ) ) ); |
51 | // general = new GeneralWidget( tabWindow->addPage( tr("M&isc"), tr("Miscellaneous Settings") ) ); | 46 | // general = new GeneralWidget( tabWindow->addPage( tr("M&isc"), tr("Miscellaneous Settings") ) ); |
52 | 47 | ||
53 | } | 48 | } |
54 | 49 | ||
55 | 50 | ||
56 | PPPConfigWidget::~PPPConfigWidget() | 51 | PPPConfigWidget::~PPPConfigWidget() |
57 | { | 52 | { |
58 | 53 | ||
59 | } | 54 | } |
60 | 55 | ||
61 | void PPPConfigWidget::accept() | 56 | void PPPConfigWidget::accept() |
62 | { | 57 | { |
63 | qDebug("PPPConfigWidget::accept"); | 58 | qDebug("PPPConfigWidget::accept"); |
64 | qDebug(" PPPData::data()->accname >%s<",PPPData::data()->accname().latin1()); | 59 | qDebug(" _pppdata->accname >%s<",interface->data()->accname().latin1()); |
65 | qDebug(" interface->getHardwareName >%s<", interface->getHardwareName().latin1()); | 60 | qDebug(" interface->getHardwareName >%s<", interface->getHardwareName().latin1()); |
66 | interface->setInterfaceName( PPPData::data()->modemDevice() ); | 61 | interface->setInterfaceName( interface->data()->modemDevice() ); |
67 | interface->setHardwareName( PPPData::data()->accname() ); | 62 | interface->setHardwareName( interface->data()->accname() ); |
68 | PPPData::data()->save(); | 63 | interface->data()->save(); |
69 | QDialog::accept(); | 64 | QDialog::accept(); |
70 | } | 65 | } |
71 | 66 | ||
72 | 67 | ||
73 | void PPPConfigWidget::reject() | 68 | void PPPConfigWidget::reject() |
74 | { | 69 | { |
75 | PPPData::data()->cancel(); | 70 | interface->data()->cancel(); |
76 | QDialog::reject(); | 71 | QDialog::reject(); |
77 | } | 72 | } |