#include <kdialog.h>
#include <tdelocale.h>

/****************************************************************************
** Form implementation generated from reading ui file 'cddbconfigwidgetbase.ui'
**
** Created by: The TQt user interface compiler (TQt 3.5.0)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "cddbconfigwidgetbase.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <ntqpushbutton.h>
#include <ntqtabwidget.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqcombobox.h>
#include <ntqspinbox.h>
#include <ntqlineedit.h>
#include <ntqwidgetstack.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a CDDBConfigWidgetBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
CDDBConfigWidgetBase::CDDBConfigWidgetBase( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "CDDBConfigWidgetBase" );
    CDDBConfigWidgetBaseLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint(), "CDDBConfigWidgetBaseLayout"); 

    tabWidget2 = new TQTabWidget( this, "tabWidget2" );

    tab = new TQWidget( tabWidget2, "tab" );
    tabLayout = new TQVBoxLayout( tab, KDialog::marginHint(), KDialog::spacingHint(), "tabLayout"); 

    kcfg_cachePolicy = new TQButtonGroup( tab, "kcfg_cachePolicy" );
    kcfg_cachePolicy->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)4, 0, 0, kcfg_cachePolicy->sizePolicy().hasHeightForWidth() ) );
    kcfg_cachePolicy->setColumnLayout(0, TQt::Vertical );
    kcfg_cachePolicy->layout()->setSpacing( 0 );
    kcfg_cachePolicy->layout()->setMargin( 6 );
    kcfg_cachePolicyLayout = new TQHBoxLayout( kcfg_cachePolicy->layout() );
    kcfg_cachePolicyLayout->setAlignment( TQt::AlignTop );

    cacheOnly = new TQRadioButton( kcfg_cachePolicy, "cacheOnly" );
    kcfg_cachePolicyLayout->addWidget( cacheOnly );

    cacheAndRemote = new TQRadioButton( kcfg_cachePolicy, "cacheAndRemote" );
    kcfg_cachePolicyLayout->addWidget( cacheAndRemote );

    remoteOnly = new TQRadioButton( kcfg_cachePolicy, "remoteOnly" );
    kcfg_cachePolicyLayout->addWidget( remoteOnly );
    tabLayout->addWidget( kcfg_cachePolicy );

    serverBox = new TQGroupBox( tab, "serverBox" );
    serverBox->setColumnLayout(0, TQt::Vertical );
    serverBox->layout()->setSpacing( 6 );
    serverBox->layout()->setMargin( 11 );
    serverBoxLayout = new TQGridLayout( serverBox->layout() );
    serverBoxLayout->setAlignment( TQt::AlignTop );

    TextLabel7 = new TQLabel( serverBox, "TextLabel7" );

    serverBoxLayout->addWidget( TextLabel7, 0, 0 );

    TextLabel9 = new TQLabel( serverBox, "TextLabel9" );

    serverBoxLayout->addWidget( TextLabel9, 1, 0 );

    kcfg_lookupTransport = new TQComboBox( false, serverBox, "kcfg_lookupTransport" );

    serverBoxLayout->addWidget( kcfg_lookupTransport, 1, 1 );

    mirrorListButton = new KPushButton( serverBox, "mirrorListButton" );

    serverBoxLayout->addMultiCellWidget( mirrorListButton, 1, 1, 2, 4 );

    kcfg_port = new TQSpinBox( serverBox, "kcfg_port" );
    kcfg_port->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)0, 0, 0, kcfg_port->sizePolicy().hasHeightForWidth() ) );
    kcfg_port->setMaxValue( 64000 );
    kcfg_port->setValue( 8880 );

    serverBoxLayout->addWidget( kcfg_port, 0, 4 );

    TextLabel8 = new TQLabel( serverBox, "TextLabel8" );
    TextLabel8->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    serverBoxLayout->addWidget( TextLabel8, 0, 3 );

    kcfg_hostname = new TQLineEdit( serverBox, "kcfg_hostname" );
    kcfg_hostname->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, kcfg_hostname->sizePolicy().hasHeightForWidth() ) );

    serverBoxLayout->addMultiCellWidget( kcfg_hostname, 0, 0, 1, 2 );
    tabLayout->addWidget( serverBox );

    cacheLocationsParent = new TQWidgetStack( tab, "cacheLocationsParent" );

    WStackPage = new TQWidget( cacheLocationsParent, "WStackPage" );
    cacheLocationsParent->addWidget( WStackPage, 0 );
    tabLayout->addWidget( cacheLocationsParent );
    spacer5 = new TQSpacerItem( 41, 260, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout->addItem( spacer5 );
    tabWidget2->insertTab( tab, TQString::fromLatin1("") );

    tab_2 = new TQWidget( tabWidget2, "tab_2" );
    tabLayout_2 = new TQGridLayout( tab_2, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "tabLayout_2"); 

    kcfg_emailAddress = new TQLineEdit( tab_2, "kcfg_emailAddress" );

    tabLayout_2->addWidget( kcfg_emailAddress, 0, 1 );

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

    tabLayout_2->addWidget( textLabel1, 0, 0 );
    spacer4 = new TQSpacerItem( 21, 240, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout_2->addItem( spacer4, 2, 1 );

    kcfg_submitTransport = new TQButtonGroup( tab_2, "kcfg_submitTransport" );
    kcfg_submitTransport->setColumnLayout(0, TQt::Vertical );
    kcfg_submitTransport->layout()->setSpacing( KDialog::spacingHint() );
    kcfg_submitTransport->layout()->setMargin( KDialog::marginHint() );
    kcfg_submitTransportLayout = new TQGridLayout( kcfg_submitTransport->layout() );
    kcfg_submitTransportLayout->setAlignment( TQt::AlignTop );
    spacer9 = new TQSpacerItem( 21, 21, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    kcfg_submitTransportLayout->addItem( spacer9, 7, 1 );
    spacer10 = new TQSpacerItem( 21, 21, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    kcfg_submitTransportLayout->addItem( spacer10, 1, 0 );

    textLabel2 = new TQLabel( kcfg_submitTransport, "textLabel2" );

    kcfg_submitTransportLayout->addMultiCellWidget( textLabel2, 1, 1, 1, 3 );

    radioButton8 = new TQRadioButton( kcfg_submitTransport, "radioButton8" );
    kcfg_submitTransport->insert( radioButton8, 1 );

    kcfg_submitTransportLayout->addMultiCellWidget( radioButton8, 2, 2, 0, 5 );
    spacer7 = new TQSpacerItem( 20, 140, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    kcfg_submitTransportLayout->addMultiCell( spacer7, 3, 7, 0, 0 );

    radioButton6 = new TQRadioButton( kcfg_submitTransport, "radioButton6" );
    kcfg_submitTransport->insert( radioButton6, 0 );

    kcfg_submitTransportLayout->addMultiCellWidget( radioButton6, 0, 0, 0, 3 );

    kcfg_httpSubmitServer = new KLineEdit( kcfg_submitTransport, "kcfg_httpSubmitServer" );

    kcfg_submitTransportLayout->addMultiCellWidget( kcfg_httpSubmitServer, 1, 1, 4, 5 );

    textLabel1_2 = new TQLabel( kcfg_submitTransport, "textLabel1_2" );
    textLabel1_2->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    kcfg_submitTransportLayout->addWidget( textLabel1_2, 1, 6 );

    kcfg_httpSubmitPort = new TQSpinBox( kcfg_submitTransport, "kcfg_httpSubmitPort" );

    kcfg_submitTransportLayout->addWidget( kcfg_httpSubmitPort, 1, 7 );

    textLabel9_2 = new TQLabel( kcfg_submitTransport, "textLabel9_2" );

    kcfg_submitTransportLayout->addMultiCellWidget( textLabel9_2, 3, 3, 1, 4 );

    textLabel2_2 = new TQLabel( kcfg_submitTransport, "textLabel2_2" );
    textLabel2_2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)5, 0, 0, textLabel2_2->sizePolicy().hasHeightForWidth() ) );

    kcfg_submitTransportLayout->addMultiCellWidget( textLabel2_2, 4, 4, 1, 4 );

    textLabel3 = new TQLabel( kcfg_submitTransport, "textLabel3" );
    textLabel3->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, textLabel3->sizePolicy().hasHeightForWidth() ) );

    kcfg_submitTransportLayout->addMultiCellWidget( textLabel3, 5, 5, 1, 2 );

    kcfg_replyTo = new TQLineEdit( kcfg_submitTransport, "kcfg_replyTo" );

    kcfg_submitTransportLayout->addMultiCellWidget( kcfg_replyTo, 3, 3, 5, 7 );

    needsAuthenticationBox = new TQCheckBox( kcfg_submitTransport, "needsAuthenticationBox" );

    kcfg_submitTransportLayout->addMultiCellWidget( needsAuthenticationBox, 6, 6, 1, 7 );

    kcfg_smtpHostname = new TQLineEdit( kcfg_submitTransport, "kcfg_smtpHostname" );

    kcfg_submitTransportLayout->addMultiCellWidget( kcfg_smtpHostname, 4, 4, 5, 7 );

    textLabel4 = new TQLabel( kcfg_submitTransport, "textLabel4" );

    kcfg_submitTransportLayout->addMultiCellWidget( textLabel4, 7, 7, 2, 4 );

    kcfg_smtpUsername = new TQLineEdit( kcfg_submitTransport, "kcfg_smtpUsername" );
    kcfg_smtpUsername->setEnabled( false );
    kcfg_smtpUsername->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)5, 0, 0, kcfg_smtpUsername->sizePolicy().hasHeightForWidth() ) );

    kcfg_submitTransportLayout->addMultiCellWidget( kcfg_smtpUsername, 7, 7, 5, 7 );

    kcfg_smtpPort = new TQSpinBox( kcfg_submitTransport, "kcfg_smtpPort" );
    kcfg_smtpPort->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)0, 0, 0, kcfg_smtpPort->sizePolicy().hasHeightForWidth() ) );
    kcfg_smtpPort->setMaxValue( 65535 );
    kcfg_smtpPort->setValue( 25 );

    kcfg_submitTransportLayout->addMultiCellWidget( kcfg_smtpPort, 5, 5, 3, 4 );
    spacer6 = new TQSpacerItem( 260, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    kcfg_submitTransportLayout->addMultiCell( spacer6, 5, 5, 5, 7 );

    tabLayout_2->addMultiCellWidget( kcfg_submitTransport, 1, 1, 0, 1 );
    tabWidget2->insertTab( tab_2, TQString::fromLatin1("") );
    CDDBConfigWidgetBaseLayout->addWidget( tabWidget2 );
    languageChange();
    resize( TQSize(452, 573).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( cacheOnly, TQ_SIGNAL( toggled(bool) ), serverBox, TQ_SLOT( setDisabled(bool) ) );
    connect( cacheAndRemote, TQ_SIGNAL( toggled(bool) ), serverBox, TQ_SLOT( setEnabled(bool) ) );
    connect( remoteOnly, TQ_SIGNAL( toggled(bool) ), serverBox, TQ_SLOT( setEnabled(bool) ) );
    connect( needsAuthenticationBox, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( needAuthenticationChanged(bool) ) );
    connect( kcfg_lookupTransport, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( protocolChanged() ) );
    connect( mirrorListButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( showMirrorList() ) );

    // tab order
    setTabOrder( tabWidget2, cacheOnly );
    setTabOrder( cacheOnly, cacheAndRemote );
    setTabOrder( cacheAndRemote, remoteOnly );
    setTabOrder( remoteOnly, kcfg_hostname );
    setTabOrder( kcfg_hostname, kcfg_port );
    setTabOrder( kcfg_port, kcfg_lookupTransport );

    // buddies
    TextLabel7->setBuddy( kcfg_hostname );
    TextLabel9->setBuddy( kcfg_lookupTransport );
    TextLabel8->setBuddy( kcfg_port );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void CDDBConfigWidgetBase::languageChange()
{
    setCaption( tr2i18n( "CDDB Settings" ) );
    kcfg_cachePolicy->setTitle( tr2i18n( "Mode" ) );
    cacheOnly->setText( tr2i18n( "&Cache only" ) );
    TQWhatsThis::add( cacheOnly, tr2i18n( "Only check in the local cache for CD information." ) );
    cacheAndRemote->setText( tr2i18n( "Cache &and remote" ) );
    TQWhatsThis::add( cacheAndRemote, tr2i18n( "Check for locally cached CD information before trying to look up at remote CDDB server." ) );
    remoteOnly->setText( tr2i18n( "&Remote only" ) );
    TQWhatsThis::add( remoteOnly, tr2i18n( "Only try to look up at remote CDDB server." ) );
    serverBox->setTitle( tr2i18n( "CDDB Server" ) );
    TextLabel7->setText( tr2i18n( "CDD&B server:" ) );
    TextLabel9->setText( tr2i18n( "&Transport:" ) );
    kcfg_lookupTransport->clear();
    kcfg_lookupTransport->insertItem( tr2i18n( "CDDB" ) );
    kcfg_lookupTransport->insertItem( tr2i18n( "HTTP" ) );
    TQWhatsThis::add( kcfg_lookupTransport, tr2i18n( "Type of lookup which should be tried at the CDDB server." ) );
    mirrorListButton->setText( tr2i18n( "Show &Mirror List" ) );
    TQWhatsThis::add( kcfg_port, tr2i18n( "Port to connect to on CDDB server." ) );
    TextLabel8->setText( tr2i18n( "&Port:" ) );
    kcfg_hostname->setText( tr2i18n( "gnudb.gnudb.org" ) );
    TQWhatsThis::add( kcfg_hostname, tr2i18n( "Name of CDDB server which will be used to look up CD information." ) );
    tabWidget2->changeTab( tab, tr2i18n( "&Lookup" ) );
    textLabel1->setText( tr2i18n( "Email address:" ) );
    kcfg_submitTransport->setTitle( tr2i18n( "Submit Method" ) );
    textLabel2->setText( tr2i18n( "Server:" ) );
    radioButton8->setText( tr2i18n( "SMTP (Email)" ) );
    radioButton6->setText( tr2i18n( "HTTP" ) );
    textLabel1_2->setText( tr2i18n( "Port:" ) );
    textLabel9_2->setText( tr2i18n( "Reply-To:" ) );
    textLabel2_2->setText( tr2i18n( "SMTP server:" ) );
    textLabel3->setText( tr2i18n( "Port:" ) );
    needsAuthenticationBox->setText( tr2i18n( "Server needs authentication" ) );
    textLabel4->setText( tr2i18n( "Username:" ) );
    tabWidget2->changeTab( tab_2, tr2i18n( "&Submit" ) );
}

void CDDBConfigWidgetBase::protocolChanged()
{
    tqWarning( "CDDBConfigWidgetBase::protocolChanged(): Not implemented yet" );
}

void CDDBConfigWidgetBase::showMirrorList()
{
    tqWarning( "CDDBConfigWidgetBase::showMirrorList(): Not implemented yet" );
}

void CDDBConfigWidgetBase::needAuthenticationChanged(bool)
{
    tqWarning( "CDDBConfigWidgetBase::needAuthenticationChanged(bool): Not implemented yet" );
}

/****************************************************************************
** CDDBConfigWidgetBase meta object code from reading C++ file 'cddbconfigwidgetbase.h'
**
** Created by: The TQt Meta Object Compiler version 26 (TQt 3.5.0)
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#undef TQT_NO_COMPAT
#include "cddbconfigwidgetbase.h"
#include <ntqmetaobject.h>
#include <ntqapplication.h>

#include <private/qucomextra_p.h>
#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
#error "This file was generated using the moc from 3.5.0. It"
#error "cannot be used with the include files from this version of TQt."
#error "(The moc has changed too much.)"
#endif

const char *CDDBConfigWidgetBase::className() const
{
    return "CDDBConfigWidgetBase";
}

TQMetaObject *CDDBConfigWidgetBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_CDDBConfigWidgetBase( "CDDBConfigWidgetBase", &CDDBConfigWidgetBase::staticMetaObject );

#ifndef TQT_NO_TRANSLATION
TQString CDDBConfigWidgetBase::tr( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "CDDBConfigWidgetBase", s, c, TQApplication::DefaultCodec );
    else
	return TQString::fromLatin1( s );
}
#ifndef TQT_NO_TRANSLATION_UTF8
TQString CDDBConfigWidgetBase::trUtf8( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "CDDBConfigWidgetBase", s, c, TQApplication::UnicodeUTF8 );
    else
	return TQString::fromUtf8( s );
}
#endif // TQT_NO_TRANSLATION_UTF8

#endif // TQT_NO_TRANSLATION

TQMetaObject* CDDBConfigWidgetBase::staticMetaObject()
{
    if ( metaObj ) {
	return metaObj;
}
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->lock();
    if ( metaObj ) {
	if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
	return metaObj;
    }
#endif // TQT_THREAD_SUPPORT
    TQMetaObject* parentObject = TQWidget::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQUMethod slot_1 = {"protocolChanged", 0, 0 };
    static const TQUMethod slot_2 = {"showMirrorList", 0, 0 };
    static const TQUParameter param_slot_3[] = {
	{ 0, &static_QUType_bool, 0, TQUParameter::In }
    };
    static const TQUMethod slot_3 = {"needAuthenticationChanged", 1, param_slot_3 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "protocolChanged()", &slot_1, TQMetaData::Protected },
	{ "showMirrorList()", &slot_2, TQMetaData::Protected },
	{ "needAuthenticationChanged(bool)", &slot_3, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"CDDBConfigWidgetBase", parentObject,
	slot_tbl, 4,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_CDDBConfigWidgetBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

void* CDDBConfigWidgetBase::tqt_cast( const char* clname )
{
    if ( !qstrcmp( clname, "CDDBConfigWidgetBase" ) )
	return this;
    return TQWidget::tqt_cast( clname );
}

bool CDDBConfigWidgetBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: protocolChanged(); break;
    case 2: showMirrorList(); break;
    case 3: needAuthenticationChanged((bool)static_QUType_bool.get(_o+1)); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

bool CDDBConfigWidgetBase::tqt_emit( int _id, TQUObject* _o )
{
    return TQWidget::tqt_emit(_id,_o);
}
#ifndef TQT_NO_PROPERTIES

bool CDDBConfigWidgetBase::tqt_property( int id, int f, TQVariant* v)
{
    return TQWidget::tqt_property( id, f, v);
}

bool CDDBConfigWidgetBase::tqt_static_property( TQObject* , int , int , TQVariant* ){ return false; }
#endif // TQT_NO_PROPERTIES
