/****************************************************************************
** Form implementation generated from reading ui file 'CdboBurnOptBase.ui'
**
** Created: Mon Apr 29 02:15:45 2002
**      by:  The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "CdboBurnOptBase.h"
#include "CdboBurnOptBase.moc"

#include <qvariant.h>
#include <qbuttongroup.h>
#include <qcheckbox.h>
#include <qframe.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/* 
 *  Constructs a CdboBurnOptBase which is a child of 'parent', with the 
 *  name 'name'.' 
 */
CdboBurnOptBase::CdboBurnOptBase( QWidget* parent,  const char* name )
    : KCModule( parent, name )
{
    if ( !name )
	setName( "CdboBurnOptBase" );
    resize( 575, 450 ); 
    setMinimumSize( QSize( 575, 450 ) );
    setCaption( trUtf8( "Recording Options" ) );
    CdboBurnOptBaseLayout = new QVBoxLayout( this, 0, 6, "CdboBurnOptBaseLayout"); 

    mnPnl = new QFrame( this, "mnPnl" );
    mnPnl->setMinimumSize( QSize( 565, 440 ) );
    mnPnl->setMaximumSize( QSize( 5650, 4170 ) );
    mnPnl->setFrameShape( QFrame::StyledPanel );
    mnPnl->setFrameShadow( QFrame::Raised );
    mnPnl->setLineWidth( 2 );
    mnPnlLayout = new QGridLayout( mnPnl, 1, 1, 11, 6, "mnPnlLayout"); 

    ButtonGroup1_2_2 = new QButtonGroup( mnPnl, "ButtonGroup1_2_2" );
    ButtonGroup1_2_2->setTitle( trUtf8( "General Recording Options" ) );
    ButtonGroup1_2_2->setAlignment( int( QButtonGroup::WordBreak | QButtonGroup::AlignLeft ) );
    ButtonGroup1_2_2->setExclusive( FALSE );
    ButtonGroup1_2_2->setColumnLayout(0, Qt::Vertical );
    ButtonGroup1_2_2->layout()->setSpacing( 6 );
    ButtonGroup1_2_2->layout()->setMargin( 11 );
    ButtonGroup1_2_2Layout = new QGridLayout( ButtonGroup1_2_2->layout() );
    ButtonGroup1_2_2Layout->setAlignment( Qt::AlignTop );

    overburnChk = new QCheckBox( ButtonGroup1_2_2, "overburnChk" );
    overburnChk->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, overburnChk->sizePolicy().hasHeightForWidth() ) );
    overburnChk->setText( trUtf8( "Overburn" ) );
    overburnChk->setChecked( TRUE );
    QToolTip::add( overburnChk, trUtf8( "Allow 'cdrecord' to write more than the official size of a <b></b>medium. Altho most blank media may hold more space than the official size, it's a good idea to make a test to check if your drive implements the feature." ) );

    ButtonGroup1_2_2Layout->addWidget( overburnChk, 1, 0 );
    QSpacerItem* spacer = new QSpacerItem( 16, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
    ButtonGroup1_2_2Layout->addItem( spacer, 1, 1 );

    TextLabel1_2 = new QLabel( ButtonGroup1_2_2, "TextLabel1_2" );
    TextLabel1_2->setText( trUtf8( "Media catalog number:" ) );
    QToolTip::add( TextLabel1_2, trUtf8( "Media Catalog Number of the CD." ) );

    ButtonGroup1_2_2Layout->addWidget( TextLabel1_2, 1, 2 );

    ejectChk = new QCheckBox( ButtonGroup1_2_2, "ejectChk" );
    ejectChk->setText( trUtf8( "&Eject when done" ) );
    ejectChk->setChecked( TRUE );
    QToolTip::add( ejectChk, trUtf8( "Eject media when done." ) );
    QWhatsThis::add( ejectChk, trUtf8( "Eject media when done." ) );

    ButtonGroup1_2_2Layout->addWidget( ejectChk, 0, 0 );

    burnProofChk = new QCheckBox( ButtonGroup1_2_2, "burnProofChk" );
    QFont burnProofChk_font(  burnProofChk->font() );
    burnProofChk_font.setBold( TRUE );
    burnProofChk_font.setItalic( TRUE );
    burnProofChk->setFont( burnProofChk_font ); 
    burnProofChk->setText( trUtf8( "BurnProof" ) );
    QToolTip::add( burnProofChk, trUtf8( "Use <i>'Buffer Underrun Proof'</i> (may not work on some systems)." ) );
    QWhatsThis::add( burnProofChk, trUtf8( "Use <i>'Buffer Underrun Proof'</i> writing with drives that use the Sanyo BURN-Proof technology." ) );

    ButtonGroup1_2_2Layout->addWidget( burnProofChk, 2, 0 );

    checkDriveChk = new QCheckBox( ButtonGroup1_2_2, "checkDriveChk" );
    checkDriveChk->setText( trUtf8( "Check drive first" ) );
    QToolTip::add( checkDriveChk, trUtf8( "Check device before recording" ) );

    ButtonGroup1_2_2Layout->addMultiCellWidget( checkDriveChk, 0, 0, 1, 2 );

    useCustOptChk = new QCheckBox( ButtonGroup1_2_2, "useCustOptChk" );
    useCustOptChk->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)0, 0, 0, useCustOptChk->sizePolicy().hasHeightForWidth() ) );
    useCustOptChk->setText( trUtf8( "Use custom 'cdrecord' options" ) );
    QToolTip::add( useCustOptChk, trUtf8( "Use custom 'cdrecord' options. (Options for<b></b> people,who know what to do with them)." ) );

    ButtonGroup1_2_2Layout->addMultiCellWidget( useCustOptChk, 2, 2, 1, 2 );

    mcnTxt = new QLineEdit( ButtonGroup1_2_2, "mcnTxt" );
    mcnTxt->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, mcnTxt->sizePolicy().hasHeightForWidth() ) );
    mcnTxt->setAcceptDrops( FALSE );
    QToolTip::add( mcnTxt, trUtf8( "Media Catalog Number of the CD." ) );

    ButtonGroup1_2_2Layout->addWidget( mcnTxt, 1, 3 );

    daoChk = new QCheckBox( ButtonGroup1_2_2, "daoChk" );
    daoChk->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, daoChk->sizePolicy().hasHeightForWidth() ) );
    daoChk->setText( trUtf8( "DAO (Disk at once)" ) );
    QToolTip::add( daoChk, trUtf8( "Set 'Disc At Once' mode --<br>(may not work on some systems)." ) );

    ButtonGroup1_2_2Layout->addWidget( daoChk, 0, 3 );

    mnPnlLayout->addWidget( ButtonGroup1_2_2, 0, 0 );
    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    mnPnlLayout->addItem( spacer_2, 3, 0 );

    custOptPnl = new QButtonGroup( mnPnl, "custOptPnl" );
    custOptPnl->setEnabled( TRUE );
    custOptPnl->setMargin( 0 );
    custOptPnl->setTitle( trUtf8( "Custom 'cdrecord' Options" ) );
    custOptPnl->setColumnLayout(0, Qt::Vertical );
    custOptPnl->layout()->setSpacing( 6 );
    custOptPnl->layout()->setMargin( 11 );
    custOptPnlLayout = new QGridLayout( custOptPnl->layout() );
    custOptPnlLayout->setAlignment( Qt::AlignTop );

    useInfChk = new QCheckBox( custOptPnl, "useInfChk" );
    useInfChk->setText( trUtf8( "Ignore *.inf files" ) );
    QToolTip::add( useInfChk, trUtf8( "If this option is used, the pregap size information that is read from the *.inf files will be ignored. <b></b>" ) );

    custOptPnlLayout->addMultiCellWidget( useInfChk, 0, 0, 0, 2 );

    TextLabel3 = new QLabel( custOptPnl, "TextLabel3" );
    TextLabel3->setText( trUtf8( "Fifo (ring buffer) size:" ) );
    TextLabel3->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignLeft ) );

    custOptPnlLayout->addMultiCellWidget( TextLabel3, 1, 1, 0, 1 );

    TextLabel1_3 = new QLabel( custOptPnl, "TextLabel1_3" );
    TextLabel1_3->setText( trUtf8( "Driver name:" ) );
    TextLabel1_3->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignLeft ) );

    custOptPnlLayout->addWidget( TextLabel1_3, 2, 0 );

    driverNameTxt = new QLineEdit( custOptPnl, "driverNameTxt" );
    QToolTip::add( driverNameTxt, trUtf8( "User supplied driver name for the device." ) );
    QWhatsThis::add( driverNameTxt, trUtf8( "Allows to use a user supplied driver name for  the device." ) );

    custOptPnlLayout->addMultiCellWidget( driverNameTxt, 2, 2, 1, 2 );

    fifoSizeSpn = new QSpinBox( custOptPnl, "fifoSizeSpn" );
    fifoSizeSpn->setMaxValue( 32 );
    fifoSizeSpn->setMinValue( 4 );
    fifoSizeSpn->setLineStep( 4 );
    fifoSizeSpn->setSuffix( trUtf8( " MB" ) );
    QToolTip::add( fifoSizeSpn, trUtf8( "Fifo (ring buffer) size." ) );

    custOptPnlLayout->addWidget( fifoSizeSpn, 1, 2 );

    TextLabel4 = new QLabel( custOptPnl, "TextLabel4" );
    TextLabel4->setText( trUtf8( "SCSI command time out:" ) );
    TextLabel4->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignLeft ) );

    custOptPnlLayout->addMultiCellWidget( TextLabel4, 1, 1, 4, 5 );

    TextLabel2 = new QLabel( custOptPnl, "TextLabel2" );
    TextLabel2->setText( trUtf8( "Driver Options:" ) );
    TextLabel2->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignLeft ) );

    custOptPnlLayout->addWidget( TextLabel2, 2, 4 );

    driverOptTxt = new QLineEdit( custOptPnl, "driverOptTxt" );
    driverOptTxt->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, driverOptTxt->sizePolicy().hasHeightForWidth() ) );
    QToolTip::add( driverOptTxt, trUtf8( "Driver specific options." ) );
    QWhatsThis::add( driverOptTxt, trUtf8( "Driver specific options." ) );

    custOptPnlLayout->addMultiCellWidget( driverOptTxt, 2, 2, 5, 6 );

    scsiTimeOutSpn = new QSpinBox( custOptPnl, "scsiTimeOutSpn" );
    scsiTimeOutSpn->setMaxValue( 300 );
    scsiTimeOutSpn->setMinValue( 0 );
    scsiTimeOutSpn->setLineStep( 15 );
    scsiTimeOutSpn->setValue( 45 );
    scsiTimeOutSpn->setSuffix( trUtf8( " sec" ) );
    QToolTip::add( scsiTimeOutSpn, trUtf8( "Default SCSI command timeout value. Used only by <b></b>'cdrecord'." ) );

    custOptPnlLayout->addWidget( scsiTimeOutSpn, 1, 6 );

    defPregapSpn = new QSpinBox( custOptPnl, "defPregapSpn" );
    defPregapSpn->setMaxValue( 100 );
    defPregapSpn->setSuffix( trUtf8( " sec" ) );
    QToolTip::add( defPregapSpn, trUtf8( "Default pre-gap size for all tracks except track number 1." ) );

    custOptPnlLayout->addWidget( defPregapSpn, 0, 6 );

    defPregapLbl = new QLabel( custOptPnl, "defPregapLbl" );
    defPregapLbl->setText( trUtf8( "Default pre-gap size:" ) );
    defPregapLbl->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignLeft ) );

    custOptPnlLayout->addMultiCellWidget( defPregapLbl, 0, 0, 4, 5 );
    QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Maximum, QSizePolicy::Minimum );
    custOptPnlLayout->addItem( spacer_3, 0, 3 );

    mnPnlLayout->addWidget( custOptPnl, 1, 0 );

    ButtonGroup1_2_3 = new QButtonGroup( mnPnl, "ButtonGroup1_2_3" );
    ButtonGroup1_2_3->setTitle( trUtf8( "Erase Options" ) );
    ButtonGroup1_2_3->setExclusive( FALSE );
    ButtonGroup1_2_3->setColumnLayout(0, Qt::Vertical );
    ButtonGroup1_2_3->layout()->setSpacing( 6 );
    ButtonGroup1_2_3->layout()->setMargin( 11 );
    ButtonGroup1_2_3Layout = new QHBoxLayout( ButtonGroup1_2_3->layout() );
    ButtonGroup1_2_3Layout->setAlignment( Qt::AlignTop );

    dummyEraseChk = new QCheckBox( ButtonGroup1_2_3, "dummyEraseChk" );
    dummyEraseChk->setText( trUtf8( "&Dummy erase" ) );
    QToolTip::add( dummyEraseChk, trUtf8( "Leave laser off while easing. --<br>Best way to make sure your device works." ) );
    ButtonGroup1_2_3Layout->addWidget( dummyEraseChk );

    ejectEraseChk = new QCheckBox( ButtonGroup1_2_3, "ejectEraseChk" );
    ejectEraseChk->setText( trUtf8( "&Eject when done erasing" ) );
    ejectEraseChk->setChecked( TRUE );
    QToolTip::add( ejectEraseChk, trUtf8( "Eject CD-RW when done erasing." ) );
    ButtonGroup1_2_3Layout->addWidget( ejectEraseChk );

    checkDriveEraseChk = new QCheckBox( ButtonGroup1_2_3, "checkDriveEraseChk" );
    checkDriveEraseChk->setText( trUtf8( "Check drive first" ) );
    QToolTip::add( checkDriveEraseChk, trUtf8( "Check device before erasing" ) );
    ButtonGroup1_2_3Layout->addWidget( checkDriveEraseChk );

    mnPnlLayout->addWidget( ButtonGroup1_2_3, 2, 0 );
    CdboBurnOptBaseLayout->addWidget( mnPnl );

    // signals and slots connections
    connect( dummyEraseChk, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( ejectEraseChk, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( checkDriveEraseChk, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( defPregapSpn, SIGNAL( valueChanged(int) ), this, SLOT( slotChanged() ) );
    connect( scsiTimeOutSpn, SIGNAL( valueChanged(int) ), this, SLOT( slotChanged() ) );
    connect( fifoSizeSpn, SIGNAL( valueChanged(int) ), this, SLOT( slotChanged() ) );
    connect( burnProofChk, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( useCustOptChk, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( daoChk, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( overburnChk, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( ejectChk, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( checkDriveChk, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( mcnTxt, SIGNAL( textChanged(const QString&) ), this, SLOT( slotChanged() ) );
    connect( driverNameTxt, SIGNAL( textChanged(const QString&) ), this, SLOT( slotChanged() ) );
    connect( driverOptTxt, SIGNAL( textChanged(const QString&) ), this, SLOT( slotChanged() ) );
    connect( useInfChk, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( useInfChk, SIGNAL( clicked() ), this, SLOT( ignoreInfSlot() ) );
}

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

void CdboBurnOptBase::ignoreInfSlot()
{
    qWarning( "CdboBurnOptBase::ignoreInfSlot(): Not implemented yet!" );
}

void CdboBurnOptBase::slotChanged()
{
    emit changed(true);
}

