#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/home/tluebke/kwlan/src/kipsettings.ui'
**
** Created: Wed Jul 12 17:05:55 2006
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.6   edited Aug 31 2005 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "kipsettings.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qtabwidget.h>
#include <qwidget.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <qlineedit.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/*
 *  Constructs a KIpSettings as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
KIpSettings::KIpSettings( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "KIpSettings" );
    setModal( TRUE );
    KIpSettingsLayout = new QGridLayout( this, 1, 1, 11, 6, "KIpSettingsLayout"); 

    layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); 
    spacer1 = new QSpacerItem( 137, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout7->addItem( spacer1 );

    pbOk = new QPushButton( this, "pbOk" );
    layout7->addWidget( pbOk );

    pbCancel = new QPushButton( this, "pbCancel" );
    layout7->addWidget( pbCancel );

    KIpSettingsLayout->addLayout( layout7, 1, 0 );

    tabSettings = new QTabWidget( this, "tabSettings" );

    tabIp = new QWidget( tabSettings, "tabIp" );
    tabIpLayout = new QGridLayout( tabIp, 1, 1, 11, 6, "tabIpLayout"); 

    layout11 = new QVBoxLayout( 0, 0, 6, "layout11"); 

    txtSsid = new QLabel( tabIp, "txtSsid" );
    layout11->addWidget( txtSsid );

    layout15 = new QHBoxLayout( 0, 0, 6, "layout15"); 

    layout5 = new QVBoxLayout( 0, 0, 6, "layout5"); 

    txtDhcp = new QLabel( tabIp, "txtDhcp" );
    layout5->addWidget( txtDhcp );

    txtIPAddress = new QLabel( tabIp, "txtIPAddress" );
    layout5->addWidget( txtIPAddress );

    txtNetmask = new QLabel( tabIp, "txtNetmask" );
    layout5->addWidget( txtNetmask );

    textLabel4 = new QLabel( tabIp, "textLabel4" );
    layout5->addWidget( textLabel4 );
    layout15->addLayout( layout5 );

    layout4 = new QVBoxLayout( 0, 0, 6, "layout4"); 

    cbDhcp = new QCheckBox( tabIp, "cbDhcp" );
    layout4->addWidget( cbDhcp );

    leIpAddress = new QLineEdit( tabIp, "leIpAddress" );
    layout4->addWidget( leIpAddress );

    leNetmask = new QLineEdit( tabIp, "leNetmask" );
    layout4->addWidget( leNetmask );

    leGateway = new QLineEdit( tabIp, "leGateway" );
    layout4->addWidget( leGateway );
    layout15->addLayout( layout4 );
    layout11->addLayout( layout15 );

    cbOverrideIp = new QCheckBox( tabIp, "cbOverrideIp" );
    layout11->addWidget( cbOverrideIp );

    tabIpLayout->addLayout( layout11, 0, 0 );
    tabSettings->insertTab( tabIp, QString::fromLatin1("") );

    tabDNS = new QWidget( tabSettings, "tabDNS" );
    tabDNSLayout = new QGridLayout( tabDNS, 1, 1, 11, 6, "tabDNSLayout"); 

    layout14 = new QVBoxLayout( 0, 0, 6, "layout14"); 

    layout13 = new QHBoxLayout( 0, 0, 6, "layout13"); 

    layout12 = new QVBoxLayout( 0, 0, 6, "layout12"); 

    txtDns1 = new QLabel( tabDNS, "txtDns1" );
    layout12->addWidget( txtDns1 );

    txtDns2 = new QLabel( tabDNS, "txtDns2" );
    layout12->addWidget( txtDns2 );

    txtDomain = new QLabel( tabDNS, "txtDomain" );
    layout12->addWidget( txtDomain );
    layout13->addLayout( layout12 );

    layout11_2 = new QVBoxLayout( 0, 0, 6, "layout11_2"); 

    leDns1 = new QLineEdit( tabDNS, "leDns1" );
    layout11_2->addWidget( leDns1 );

    leDns2 = new QLineEdit( tabDNS, "leDns2" );
    layout11_2->addWidget( leDns2 );

    leDomain = new QLineEdit( tabDNS, "leDomain" );
    layout11_2->addWidget( leDomain );
    layout13->addLayout( layout11_2 );
    layout14->addLayout( layout13 );

    cbOverrideDns = new QCheckBox( tabDNS, "cbOverrideDns" );
    layout14->addWidget( cbOverrideDns );

    tabDNSLayout->addLayout( layout14, 0, 0 );
    tabSettings->insertTab( tabDNS, QString::fromLatin1("") );

    KIpSettingsLayout->addWidget( tabSettings, 0, 0 );
    languageChange();
    resize( QSize(334, 277).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( pbOk, SIGNAL( clicked() ), this, SLOT( Ok() ) );
    connect( pbCancel, SIGNAL( clicked() ), this, SLOT( Cancel() ) );
    connect( cbDhcp, SIGNAL( stateChanged(int) ), this, SLOT( dhcpChanged(int) ) );

    // tab order
    setTabOrder( cbDhcp, leIpAddress );
    setTabOrder( leIpAddress, leNetmask );
    setTabOrder( leNetmask, leGateway );
    setTabOrder( leGateway, leDns1 );
    setTabOrder( leDns1, leDns2 );
    setTabOrder( leDns2, pbOk );
    setTabOrder( pbOk, pbCancel );
}

/*
 *  Destroys the object and frees any allocated resources
 */
KIpSettings::~KIpSettings()
{
    // no need to delete child widgets, Qt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KIpSettings::languageChange()
{
    setCaption( tr2i18n( "Kwlan Ip Settings" ) );
    pbOk->setText( tr2i18n( "O&k" ) );
    pbOk->setAccel( QKeySequence( tr2i18n( "Alt+K" ) ) );
    pbCancel->setText( tr2i18n( "&Cancel" ) );
    pbCancel->setAccel( QKeySequence( tr2i18n( "Alt+C" ) ) );
    txtSsid->setText( tr2i18n( "SSID" ) );
    txtDhcp->setText( tr2i18n( "Address Type" ) );
    txtIPAddress->setText( tr2i18n( "IP Address" ) );
    txtNetmask->setText( tr2i18n( "Netmask" ) );
    textLabel4->setText( tr2i18n( "Gateway" ) );
    cbDhcp->setText( tr2i18n( "&Use DHCP" ) );
    cbDhcp->setAccel( QKeySequence( tr2i18n( "Alt+U" ) ) );
    cbOverrideIp->setText( tr2i18n( "Do not &override existing settings" ) );
    cbOverrideIp->setAccel( QKeySequence( tr2i18n( "Alt+O" ) ) );
    tabSettings->changeTab( tabIp, tr2i18n( "IP &Address" ) );
    txtDns1->setText( tr2i18n( "Primary DNS" ) );
    txtDns2->setText( tr2i18n( "Secondary DNS" ) );
    txtDomain->setText( tr2i18n( "Domain Name" ) );
    cbOverrideDns->setText( tr2i18n( "Do not &override existing DNS settings" ) );
    cbOverrideDns->setAccel( QKeySequence( tr2i18n( "Alt+O" ) ) );
    tabSettings->changeTab( tabDNS, tr2i18n( "D&NS" ) );
}

void KIpSettings::Ok()
{
    qWarning( "KIpSettings::Ok(): Not implemented yet" );
}

void KIpSettings::Cancel()
{
    qWarning( "KIpSettings::Cancel(): Not implemented yet" );
}

void KIpSettings::dhcpChanged(int)
{
    qWarning( "KIpSettings::dhcpChanged(int): Not implemented yet" );
}

void KIpSettings::setSsid(QString)
{
    qWarning( "KIpSettings::setSsid(QString): Not implemented yet" );
}

#include "kipsettings.moc"
