#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './srkmetainfodialogbase.ui'
**
** Created: wo sep 6 18:04:38 2006
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.6   edited Aug 31 2005 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "srkmetainfodialogbase.h"

#include <qvariant.h>
#include <srkcategorycombobox.h>
#include <srkplatformcombobox.h>
#include <qpushbutton.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <klineedit.h>
#include <ktextedit.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

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

    layout2 = new QHBoxLayout( 0, 0, 6, "layout2"); 

    buttonOk = new QPushButton( this, "buttonOk" );
    buttonOk->setAutoDefault( TRUE );
    buttonOk->setDefault( TRUE );
    layout2->addWidget( buttonOk );

    buttonCancel = new QPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( TRUE );
    layout2->addWidget( buttonCancel );
    spacer2 = new QSpacerItem( 400, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout2->addItem( spacer2 );

    SRKMetaInfoDialogBaseLayout->addMultiCellLayout( layout2, 2, 2, 0, 1 );

    recCategoryGrp = new QGroupBox( this, "recCategoryGrp" );

    categoryLabel = new QLabel( recCategoryGrp, "categoryLabel" );
    categoryLabel->setEnabled( TRUE );
    categoryLabel->setGeometry( QRect( 20, 30, 100, 16 ) );

    categoryCombo = new SRKCategoryComboBox( recCategoryGrp, "categoryCombo" );
    categoryCombo->setGeometry( QRect( 30, 60, 350, 25 ) );

    SRKMetaInfoDialogBaseLayout->addWidget( recCategoryGrp, 1, 1 );

    recGrp = new QGroupBox( this, "recGrp" );
    recGrp->setColumnLayout(0, Qt::Vertical );
    recGrp->layout()->setSpacing( 6 );
    recGrp->layout()->setMargin( 11 );
    recGrpLayout = new QGridLayout( recGrp->layout() );
    recGrpLayout->setAlignment( Qt::AlignTop );

    layout11 = new QHBoxLayout( 0, 0, 6, "layout11"); 

    vncViewerVncpasswdLbl_2_3 = new QLabel( recGrp, "vncViewerVncpasswdLbl_2_3" );
    vncViewerVncpasswdLbl_2_3->setEnabled( TRUE );
    layout11->addWidget( vncViewerVncpasswdLbl_2_3 );
    spacer4 = new QSpacerItem( 391, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout11->addItem( spacer4 );

    recGrpLayout->addMultiCellLayout( layout11, 2, 2, 0, 1 );
    spacer3 = new QSpacerItem( 110, 20, QSizePolicy::Minimum, QSizePolicy::Minimum );
    recGrpLayout->addItem( spacer3, 1, 1 );

    layout12 = new QGridLayout( 0, 1, 1, 0, 6, "layout12"); 

    question = new KLineEdit( recGrp, "question" );
    question->setEnabled( TRUE );

    layout12->addWidget( question, 1, 1 );

    description = new KTextEdit( recGrp, "description" );

    layout12->addWidget( description, 2, 1 );

    vncViewerVncpasswdLbl = new QLabel( recGrp, "vncViewerVncpasswdLbl" );
    vncViewerVncpasswdLbl->setEnabled( TRUE );
    vncViewerVncpasswdLbl->setAlignment( int( QLabel::AlignTop ) );

    layout12->addWidget( vncViewerVncpasswdLbl, 2, 0 );

    vncViewerLocLbl = new QLabel( recGrp, "vncViewerLocLbl" );
    vncViewerLocLbl->setEnabled( TRUE );

    layout12->addWidget( vncViewerLocLbl, 0, 0 );

    vncViewerVncpasswdLbl_2 = new QLabel( recGrp, "vncViewerVncpasswdLbl_2" );
    vncViewerVncpasswdLbl_2->setEnabled( TRUE );
    vncViewerVncpasswdLbl_2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );

    layout12->addWidget( vncViewerVncpasswdLbl_2, 1, 0 );

    title = new KLineEdit( recGrp, "title" );
    title->setEnabled( TRUE );

    layout12->addWidget( title, 0, 1 );

    recGrpLayout->addLayout( layout12, 1, 0 );

    layout8 = new QHBoxLayout( 0, 0, 6, "layout8"); 
    spacer7_2 = new QSpacerItem( 190, 20, QSizePolicy::Preferred, QSizePolicy::Minimum );
    layout8->addItem( spacer7_2 );

    vncViewerVncpasswdLbl_2_3_2 = new QLabel( recGrp, "vncViewerVncpasswdLbl_2_3_2" );
    vncViewerVncpasswdLbl_2_3_2->setEnabled( TRUE );
    vncViewerVncpasswdLbl_2_3_2->setPaletteForegroundColor( QColor( 225, 0, 0 ) );
    vncViewerVncpasswdLbl_2_3_2->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );
    layout8->addWidget( vncViewerVncpasswdLbl_2_3_2 );
    spacer7 = new QSpacerItem( 190, 20, QSizePolicy::Preferred, QSizePolicy::Minimum );
    layout8->addItem( spacer7 );

    recGrpLayout->addMultiCellLayout( layout8, 0, 0, 0, 1 );

    SRKMetaInfoDialogBaseLayout->addMultiCellWidget( recGrp, 0, 0, 0, 1 );

    recPlatformGrp = new QGroupBox( this, "recPlatformGrp" );

    platformLabel = new QLabel( recPlatformGrp, "platformLabel" );
    platformLabel->setEnabled( TRUE );
    platformLabel->setGeometry( QRect( 20, 30, 240, 16 ) );

    platformCombo = new SRKPlatformComboBox( recPlatformGrp, "platformCombo" );
    platformCombo->setGeometry( QRect( 26, 60, 350, 25 ) );

    SRKMetaInfoDialogBaseLayout->addWidget( recPlatformGrp, 1, 0 );
    languageChange();
    resize( QSize(812, 492).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( categoryCombo, SIGNAL( activated(const QString&,SRKCategoryComboBox*) ), this, SLOT( categoryChanged(const QString&,SRKCategoryComboBox*) ) );
    connect( platformCombo, SIGNAL( activated(const QString&,SRKPlatformComboBox*) ), this, SLOT( platformChanged(const QString&,SRKPlatformComboBox*) ) );

    // tab order
    setTabOrder( title, question );
    setTabOrder( question, description );
    setTabOrder( description, buttonOk );
    setTabOrder( buttonOk, buttonCancel );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void SRKMetaInfoDialogBase::languageChange()
{
    setCaption( tr2i18n( "Edit Meta Info" ) );
    buttonOk->setText( tr2i18n( "&OK" ) );
    buttonOk->setAccel( QKeySequence( QString::null ) );
    buttonCancel->setText( tr2i18n( "C&ancel" ) );
    buttonCancel->setAccel( QKeySequence( tr2i18n( "Alt+A" ) ) );
    recCategoryGrp->setTitle( tr2i18n( "recording category placement" ) );
    categoryLabel->setText( tr2i18n( "select category" ) );
    recGrp->setTitle( tr2i18n( "recording info" ) );
    vncViewerVncpasswdLbl_2_3->setText( tr2i18n( "Note: author information will be set by login-procedure." ) );
    question->setText( QString::null );
    QToolTip::add( question, QString::null );
    vncViewerVncpasswdLbl->setText( tr2i18n( "description" ) );
    vncViewerLocLbl->setText( tr2i18n( "title" ) );
    vncViewerVncpasswdLbl_2->setText( tr2i18n( "recording answers this question" ) );
    title->setText( QString::null );
    QToolTip::add( title, QString::null );
    vncViewerVncpasswdLbl_2_3_2->setText( tr2i18n( "<b>Please supply this info in English.</b>" ) );
    recPlatformGrp->setTitle( tr2i18n( "target recording platform" ) );
    platformLabel->setText( tr2i18n( "select the platform of the recording" ) );
}

void SRKMetaInfoDialogBase::categoryChanged(const QString&,SRKCategoryComboBox*)
{
    qWarning( "SRKMetaInfoDialogBase::categoryChanged(const QString&,SRKCategoryComboBox*): Not implemented yet" );
}

void SRKMetaInfoDialogBase::platformChanged(const QString&,SRKPlatformComboBox*)
{
    qWarning( "SRKMetaInfoDialogBase::platformChanged(const QString&,SRKPlatformComboBox*): Not implemented yet" );
}

#include "srkmetainfodialogbase.moc"
