#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/usr/src/ports/kdebase3/kdebase3-3.5.10-11.i686/src/kdebase-3.5.10/kcontrol/dnssd/configdialog.ui'
**
** Created by User Interface Compiler
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "configdialog.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qtabwidget.h>
#include <qwidget.h>
#include <qcheckbox.h>
#include <keditlistbox.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qlabel.h>
#include <klineedit.h>
#include <kpassdlg.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "kcmodule.h"
#include "keditlistbox.h"
#include "klineedit.h"
#include "kpassdlg.h"

/*
 *  Constructs a ConfigDialog which is a child of 'parent', with the
 *  name 'name'.' 
 */
ConfigDialog::ConfigDialog( QWidget* parent,  const char* name )
    : KCModule( parent, name )
{
    if ( !name )
	setName( "ConfigDialog" );
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
    setMinimumSize( QSize( 0, 0 ) );
    ConfigDialogLayout = new QGridLayout( this, 1, 1, 11, 6, "ConfigDialogLayout"); 

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

    tab = new QWidget( tabs, "tab" );
    tabLayout = new QVBoxLayout( tab, 11, 6, "tabLayout"); 

    kcfg_BrowseLocal = new QCheckBox( tab, "kcfg_BrowseLocal" );
    tabLayout->addWidget( kcfg_BrowseLocal );

    kcfg_DomainList = new KEditListBox( tab, "kcfg_DomainList" );
    kcfg_DomainList->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, kcfg_DomainList->sizePolicy().hasHeightForWidth() ) );
    tabLayout->addWidget( kcfg_DomainList );

    kcfg_PublishType = new QButtonGroup( tab, "kcfg_PublishType" );
    kcfg_PublishType->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, kcfg_PublishType->sizePolicy().hasHeightForWidth() ) );

    LANButtor = new QRadioButton( kcfg_PublishType, "LANButtor" );
    LANButtor->setGeometry( QRect( 11, 23, 618, 22 ) );
    LANButtor->setChecked( FALSE );

    WANButton = new QRadioButton( kcfg_PublishType, "WANButton" );
    WANButton->setEnabled( TRUE );
    WANButton->setGeometry( QRect( 11, 51, 618, 22 ) );
    tabLayout->addWidget( kcfg_PublishType );
    tabs->insertTab( tab, QString::fromLatin1("") );

    tab_2 = new QWidget( tabs, "tab_2" );
    tabLayout_2 = new QVBoxLayout( tab_2, 11, 6, "tabLayout_2"); 

    layout7 = new QGridLayout( 0, 1, 1, 0, 6, "layout7"); 

    textLabel2 = new QLabel( tab_2, "textLabel2" );

    layout7->addMultiCellWidget( textLabel2, 2, 2, 0, 1 );
    spacer4 = new QSpacerItem( 130, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout7->addMultiCell( spacer4, 1, 1, 1, 2 );

    hostedit = new KLineEdit( tab_2, "hostedit" );

    layout7->addWidget( hostedit, 1, 3 );

    secretedit = new KPasswordEdit( tab_2, "secretedit" );

    layout7->addWidget( secretedit, 2, 3 );

    domainLabel = new QLabel( tab_2, "domainLabel" );
    domainLabel->setEnabled( TRUE );

    layout7->addMultiCellWidget( domainLabel, 0, 0, 0, 1 );

    textLabel1 = new QLabel( tab_2, "textLabel1" );

    layout7->addWidget( textLabel1, 1, 0 );

    domainedit = new KLineEdit( tab_2, "domainedit" );
    domainedit->setEnabled( TRUE );

    layout7->addWidget( domainedit, 0, 3 );
    spacer1 = new QSpacerItem( 90, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout7->addItem( spacer1, 0, 2 );
    spacer5 = new QSpacerItem( 90, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout7->addItem( spacer5, 2, 2 );
    tabLayout_2->addLayout( layout7 );
    spacer7 = new QSpacerItem( 50, 110, QSizePolicy::Minimum, QSizePolicy::Expanding );
    tabLayout_2->addItem( spacer7 );
    tabs->insertTab( tab_2, QString::fromLatin1("") );

    ConfigDialogLayout->addWidget( tabs, 0, 0 );
    languageChange();
    resize( QSize(571, 486).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ConfigDialog::languageChange()
{
    setCaption( tr2i18n( "MyDialog1" ) );
    kcfg_BrowseLocal->setText( tr2i18n( "Browse local networ&k" ) );
    QWhatsThis::add( kcfg_BrowseLocal, tr2i18n( "Browse local network (domain .local) using multicast DNS." ) );
    kcfg_DomainList->setTitle( tr2i18n( "Additional Domains" ) );
    QWhatsThis::add( kcfg_DomainList, tr2i18n( "List of Internet domains  that will be browsed for services. Do not put .local here - it\n"
"is configured with 'Browse local network' option above." ) );
    kcfg_PublishType->setTitle( tr2i18n( "Publishing Mode" ) );
    LANButtor->setText( tr2i18n( "Loc&al network" ) );
    QWhatsThis::add( LANButtor, tr2i18n( "Advertise services on local network (in domain .local) using multicast DNS." ) );
    WANButton->setText( tr2i18n( "&Wide area network" ) );
    QWhatsThis::add( WANButton, tr2i18n( "Advertise services on Internet domain using public IP. To have this option working you need to configure wide area operation in using administrator mode" ) );
    tabs->changeTab( tab, tr2i18n( "&General" ) );
    textLabel2->setText( tr2i18n( "Shared secret:" ) );
    QWhatsThis::add( hostedit, tr2i18n( "Name of this machine. Must be in fully qualified form (host.domain)" ) );
    QWhatsThis::add( secretedit, tr2i18n( "Optional shared secret used for authorization of DNS dynamic updates." ) );
    domainLabel->setText( tr2i18n( "Domain:" ) );
    textLabel1->setText( tr2i18n( "Hostname:" ) );
    tabs->changeTab( tab_2, tr2i18n( "W&ide area" ) );
}

void ConfigDialog::radioButton2_2_toggled(bool)
{
    qWarning( "ConfigDialog::radioButton2_2_toggled(bool): Not implemented yet" );
}

#include "configdialog.moc"
