summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/pppconfig.cpp
blob: 5fa7d3f05380e8ffc2d96b581fee811b0be0cd4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

#include <qlayout.h>
#include <qmessagebox.h>
#include <qtabwidget.h>

#include "accounts.h"
#include "general.h"
#include "interfaceppp.h"
#include "modem.h"
#include "pppconfig.h"
#include "pppdata.h"
#include "runtests.h"

PPPConfigWidget::PPPConfigWidget( InterfacePPP* iface, QWidget *parent,
                                  const char *name,
                                  bool modal, WFlags fl )
  : QDialog(parent, name, modal, fl)
{
    setCaption(tr("Configure Modem"));
    int result = runTests();
    if(result == TEST_CRITICAL){
        QMessageBox::critical(0, tr("Modem failure"), tr("A critical failure appeard while testing the modem") );
        return;
    }

    interface = iface;
    qDebug("PPPConfigWidget::PPPConfigWidget");
    qDebug(" interface->getHardwareName >%s<", interface->getHardwareName().latin1());

    qDebug(" _pppdata->accname >%s<",interface->data()->accname().latin1());
    qDebug(" _pppdata->currentAccountID() >%i<",interface->data()->currentAccountID());

  QVBoxLayout *layout = new QVBoxLayout( this );
  layout->setSpacing( 0 );
  layout->setMargin( 1 );
  tabWindow = new QTabWidget( this, "tabWidget" );
  layout->addWidget( tabWindow );

  accounts = new AccountWidget( interface->data(), tabWindow, "accounts" );
  tabWindow->addTab( accounts, tr("&Accounts") );
  modem1 = new ModemWidget( interface, tabWindow, "modem1" );
  tabWindow->addTab( modem1, tr("&Device") );
  modem2 = new ModemWidget2( interface, tabWindow, "modem2" );
  tabWindow->addTab( modem2, tr("&Modem") );

}


PPPConfigWidget::~PPPConfigWidget()
{

}

void PPPConfigWidget::accept()
{
    qDebug("PPPConfigWidget::accept");
    qDebug(" _pppdata->accname >%s<",interface->data()->accname().latin1());
    qDebug(" interface->getHardwareName >%s<", interface->getHardwareName().latin1());
    interface->setInterfaceName( interface->data()->modemDevice() );
    interface->setHardwareName( interface->data()->accname() );
    interface->save();
    QDialog::accept();
}


void PPPConfigWidget::reject()
{
    interface->data()->cancel();
    QDialog::reject();
}