#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/usr/src/ports/kdebase3/kdebase3-3.5.10-11.x86_64/src/kdebase-3.5.10/kcontrol/konsole/schemadialog.ui'
**
** Created by User Interface Compiler
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "schemadialog.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qgroupbox.h>
#include <qcheckbox.h>
#include <kcolorbutton.h>
#include <qcombobox.h>
#include <qlistbox.h>
#include <qtoolbutton.h>
#include <qslider.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "kdialog.h"

/*
 *  Constructs a SchemaDialog as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
SchemaDialog::SchemaDialog( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "SchemaDialog" );
    SchemaDialogLayout = new QGridLayout( this, 1, 1, 0, KDialog::spacingHint(), "SchemaDialogLayout"); 

    Layout2 = new QHBoxLayout( 0, 0, KDialog::spacingHint(), "Layout2"); 

    TextLabel1 = new QLabel( this, "TextLabel1" );
    Layout2->addWidget( TextLabel1 );

    titleLine = new QLineEdit( this, "titleLine" );
    titleLine->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, titleLine->sizePolicy().hasHeightForWidth() ) );
    Layout2->addWidget( titleLine );

    SchemaDialogLayout->addMultiCellLayout( Layout2, 0, 0, 0, 1 );

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

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

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

    boldCheck = new QCheckBox( GroupBox1, "boldCheck" );

    GroupBox1Layout->addWidget( boldCheck, 2, 0 );
    Spacer5 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    GroupBox1Layout->addItem( Spacer5, 1, 4 );

    colorButton = new KColorButton( GroupBox1, "colorButton" );

    GroupBox1Layout->addWidget( colorButton, 1, 3 );

    typeCombo = new QComboBox( FALSE, GroupBox1, "typeCombo" );

    GroupBox1Layout->addWidget( typeCombo, 1, 2 );
    Spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
    GroupBox1Layout->addItem( Spacer2, 1, 1 );

    transparentCheck = new QCheckBox( GroupBox1, "transparentCheck" );

    GroupBox1Layout->addMultiCellWidget( transparentCheck, 2, 2, 2, 4 );

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

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

    colorCombo = new QComboBox( FALSE, GroupBox1, "colorCombo" );
    colorCombo->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, colorCombo->sizePolicy().hasHeightForWidth() ) );

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

    SchemaDialogLayout->addMultiCellWidget( GroupBox1, 1, 1, 0, 1 );

    GroupBox2 = new QGroupBox( this, "GroupBox2" );
    GroupBox2->setColumnLayout(0, Qt::Vertical );
    GroupBox2->layout()->setSpacing( KDialog::spacingHint() );
    GroupBox2->layout()->setMargin( KDialog::marginHint() );
    GroupBox2Layout = new QVBoxLayout( GroupBox2->layout() );
    GroupBox2Layout->setAlignment( Qt::AlignTop );

    schemaList = new QListBox( GroupBox2, "schemaList" );
    GroupBox2Layout->addWidget( schemaList );

    defaultSchemaCB = new QCheckBox( GroupBox2, "defaultSchemaCB" );
    GroupBox2Layout->addWidget( defaultSchemaCB );

    Layout3 = new QGridLayout( 0, 1, 1, 0, KDialog::spacingHint(), "Layout3"); 

    saveButton = new QPushButton( GroupBox2, "saveButton" );

    Layout3->addWidget( saveButton, 0, 0 );

    removeButton = new QPushButton( GroupBox2, "removeButton" );

    Layout3->addWidget( removeButton, 1, 0 );
    Spacer7 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout3->addItem( Spacer7, 0, 1 );
    GroupBox2Layout->addLayout( Layout3 );

    SchemaDialogLayout->addWidget( GroupBox2, 2, 0 );

    GroupBox13 = new QGroupBox( this, "GroupBox13" );
    GroupBox13->setColumnLayout(0, Qt::Vertical );
    GroupBox13->layout()->setSpacing( KDialog::spacingHint() );
    GroupBox13->layout()->setMargin( KDialog::marginHint() );
    GroupBox13Layout = new QGridLayout( GroupBox13->layout() );
    GroupBox13Layout->setAlignment( Qt::AlignTop );
    Spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
    GroupBox13Layout->addItem( Spacer1, 4, 0 );

    backgndLine = new QLineEdit( GroupBox13, "backgndLine" );

    GroupBox13Layout->addMultiCellWidget( backgndLine, 1, 1, 0, 4 );

    imageBrowse = new QToolButton( GroupBox13, "imageBrowse" );

    GroupBox13Layout->addWidget( imageBrowse, 1, 5 );

    modeCombo = new QComboBox( FALSE, GroupBox13, "modeCombo" );

    GroupBox13Layout->addMultiCellWidget( modeCombo, 0, 0, 3, 4 );

    TextLabel11 = new QLabel( GroupBox13, "TextLabel11" );

    GroupBox13Layout->addMultiCellWidget( TextLabel11, 0, 0, 0, 2 );

    TextLabel6 = new QLabel( GroupBox13, "TextLabel6" );

    GroupBox13Layout->addWidget( TextLabel6, 5, 1 );

    shadeSlide = new QSlider( GroupBox13, "shadeSlide" );
    shadeSlide->setValue( 50 );
    shadeSlide->setOrientation( QSlider::Horizontal );

    GroupBox13Layout->addMultiCellWidget( shadeSlide, 5, 5, 2, 3 );

    TextLabel5 = new QLabel( GroupBox13, "TextLabel5" );

    GroupBox13Layout->addWidget( TextLabel5, 5, 4 );

    TextLabel3 = new QLabel( GroupBox13, "TextLabel3" );

    GroupBox13Layout->addMultiCellWidget( TextLabel3, 4, 4, 1, 2 );

    shadeColor = new KColorButton( GroupBox13, "shadeColor" );

    GroupBox13Layout->addMultiCellWidget( shadeColor, 4, 4, 3, 4 );

    previewPixmap = new QLabel( GroupBox13, "previewPixmap" );
    previewPixmap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, previewPixmap->sizePolicy().hasHeightForWidth() ) );
    previewPixmap->setMinimumSize( QSize( 180, 120 ) );
    previewPixmap->setMaximumSize( QSize( 180, 120 ) );
    previewPixmap->setFrameShape( QLabel::Panel );
    previewPixmap->setFrameShadow( QLabel::Sunken );
    previewPixmap->setScaledContents( TRUE );

    GroupBox13Layout->addMultiCellWidget( previewPixmap, 2, 2, 0, 4 );

    transparencyCheck = new QCheckBox( GroupBox13, "transparencyCheck" );

    GroupBox13Layout->addMultiCellWidget( transparencyCheck, 3, 3, 0, 5 );

    SchemaDialogLayout->addWidget( GroupBox13, 2, 1 );
    Spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    SchemaDialogLayout->addItem( Spacer4, 3, 0 );
    languageChange();
    resize( QSize(420, 423).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( transparencyCheck, SIGNAL( toggled(bool) ), shadeSlide, SLOT( setEnabled(bool) ) );
    connect( transparencyCheck, SIGNAL( toggled(bool) ), shadeColor, SLOT( setEnabled(bool) ) );
    connect( transparencyCheck, SIGNAL( toggled(bool) ), TextLabel3, SLOT( setEnabled(bool) ) );
    connect( transparencyCheck, SIGNAL( toggled(bool) ), TextLabel6, SLOT( setEnabled(bool) ) );
    connect( transparencyCheck, SIGNAL( toggled(bool) ), TextLabel5, SLOT( setDisabled(bool) ) );
    connect( transparencyCheck, SIGNAL( toggled(bool) ), TextLabel5, SLOT( setEnabled(bool) ) );
    connect( defaultSchemaCB, SIGNAL( toggled(bool) ), defaultSchemaCB, SLOT( setDisabled(bool) ) );
    connect( transparencyCheck, SIGNAL( toggled(bool) ), backgndLine, SLOT( setDisabled(bool) ) );
    connect( transparencyCheck, SIGNAL( toggled(bool) ), imageBrowse, SLOT( setDisabled(bool) ) );

    // tab order
    setTabOrder( titleLine, colorCombo );
    setTabOrder( colorCombo, typeCombo );
    setTabOrder( typeCombo, boldCheck );
    setTabOrder( boldCheck, transparentCheck );
    setTabOrder( transparentCheck, colorButton );
    setTabOrder( colorButton, schemaList );
    setTabOrder( schemaList, defaultSchemaCB );
    setTabOrder( defaultSchemaCB, saveButton );
    setTabOrder( saveButton, removeButton );
    setTabOrder( removeButton, modeCombo );
    setTabOrder( modeCombo, backgndLine );
    setTabOrder( backgndLine, transparencyCheck );
    setTabOrder( transparencyCheck, shadeColor );
    setTabOrder( shadeColor, shadeSlide );

    // buddies
    TextLabel1->setBuddy( titleLine );
    TextLabel8->setBuddy( colorCombo );
    TextLabel1_2->setBuddy( typeCombo );
    TextLabel11->setBuddy( modeCombo );
    TextLabel3->setBuddy( shadeColor );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void SchemaDialog::languageChange()
{
    setCaption( tr2i18n( "Konsole Schema Editor" ) );
    TextLabel1->setText( tr2i18n( "&Title:" ) );
    GroupBox1->setTitle( tr2i18n( "Colors" ) );
    TextLabel8->setText( tr2i18n( "Shell co&lor:" ) );
    boldCheck->setText( tr2i18n( "&Bold" ) );
    colorButton->setText( QString::null );
    typeCombo->clear();
    typeCombo->insertItem( tr2i18n( "Custom" ) );
    typeCombo->insertItem( tr2i18n( "System Background" ) );
    typeCombo->insertItem( tr2i18n( "System Foreground" ) );
    typeCombo->insertItem( tr2i18n( "Random Hue" ) );
    transparentCheck->setText( tr2i18n( "Trans&parent" ) );
    TextLabel1_2->setText( tr2i18n( "&Konsole color:" ) );
    colorCombo->clear();
    colorCombo->insertItem( tr2i18n( "0 - Foreground Color" ) );
    colorCombo->insertItem( tr2i18n( "1 - Background Color" ) );
    colorCombo->insertItem( tr2i18n( "2 - Color 0 (black)" ) );
    colorCombo->insertItem( tr2i18n( "3 - Color 1 (red)" ) );
    colorCombo->insertItem( tr2i18n( "4 - Color 2 (green)" ) );
    colorCombo->insertItem( tr2i18n( "5 - Color 3 (yellow)" ) );
    colorCombo->insertItem( tr2i18n( "6 - Color 4 (blue)" ) );
    colorCombo->insertItem( tr2i18n( "7 - Color 5 (magenta)" ) );
    colorCombo->insertItem( tr2i18n( "8 - Color 6 (cyan)" ) );
    colorCombo->insertItem( tr2i18n( "9 - Color 7 (white)" ) );
    colorCombo->insertItem( tr2i18n( "10 - Foreground Intensive Color" ) );
    colorCombo->insertItem( tr2i18n( "11 - Background Intensive Color" ) );
    colorCombo->insertItem( tr2i18n( "12 - Color 0 Intensive (gray)" ) );
    colorCombo->insertItem( tr2i18n( "13 - Color 1 Intensive (light red)" ) );
    colorCombo->insertItem( tr2i18n( "14 - Color 2 Intensive (light green)" ) );
    colorCombo->insertItem( tr2i18n( "15 - Color 3 Intensive (light yellow)" ) );
    colorCombo->insertItem( tr2i18n( "16 - Color 4 Intensive (light blue)" ) );
    colorCombo->insertItem( tr2i18n( "17 - Color 5 Intensive (light magenta)" ) );
    colorCombo->insertItem( tr2i18n( "18 - Color 6 Intensive (light cyan)" ) );
    colorCombo->insertItem( tr2i18n( "19 - Color 7 Intensive (white)" ) );
    GroupBox2->setTitle( tr2i18n( "Schema" ) );
    defaultSchemaCB->setText( tr2i18n( "S&et as default schema" ) );
    saveButton->setText( tr2i18n( "Sa&ve Schema..." ) );
    removeButton->setText( tr2i18n( "&Remove Schema" ) );
    GroupBox13->setTitle( tr2i18n( "Background" ) );
    imageBrowse->setText( tr2i18n( "..." ) );
    modeCombo->clear();
    modeCombo->insertItem( tr2i18n( "Tiled" ) );
    modeCombo->insertItem( tr2i18n( "Centered" ) );
    modeCombo->insertItem( tr2i18n( "Full" ) );
    TextLabel11->setText( tr2i18n( "&Image:" ) );
    TextLabel6->setText( tr2i18n( "Min" ) );
    TextLabel5->setText( tr2i18n( "Max" ) );
    TextLabel3->setText( tr2i18n( "Shade t&o:" ) );
    shadeColor->setText( QString::null );
    transparencyCheck->setText( tr2i18n( "Tr&ansparent" ) );
}

#include "schemadialog.moc"
