#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './networkconfigbase.ui'
**
** Created: 木  7月 19 22:29:41 2007
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.5   edited Aug 31 12:13 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "networkconfigbase.h"

#include <qvariant.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <klistbox.h>
#include <qcheckbox.h>
#include <qframe.h>
#include <knuminput.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "klineedit.h"
#include "kpushbutton.h"
#include "klistbox.h"
#include "knuminput.h"

/*
 *  Constructs a NetworkConfigBase 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.
 */
NetworkConfigBase::NetworkConfigBase( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "NetworkConfigBase" );
    setModal( TRUE );

    groupBox5 = new QGroupBox( this, "groupBox5" );
    groupBox5->setGeometry( QRect( 20, 330, 550, 170 ) );

    textLabel2 = new QLabel( groupBox5, "textLabel2" );
    textLabel2->setGeometry( QRect( 10, 30, 240, 20 ) );

    m_IpAddressOrFQDNEditbox = new KLineEdit( groupBox5, "m_IpAddressOrFQDNEditbox" );
    m_IpAddressOrFQDNEditbox->setGeometry( QRect( 10, 80, 170, 25 ) );

    m_DeleteFromBroadcastButton = new KPushButton( groupBox5, "m_DeleteFromBroadcastButton" );
    m_DeleteFromBroadcastButton->setGeometry( QRect( 190, 100, 60, 28 ) );

    m_AddToBroadcastButton = new KPushButton( groupBox5, "m_AddToBroadcastButton" );
    m_AddToBroadcastButton->setGeometry( QRect( 190, 60, 60, 28 ) );

    m_BroadcastListbox = new KListBox( groupBox5, "m_BroadcastListbox" );
    m_BroadcastListbox->setGeometry( QRect( 260, 30, 280, 130 ) );

    m_DialupCheckbox = new QCheckBox( groupBox5, "m_DialupCheckbox" );
    m_DialupCheckbox->setGeometry( QRect( 10, 110, 170, 23 ) );

    frame5 = new QFrame( this, "frame5" );
    frame5->setGeometry( QRect( 20, 510, 550, 40 ) );
    frame5->setFrameShape( QFrame::StyledPanel );
    frame5->setFrameShadow( QFrame::Raised );
    frame5->setLineWidth( 0 );

    m_ApplyButton = new KPushButton( frame5, "m_ApplyButton" );
    m_ApplyButton->setGeometry( QRect( 440, 0, 100, 30 ) );

    m_CancelButton = new KPushButton( frame5, "m_CancelButton" );
    m_CancelButton->setGeometry( QRect( 280, 0, 100, 30 ) );

    m_OKButton = new KPushButton( frame5, "m_OKButton" );
    m_OKButton->setGeometry( QRect( 170, 0, 100, 30 ) );

    groupBox35 = new QGroupBox( this, "groupBox35" );
    groupBox35->setGeometry( QRect( 20, 10, 550, 310 ) );

    textLabel5 = new QLabel( groupBox35, "textLabel5" );
    textLabel5->setGeometry( QRect( 20, 270, 140, 20 ) );

    m_InterfaceNameLabel = new QLabel( groupBox35, "m_InterfaceNameLabel" );
    m_InterfaceNameLabel->setGeometry( QRect( 170, 210, 370, 30 ) );

    m_IpAddressLabel = new QLabel( groupBox35, "m_IpAddressLabel" );
    m_IpAddressLabel->setGeometry( QRect( 170, 240, 370, 20 ) );

    textLabel4 = new QLabel( groupBox35, "textLabel4" );
    textLabel4->setGeometry( QRect( 20, 240, 140, 20 ) );

    m_AddInterfaceButton = new KPushButton( groupBox35, "m_AddInterfaceButton" );
    m_AddInterfaceButton->setGeometry( QRect( 240, 100, 70, 30 ) );

    textLabel3 = new QLabel( groupBox35, "textLabel3" );
    textLabel3->setGeometry( QRect( 20, 210, 140, 20 ) );

    m_DeleteInterfaceButton = new KPushButton( groupBox35, "m_DeleteInterfaceButton" );
    m_DeleteInterfaceButton->setGeometry( QRect( 240, 140, 70, 30 ) );

    m_PortNoNumInput = new KIntNumInput( groupBox35, "m_PortNoNumInput" );
    m_PortNoNumInput->setGeometry( QRect( 170, 270, 143, 30 ) );
    m_PortNoNumInput->setValue( 2425 );
    m_PortNoNumInput->setMinValue( 0 );
    m_PortNoNumInput->setMaxValue( 65535 );

    m_PortNoSetButton = new KPushButton( groupBox35, "m_PortNoSetButton" );
    m_PortNoSetButton->setGeometry( QRect( 460, 260, 80, 40 ) );

    m_InterfaceListbox = new KListBox( groupBox35, "m_InterfaceListbox" );
    m_InterfaceListbox->setGeometry( QRect( 20, 90, 210, 110 ) );

    textLabel6 = new QLabel( groupBox35, "textLabel6" );
    textLabel6->setGeometry( QRect( 20, 70, 210, 20 ) );

    m_UseInterfaceListbox = new KListBox( groupBox35, "m_UseInterfaceListbox" );
    m_UseInterfaceListbox->setGeometry( QRect( 320, 90, 210, 110 ) );

    textLabel7 = new QLabel( groupBox35, "textLabel7" );
    textLabel7->setGeometry( QRect( 320, 70, 210, 20 ) );

    m_SpecifyNicCheckbox = new QCheckBox( groupBox35, "m_SpecifyNicCheckbox" );
    m_SpecifyNicCheckbox->setGeometry( QRect( 10, 20, 530, 50 ) );

    m_SetDefaultPortNoButton = new KPushButton( groupBox35, "m_SetDefaultPortNoButton" );
    m_SetDefaultPortNoButton->setGeometry( QRect( 316, 260, 140, 40 ) );
    languageChange();
    resize( QSize(587, 544).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_AddToBroadcastButton, SIGNAL( clicked() ), this, SLOT( slotAddBroadcastAddressClicked() ) );
    connect( m_DeleteFromBroadcastButton, SIGNAL( clicked() ), this, SLOT( slotDeleteBroadcastAddressClicked() ) );
    connect( m_ApplyButton, SIGNAL( clicked() ), this, SLOT( slotApplyClicked() ) );
    connect( m_CancelButton, SIGNAL( clicked() ), this, SLOT( slotCancelClicked() ) );
    connect( m_OKButton, SIGNAL( clicked() ), this, SLOT( slotOkClicked() ) );
    connect( m_SpecifyNicCheckbox, SIGNAL( clicked() ), this, SLOT( slotSpecifyNetworkInterfaceClicked() ) );
    connect( m_AddInterfaceButton, SIGNAL( clicked() ), this, SLOT( slotAddInterfaceClicked() ) );
    connect( m_DeleteInterfaceButton, SIGNAL( clicked() ), this, SLOT( slotDeleteInterfaceClicked() ) );
    connect( m_UseInterfaceListbox, SIGNAL( currentChanged(QListBoxItem*) ), this, SLOT( slotUseInterfaceClicked(QListBoxItem*) ) );
    connect( m_PortNoSetButton, SIGNAL( clicked() ), this, SLOT( slotSetPortNoClicked() ) );
    connect( m_SetDefaultPortNoButton, SIGNAL( clicked() ), this, SLOT( slotSetDefaultPortNoClicked() ) );

    // tab order
    setTabOrder( m_SpecifyNicCheckbox, m_InterfaceListbox );
    setTabOrder( m_InterfaceListbox, m_AddInterfaceButton );
    setTabOrder( m_AddInterfaceButton, m_DeleteInterfaceButton );
    setTabOrder( m_DeleteInterfaceButton, m_UseInterfaceListbox );
    setTabOrder( m_UseInterfaceListbox, m_PortNoNumInput );
    setTabOrder( m_PortNoNumInput, m_PortNoSetButton );
    setTabOrder( m_PortNoSetButton, m_IpAddressOrFQDNEditbox );
    setTabOrder( m_IpAddressOrFQDNEditbox, m_DialupCheckbox );
    setTabOrder( m_DialupCheckbox, m_AddToBroadcastButton );
    setTabOrder( m_AddToBroadcastButton, m_DeleteFromBroadcastButton );
    setTabOrder( m_DeleteFromBroadcastButton, m_BroadcastListbox );
    setTabOrder( m_BroadcastListbox, m_OKButton );
    setTabOrder( m_OKButton, m_CancelButton );
    setTabOrder( m_CancelButton, m_ApplyButton );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void NetworkConfigBase::languageChange()
{
    setCaption( tr2i18n( "KIpMessenger - Nerwork Configuration" ) );
    groupBox5->setTitle( tr2i18n( "Broadcast configuration without Local Network" ) );
    textLabel2->setText( tr2i18n( "ex:192.168.1.255 ( or FQDN)" ) );
    m_DeleteFromBroadcastButton->setText( tr2i18n( "<<" ) );
    m_AddToBroadcastButton->setText( tr2i18n( ">>" ) );
    m_DialupCheckbox->setText( tr2i18n( "Connect &to dialup" ) );
    m_DialupCheckbox->setAccel( QKeySequence( tr2i18n( "Alt+T" ) ) );
    m_ApplyButton->setText( tr2i18n( "Appl&y" ) );
    m_ApplyButton->setAccel( QKeySequence( tr2i18n( "Alt+Y" ) ) );
    m_CancelButton->setText( tr2i18n( "C&ancel" ) );
    m_CancelButton->setAccel( QKeySequence( tr2i18n( "Alt+A" ) ) );
    m_OKButton->setText( tr2i18n( "&OK" ) );
    m_OKButton->setAccel( QKeySequence( tr2i18n( "Alt+O" ) ) );
    groupBox35->setTitle( tr2i18n( "Network interface" ) );
    textLabel5->setText( tr2i18n( "Port No" ) );
    m_InterfaceNameLabel->setText( tr2i18n( "eth0" ) );
    m_IpAddressLabel->setText( tr2i18n( "1000:2000:3000:4000:5000:6000:7000:8000" ) );
    textLabel4->setText( tr2i18n( "IP Address" ) );
    m_AddInterfaceButton->setText( tr2i18n( ">>" ) );
    textLabel3->setText( tr2i18n( "Interface" ) );
    m_DeleteInterfaceButton->setText( tr2i18n( "<<" ) );
    m_PortNoSetButton->setText( tr2i18n( "Set" ) );
    textLabel6->setText( tr2i18n( "Don't use" ) );
    textLabel7->setText( tr2i18n( "Use" ) );
    m_SpecifyNicCheckbox->setText( tr2i18n( "Specify network interface.\n"
"(&Use all network interfaces when no specified)" ) );
    m_SpecifyNicCheckbox->setAccel( QKeySequence( tr2i18n( "Alt+U" ) ) );
    m_SetDefaultPortNoButton->setText( tr2i18n( "Default port" ) );
}

void NetworkConfigBase::slotDeleteBroadcastAddressClicked()
{
    qWarning( "NetworkConfigBase::slotDeleteBroadcastAddressClicked(): Not implemented yet" );
}

void NetworkConfigBase::slotAddBroadcastAddressClicked()
{
    qWarning( "NetworkConfigBase::slotAddBroadcastAddressClicked(): Not implemented yet" );
}

void NetworkConfigBase::slotApplyClicked()
{
    qWarning( "NetworkConfigBase::slotApplyClicked(): Not implemented yet" );
}

void NetworkConfigBase::slotCancelClicked()
{
    qWarning( "NetworkConfigBase::slotCancelClicked(): Not implemented yet" );
}

void NetworkConfigBase::slotOkClicked()
{
    qWarning( "NetworkConfigBase::slotOkClicked(): Not implemented yet" );
}

void NetworkConfigBase::slotAddInterfaceClicked()
{
    qWarning( "NetworkConfigBase::slotAddInterfaceClicked(): Not implemented yet" );
}

void NetworkConfigBase::slotDeleteInterfaceClicked()
{
    qWarning( "NetworkConfigBase::slotDeleteInterfaceClicked(): Not implemented yet" );
}

void NetworkConfigBase::slotSetPortNoClicked()
{
    qWarning( "NetworkConfigBase::slotSetPortNoClicked(): Not implemented yet" );
}

void NetworkConfigBase::slotSpecifyNetworkInterfaceClicked()
{
    qWarning( "NetworkConfigBase::slotSpecifyNetworkInterfaceClicked(): Not implemented yet" );
}

void NetworkConfigBase::slotUseInterfaceClicked(QListBoxItem*)
{
    qWarning( "NetworkConfigBase::slotUseInterfaceClicked(QListBoxItem*): Not implemented yet" );
}

void NetworkConfigBase::slotSetDefaultPortNoClicked()
{
    qWarning( "NetworkConfigBase::slotSetDefaultPortNoClicked(): Not implemented yet" );
}

#include "networkconfigbase.moc"
