#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './kdartestsdlg.ui'
**
** Created: Sun Jul 10 12:14:52 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 "kdartestsdlg.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qframe.h>
#include <qheader.h>
#include <klistview.h>
#include <qwidgetstack.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <klineedit.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>


/*
 *  Constructs a KDarTestsDlg as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
KDarTestsDlg::KDarTestsDlg( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "KDarTestsDlg" );
    KDarTestsDlgLayout = new QVBoxLayout( this, 11, 6, "KDarTestsDlgLayout"); 

    frame3 = new QFrame( this, "frame3" );
    frame3->setFrameShape( QFrame::StyledPanel );
    frame3->setFrameShadow( QFrame::Raised );
    frame3Layout = new QHBoxLayout( frame3, 11, 6, "frame3Layout"); 

    kListView1 = new KListView( frame3, "kListView1" );
    kListView1->addColumn( tr2i18n( "Test modules" ) );
    kListView1->header()->setResizeEnabled( FALSE, kListView1->header()->count() - 1 );
    kListView1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)7, 0, 0, kListView1->sizePolicy().hasHeightForWidth() ) );
    kListView1->setFullWidth( TRUE );
    frame3Layout->addWidget( kListView1 );

    testWidgetStack = new QWidgetStack( frame3, "testWidgetStack" );
    testWidgetStack->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)5, 0, 0, testWidgetStack->sizePolicy().hasHeightForWidth() ) );

    GUI = new QWidget( testWidgetStack, "GUI" );
    testWidgetStack->addWidget( GUI, 0 );

    RegExp = new QWidget( testWidgetStack, "RegExp" );
    testWidgetStack->addWidget( RegExp, 1 );

    Libdar_operations = new QWidget( testWidgetStack, "Libdar_operations" );
    testWidgetStack->addWidget( Libdar_operations, 2 );

    String_substitution = new QWidget( testWidgetStack, "String_substitution" );
    String_substitutionLayout = new QVBoxLayout( String_substitution, 11, 6, "String_substitutionLayout"); 

    groupBox1 = new QGroupBox( String_substitution, "groupBox1" );
    groupBox1->setColumnLayout(0, Qt::Vertical );
    groupBox1->layout()->setSpacing( 6 );
    groupBox1->layout()->setMargin( 11 );
    groupBox1Layout = new QVBoxLayout( groupBox1->layout() );
    groupBox1Layout->setAlignment( Qt::AlignTop );

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

    textLabel1 = new QLabel( groupBox1, "textLabel1" );
    layout2->addWidget( textLabel1 );

    archiveNameInputLineEdit = new KLineEdit( groupBox1, "archiveNameInputLineEdit" );
    layout2->addWidget( archiveNameInputLineEdit );
    groupBox1Layout->addLayout( layout2 );

    archiveNameResultKLineEdit = new KLineEdit( groupBox1, "archiveNameResultKLineEdit" );
    archiveNameResultKLineEdit->setPaletteBackgroundColor( QColor( 254, 253, 252 ) );
    archiveNameResultKLineEdit->setReadOnly( TRUE );
    groupBox1Layout->addWidget( archiveNameResultKLineEdit );
    spacer2 = new QSpacerItem( 20, 281, QSizePolicy::Minimum, QSizePolicy::Expanding );
    groupBox1Layout->addItem( spacer2 );
    String_substitutionLayout->addWidget( groupBox1 );
    testWidgetStack->addWidget( String_substitution, 3 );

    Archive_handle = new QWidget( testWidgetStack, "Archive_handle" );
    testWidgetStack->addWidget( Archive_handle, 4 );
    frame3Layout->addWidget( testWidgetStack );
    KDarTestsDlgLayout->addWidget( frame3 );

    layout1 = new QHBoxLayout( 0, 0, 6, "layout1"); 
    spacer1 = new QSpacerItem( 311, 41, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout1->addItem( spacer1 );

    quitPushButton = new QPushButton( this, "quitPushButton" );
    layout1->addWidget( quitPushButton );
    KDarTestsDlgLayout->addLayout( layout1 );
    languageChange();
    resize( QSize(620, 594).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( quitPushButton, SIGNAL( clicked() ), this, SLOT( quit() ) );
    connect( kListView1, SIGNAL( clicked(QListViewItem*) ), this, SLOT( slotRaiseWidgetStack(QListViewItem*) ) );
    connect( archiveNameInputLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( slotTestStringSubstitutionNewArchiveName(const QString&) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KDarTestsDlg::languageChange()
{
    setCaption( tr2i18n( "KDar testing framework" ) );
    kListView1->header()->setLabel( 0, tr2i18n( "Test modules" ) );
    kListView1->clear();
    QListViewItem * item = new QListViewItem( kListView1, 0 );
    item->setText( 0, tr2i18n( "GUI" ) );

    QListViewItem * item_2 = new QListViewItem( kListView1, item );
    item_2->setOpen( TRUE );
    item = new QListViewItem( item_2, item );
    item->setText( 0, tr2i18n( "String substitution" ) );
    item_2->setOpen( TRUE );
    item = new QListViewItem( item_2, item );
    item->setText( 0, tr2i18n( "Archive handle" ) );
    item_2->setText( 0, tr2i18n( "RegExp" ) );

    item = new QListViewItem( kListView1, item_2 );
    item->setText( 0, tr2i18n( "Libdar operations" ) );

    groupBox1->setTitle( tr2i18n( "String substitutions for creation" ) );
    textLabel1->setText( tr2i18n( "New archive name:" ) );
    quitPushButton->setText( tr2i18n( "&Quit" ) );
    quitPushButton->setAccel( QKeySequence( tr2i18n( "Alt+Q" ) ) );
}

void KDarTestsDlg::slotRaiseWidgetStack(QListViewItem*)
{
    qWarning( "KDarTestsDlg::slotRaiseWidgetStack(QListViewItem*): Not implemented yet" );
}

void KDarTestsDlg::slotTestStringSubstitutionNewArchiveName(const QString&)
{
    qWarning( "KDarTestsDlg::slotTestStringSubstitutionNewArchiveName(const QString&): Not implemented yet" );
}

void KDarTestsDlg::quit()
{
    qWarning( "KDarTestsDlg::quit(): Not implemented yet" );
}

#include "kdartestsdlg.moc"
