#include <kdialog.h>
#include <tdelocale.h>

/****************************************************************************
** Form implementation generated from reading ui file 'sessiondialog.ui'
**
** Created by: The TQt user interface compiler (TQt 3.5.0)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "sessiondialog.h"

#include <ntqvariant.h>
#include <kdialog.h>
#include <kicondialog.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <kurlrequester.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqcombobox.h>
#include <ntqlineedit.h>
#include <ntqlabel.h>
#include <ntqlistbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

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

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

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

    fontCombo = new TQComboBox( false, propertiesGroup, "fontCombo" );
    fontCombo->setEnabled( false );

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

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

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

    keytabCombo = new TQComboBox( false, propertiesGroup, "keytabCombo" );

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

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

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

    schemaCombo = new TQComboBox( false, propertiesGroup, "schemaCombo" );

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

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

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

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

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

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

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

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

    previewIcon = new TDEIconButton( propertiesGroup, "previewIcon" );
    previewIcon->setMinimumSize( TQSize( 100, 100 ) );
    previewIcon->setMaximumSize( TQSize( 100, 100 ) );

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

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

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

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

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

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

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

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

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

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

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

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

    generalGroup = new TQGroupBox( this, "generalGroup" );
    generalGroup->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, generalGroup->sizePolicy().hasHeightForWidth() ) );
    generalGroup->setColumnLayout(0, TQt::Vertical );
    generalGroup->layout()->setSpacing( KDialog::spacingHint() );
    generalGroup->layout()->setMargin( KDialog::marginHint() );
    generalGroupLayout = new TQHBoxLayout( generalGroup->layout() );
    generalGroupLayout->setAlignment( TQt::AlignTop );

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

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

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

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

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

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

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

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

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

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

    executeLine = new TQLineEdit( generalGroup, "executeLine" );
    executeLine->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::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( TQSize(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, TQt 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( TQString::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:" ) );
}

/****************************************************************************
** SessionDialog meta object code from reading C++ file 'sessiondialog.h'
**
** Created by: The TQt Meta Object Compiler version 26 (TQt 3.5.0)
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#undef TQT_NO_COMPAT
#include "sessiondialog.h"
#include <ntqmetaobject.h>
#include <ntqapplication.h>

#include <private/qucomextra_p.h>
#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
#error "This file was generated using the moc from 3.5.0. It"
#error "cannot be used with the include files from this version of TQt."
#error "(The moc has changed too much.)"
#endif

const char *SessionDialog::className() const
{
    return "SessionDialog";
}

TQMetaObject *SessionDialog::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_SessionDialog( "SessionDialog", &SessionDialog::staticMetaObject );

#ifndef TQT_NO_TRANSLATION
TQString SessionDialog::tr( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "SessionDialog", s, c, TQApplication::DefaultCodec );
    else
	return TQString::fromLatin1( s );
}
#ifndef TQT_NO_TRANSLATION_UTF8
TQString SessionDialog::trUtf8( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "SessionDialog", s, c, TQApplication::UnicodeUTF8 );
    else
	return TQString::fromUtf8( s );
}
#endif // TQT_NO_TRANSLATION_UTF8

#endif // TQT_NO_TRANSLATION

TQMetaObject* SessionDialog::staticMetaObject()
{
    if ( metaObj ) {
	return metaObj;
}
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->lock();
    if ( metaObj ) {
	if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
	return metaObj;
    }
#endif // TQT_THREAD_SUPPORT
    TQMetaObject* parentObject = TQWidget::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"SessionDialog", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_SessionDialog.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

void* SessionDialog::tqt_cast( const char* clname )
{
    if ( !qstrcmp( clname, "SessionDialog" ) )
	return this;
    return TQWidget::tqt_cast( clname );
}

bool SessionDialog::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

bool SessionDialog::tqt_emit( int _id, TQUObject* _o )
{
    return TQWidget::tqt_emit(_id,_o);
}
#ifndef TQT_NO_PROPERTIES

bool SessionDialog::tqt_property( int id, int f, TQVariant* v)
{
    return TQWidget::tqt_property( id, f, v);
}

bool SessionDialog::tqt_static_property( TQObject* , int , int , TQVariant* ){ return false; }
#endif // TQT_NO_PROPERTIES
