00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "interfacesetup.h"
00010
00011 #include <qcheckbox.h>
00012 #include <qgroupbox.h>
00013 #include <qlabel.h>
00014 #include <qlineedit.h>
00015 #include <qpushbutton.h>
00016 #include <qlayout.h>
00017 #include <qvariant.h>
00018 #include <qtooltip.h>
00019 #include <qwhatsthis.h>
00020
00021
00022
00023
00024
00025 InterfaceSetup::InterfaceSetup( QWidget* parent, const char* name, WFlags fl )
00026 : QWidget( parent, name, fl )
00027 {
00028 if ( !name )
00029 setName( "InterfaceSetup" );
00030 resize( 282, 280 );
00031 setCaption( tr( "Interface Configuration" ) );
00032 InterfaceSetupLayout = new QVBoxLayout( this );
00033 InterfaceSetupLayout->setSpacing( 6 );
00034 InterfaceSetupLayout->setMargin( 11 );
00035
00036 autoStart = new QCheckBox( this, "autoStart" );
00037 autoStart->setText( tr( "Automatically bring up" ) );
00038 InterfaceSetupLayout->addWidget( autoStart );
00039
00040 dhcpCheckBox = new QCheckBox( this, "dhcpCheckBox" );
00041 dhcpCheckBox->setText( tr( "DHCP" ) );
00042 dhcpCheckBox->setChecked( TRUE );
00043 InterfaceSetupLayout->addWidget( dhcpCheckBox );
00044
00045 staticGroupBox = new QGroupBox( this, "staticGroupBox" );
00046 staticGroupBox->setEnabled( FALSE );
00047 staticGroupBox->setFrameShape( QGroupBox::Box );
00048 staticGroupBox->setFrameShadow( QGroupBox::Sunken );
00049 staticGroupBox->setTitle( tr( "Static Ip Configuration" ) );
00050 staticGroupBox->setColumnLayout(0, Qt::Vertical );
00051 staticGroupBox->layout()->setSpacing( 0 );
00052 staticGroupBox->layout()->setMargin( 0 );
00053 staticGroupBoxLayout = new QGridLayout( staticGroupBox->layout() );
00054 staticGroupBoxLayout->setAlignment( Qt::AlignTop );
00055 staticGroupBoxLayout->setSpacing( 6 );
00056 staticGroupBoxLayout->setMargin( 11 );
00057
00058 TextLabel5 = new QLabel( staticGroupBox, "TextLabel5" );
00059 TextLabel5->setText( tr( "Subnet Mask" ) );
00060
00061 staticGroupBoxLayout->addWidget( TextLabel5, 1, 0 );
00062
00063 gatewayEdit = new QLineEdit( staticGroupBox, "gatewayEdit" );
00064
00065 staticGroupBoxLayout->addWidget( gatewayEdit, 2, 1 );
00066
00067 subnetMaskEdit = new QLineEdit( staticGroupBox, "subnetMaskEdit" );
00068 subnetMaskEdit->setText( tr( "255.255.255.0" ) );
00069
00070 staticGroupBoxLayout->addWidget( subnetMaskEdit, 1, 1 );
00071
00072 ipAddressEdit = new QLineEdit( staticGroupBox, "ipAddressEdit" );
00073
00074 staticGroupBoxLayout->addWidget( ipAddressEdit, 0, 1 );
00075
00076 TextLabel2 = new QLabel( staticGroupBox, "TextLabel2" );
00077 TextLabel2->setText( tr( "First DNS" ) );
00078
00079 staticGroupBoxLayout->addWidget( TextLabel2, 3, 0 );
00080
00081 TextLabel4 = new QLabel( staticGroupBox, "TextLabel4" );
00082 TextLabel4->setText( tr( "IP Address" ) );
00083
00084 staticGroupBoxLayout->addWidget( TextLabel4, 0, 0 );
00085
00086 TextLabel1_2 = new QLabel( staticGroupBox, "TextLabel1_2" );
00087 TextLabel1_2->setText( tr( "Gateway" ) );
00088
00089 staticGroupBoxLayout->addWidget( TextLabel1_2, 2, 0 );
00090
00091 TextLabel3 = new QLabel( staticGroupBox, "TextLabel3" );
00092 TextLabel3->setText( tr( "Second DNS" ) );
00093
00094 staticGroupBoxLayout->addWidget( TextLabel3, 4, 0 );
00095
00096 firstDNSLineEdit = new QLineEdit( staticGroupBox, "firstDNSLineEdit" );
00097
00098 staticGroupBoxLayout->addWidget( firstDNSLineEdit, 3, 1 );
00099
00100 secondDNSLineEdit = new QLineEdit( staticGroupBox, "secondDNSLineEdit" );
00101
00102 staticGroupBoxLayout->addWidget( secondDNSLineEdit, 4, 1 );
00103 InterfaceSetupLayout->addWidget( staticGroupBox );
00104 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
00105 InterfaceSetupLayout->addItem( spacer );
00106
00107
00108 connect( dhcpCheckBox, SIGNAL( toggled(bool) ), staticGroupBox, SLOT( setDisabled(bool) ) );
00109
00110
00111 setTabOrder( autoStart, dhcpCheckBox );
00112 setTabOrder( dhcpCheckBox, ipAddressEdit );
00113 setTabOrder( ipAddressEdit, subnetMaskEdit );
00114 setTabOrder( subnetMaskEdit, gatewayEdit );
00115 setTabOrder( gatewayEdit, firstDNSLineEdit );
00116 setTabOrder( firstDNSLineEdit, secondDNSLineEdit );
00117 }
00118
00119
00120
00121
00122 InterfaceSetup::~InterfaceSetup()
00123 {
00124
00125 }
00126