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

#include "sessiondialog.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qgroupbox.h>
#include <qcombobox.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <kicondialog.h>
#include <qlistbox.h>
#include <kurlrequester.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "kicondialog.h"
#include "kurlrequester.h"
#include "klineedit.h"
#include "kpushbutton.h"
#include "kdialog.h"

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

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

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

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

    fontCombo = new QComboBox( FALSE, propertiesGroup, "fontCombo" );
    fontCombo->setEnabled( FALSE );

    Layout29->addWidget( fontCombo, 0, 1 );

    termLine = new QLineEdit( propertiesGroup, "termLine" );
    termLine->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, termLine->sizePolicy().hasHeightForWidth() ) );

    Layout29->addWidget( termLine, 1, 1 );

    keytabCombo = new QComboBox( FALSE, propertiesGroup, "keytabCombo" );

    Layout29->addMultiCellWidget( keytabCombo, 3, 3, 0, 1 );

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

    Layout29->addWidget( TextLabel5, 0, 0 );

    schemaCombo = new QComboBox( FALSE, propertiesGroup, "schemaCombo" );

    Layout29->addMultiCellWidget( schemaCombo, 5, 5, 0, 1 );

    TextLabel7 = new QLabel( propertiesGroup, "TextLabel7" );

    Layout29->addMultiCellWidget( TextLabel7, 4, 4, 0, 1 );

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

    Layout29->addWidget( TextLabel8, 1, 0 );

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

    Layout29->addMultiCellWidget( TextLabel6, 2, 2, 0, 1 );

    propertiesGroupLayout->addMultiCellLayout( Layout29, 1, 1, 0, 1 );

    previewIcon = new KIconButton( propertiesGroup, "previewIcon" );
    previewIcon->setMinimumSize( QSize( 100, 100 ) );
    previewIcon->setMaximumSize( QSize( 100, 100 ) );

    propertiesGroupLayout->addWidget( previewIcon, 0, 1 );

    TextLabel4 = new QLabel( propertiesGroup, "TextLabel4" );
    TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
    TextLabel4->setMinimumSize( QSize( 90, 100 ) );
    TextLabel4->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );

    propertiesGroupLayout->addWidget( TextLabel4, 0, 0 );

    layout8->addWidget( propertiesGroup, 1, 1 );

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

    sessionList = new QListBox( sessionGroup, "sessionList" );
    sessionGroupLayout->addWidget( sessionList );

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

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

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

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

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

    layout8->addWidget( sessionGroup, 1, 0 );

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

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

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

    TextLabel1 = new QLabel( generalGroup, "TextLabel1" );
    TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );

    layout5->addWidget( TextLabel1, 0, 0 );

    TextLabel2 = new QLabel( generalGroup, "TextLabel2" );

    layout5->addWidget( TextLabel2, 1, 0 );

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

    layout5->addWidget( TextLabel3, 2, 0 );
    layout6->addLayout( layout5 );

    layout4 = new QVBoxLayout( 0, 0, KDialog::spacingHint(), "layout4"); 

    nameLine = new QLineEdit( generalGroup, "nameLine" );
    nameLine->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, nameLine->sizePolicy().hasHeightForWidth() ) );
    layout4->addWidget( nameLine );

    executeLine = new QLineEdit( generalGroup, "executeLine" );
    executeLine->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, executeLine->sizePolicy().hasHeightForWidth() ) );
    layout4->addWidget( executeLine );

    directoryLine = new KURLRequester( generalGroup, "directoryLine" );
    layout4->addWidget( directoryLine );
    layout6->addLayout( layout4 );
    generalGroupLayout->addLayout( layout6 );

    layout8->addMultiCellWidget( generalGroup, 0, 0, 0, 1 );
    SessionDialogLayout->addLayout( layout8 );
    languageChange();
    resize( QSize(436, 476).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( nameLine, executeLine );
    setTabOrder( executeLine, directoryLine );
    setTabOrder( directoryLine, sessionList );
    setTabOrder( sessionList, saveButton );
    setTabOrder( saveButton, removeButton );
    setTabOrder( removeButton, previewIcon );
    setTabOrder( previewIcon, fontCombo );
    setTabOrder( fontCombo, termLine );
    setTabOrder( termLine, keytabCombo );
    setTabOrder( keytabCombo, schemaCombo );

    // buddies
    TextLabel5->setBuddy( fontCombo );
    TextLabel7->setBuddy( schemaCombo );
    TextLabel8->setBuddy( termLine );
    TextLabel6->setBuddy( keytabCombo );
    TextLabel4->setBuddy( previewIcon );
    TextLabel1->setBuddy( nameLine );
    TextLabel2->setBuddy( executeLine );
    TextLabel3->setBuddy( directoryLine );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void SessionDialog::languageChange()
{
    setCaption( tr2i18n( "Konsole Session Editor" ) );
    propertiesGroup->setTitle( tr2i18n( "Properties" ) );
    fontCombo->clear();
    fontCombo->insertItem( tr2i18n( "<Default>" ) );
    fontCombo->insertItem( tr2i18n( "Normal" ) );
    fontCombo->insertItem( tr2i18n( "Tiny" ) );
    fontCombo->insertItem( tr2i18n( "Small" ) );
    fontCombo->insertItem( tr2i18n( "Medium" ) );
    fontCombo->insertItem( tr2i18n( "Large" ) );
    fontCombo->insertItem( tr2i18n( "Huge" ) );
    fontCombo->insertItem( tr2i18n( "Linux" ) );
    fontCombo->insertItem( tr2i18n( "Unicode" ) );
    fontCombo->insertItem( tr2i18n( "Custom" ) );
    TextLabel5->setText( tr2i18n( "&Font:" ) );
    TextLabel7->setText( tr2i18n( "S&chema:" ) );
    TextLabel8->setText( tr2i18n( "$&TERM:" ) );
    TextLabel6->setText( tr2i18n( "&Keytab:" ) );
    previewIcon->setText( QString::null );
    TextLabel4->setText( tr2i18n( "&Icon:" ) );
    sessionGroup->setTitle( tr2i18n( "Session" ) );
    saveButton->setText( tr2i18n( "Sa&ve Session..." ) );
    removeButton->setText( tr2i18n( "&Remove Session" ) );
    generalGroup->setTitle( tr2i18n( "General" ) );
    TextLabel1->setText( tr2i18n( "&Name:" ) );
    TextLabel2->setText( tr2i18n( "E&xecute:" ) );
    TextLabel3->setText( tr2i18n( "&Directory:" ) );
}

#include "sessiondialog.moc"
