#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/home/oliver/work/programming/kyammi/src/ConsistencyCheckDialogBase.ui'
**
** Created: Sun Jul 31 13:19:26 2005
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.4   edited Nov 24 2003 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "ConsistencyCheckDialogBase.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <qbuttongroup.h>
#include <qcheckbox.h>
#include <qlineedit.h>
#include <ktextedit.h>
#include <qcombobox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>

/*
 *  Constructs a CheckConsistencyDialogBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
CheckConsistencyDialogBase::CheckConsistencyDialogBase( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "CheckConsistencyDialogBase" );
    setSizeGripEnabled( TRUE );
    CheckConsistencyDialogBaseLayout = new QGridLayout( this, 1, 1, 11, 6, "CheckConsistencyDialogBaseLayout"); 

    TextLabelTitle = new QLabel( this, "TextLabelTitle" );
    TextLabelTitle->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)4, 0, 0, TextLabelTitle->sizePolicy().hasHeightForWidth() ) );
    QFont TextLabelTitle_font(  TextLabelTitle->font() );
    TextLabelTitle_font.setBold( TRUE );
    TextLabelTitle_font.setItalic( TRUE );
    TextLabelTitle->setFont( TextLabelTitle_font ); 

    CheckConsistencyDialogBaseLayout->addMultiCellWidget( TextLabelTitle, 0, 0, 0, 2 );

    PushButtonOk = new QPushButton( this, "PushButtonOk" );
    PushButtonOk->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, PushButtonOk->sizePolicy().hasHeightForWidth() ) );

    CheckConsistencyDialogBaseLayout->addWidget( PushButtonOk, 7, 2 );

    PushButtonCancel = new QPushButton( this, "PushButtonCancel" );
    PushButtonCancel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, PushButtonCancel->sizePolicy().hasHeightForWidth() ) );

    CheckConsistencyDialogBaseLayout->addWidget( PushButtonCancel, 7, 3 );

    PushButtonPatternReplacements = new QPushButton( this, "PushButtonPatternReplacements" );

    CheckConsistencyDialogBaseLayout->addWidget( PushButtonPatternReplacements, 7, 0 );
    Spacer1_5_2 = new QSpacerItem( 160, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
    CheckConsistencyDialogBaseLayout->addItem( Spacer1_5_2, 7, 1 );

    buttonGroup7 = new QButtonGroup( this, "buttonGroup7" );
    buttonGroup7->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)5, 0, 0, buttonGroup7->sizePolicy().hasHeightForWidth() ) );
    buttonGroup7->setColumnLayout(0, Qt::Vertical );
    buttonGroup7->layout()->setSpacing( 1 );
    buttonGroup7->layout()->setMargin( 4 );
    buttonGroup7Layout = new QGridLayout( buttonGroup7->layout() );
    buttonGroup7Layout->setAlignment( Qt::AlignTop );

    CheckBoxCheckDirectories = new QCheckBox( buttonGroup7, "CheckBoxCheckDirectories" );

    buttonGroup7Layout->addMultiCellWidget( CheckBoxCheckDirectories, 0, 0, 0, 2 );

    CheckBoxCorrectDirectories = new QCheckBox( buttonGroup7, "CheckBoxCorrectDirectories" );

    buttonGroup7Layout->addMultiCellWidget( CheckBoxCorrectDirectories, 1, 1, 1, 2 );
    Spacer1_3 = new QSpacerItem( 40, 16, QSizePolicy::Fixed, QSizePolicy::Minimum );
    buttonGroup7Layout->addItem( Spacer1_3, 1, 0 );

    CheckBoxDeleteEmptyDirectories = new QCheckBox( buttonGroup7, "CheckBoxDeleteEmptyDirectories" );

    buttonGroup7Layout->addMultiCellWidget( CheckBoxDeleteEmptyDirectories, 3, 3, 1, 2 );
    Spacer1_2_2_2 = new QSpacerItem( 40, 16, QSizePolicy::Fixed, QSizePolicy::Minimum );
    buttonGroup7Layout->addItem( Spacer1_2_2_2, 3, 0 );

    LabelDirectoryPattern = new QLabel( buttonGroup7, "LabelDirectoryPattern" );

    buttonGroup7Layout->addMultiCellWidget( LabelDirectoryPattern, 2, 2, 0, 1 );

    LineEditDirectoryPattern = new QLineEdit( buttonGroup7, "LineEditDirectoryPattern" );

    buttonGroup7Layout->addWidget( LineEditDirectoryPattern, 2, 2 );

    CheckConsistencyDialogBaseLayout->addMultiCellWidget( buttonGroup7, 5, 5, 0, 1 );

    TextEditOutput = new KTextEdit( this, "TextEditOutput" );
    TextEditOutput->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, TextEditOutput->sizePolicy().hasHeightForWidth() ) );
    TextEditOutput->setMinimumSize( QSize( 280, 0 ) );
    TextEditOutput->setFrameShape( KTextEdit::LineEditPanel );
    TextEditOutput->setFrameShadow( KTextEdit::Sunken );
    TextEditOutput->setHScrollBarMode( KTextEdit::AlwaysOn );
    TextEditOutput->setTextFormat( KTextEdit::AutoText );
    TextEditOutput->setWordWrap( KTextEdit::NoWrap );
    TextEditOutput->setWrapPolicy( KTextEdit::Anywhere );
    TextEditOutput->setReadOnly( TRUE );

    CheckConsistencyDialogBaseLayout->addMultiCellWidget( TextEditOutput, 1, 6, 2, 3 );

    buttonGroup3 = new QButtonGroup( this, "buttonGroup3" );
    buttonGroup3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)5, 0, 0, buttonGroup3->sizePolicy().hasHeightForWidth() ) );
    buttonGroup3->setColumnLayout(0, Qt::Vertical );
    buttonGroup3->layout()->setSpacing( 1 );
    buttonGroup3->layout()->setMargin( 4 );
    buttonGroup3Layout = new QGridLayout( buttonGroup3->layout() );
    buttonGroup3Layout->setAlignment( Qt::AlignTop );

    CheckBoxCheckForExistence = new QCheckBox( buttonGroup3, "CheckBoxCheckForExistence" );

    buttonGroup3Layout->addMultiCellWidget( CheckBoxCheckForExistence, 0, 0, 0, 1 );

    CheckBoxUpdateNonExisting = new QCheckBox( buttonGroup3, "CheckBoxUpdateNonExisting" );

    buttonGroup3Layout->addWidget( CheckBoxUpdateNonExisting, 1, 1 );
    Spacer1 = new QSpacerItem( 40, 16, QSizePolicy::Fixed, QSizePolicy::Minimum );
    buttonGroup3Layout->addItem( Spacer1, 1, 0 );

    CheckConsistencyDialogBaseLayout->addMultiCellWidget( buttonGroup3, 1, 1, 0, 1 );

    buttonGroup5 = new QButtonGroup( this, "buttonGroup5" );
    buttonGroup5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)5, 0, 0, buttonGroup5->sizePolicy().hasHeightForWidth() ) );
    buttonGroup5->setColumnLayout(0, Qt::Vertical );
    buttonGroup5->layout()->setSpacing( 1 );
    buttonGroup5->layout()->setMargin( 4 );
    buttonGroup5Layout = new QGridLayout( buttonGroup5->layout() );
    buttonGroup5Layout->setAlignment( Qt::AlignTop );

    CheckBoxCheckTags = new QCheckBox( buttonGroup5, "CheckBoxCheckTags" );

    buttonGroup5Layout->addMultiCellWidget( CheckBoxCheckTags, 0, 0, 0, 1 );
    Spacer1_2 = new QSpacerItem( 40, 16, QSizePolicy::Fixed, QSizePolicy::Minimum );
    buttonGroup5Layout->addItem( Spacer1_2, 1, 0 );
    Spacer1_2_2 = new QSpacerItem( 40, 16, QSizePolicy::Fixed, QSizePolicy::Minimum );
    buttonGroup5Layout->addItem( Spacer1_2_2, 2, 0 );

    ComboBoxCorrectTagsDirection = new QComboBox( FALSE, buttonGroup5, "ComboBoxCorrectTagsDirection" );
    ComboBoxCorrectTagsDirection->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, ComboBoxCorrectTagsDirection->sizePolicy().hasHeightForWidth() ) );

    buttonGroup5Layout->addWidget( ComboBoxCorrectTagsDirection, 2, 1 );

    CheckBoxCorrectTags = new QCheckBox( buttonGroup5, "CheckBoxCorrectTags" );

    buttonGroup5Layout->addWidget( CheckBoxCorrectTags, 1, 1 );

    CheckConsistencyDialogBaseLayout->addMultiCellWidget( buttonGroup5, 2, 2, 0, 1 );

    buttonGroup6 = new QButtonGroup( this, "buttonGroup6" );
    buttonGroup6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)5, 0, 0, buttonGroup6->sizePolicy().hasHeightForWidth() ) );
    buttonGroup6->setColumnLayout(0, Qt::Vertical );
    buttonGroup6->layout()->setSpacing( 1 );
    buttonGroup6->layout()->setMargin( 4 );
    buttonGroup6Layout = new QGridLayout( buttonGroup6->layout() );
    buttonGroup6Layout->setAlignment( Qt::AlignTop );

    CheckBoxCheckFilenames = new QCheckBox( buttonGroup6, "CheckBoxCheckFilenames" );

    buttonGroup6Layout->addMultiCellWidget( CheckBoxCheckFilenames, 0, 0, 0, 2 );

    CheckBoxCorrectFilenames = new QCheckBox( buttonGroup6, "CheckBoxCorrectFilenames" );

    buttonGroup6Layout->addMultiCellWidget( CheckBoxCorrectFilenames, 1, 1, 1, 2 );
    Spacer1_4 = new QSpacerItem( 40, 16, QSizePolicy::Fixed, QSizePolicy::Minimum );
    buttonGroup6Layout->addItem( Spacer1_4, 1, 0 );

    LabelFilenamePattern = new QLabel( buttonGroup6, "LabelFilenamePattern" );

    buttonGroup6Layout->addMultiCellWidget( LabelFilenamePattern, 2, 2, 0, 1 );

    LineEditFilenamePattern = new QLineEdit( buttonGroup6, "LineEditFilenamePattern" );
    LineEditFilenamePattern->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, LineEditFilenamePattern->sizePolicy().hasHeightForWidth() ) );

    buttonGroup6Layout->addWidget( LineEditFilenamePattern, 2, 2 );

    CheckConsistencyDialogBaseLayout->addMultiCellWidget( buttonGroup6, 4, 4, 0, 1 );

    buttonGroup8 = new QButtonGroup( this, "buttonGroup8" );
    buttonGroup8->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)5, 0, 0, buttonGroup8->sizePolicy().hasHeightForWidth() ) );
    buttonGroup8->setColumnLayout(0, Qt::Vertical );
    buttonGroup8->layout()->setSpacing( 1 );
    buttonGroup8->layout()->setMargin( 4 );
    buttonGroup8Layout = new QGridLayout( buttonGroup8->layout() );
    buttonGroup8Layout->setAlignment( Qt::AlignTop );

    CheckBoxCheckDoubles = new QCheckBox( buttonGroup8, "CheckBoxCheckDoubles" );

    buttonGroup8Layout->addWidget( CheckBoxCheckDoubles, 0, 0 );

    CheckConsistencyDialogBaseLayout->addMultiCellWidget( buttonGroup8, 6, 6, 0, 1 );

    buttonGroup8_2 = new QButtonGroup( this, "buttonGroup8_2" );
    buttonGroup8_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)5, 0, 0, buttonGroup8_2->sizePolicy().hasHeightForWidth() ) );
    buttonGroup8_2->setColumnLayout(0, Qt::Vertical );
    buttonGroup8_2->layout()->setSpacing( 1 );
    buttonGroup8_2->layout()->setMargin( 4 );
    buttonGroup8_2Layout = new QGridLayout( buttonGroup8_2->layout() );
    buttonGroup8_2Layout->setAlignment( Qt::AlignTop );

    CheckBoxIgnoreCase = new QCheckBox( buttonGroup8_2, "CheckBoxIgnoreCase" );

    buttonGroup8_2Layout->addWidget( CheckBoxIgnoreCase, 0, 0 );

    CheckConsistencyDialogBaseLayout->addMultiCellWidget( buttonGroup8_2, 3, 3, 0, 1 );
    languageChange();
    resize( QSize(737, 579).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( PushButtonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );

    // tab order
    setTabOrder( CheckBoxCheckForExistence, CheckBoxUpdateNonExisting );
    setTabOrder( CheckBoxUpdateNonExisting, CheckBoxCheckTags );
    setTabOrder( CheckBoxCheckTags, CheckBoxCorrectTags );
    setTabOrder( CheckBoxCorrectTags, ComboBoxCorrectTagsDirection );
    setTabOrder( ComboBoxCorrectTagsDirection, CheckBoxIgnoreCase );
    setTabOrder( CheckBoxIgnoreCase, CheckBoxCheckFilenames );
    setTabOrder( CheckBoxCheckFilenames, CheckBoxCorrectFilenames );
    setTabOrder( CheckBoxCorrectFilenames, LineEditFilenamePattern );
    setTabOrder( LineEditFilenamePattern, CheckBoxCheckDirectories );
    setTabOrder( CheckBoxCheckDirectories, CheckBoxCorrectDirectories );
    setTabOrder( CheckBoxCorrectDirectories, LineEditDirectoryPattern );
    setTabOrder( LineEditDirectoryPattern, CheckBoxDeleteEmptyDirectories );
    setTabOrder( CheckBoxDeleteEmptyDirectories, CheckBoxCheckDoubles );
    setTabOrder( CheckBoxCheckDoubles, PushButtonPatternReplacements );
    setTabOrder( PushButtonPatternReplacements, PushButtonOk );
    setTabOrder( PushButtonOk, PushButtonCancel );
    setTabOrder( PushButtonCancel, TextEditOutput );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void CheckConsistencyDialogBase::languageChange()
{
    setCaption( tr2i18n( "Check consistency of song database" ) );
    TextLabelTitle->setText( tr2i18n( "Consistency Check" ) );
    PushButtonOk->setText( tr2i18n( "Start Check..." ) );
    PushButtonCancel->setText( tr2i18n( "Exit" ) );
    PushButtonPatternReplacements->setText( tr2i18n( "Pattern Replacements..." ) );
    buttonGroup7->setTitle( QString::null );
    CheckBoxCheckDirectories->setText( tr2i18n( "check directories" ) );
    QToolTip::add( CheckBoxCheckDirectories, tr2i18n( "Checks, whether the directories correspond to the configured directory scheme" ) );
    CheckBoxCorrectDirectories->setText( tr2i18n( "correct inconsistent directories" ) );
    QToolTip::add( CheckBoxCorrectDirectories, tr2i18n( "If directories differ from the configured directory scheme, the files will be moved" ) );
    CheckBoxDeleteEmptyDirectories->setText( tr2i18n( "delete empty directories" ) );
    QToolTip::add( CheckBoxDeleteEmptyDirectories, tr2i18n( "If directories are empty after moving files, these will be removed." ) );
    LabelDirectoryPattern->setText( tr2i18n( "pattern:" ) );
    QToolTip::add( LabelDirectoryPattern, tr2i18n( "The filename pattern to use for renaming files." ) );
    QToolTip::add( LineEditDirectoryPattern, tr2i18n( "The filename pattern to use for renaming files." ) );
    QToolTip::add( TextEditOutput, tr2i18n( "output of consistency check" ) );
    buttonGroup3->setTitle( QString::null );
    CheckBoxCheckForExistence->setText( tr2i18n( "check for existence of files" ) );
    QToolTip::add( CheckBoxCheckForExistence, tr2i18n( "Checks, whether the file is existing and readable" ) );
    CheckBoxUpdateNonExisting->setText( tr2i18n( "update/delete non existing entries" ) );
    QToolTip::add( CheckBoxUpdateNonExisting, tr2i18n( "Entries not existing at their saved location are updated (existing on media) or deleted (not existing on any media)" ) );
    buttonGroup5->setTitle( QString::null );
    CheckBoxCheckTags->setText( tr2i18n( "check tags" ) );
    QToolTip::add( CheckBoxCheckTags, tr2i18n( "Checks, whether the (mp3/ogg) tags are consistent with Yammi's database" ) );
    ComboBoxCorrectTagsDirection->clear();
    ComboBoxCorrectTagsDirection->insertItem( tr2i18n( "Yammi database => File Tags" ) );
    ComboBoxCorrectTagsDirection->insertItem( tr2i18n( "File Tags => Yammi database" ) );
    CheckBoxCorrectTags->setText( tr2i18n( "correct inconsistent tags" ) );
    QToolTip::add( CheckBoxCorrectTags, tr2i18n( "If tags do not correspond to the information in Yammi's database, they wil be corrected." ) );
    buttonGroup6->setTitle( QString::null );
    CheckBoxCheckFilenames->setText( tr2i18n( "check filenames" ) );
    QToolTip::add( CheckBoxCheckFilenames, tr2i18n( "Checks, whether the filenames correspond to the configured filename scheme" ) );
    CheckBoxCorrectFilenames->setText( tr2i18n( "correct inconsistent filenames" ) );
    QToolTip::add( CheckBoxCorrectFilenames, tr2i18n( "If filenames differ from the configured filename scheme, they will be corrected" ) );
    LabelFilenamePattern->setText( tr2i18n( "pattern:" ) );
    QToolTip::add( LabelFilenamePattern, tr2i18n( "The filename pattern to use for renaming files." ) );
    QToolTip::add( LineEditFilenamePattern, tr2i18n( "The filename pattern to use for renaming files." ) );
    buttonGroup8->setTitle( QString::null );
    CheckBoxCheckDoubles->setText( tr2i18n( "check for doubles" ) );
    QToolTip::add( CheckBoxCheckDoubles, tr2i18n( "checks for entries that are contained twice in Yammi's database" ) );
    buttonGroup8_2->setTitle( QString::null );
    CheckBoxIgnoreCase->setText( tr2i18n( "ignore case in filename checks" ) );
    QToolTip::add( CheckBoxIgnoreCase, tr2i18n( "ignore case differences in filename / directory check" ) );
}

#include "ConsistencyCheckDialogBase.moc"
