Networksettings API API Documentation

interfacesetup.cpp

00001 /****************************************************************************
00002 ** Form implementation generated from reading ui file 'interfacesetup.ui'
00003 **
00004 ** Created: Sun Jan 11 15:26:19 2004
00005 **      by:  The User Interface Compiler (uic)
00006 **
00007 ** WARNING! All changes made in this file will be lost!
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  *  Constructs a InterfaceSetup which is a child of 'parent', with the 
00023  *  name 'name' and widget flags set to 'f' 
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     // signals and slots connections
00108     connect( dhcpCheckBox, SIGNAL( toggled(bool) ), staticGroupBox, SLOT( setDisabled(bool) ) );
00109 
00110     // tab order
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  *  Destroys the object and frees any allocated resources
00121  */
00122 InterfaceSetup::~InterfaceSetup()
00123 {
00124     // no need to delete child widgets, Qt does it all for us
00125 }
00126 
KDE Logo
This file is part of the documentation for OPIE Version 1.0.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:26:44 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001