#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/home/oliver/work/programming/kyammi/src/SongInfoDialog.ui'
**
** Created: Sun Jul 31 13:19:42 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 "SongInfoDialog.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qgroupbox.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/*
 *  Constructs a SongInfoDialog 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.
 */
SongInfoDialog::SongInfoDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "SongInfoDialog" );
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
    setSizeGripEnabled( TRUE );
    SongInfoDialogLayout = new QGridLayout( this, 1, 1, 11, 6, "SongInfoDialogLayout"); 

    GroupBox1 = new QGroupBox( this, "GroupBox1" );
    GroupBox1->setColumnLayout(0, Qt::Vertical );
    GroupBox1->layout()->setSpacing( 3 );
    GroupBox1->layout()->setMargin( 5 );
    GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
    GroupBox1Layout->setAlignment( Qt::AlignTop );

    LineEditArtist = new QLineEdit( GroupBox1, "LineEditArtist" );

    GroupBox1Layout->addMultiCellWidget( LineEditArtist, 0, 0, 1, 5 );

    LineEditTitle = new QLineEdit( GroupBox1, "LineEditTitle" );

    GroupBox1Layout->addMultiCellWidget( LineEditTitle, 1, 1, 1, 5 );

    LineEditAlbum = new QLineEdit( GroupBox1, "LineEditAlbum" );

    GroupBox1Layout->addMultiCellWidget( LineEditAlbum, 2, 2, 1, 5 );

    LabelAlbum = new QLabel( GroupBox1, "LabelAlbum" );

    GroupBox1Layout->addWidget( LabelAlbum, 2, 0 );

    LineEditComment = new QLineEdit( GroupBox1, "LineEditComment" );

    GroupBox1Layout->addMultiCellWidget( LineEditComment, 3, 3, 1, 5 );

    LabelComment = new QLabel( GroupBox1, "LabelComment" );

    GroupBox1Layout->addWidget( LabelComment, 3, 0 );

    LabelYear = new QLabel( GroupBox1, "LabelYear" );

    GroupBox1Layout->addWidget( LabelYear, 4, 0 );

    LabelTitle = new QLabel( GroupBox1, "LabelTitle" );

    GroupBox1Layout->addWidget( LabelTitle, 1, 0 );

    LineEditTrack = new QLineEdit( GroupBox1, "LineEditTrack" );
    LineEditTrack->setMinimumSize( QSize( 40, 0 ) );

    GroupBox1Layout->addWidget( LineEditTrack, 4, 3 );

    LineEditYear = new QLineEdit( GroupBox1, "LineEditYear" );
    LineEditYear->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, LineEditYear->sizePolicy().hasHeightForWidth() ) );
    LineEditYear->setMinimumSize( QSize( 65, 0 ) );

    GroupBox1Layout->addWidget( LineEditYear, 4, 1 );

    LabelTrack = new QLabel( GroupBox1, "LabelTrack" );

    GroupBox1Layout->addWidget( LabelTrack, 4, 2 );

    LabelGenre = new QLabel( GroupBox1, "LabelGenre" );

    GroupBox1Layout->addWidget( LabelGenre, 4, 4 );

    LabelArtist = new QLabel( GroupBox1, "LabelArtist" );

    GroupBox1Layout->addWidget( LabelArtist, 0, 0 );

    ComboBoxGenre = new QComboBox( FALSE, GroupBox1, "ComboBoxGenre" );
    ComboBoxGenre->setEditable( TRUE );

    GroupBox1Layout->addWidget( ComboBoxGenre, 4, 5 );

    SongInfoDialogLayout->addMultiCellWidget( GroupBox1, 1, 1, 0, 4 );

    GroupBox2 = new QGroupBox( this, "GroupBox2" );
    GroupBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, GroupBox2->sizePolicy().hasHeightForWidth() ) );
    GroupBox2->setColumnLayout(0, Qt::Vertical );
    GroupBox2->layout()->setSpacing( 3 );
    GroupBox2->layout()->setMargin( 5 );
    GroupBox2Layout = new QGridLayout( GroupBox2->layout() );
    GroupBox2Layout->setAlignment( Qt::AlignTop );

    LabelAddedTo = new QLabel( GroupBox2, "LabelAddedTo" );

    GroupBox2Layout->addWidget( LabelAddedTo, 0, 0 );

    LineEditAddedTo = new QLineEdit( GroupBox2, "LineEditAddedTo" );
    LineEditAddedTo->setReadOnly( TRUE );

    GroupBox2Layout->addWidget( LineEditAddedTo, 0, 1 );

    LineEditLastPlayed = new QLineEdit( GroupBox2, "LineEditLastPlayed" );
    LineEditLastPlayed->setEnabled( TRUE );
    LineEditLastPlayed->setEdited( FALSE );
    LineEditLastPlayed->setReadOnly( TRUE );

    GroupBox2Layout->addWidget( LineEditLastPlayed, 0, 3 );

    LabelLastPlayed = new QLabel( GroupBox2, "LabelLastPlayed" );
    LabelLastPlayed->setEnabled( TRUE );

    GroupBox2Layout->addWidget( LabelLastPlayed, 0, 2 );

    SongInfoDialogLayout->addMultiCellWidget( GroupBox2, 3, 3, 0, 4 );

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

    SongInfoDialogLayout->addWidget( PushButtonCancel, 4, 3 );

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

    SongInfoDialogLayout->addWidget( PushButtonOK, 4, 1 );
    spacer1_2 = new QSpacerItem( 80, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    SongInfoDialogLayout->addItem( spacer1_2, 4, 4 );
    spacer1_3 = new QSpacerItem( 50, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    SongInfoDialogLayout->addItem( spacer1_3, 4, 0 );

    LabelHeading = new QLabel( this, "LabelHeading" );
    LabelHeading->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)4, 0, 0, LabelHeading->sizePolicy().hasHeightForWidth() ) );
    QFont LabelHeading_font(  LabelHeading->font() );
    LabelHeading_font.setPointSize( 15 );
    LabelHeading_font.setBold( TRUE );
    LabelHeading_font.setItalic( TRUE );
    LabelHeading->setFont( LabelHeading_font ); 

    SongInfoDialogLayout->addMultiCellWidget( LabelHeading, 0, 0, 0, 4 );
    spacer1 = new QSpacerItem( 80, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    SongInfoDialogLayout->addItem( spacer1, 4, 2 );

    GroupBox3 = new QGroupBox( this, "GroupBox3" );
    GroupBox3->setColumnLayout(0, Qt::Vertical );
    GroupBox3->layout()->setSpacing( 3 );
    GroupBox3->layout()->setMargin( 5 );
    GroupBox3Layout = new QGridLayout( GroupBox3->layout() );
    GroupBox3Layout->setAlignment( Qt::AlignTop );

    LabelSize = new QLabel( GroupBox3, "LabelSize" );

    GroupBox3Layout->addMultiCellWidget( LabelSize, 1, 1, 0, 1 );

    LabelPath = new QLabel( GroupBox3, "LabelPath" );

    GroupBox3Layout->addMultiCellWidget( LabelPath, 2, 2, 0, 1 );

    LabelLength = new QLabel( GroupBox3, "LabelLength" );

    GroupBox3Layout->addMultiCellWidget( LabelLength, 0, 0, 0, 1 );

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

    GroupBox3Layout->addWidget( ComboBoxMedia, 0, 5 );

    ReadOnlyBitrate = new QLineEdit( GroupBox3, "ReadOnlyBitrate" );
    ReadOnlyBitrate->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, ReadOnlyBitrate->sizePolicy().hasHeightForWidth() ) );
    ReadOnlyBitrate->setReadOnly( TRUE );

    GroupBox3Layout->addWidget( ReadOnlyBitrate, 1, 5 );

    LabelMedia = new QLabel( GroupBox3, "LabelMedia" );

    GroupBox3Layout->addWidget( LabelMedia, 0, 4 );

    LabelBitrate = new QLabel( GroupBox3, "LabelBitrate" );

    GroupBox3Layout->addWidget( LabelBitrate, 1, 4 );

    ReadOnlySize = new QLineEdit( GroupBox3, "ReadOnlySize" );
    ReadOnlySize->setReadOnly( TRUE );

    GroupBox3Layout->addMultiCellWidget( ReadOnlySize, 1, 1, 2, 3 );

    ReadOnlyLength = new QLineEdit( GroupBox3, "ReadOnlyLength" );
    ReadOnlyLength->setReadOnly( TRUE );

    GroupBox3Layout->addMultiCellWidget( ReadOnlyLength, 0, 0, 2, 3 );

    ReadOnlyProposedFilename = new QLineEdit( GroupBox3, "ReadOnlyProposedFilename" );
    ReadOnlyProposedFilename->setReadOnly( TRUE );

    GroupBox3Layout->addMultiCellWidget( ReadOnlyProposedFilename, 5, 5, 3, 5 );

    ReadOnlyFilename = new QLineEdit( GroupBox3, "ReadOnlyFilename" );
    ReadOnlyFilename->setReadOnly( TRUE );

    GroupBox3Layout->addMultiCellWidget( ReadOnlyFilename, 4, 4, 3, 5 );

    ReadOnlyPath = new QLineEdit( GroupBox3, "ReadOnlyPath" );
    ReadOnlyPath->setReadOnly( TRUE );

    GroupBox3Layout->addMultiCellWidget( ReadOnlyPath, 2, 2, 3, 5 );

    ReadOnlyProposedPath = new QLineEdit( GroupBox3, "ReadOnlyProposedPath" );
    ReadOnlyProposedPath->setReadOnly( TRUE );

    GroupBox3Layout->addMultiCellWidget( ReadOnlyProposedPath, 3, 3, 3, 5 );

    LabelFilename = new QLabel( GroupBox3, "LabelFilename" );

    GroupBox3Layout->addMultiCellWidget( LabelFilename, 4, 4, 0, 2 );

    CheckBoxCorrectPath = new QCheckBox( GroupBox3, "CheckBoxCorrectPath" );

    GroupBox3Layout->addMultiCellWidget( CheckBoxCorrectPath, 3, 3, 1, 2 );
    spacer1_4_3 = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
    GroupBox3Layout->addItem( spacer1_4_3, 3, 0 );
    spacer1_4_3_2 = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
    GroupBox3Layout->addItem( spacer1_4_3_2, 5, 0 );

    CheckBoxCorrectFilename = new QCheckBox( GroupBox3, "CheckBoxCorrectFilename" );

    GroupBox3Layout->addMultiCellWidget( CheckBoxCorrectFilename, 5, 5, 1, 2 );

    SongInfoDialogLayout->addMultiCellWidget( GroupBox3, 2, 2, 0, 4 );
    languageChange();
    resize( QSize(481, 591).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

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

    // tab order
    setTabOrder( LineEditArtist, LineEditTitle );
    setTabOrder( LineEditTitle, LineEditAlbum );
    setTabOrder( LineEditAlbum, LineEditComment );
    setTabOrder( LineEditComment, LineEditYear );
    setTabOrder( LineEditYear, LineEditTrack );
    setTabOrder( LineEditTrack, ComboBoxGenre );
    setTabOrder( ComboBoxGenre, ReadOnlyLength );
    setTabOrder( ReadOnlyLength, ComboBoxMedia );
    setTabOrder( ComboBoxMedia, ReadOnlySize );
    setTabOrder( ReadOnlySize, ReadOnlyBitrate );
    setTabOrder( ReadOnlyBitrate, ReadOnlyPath );
    setTabOrder( ReadOnlyPath, ReadOnlyFilename );
    setTabOrder( ReadOnlyFilename, ReadOnlyProposedFilename );
    setTabOrder( ReadOnlyProposedFilename, LineEditAddedTo );
    setTabOrder( LineEditAddedTo, LineEditLastPlayed );
    setTabOrder( LineEditLastPlayed, PushButtonOK );
    setTabOrder( PushButtonOK, PushButtonCancel );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void SongInfoDialog::languageChange()
{
    setCaption( tr2i18n( "show and edit song info" ) );
    GroupBox1->setTitle( tr2i18n( "tag information" ) );
    LabelAlbum->setText( tr2i18n( "Album" ) );
    LabelComment->setText( tr2i18n( "Comment" ) );
    LabelYear->setText( tr2i18n( "Year" ) );
    LabelTitle->setText( tr2i18n( "Title" ) );
    LabelTrack->setText( tr2i18n( "Track" ) );
    LabelGenre->setText( tr2i18n( "Genre" ) );
    LabelArtist->setText( tr2i18n( "Artist" ) );
    QToolTip::add( ComboBoxGenre, QString::null );
    GroupBox2->setTitle( tr2i18n( "database info" ) );
    LabelAddedTo->setText( tr2i18n( "Added" ) );
    QToolTip::add( LineEditAddedTo, tr2i18n( "Indicates the date when this song was added to the database" ) );
    QToolTip::add( LineEditLastPlayed, tr2i18n( "not implemented yet..." ) );
    LabelLastPlayed->setText( tr2i18n( "Last played" ) );
    PushButtonCancel->setText( tr2i18n( "Cancel" ) );
    PushButtonOK->setText( tr2i18n( "OK" ) );
    LabelHeading->setText( tr2i18n( "song info..." ) );
    GroupBox3->setTitle( tr2i18n( "read only" ) );
    LabelSize->setText( tr2i18n( "Size" ) );
    LabelPath->setText( tr2i18n( "Path" ) );
    LabelLength->setText( tr2i18n( "Length" ) );
    QToolTip::add( ComboBoxMedia, tr2i18n( "lists all media containing this song" ) );
    LabelMedia->setText( tr2i18n( "Media" ) );
    QToolTip::add( LabelMedia, tr2i18n( "lists all media containing this song" ) );
    LabelBitrate->setText( tr2i18n( "Bitrate" ) );
    LabelFilename->setText( tr2i18n( "Filename" ) );
    CheckBoxCorrectPath->setText( tr2i18n( "correct to" ) );
    CheckBoxCorrectFilename->setText( tr2i18n( "correct to" ) );
}

#include "SongInfoDialog.moc"
