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

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

#include "fileselectdlgbase.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <kurlrequester.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqcombobox.h>
#include <ntqcheckbox.h>
#include <ntqbuttongroup.h>
#include <ntqgroupbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a FileSelectDlgBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qdialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qdialog.
 */
FileSelectDlgBase::FileSelectDlgBase( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "FileSelectDlgBase" );
    FileSelectDlgBaseLayout = new TQGridLayout( this, 1, 1, 11, 6, "FileSelectDlgBaseLayout"); 

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

    textLabel1_2 = new TQLabel( this, "textLabel1_2" );
    layout4->addWidget( textLabel1_2 );

    m_downloadLocation = new KURLRequester( this, "m_downloadLocation" );
    layout4->addWidget( m_downloadLocation );

    FileSelectDlgBaseLayout->addMultiCellLayout( layout4, 0, 0, 0, 2 );

    layout6 = new TQHBoxLayout( 0, 0, 6, "layout6"); 

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

    textLabel2 = new TQLabel( this, "textLabel2" );
    textLabel2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)5, 0, 0, textLabel2->sizePolicy().hasHeightForWidth() ) );
    layout5->addWidget( textLabel2 );

    m_cmbGroups = new TQComboBox( false, this, "m_cmbGroups" );
    layout5->addWidget( m_cmbGroups );
    layout6->addLayout( layout5 );

    m_chkUserControlled = new TQCheckBox( this, "m_chkUserControlled" );
    m_chkUserControlled->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)0, 0, 0, m_chkUserControlled->sizePolicy().hasHeightForWidth() ) );
    layout6->addWidget( m_chkUserControlled );

    m_chkStartTorrent = new TQCheckBox( this, "m_chkStartTorrent" );
    m_chkStartTorrent->setEnabled( false );
    m_chkStartTorrent->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)0, 0, 0, m_chkStartTorrent->sizePolicy().hasHeightForWidth() ) );
    m_chkStartTorrent->setChecked( true );
    layout6->addWidget( m_chkStartTorrent );

    FileSelectDlgBaseLayout->addMultiCellLayout( layout6, 1, 1, 0, 2 );

    pnlFiles = new TQButtonGroup( this, "pnlFiles" );
    pnlFiles->setColumnLayout(0, TQt::Vertical );
    pnlFiles->layout()->setSpacing( 6 );
    pnlFiles->layout()->setMargin( 11 );
    pnlFilesLayout = new TQGridLayout( pnlFiles->layout() );
    pnlFilesLayout->setAlignment( TQt::AlignTop );

    m_file_view = new TDEListView( pnlFiles, "m_file_view" );
    m_file_view->addColumn( tr2i18n( "File" ) );
    m_file_view->addColumn( tr2i18n( "Size" ) );
    m_file_view->addColumn( tr2i18n( "Download" ) );
    m_file_view->setFullWidth( true );

    pnlFilesLayout->addMultiCellWidget( m_file_view, 0, 3, 0, 0 );

    m_select_all = new KPushButton( pnlFiles, "m_select_all" );

    pnlFilesLayout->addWidget( m_select_all, 0, 1 );

    m_select_none = new KPushButton( pnlFiles, "m_select_none" );

    pnlFilesLayout->addWidget( m_select_none, 1, 1 );

    m_invert_selection = new KPushButton( pnlFiles, "m_invert_selection" );

    pnlFilesLayout->addWidget( m_invert_selection, 2, 1 );
    spacer1 = new TQSpacerItem( 20, 135, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    pnlFilesLayout->addItem( spacer1, 3, 1 );

    FileSelectDlgBaseLayout->addMultiCellWidget( pnlFiles, 2, 2, 0, 2 );

    groupBox1 = new TQGroupBox( this, "groupBox1" );
    groupBox1->setColumnLayout(0, TQt::Vertical );
    groupBox1->layout()->setSpacing( 6 );
    groupBox1->layout()->setMargin( 11 );
    groupBox1Layout = new TQGridLayout( groupBox1->layout() );
    groupBox1Layout->setAlignment( TQt::AlignTop );
    spacer9 = new TQSpacerItem( 40, 20, TQSizePolicy::Preferred, TQSizePolicy::Minimum );
    groupBox1Layout->addItem( spacer9, 0, 2 );

    layout33 = new TQVBoxLayout( 0, 0, 6, "layout33"); 

    textLabel1 = new TQLabel( groupBox1, "textLabel1" );
    layout33->addWidget( textLabel1 );

    textLabel3 = new TQLabel( groupBox1, "textLabel3" );
    layout33->addWidget( textLabel3 );

    textLabel6 = new TQLabel( groupBox1, "textLabel6" );
    layout33->addWidget( textLabel6 );

    groupBox1Layout->addLayout( layout33, 0, 0 );

    layout34 = new TQVBoxLayout( 0, 0, 6, "layout34"); 

    lblRequired = new TQLabel( groupBox1, "lblRequired" );
    layout34->addWidget( lblRequired );

    lblFree = new TQLabel( groupBox1, "lblFree" );
    layout34->addWidget( lblFree );

    lblStatus = new TQLabel( groupBox1, "lblStatus" );
    layout34->addWidget( lblStatus );

    groupBox1Layout->addLayout( layout34, 0, 1 );

    FileSelectDlgBaseLayout->addMultiCellWidget( groupBox1, 3, 3, 0, 2 );
    spacer3 = new TQSpacerItem( 220, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    FileSelectDlgBaseLayout->addItem( spacer3, 4, 0 );

    m_ok = new KPushButton( this, "m_ok" );
    m_ok->setDefault( true );
    m_ok->setProperty( "stdItem", 1 );

    FileSelectDlgBaseLayout->addWidget( m_ok, 4, 1 );

    m_cancel = new KPushButton( this, "m_cancel" );
    m_cancel->setProperty( "stdItem", 2 );

    FileSelectDlgBaseLayout->addWidget( m_cancel, 4, 2 );
    languageChange();
    resize( TQSize(491, 500).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_chkUserControlled, TQ_SIGNAL( toggled(bool) ), m_chkStartTorrent, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( m_ok, m_cancel );
    setTabOrder( m_cancel, m_downloadLocation );
    setTabOrder( m_downloadLocation, m_cmbGroups );
    setTabOrder( m_cmbGroups, m_chkUserControlled );
    setTabOrder( m_chkUserControlled, m_chkStartTorrent );
    setTabOrder( m_chkStartTorrent, m_file_view );
    setTabOrder( m_file_view, m_select_all );
    setTabOrder( m_select_all, m_select_none );
    setTabOrder( m_select_none, m_invert_selection );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void FileSelectDlgBase::languageChange()
{
    setCaption( tr2i18n( "Select Which Files You Want to Download" ) );
    textLabel1_2->setText( tr2i18n( "Download to:" ) );
    textLabel2->setText( tr2i18n( "Group:" ) );
    m_chkUserControlled->setText( tr2i18n( "&User controlled" ) );
    m_chkStartTorrent->setText( tr2i18n( "Start torrent" ) );
    pnlFiles->setTitle( tr2i18n( "Files" ) );
    m_file_view->header()->setLabel( 0, tr2i18n( "File" ) );
    m_file_view->header()->setLabel( 1, tr2i18n( "Size" ) );
    m_file_view->header()->setLabel( 2, tr2i18n( "Download" ) );
    m_select_all->setText( tr2i18n( "Select &All" ) );
    m_select_none->setText( tr2i18n( "Select &None" ) );
    m_invert_selection->setText( tr2i18n( "Invert Selection" ) );
    groupBox1->setTitle( tr2i18n( "Disk space" ) );
    textLabel1->setText( tr2i18n( "Required disk space:" ) );
    textLabel3->setText( tr2i18n( "Free disk space:" ) );
    textLabel6->setText( tr2i18n( "After download:" ) );
    m_ok->setText( tr2i18n( "&OK" ) );
    m_cancel->setText( tr2i18n( "&Cancel" ) );
}

/****************************************************************************
** FileSelectDlgBase meta object code from reading C++ file 'fileselectdlgbase.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 "fileselectdlgbase.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 *FileSelectDlgBase::className() const
{
    return "FileSelectDlgBase";
}

TQMetaObject *FileSelectDlgBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_FileSelectDlgBase( "FileSelectDlgBase", &FileSelectDlgBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* FileSelectDlgBase::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 = TQDialog::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"FileSelectDlgBase", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_FileSelectDlgBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool FileSelectDlgBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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