author | wimpie <wimpie> | 2004-04-02 18:29:49 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-04-02 18:29:49 (UTC) |
commit | 5334b639c9f97793bcae4f50f7b47c7a2ada4e2f (patch) (unidiff) | |
tree | f55aebd4314ab878bc39b6b08b8323a8ef78d803 /noncore/settings/networksettings2/ppp/PPPIPedit.cpp | |
parent | 7c8922b37b5bb7696c0ff2cbc999e2936b9b509f (diff) | |
download | opie-5334b639c9f97793bcae4f50f7b47c7a2ada4e2f.zip opie-5334b639c9f97793bcae4f50f7b47c7a2ada4e2f.tar.gz opie-5334b639c9f97793bcae4f50f7b47c7a2ada4e2f.tar.bz2 |
First import of NS2 app
Diffstat (limited to 'noncore/settings/networksettings2/ppp/PPPIPedit.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/ppp/PPPIPedit.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/ppp/PPPIPedit.cpp b/noncore/settings/networksettings2/ppp/PPPIPedit.cpp new file mode 100644 index 0000000..6965e5a --- a/dev/null +++ b/noncore/settings/networksettings2/ppp/PPPIPedit.cpp | |||
@@ -0,0 +1,57 @@ | |||
1 | #include <qmessagebox.h> | ||
2 | #include <qcheckbox.h> | ||
3 | #include <qradiobutton.h> | ||
4 | #include <qlineedit.h> | ||
5 | #include <GUIUtils.h> | ||
6 | #include "PPPIPedit.h" | ||
7 | |||
8 | PPPIPEdit::PPPIPEdit( QWidget * Parent ) : PPPIPGUI( Parent ){ | ||
9 | } | ||
10 | |||
11 | QString PPPIPEdit::acceptable( void ) { | ||
12 | if( IPFixed_RB->isChecked() ) { | ||
13 | if( IPAddress_LE->text().isEmpty() ) | ||
14 | return tr("IPAddress needed" ); | ||
15 | if( ! validIP( IPAddress_LE->text() ) ) | ||
16 | return tr("IPAddress not valid" ); | ||
17 | if( IPSubMask_LE->text().isEmpty() ) | ||
18 | return tr("Subnet mask needed" ); | ||
19 | if( ! validIP( IPSubMask_LE->text() ) ) | ||
20 | return tr("Subnet mask not valid" ); | ||
21 | } else if( GWFixed_RB->isChecked() ) { | ||
22 | if( GWAddress_LE->text().isEmpty() ) | ||
23 | return tr("Gateway address needed" ); | ||
24 | if( ! validIP( GWAddress_LE->text() ) ) | ||
25 | return tr("Gateway address not valid" ); | ||
26 | }; | ||
27 | |||
28 | return QString(); | ||
29 | } | ||
30 | |||
31 | bool PPPIPEdit::commit( PPPData_t & D ) { | ||
32 | |||
33 | bool SM = 0; | ||
34 | |||
35 | CBM( D.IP.IPAutomatic, IPServerAssigned_RB, SM ); | ||
36 | if( ! D.IP.IPAutomatic ) { | ||
37 | TXTM( D.IP.IPAddress, IPAddress_LE, SM ); | ||
38 | TXTM( D.IP.IPSubMask, IPSubMask_LE, SM ); | ||
39 | } | ||
40 | |||
41 | CBM( D.IP.GWAutomatic, GWServerAssigned_RB, SM ); | ||
42 | if( ! D.IP.GWAutomatic ) { | ||
43 | TXTM( D.IP.GWAddress, GWAddress_LE, SM ); | ||
44 | } | ||
45 | |||
46 | CBM( D.IP.GWIsDefault, GWIsDefault_CB, SM ); | ||
47 | return SM; | ||
48 | } | ||
49 | |||
50 | void PPPIPEdit::showData( PPPData_t & D ) { | ||
51 | IPServerAssigned_RB->setChecked( D.IP.IPAutomatic ); | ||
52 | IPAddress_LE->setText( D.IP.IPAddress ); | ||
53 | IPSubMask_LE->setText( D.IP.IPSubMask ); | ||
54 | GWServerAssigned_RB->setChecked( D.IP.GWAutomatic ); | ||
55 | GWAddress_LE->setText( D.IP.GWAddress ); | ||
56 | GWIsDefault_CB->setChecked( D.IP.GWIsDefault ); | ||
57 | } | ||