/****************************************************************************
** Form implementation generated from reading ui file 'CdboCdromDevicesBase.ui'
**
** Created: Wed May 1 15:43:15 2002
**      by:  The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "CdboCdromDevicesBase.h"
#include "CdboCdromDevicesBase.moc"

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

/*
 *  Constructs a CdboCdromDevicesBase which is a child of 'parent', with the
 *  name 'name'.'
 */
CdboCdromDevicesBase::CdboCdromDevicesBase( QWidget* parent,  const char* name )
    : KCModule( parent, name )
{
    if ( !name )
	setName( "CdboCdromDevicesBase" );
    resize( 520, 420 );
    setMinimumSize( QSize( 520, 420 ) );
    setCaption( trUtf8( "Device Settings" ) );
    CdboCdromDevicesBaseLayout = new QVBoxLayout( this, 0, 6, "CdboCdromDevicesBaseLayout");

    detectionTbs = new QTabWidget( this, "detectionTbs" );
    detectionTbs->setMinimumSize( QSize( 510, 417 ) );
    detectionTbs->setMaximumSize( QSize( 5350, 4170 ) );

    tab = new QWidget( detectionTbs, "tab" );
    tabLayout = new QGridLayout( tab, 1, 1, 11, 6, "tabLayout");

    autoLst = new KListView( tab, "autoLst" );
    autoLst->addColumn( trUtf8( "Device" ) );
    autoLst->addColumn( trUtf8( "Model" ) );
    autoLst->addColumn( trUtf8( "Driver" ) );
    autoLst->addColumn( trUtf8( "SCSI" ) );

    tabLayout->addMultiCellWidget( autoLst, 0, 0, 0, 2 );

    Line1 = new QFrame( tab, "Line1" );
    Line1->setProperty( "frameShape", (int)QFrame::HLine );
    Line1->setFrameShadow( QFrame::Sunken );
    Line1->setFrameShape( QFrame::HLine );

    tabLayout->addMultiCellWidget( Line1, 1, 1, 0, 2 );

    detailsBtn = new QPushButton( tab, "detailsBtn" );
    detailsBtn->setEnabled( FALSE );
    detailsBtn->setText( trUtf8( "D&etails" ) );
    QToolTip::add( detailsBtn, trUtf8( "Show details about SCSI device." ) );

    tabLayout->addWidget( detailsBtn, 2, 0 );

    rescanBtn = new QPushButton( tab, "rescanBtn" );
    rescanBtn->setEnabled( TRUE );
    rescanBtn->setText( trUtf8( "&Rescan" ) );
    QToolTip::add( rescanBtn, trUtf8( "Rescan devices." ) );

    tabLayout->addWidget( rescanBtn, 2, 2 );
    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    tabLayout->addItem( spacer, 2, 1 );
    detectionTbs->insertTab( tab, trUtf8( "&Autodetect" ) );

    tab_2 = new QWidget( detectionTbs, "tab_2" );
    tabLayout_2 = new QGridLayout( tab_2, 1, 1, 11, 6, "tabLayout_2");

    scsiDetaislBtn = new QPushButton( tab_2, "scsiDetaislBtn" );
    scsiDetaislBtn->setEnabled( FALSE );
    scsiDetaislBtn->setText( trUtf8( "D&etails" ) );
    QToolTip::add( scsiDetaislBtn, trUtf8( "Show details about SCSI device." ) );

    tabLayout_2->addWidget( scsiDetaislBtn, 2, 0 );

    retryBtn = new QPushButton( tab_2, "retryBtn" );
    retryBtn->setEnabled( TRUE );
    retryBtn->setText( trUtf8( "&Rescan" ) );
    QToolTip::add( retryBtn, trUtf8( "Run scanbus with cdrecord." ) );

    tabLayout_2->addWidget( retryBtn, 2, 2 );
    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    tabLayout_2->addItem( spacer_2, 2, 1 );

    Line2 = new QFrame( tab_2, "Line2" );
    Line2->setProperty( "frameShape", (int)QFrame::HLine );
    Line2->setFrameShadow( QFrame::Sunken );
    Line2->setFrameShape( QFrame::HLine );

    tabLayout_2->addMultiCellWidget( Line2, 1, 1, 0, 2 );

    scsiLst = new KListView( tab_2, "scsiLst" );
    scsiLst->addColumn( trUtf8( "SCSI" ) );
    scsiLst->addColumn( trUtf8( "Brand" ) );
    scsiLst->addColumn( trUtf8( "Model" ) );
    scsiLst->addColumn( trUtf8( "Type" ) );

    tabLayout_2->addMultiCellWidget( scsiLst, 0, 0, 0, 2 );
    detectionTbs->insertTab( tab_2, trUtf8( "&Scanbus" ) );

    tab_3 = new QWidget( detectionTbs, "tab_3" );
    tabLayout_3 = new QGridLayout( tab_3, 1, 1, 11, 6, "tabLayout_3");

    modifyCustomBtn = new QPushButton( tab_3, "modifyCustomBtn" );
    modifyCustomBtn->setEnabled( FALSE );
    modifyCustomBtn->setText( trUtf8( "Modify Entry" ) );

    tabLayout_3->addWidget( modifyCustomBtn, 1, 1 );

    removeCustomBtn = new QPushButton( tab_3, "removeCustomBtn" );
    removeCustomBtn->setEnabled( FALSE );
    removeCustomBtn->setText( trUtf8( "Remove Entry" ) );

    tabLayout_3->addWidget( removeCustomBtn, 1, 2 );

    addCustomBtn = new QPushButton( tab_3, "addCustomBtn" );
    addCustomBtn->setText( trUtf8( "Add to List" ) );

    tabLayout_3->addWidget( addCustomBtn, 1, 0 );

    customLst = new KListView( tab_3, "customLst" );
    customLst->addColumn( trUtf8( "Device" ) );
    customLst->addColumn( trUtf8( "SCSI" ) );
    customLst->addColumn( trUtf8( "Description (name) of custom device" ) );

    tabLayout_3->addMultiCellWidget( customLst, 2, 2, 0, 2 );

    ButtonGroup1 = new QButtonGroup( tab_3, "ButtonGroup1" );
    ButtonGroup1->setMinimumSize( QSize( 40, 0 ) );
    ButtonGroup1->setMaximumSize( QSize( 5210, 32767 ) );
    ButtonGroup1->setTitle( trUtf8( "Custom Device Settings" ) );
    ButtonGroup1->setColumnLayout(0, Qt::Vertical );
    ButtonGroup1->layout()->setSpacing( 6 );
    ButtonGroup1->layout()->setMargin( 11 );
    ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() );
    ButtonGroup1Layout->setAlignment( Qt::AlignTop );

    TextLabel1 = new QLabel( ButtonGroup1, "TextLabel1" );
    TextLabel1->setText( trUtf8( "Description:" ) );

    ButtonGroup1Layout->addWidget( TextLabel1, 2, 0 );

    customScsiChk = new QCheckBox( ButtonGroup1, "customScsiChk" );
    customScsiChk->setText( trUtf8( "SCSI" ) );
    QToolTip::add( customScsiChk, trUtf8( "Only devices configured as scsi can be used for burning." ) );

    ButtonGroup1Layout->addWidget( customScsiChk, 1, 0 );
    QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Minimum );
    ButtonGroup1Layout->addItem( spacer_3, 1, 1 );

    TextLabel2 = new QLabel( ButtonGroup1, "TextLabel2" );
    TextLabel2->setText( trUtf8( "Full path to your custom device:" ) );

    ButtonGroup1Layout->addMultiCellWidget( TextLabel2, 0, 0, 0, 2 );

    customScsiLbl = new QLabel( ButtonGroup1, "customScsiLbl" );
    customScsiLbl->setMinimumSize( QSize( 0, 30 ) );
    customScsiLbl->setText( trUtf8( "scsibus:" ) );
    customScsiLbl->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    ButtonGroup1Layout->addMultiCellWidget( customScsiLbl, 1, 1, 2, 3 );

    customScsiSpn = new QSpinBox( ButtonGroup1, "customScsiSpn" );

    ButtonGroup1Layout->addWidget( customScsiSpn, 1, 4 );

    customTargetLbl = new QLabel( ButtonGroup1, "customTargetLbl" );
    customTargetLbl->setMinimumSize( QSize( 0, 30 ) );
    customTargetLbl->setText( trUtf8( "target:" ) );
    customTargetLbl->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    ButtonGroup1Layout->addWidget( customTargetLbl, 1, 5 );

    customTargetSpn = new QSpinBox( ButtonGroup1, "customTargetSpn" );

    ButtonGroup1Layout->addWidget( customTargetSpn, 1, 6 );

    customBrowseBtn = new QPushButton( ButtonGroup1, "customBrowseBtn" );
    customBrowseBtn->setText( trUtf8( "..." ) );
    QToolTip::add( customBrowseBtn, trUtf8( "Open file dialog." ) );

    ButtonGroup1Layout->addWidget( customBrowseBtn, 0, 9 );

    customPathTxt = new QLineEdit( ButtonGroup1, "customPathTxt" );
    customPathTxt->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, customPathTxt->sizePolicy().hasHeightForWidth() ) );

    ButtonGroup1Layout->addMultiCellWidget( customPathTxt, 0, 0, 3, 8 );

    customLunLbl = new QLabel( ButtonGroup1, "customLunLbl" );
    customLunLbl->setMinimumSize( QSize( 0, 30 ) );
    customLunLbl->setText( trUtf8( "lun:" ) );
    customLunLbl->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    ButtonGroup1Layout->addWidget( customLunLbl, 1, 7 );

    customLunSpn = new QSpinBox( ButtonGroup1, "customLunSpn" );

    ButtonGroup1Layout->addMultiCellWidget( customLunSpn, 1, 1, 8, 9 );

    descriptionTxt = new QLineEdit( ButtonGroup1, "descriptionTxt" );
    descriptionTxt->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, descriptionTxt->sizePolicy().hasHeightForWidth() ) );
    QToolTip::add( descriptionTxt, trUtf8( "Enter name or desription of the<br>device, which will appear in the devices list." ) );

    ButtonGroup1Layout->addMultiCellWidget( descriptionTxt, 2, 2, 1, 9 );

    tabLayout_3->addMultiCellWidget( ButtonGroup1, 0, 0, 0, 2 );
    detectionTbs->insertTab( tab_3, trUtf8( "C&ustom" ) );
    CdboCdromDevicesBaseLayout->addWidget( detectionTbs );

    // signals and slots connections
    connect( customBrowseBtn, SIGNAL( clicked() ), this, SLOT( browseCustomSlot() ) );
    connect( customScsiChk, SIGNAL( clicked() ), this, SLOT( customScsiSlot() ) );
    connect( customLst, SIGNAL( clicked(QListViewItem*) ), this, SLOT( customLstSlot(QListViewItem*) ) );
    connect( customLst, SIGNAL( returnPressed(QListViewItem*) ), this, SLOT( customLstSlot(QListViewItem*) ) );
    connect( scsiDetaislBtn, SIGNAL( clicked() ), this, SLOT( scsiDetailesSlot() ) );
    connect( autoLst, SIGNAL( currentChanged(QListViewItem*) ), this, SLOT( autoSelectionChangedSlot(QListViewItem*) ) );
    connect( detailsBtn, SIGNAL( clicked() ), this, SLOT( autoScsiDetailesSlot() ) );
    connect( rescanBtn, SIGNAL( clicked() ), this, SLOT( rescanSlot() ) );
    connect( rescanBtn, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( retryBtn, SIGNAL( clicked() ), this, SLOT( retryScsiSlot() ) );
    connect( retryBtn, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( addCustomBtn, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( addCustomBtn, SIGNAL( clicked() ), this, SLOT( addCustomSlot() ) );
    connect( modifyCustomBtn, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( modifyCustomBtn, SIGNAL( clicked() ), this, SLOT( modifyCustomSlot() ) );
    connect( removeCustomBtn, SIGNAL( clicked() ), this, SLOT( slotChanged() ) );
    connect( removeCustomBtn, SIGNAL( clicked() ), this, SLOT( removeCustomSlot() ) );

    // tab order
    setTabOrder( detectionTbs, detailsBtn );
    setTabOrder( detailsBtn, rescanBtn );
    setTabOrder( rescanBtn, autoLst );
    setTabOrder( autoLst, customPathTxt );
    setTabOrder( customPathTxt, customBrowseBtn );
    setTabOrder( customBrowseBtn, customScsiChk );
    setTabOrder( customScsiChk, descriptionTxt );
    setTabOrder( descriptionTxt, addCustomBtn );
    setTabOrder( addCustomBtn, modifyCustomBtn );
    setTabOrder( modifyCustomBtn, scsiDetaislBtn );
    setTabOrder( scsiDetaislBtn, retryBtn );
    setTabOrder( retryBtn, scsiLst );
    setTabOrder( scsiLst, customLunSpn );
    setTabOrder( customLunSpn, customTargetSpn );
    setTabOrder( customTargetSpn, customScsiSpn );
    setTabOrder( customScsiSpn, removeCustomBtn );
    setTabOrder( removeCustomBtn, customLst );
}

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

void CdboCdromDevicesBase::addCustomSlot()
{
    qWarning( "CdboCdromDevicesBase::addCustomSlot(): Not implemented yet!" );
}

void CdboCdromDevicesBase::autoScsiDetailesSlot()
{
    qWarning( "CdboCdromDevicesBase::autoScsiDetailesSlot(): Not implemented yet!" );
}

void CdboCdromDevicesBase::autoSelectionChangedSlot( QListViewItem * )
{
    qWarning( "CdboCdromDevicesBase::autoSelectionChangedSlot( QListViewItem * ): Not implemented yet!" );
}

void CdboCdromDevicesBase::browseCustomSlot()
{
    qWarning( "CdboCdromDevicesBase::browseCustomSlot(): Not implemented yet!" );
}

void CdboCdromDevicesBase::customLstSlot( QListViewItem * )
{
    qWarning( "CdboCdromDevicesBase::customLstSlot( QListViewItem * ): Not implemented yet!" );
}

void CdboCdromDevicesBase::customScsiSlot()
{
    qWarning( "CdboCdromDevicesBase::customScsiSlot(): Not implemented yet!" );
}

void CdboCdromDevicesBase::modifyCustomSlot()
{
    qWarning( "CdboCdromDevicesBase::modifyCustomSlot(): Not implemented yet!" );
}

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

void CdboCdromDevicesBase::removeCustomSlot()
{
    qWarning( "CdboCdromDevicesBase::removeCustomSlot(): Not implemented yet!" );
}

void CdboCdromDevicesBase::rescanSlot()
{
    qWarning( "CdboCdromDevicesBase::rescanSlot(): Not implemented yet!" );
}

void CdboCdromDevicesBase::retryScsiSlot()
{
    qWarning( "CdboCdromDevicesBase::retryScsiSlot(): Not implemented yet!" );
}

void CdboCdromDevicesBase::scsiDetailesSlot()
{
    qWarning( "CdboCdromDevicesBase::scsiDetailesSlot(): Not implemented yet!" );
}

