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

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

#include "configdialog.h"

#include <ntqvariant.h>
#include <kcombobox.h>
#include <klineedit.h>
#include <kurlrequester.h>
#include <kpushbutton.h>
#include <kicondialog.h>
#include <ktextedit.h>
#include <kkeybutton.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqcheckbox.h>
#include <ntqframe.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a ConfigDialog as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qdialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qdialog.
 */
ConfigDialog::ConfigDialog( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "ConfigDialog" );
    setSizeGripEnabled( true );
    ConfigDialogLayout = new TQGridLayout( this, 1, 1, 11, 6, "ConfigDialogLayout"); 

    Layout1 = new TQHBoxLayout( 0, 0, 6, "Layout1"); 

    buttonHelp = new TQPushButton( this, "buttonHelp" );
    buttonHelp->setAutoDefault( true );
    Layout1->addWidget( buttonHelp );
    Horizontal_Spacing2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout1->addItem( Horizontal_Spacing2 );

    buttonOk = new TQPushButton( this, "buttonOk" );
    buttonOk->setAutoDefault( true );
    buttonOk->setDefault( true );
    Layout1->addWidget( buttonOk );

    buttonCancel = new TQPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( true );
    Layout1->addWidget( buttonCancel );

    ConfigDialogLayout->addLayout( Layout1, 3, 0 );

    buttonDetail = new TQPushButton( this, "buttonDetail" );
    buttonDetail->setToggleButton( true );

    ConfigDialogLayout->addWidget( buttonDetail, 1, 0 );

    baseGroup = new TQGroupBox( this, "baseGroup" );
    baseGroup->setFrameShape( TQGroupBox::GroupBoxPanel );
    baseGroup->setColumnLayout(0, TQt::Vertical );
    baseGroup->layout()->setSpacing( 6 );
    baseGroup->layout()->setMargin( 11 );
    baseGroupLayout = new TQGridLayout( baseGroup->layout() );
    baseGroupLayout->setAlignment( TQt::AlignTop );

    category = new KComboBox( false, baseGroup, "category" );
    category->setEditable( true );
    category->setInsertionPolicy( KComboBox::AfterCurrent );
    category->setAutoCompletion( true );
    category->setDuplicatesEnabled( false );
    category->setContextMenuEnabled( false );

    baseGroupLayout->addMultiCellWidget( category, 2, 2, 1, 2 );

    textLabel2 = new TQLabel( baseGroup, "textLabel2" );

    baseGroupLayout->addWidget( textLabel2, 1, 0 );

    appName = new KLineEdit( baseGroup, "appName" );

    baseGroupLayout->addWidget( appName, 0, 1 );

    command = new KURLRequester( baseGroup, "command" );
    command->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, command->sizePolicy().hasHeightForWidth() ) );

    baseGroupLayout->addMultiCellWidget( command, 3, 3, 1, 2 );

    genericName = new KLineEdit( baseGroup, "genericName" );

    baseGroupLayout->addWidget( genericName, 1, 1 );

    iconButton = new TDEIconButton( baseGroup, "iconButton" );
    iconButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, iconButton->sizePolicy().hasHeightForWidth() ) );
    iconButton->setMinimumSize( TQSize( 60, 60 ) );
    iconButton->setMaximumSize( TQSize( 60, 60 ) );
    iconButton->setFlat( false );
    iconButton->setIconSize( 48 );

    baseGroupLayout->addMultiCellWidget( iconButton, 0, 1, 2, 2 );

    textLabel5 = new TQLabel( baseGroup, "textLabel5" );

    baseGroupLayout->addWidget( textLabel5, 3, 0 );

    textLabel1_2 = new TQLabel( baseGroup, "textLabel1_2" );

    baseGroupLayout->addWidget( textLabel1_2, 4, 0 );

    textLabel1 = new TQLabel( baseGroup, "textLabel1" );

    baseGroupLayout->addWidget( textLabel1, 0, 0 );

    textLabel4 = new TQLabel( baseGroup, "textLabel4" );

    baseGroupLayout->addWidget( textLabel4, 2, 0 );

    keywords = new KLineEdit( baseGroup, "keywords" );

    baseGroupLayout->addMultiCellWidget( keywords, 4, 4, 1, 2 );

    startupFeedback = new TQCheckBox( baseGroup, "startupFeedback" );

    baseGroupLayout->addMultiCellWidget( startupFeedback, 5, 5, 0, 2 );

    showInSystray = new TQCheckBox( baseGroup, "showInSystray" );

    baseGroupLayout->addMultiCellWidget( showInSystray, 6, 6, 0, 2 );

    description = new KTextEdit( baseGroup, "description" );
    description->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)3, 0, 0, description->sizePolicy().hasHeightForWidth() ) );
    description->setMinimumSize( TQSize( 0, 0 ) );

    baseGroupLayout->addMultiCellWidget( description, 1, 4, 4, 4 );

    textLabel3 = new TQLabel( baseGroup, "textLabel3" );

    baseGroupLayout->addWidget( textLabel3, 0, 4 );

    line4 = new TQFrame( baseGroup, "line4" );
    line4->setFrameShape( TQFrame::VLine );
    line4->setFrameShadow( TQFrame::Sunken );
    line4->setFrameShape( TQFrame::VLine );

    baseGroupLayout->addMultiCellWidget( line4, 0, 4, 3, 3 );

    ConfigDialogLayout->addWidget( baseGroup, 0, 0 );

    extendedGroup = new TQGroupBox( this, "extendedGroup" );
    extendedGroup->setColumnLayout(0, TQt::Vertical );
    extendedGroup->layout()->setSpacing( 6 );
    extendedGroup->layout()->setMargin( 11 );
    extendedGroupLayout = new TQGridLayout( extendedGroup->layout() );
    extendedGroupLayout->setAlignment( TQt::AlignTop );

    textLabel7 = new TQLabel( extendedGroup, "textLabel7" );

    extendedGroupLayout->addMultiCellWidget( textLabel7, 0, 1, 0, 4 );

    line1 = new TQFrame( extendedGroup, "line1" );
    line1->setFrameShape( TQFrame::HLine );
    line1->setFrameShadow( TQFrame::Sunken );
    line1->setFrameShape( TQFrame::HLine );

    extendedGroupLayout->addMultiCellWidget( line1, 2, 2, 0, 5 );

    startInTerminal = new TQCheckBox( extendedGroup, "startInTerminal" );

    extendedGroupLayout->addMultiCellWidget( startInTerminal, 3, 3, 0, 4 );

    textLabel9 = new TQLabel( extendedGroup, "textLabel9" );
    textLabel9->setEnabled( false );

    extendedGroupLayout->addMultiCellWidget( textLabel9, 4, 4, 0, 1 );

    terminalSettings = new KLineEdit( extendedGroup, "terminalSettings" );
    terminalSettings->setEnabled( false );

    extendedGroupLayout->addMultiCellWidget( terminalSettings, 4, 4, 2, 5 );

    line2 = new TQFrame( extendedGroup, "line2" );
    line2->setFrameShape( TQFrame::HLine );
    line2->setFrameShadow( TQFrame::Sunken );
    line2->setFrameShape( TQFrame::HLine );

    extendedGroupLayout->addMultiCellWidget( line2, 5, 5, 0, 5 );

    startAsUser = new TQCheckBox( extendedGroup, "startAsUser" );

    extendedGroupLayout->addMultiCellWidget( startAsUser, 6, 6, 0, 4 );

    textLabel6 = new TQLabel( extendedGroup, "textLabel6" );
    textLabel6->setEnabled( false );

    extendedGroupLayout->addMultiCellWidget( textLabel6, 7, 7, 0, 1 );

    username = new KLineEdit( extendedGroup, "username" );
    username->setEnabled( false );

    extendedGroupLayout->addMultiCellWidget( username, 7, 7, 2, 5 );

    line3 = new TQFrame( extendedGroup, "line3" );
    line3->setFrameShape( TQFrame::HLine );
    line3->setFrameShadow( TQFrame::Sunken );
    line3->setFrameShape( TQFrame::HLine );

    extendedGroupLayout->addMultiCellWidget( line3, 8, 9, 0, 5 );

    textLabel8 = new TQLabel( extendedGroup, "textLabel8" );

    extendedGroupLayout->addMultiCellWidget( textLabel8, 10, 11, 0, 0 );

    workingDir = new KURLRequester( extendedGroup, "workingDir" );

    extendedGroupLayout->addMultiCellWidget( workingDir, 1, 1, 4, 5 );
    spacer2 = new TQSpacerItem( 250, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    extendedGroupLayout->addItem( spacer2, 11, 5 );

    shortcut = new KKeyButton( extendedGroup, "shortcut" );

    extendedGroupLayout->addMultiCellWidget( shortcut, 9, 11, 3, 4 );
    spacer3 = new TQSpacerItem( 31, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    extendedGroupLayout->addItem( spacer3, 11, 1 );

    ConfigDialogLayout->addWidget( extendedGroup, 2, 0 );
    languageChange();
    resize( TQSize(658, 629).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonOk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( buttonCancel, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( startInTerminal, TQ_SIGNAL( toggled(bool) ), textLabel9, TQ_SLOT( setEnabled(bool) ) );
    connect( startInTerminal, TQ_SIGNAL( toggled(bool) ), terminalSettings, TQ_SLOT( setEnabled(bool) ) );
    connect( startAsUser, TQ_SIGNAL( toggled(bool) ), textLabel6, TQ_SLOT( setEnabled(bool) ) );
    connect( startAsUser, TQ_SIGNAL( toggled(bool) ), username, TQ_SLOT( setEnabled(bool) ) );
    connect( buttonDetail, TQ_SIGNAL( toggled(bool) ), extendedGroup, TQ_SLOT( setShown(bool) ) );
    connect( buttonDetail, TQ_SIGNAL( released() ), this, TQ_SLOT( adjustSize() ) );

    // tab order
    setTabOrder( appName, genericName );
    setTabOrder( genericName, category );
    setTabOrder( category, command );
    setTabOrder( command, keywords );
    setTabOrder( keywords, startupFeedback );
    setTabOrder( startupFeedback, showInSystray );
    setTabOrder( showInSystray, iconButton );
    setTabOrder( iconButton, description );
    setTabOrder( description, buttonDetail );
    setTabOrder( buttonDetail, workingDir );
    setTabOrder( workingDir, startInTerminal );
    setTabOrder( startInTerminal, terminalSettings );
    setTabOrder( terminalSettings, startAsUser );
    setTabOrder( startAsUser, username );
    setTabOrder( username, shortcut );
    setTabOrder( shortcut, buttonHelp );
    setTabOrder( buttonHelp, buttonOk );
    setTabOrder( buttonOk, buttonCancel );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ConfigDialog::languageChange()
{
    setCaption( tr2i18n( "New Entry" ) );
    buttonHelp->setText( tr2i18n( "&Help" ) );
    buttonHelp->setAccel( TQKeySequence( tr2i18n( "F1" ) ) );
    buttonOk->setText( tr2i18n( "&OK" ) );
    buttonCancel->setText( tr2i18n( "&Cancel" ) );
    buttonDetail->setText( tr2i18n( "Extended Mode" ) );
    baseGroup->setTitle( tr2i18n( "Basic Settings" ) );
    textLabel2->setText( tr2i18n( "Is a" ) );
    iconButton->setText( TQString::null );
    textLabel5->setText( tr2i18n( "<b>Command</b>" ) );
    textLabel1_2->setText( tr2i18n( "<i>Keywords</i>" ) );
    textLabel1->setText( tr2i18n( "<i><b>Name</b></i>" ) );
    textLabel4->setText( tr2i18n( "<i><b>Category</b></i>" ) );
    startupFeedback->setText( tr2i18n( "Activate startup feedback" ) );
    showInSystray->setText( tr2i18n( "Show in system tray" ) );
    textLabel3->setText( tr2i18n( "Description" ) );
    extendedGroup->setTitle( tr2i18n( "Extended Settings" ) );
    textLabel7->setText( tr2i18n( "Working directory" ) );
    startInTerminal->setText( tr2i18n( "Start in terminal" ) );
    textLabel9->setText( tr2i18n( "Terminal settings" ) );
    startAsUser->setText( tr2i18n( "Start as different user" ) );
    textLabel6->setText( tr2i18n( "Username" ) );
    textLabel8->setText( tr2i18n( "Shortcut" ) );
    shortcut->setText( tr2i18n( "None" ) );
}

/****************************************************************************
** ConfigDialog meta object code from reading C++ file 'configdialog.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 "configdialog.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 *ConfigDialog::className() const
{
    return "ConfigDialog";
}

TQMetaObject *ConfigDialog::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ConfigDialog( "ConfigDialog", &ConfigDialog::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* ConfigDialog::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 = TQDialog::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"ConfigDialog", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ConfigDialog.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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