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

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

#include "minicli_ui.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <kpushbutton.h>
#include <ntqframe.h>
#include <ntqcheckbox.h>
#include <ntqlabel.h>
#include <kpassdlg.h>
#include <klineedit.h>
#include <ntqslider.h>
#include <kcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "kcombobox.h"
#include "kdialog.h"
#include "kiconloader.h"
#include "klineedit.h"
#include "kpassdlg.h"
#include "kpushbutton.h"
/*
 *  Constructs a MinicliDlgUI as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
MinicliDlgUI::MinicliDlgUI( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "MinicliDlgUI" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) );
    MinicliDlgUILayout = new TQGridLayout( this, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "MinicliDlgUILayout"); 
    MinicliDlgUILayout->setResizeMode( TQLayout::FreeResize );

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

    pbOptions = new KPushButton( this, "pbOptions" );
    pbOptions->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)1, 0, 0, pbOptions->sizePolicy().hasHeightForWidth() ) );
    layout4->addWidget( pbOptions );
    spacer1 = new TQSpacerItem( 80, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout4->addItem( spacer1 );

    pbRun = new KPushButton( this, "pbRun" );
    pbRun->setEnabled( false );
    pbRun->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)1, 0, 0, pbRun->sizePolicy().hasHeightForWidth() ) );
    layout4->addWidget( pbRun );

    pbCancel = new KPushButton( this, "pbCancel" );
    pbCancel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)1, 0, 0, pbCancel->sizePolicy().hasHeightForWidth() ) );
    layout4->addWidget( pbCancel );

    MinicliDlgUILayout->addMultiCellLayout( layout4, 4, 4, 0, 1 );

    layout4_2 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout4_2"); 
    spacer6_2 = new TQSpacerItem( 57, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    layout4_2->addItem( spacer6_2 );

    gbAdvanced = new TQFrame( this, "gbAdvanced" );
    gbAdvanced->setFrameShape( TQFrame::NoFrame );
    gbAdvanced->setFrameShadow( TQFrame::Raised );
    gbAdvancedLayout = new TQGridLayout( gbAdvanced, 1, 1, 0, KDialog::spacingHint(), "gbAdvancedLayout"); 
    spacer3 = new TQSpacerItem( 20, 30, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    gbAdvancedLayout->addItem( spacer3, 6, 0 );

    cbRealtime = new TQCheckBox( gbAdvanced, "cbRealtime" );

    gbAdvancedLayout->addMultiCellWidget( cbRealtime, 7, 7, 0, 3 );

    cbAppcomplete = new TQCheckBox( gbAdvanced, "cbAppcomplete" );

    gbAdvancedLayout->addMultiCellWidget( cbAppcomplete, 8, 8, 0, 3 );

    cbAutocomplete = new TQCheckBox( gbAdvanced, "cbAutocomplete" );

    gbAdvancedLayout->addMultiCellWidget( cbAutocomplete, 9, 9, 0, 3 );

    cbAutohistory = new TQCheckBox( gbAdvanced, "cbAutohistory" );

    gbAdvancedLayout->addMultiCellWidget( cbAutohistory, 10, 10, 0, 3 );

    lbUsername = new TQLabel( gbAdvanced, "lbUsername" );
    lbUsername->setEnabled( false );
    lbUsername->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, lbUsername->sizePolicy().hasHeightForWidth() ) );

    gbAdvancedLayout->addWidget( lbUsername, 3, 1 );

    lePassword = new KPasswordEdit( gbAdvanced, "lePassword" );
    lePassword->setEnabled( false );
    lePassword->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 5, 0, lePassword->sizePolicy().hasHeightForWidth() ) );

    gbAdvancedLayout->addMultiCellWidget( lePassword, 4, 4, 2, 3 );

    lbPassword = new TQLabel( gbAdvanced, "lbPassword" );
    lbPassword->setEnabled( false );
    lbPassword->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, lbPassword->sizePolicy().hasHeightForWidth() ) );

    gbAdvancedLayout->addWidget( lbPassword, 4, 1 );

    cbRunInTerminal = new TQCheckBox( gbAdvanced, "cbRunInTerminal" );

    gbAdvancedLayout->addMultiCellWidget( cbRunInTerminal, 1, 1, 0, 3 );

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

    textLabel1 = new TQLabel( gbAdvanced, "textLabel1" );
    textLabel1->setEnabled( false );
    layout30->addWidget( textLabel1 );
    spacer33 = new TQSpacerItem( 20, 9, TQSizePolicy::Minimum, TQSizePolicy::Minimum );
    layout30->addItem( spacer33 );

    gbAdvancedLayout->addLayout( layout30, 6, 1 );

    cbPriority = new TQCheckBox( gbAdvanced, "cbPriority" );

    gbAdvancedLayout->addMultiCellWidget( cbPriority, 5, 5, 0, 3 );

    leUsername = new KLineEdit( gbAdvanced, "leUsername" );
    leUsername->setEnabled( false );
    leUsername->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 5, 0, leUsername->sizePolicy().hasHeightForWidth() ) );

    gbAdvancedLayout->addMultiCellWidget( leUsername, 3, 3, 2, 3 );

    layout29 = new TQGridLayout( 0, 1, 1, 0, 0, "layout29"); 

    lbLowPriority = new TQLabel( gbAdvanced, "lbLowPriority" );
    lbLowPriority->setEnabled( false );

    layout29->addWidget( lbLowPriority, 1, 0 );

    lbHighPriority = new TQLabel( gbAdvanced, "lbHighPriority" );
    lbHighPriority->setEnabled( false );
    lbHighPriority->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    layout29->addWidget( lbHighPriority, 1, 1 );

    slPriority = new TQSlider( gbAdvanced, "slPriority" );
    slPriority->setEnabled( false );
    slPriority->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 1, 0, slPriority->sizePolicy().hasHeightForWidth() ) );
    slPriority->setLineStep( 5 );
    slPriority->setOrientation( TQSlider::Horizontal );

    layout29->addMultiCellWidget( slPriority, 0, 0, 0, 1 );

    gbAdvancedLayout->addMultiCellLayout( layout29, 6, 6, 2, 3 );

    cbRunAsOther = new TQCheckBox( gbAdvanced, "cbRunAsOther" );

    gbAdvancedLayout->addMultiCellWidget( cbRunAsOther, 2, 2, 0, 3 );
    spacer6 = new TQSpacerItem( 20, 40, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    gbAdvancedLayout->addMultiCell( spacer6, 3, 4, 0, 0 );
    layout4_2->addWidget( gbAdvanced );

    MinicliDlgUILayout->addMultiCellLayout( layout4_2, 2, 2, 0, 1 );

    separator = new TQFrame( this, "separator" );
    separator->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 1, separator->sizePolicy().hasHeightForWidth() ) );
    separator->setFrameShape( TQFrame::HLine );
    separator->setFrameShadow( TQFrame::Sunken );

    MinicliDlgUILayout->addMultiCellWidget( separator, 3, 3, 0, 1 );

    lbCommand = new TQLabel( this, "lbCommand" );
    lbCommand->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, lbCommand->sizePolicy().hasHeightForWidth() ) );

    MinicliDlgUILayout->addWidget( lbCommand, 1, 0 );

    lbRunIcon = new TQLabel( this, "lbRunIcon" );
    lbRunIcon->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, lbRunIcon->sizePolicy().hasHeightForWidth() ) );
    lbRunIcon->setAlignment( int( TQLabel::AlignCenter ) );

    MinicliDlgUILayout->addWidget( lbRunIcon, 0, 0 );

    cbCommand = new KHistoryCombo( this, "cbCommand" );
    cbCommand->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)0, 0, 0, cbCommand->sizePolicy().hasHeightForWidth() ) );
    cbCommand->setMinimumSize( TQSize( 388, 0 ) );

    MinicliDlgUILayout->addWidget( cbCommand, 1, 1 );

    lbComment = new TQLabel( this, "lbComment" );
    lbComment->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)1, 0, 0, lbComment->sizePolicy().hasHeightForWidth() ) );
    lbComment->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter ) );

    MinicliDlgUILayout->addWidget( lbComment, 0, 1 );
    languageChange();
    resize( TQSize(325, 390).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( cbPriority, TQ_SIGNAL( toggled(bool) ), lbLowPriority, TQ_SLOT( setEnabled(bool) ) );
    connect( cbPriority, TQ_SIGNAL( toggled(bool) ), slPriority, TQ_SLOT( setEnabled(bool) ) );
    connect( cbPriority, TQ_SIGNAL( toggled(bool) ), lbHighPriority, TQ_SLOT( setEnabled(bool) ) );
    connect( cbRunAsOther, TQ_SIGNAL( toggled(bool) ), lbUsername, TQ_SLOT( setEnabled(bool) ) );
    connect( cbRunAsOther, TQ_SIGNAL( toggled(bool) ), leUsername, TQ_SLOT( setEnabled(bool) ) );
    connect( cbRunAsOther, TQ_SIGNAL( toggled(bool) ), lbPassword, TQ_SLOT( setEnabled(bool) ) );
    connect( cbRunAsOther, TQ_SIGNAL( toggled(bool) ), lePassword, TQ_SLOT( setEnabled(bool) ) );
    connect( cbPriority, TQ_SIGNAL( toggled(bool) ), textLabel1, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( cbCommand, cbRunInTerminal );
    setTabOrder( cbRunInTerminal, cbRunAsOther );
    setTabOrder( cbRunAsOther, leUsername );
    setTabOrder( leUsername, lePassword );
    setTabOrder( lePassword, cbPriority );
    setTabOrder( cbPriority, slPriority );
    setTabOrder( slPriority, pbOptions );
    setTabOrder( pbOptions, pbRun );
    setTabOrder( pbRun, pbCancel );

    // buddies
    lbUsername->setBuddy( leUsername );
    lbPassword->setBuddy( lePassword );
    textLabel1->setBuddy( slPriority );
    lbCommand->setBuddy( cbCommand );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void MinicliDlgUI::languageChange()
{
    pbOptions->setText( TQString::null );
    pbRun->setText( TQString::null );
    pbCancel->setText( TQString::null );
    cbRealtime->setText( tr2i18n( "Run with realtime &scheduling" ) );
    TQWhatsThis::add( cbRealtime, tr2i18n( "<qt>Select whether realtime scheduling should be enabled for the application. The scheduler governs which process will run and which will have to wait. Two schedulers are available:\n"
"<ul>\n"
"<li><em>Normal:</em> This is the standard, timesharing scheduler. It will divide fairly the available processing time between all processes.</li>\n"
"<li><em>Realtime:</em>This scheduler will run your application uninterrupted until it gives up the processor. This can be dangerous. An application that does not give up the processor might hang the system. You need root's password to use the scheduler.</li>\n"
"</ul>\n"
"</qt>" ) );
    cbAppcomplete->setText( tr2i18n( "Autocomplete shows available &applications" ) );
    TQWhatsThis::add( cbAppcomplete, tr2i18n( "<qt>When enabled, the system shows available applications in the autocompletion area.\n"
"						</qt>" ) );
    cbAutocomplete->setText( tr2i18n( "Autocomplete uses &filesystem instead of history" ) );
    TQWhatsThis::add( cbAutocomplete, tr2i18n( "<qt>This selects whether the filesystem or the past command history will be used for autocompletion.\n"
"						</qt>" ) );
    cbAutohistory->setText( tr2i18n( "Autocomplete uses &both history and filesystem" ) );
    TQWhatsThis::add( cbAutohistory, tr2i18n( "<qt>This selects whether the filesystem and the past command history will be used for autocompletion.\n"
"						</qt>" ) );
    lbUsername->setText( tr2i18n( "User&name:" ) );
    TQWhatsThis::add( lbUsername, tr2i18n( "Enter the user you want to run the application as here." ) );
    TQWhatsThis::add( lePassword, tr2i18n( "Enter the password here for the user you specified above." ) );
    lbPassword->setText( tr2i18n( "Pass&word:" ) );
    TQWhatsThis::add( lbPassword, tr2i18n( "Enter the password here for the user you specified above." ) );
    cbRunInTerminal->setText( tr2i18n( "Run in &terminal window" ) );
    TQWhatsThis::add( cbRunInTerminal, tr2i18n( "Check this option if the application you want to run is a text mode application. The application will then be run in a terminal emulator window." ) );
    textLabel1->setText( tr2i18n( "&Priority:" ) );
    TQWhatsThis::add( textLabel1, tr2i18n( "The priority that the command will be run with can be set here. From left to right, it goes from low to high. The center position is the default value. For priorities higher than the default, you will need to provide the root password." ) );
    cbPriority->setText( tr2i18n( "Run with a &different priority" ) );
    TQWhatsThis::add( cbPriority, tr2i18n( "Check this option if you want to run the application with a different priority. A higher priority tells the operating system to give more processing time to your application." ) );
    TQWhatsThis::add( leUsername, tr2i18n( "Enter the user you want to run the application as here." ) );
    lbLowPriority->setText( tr2i18n( "Low" ) );
    TQWhatsThis::add( lbLowPriority, tr2i18n( "The priority that the command will be run with can be set here. From left to right, it goes from low to high. The center position is the default value. For priorities higher than the default, you will need to provide the root password." ) );
    lbHighPriority->setText( tr2i18n( "High" ) );
    TQWhatsThis::add( lbHighPriority, tr2i18n( "The priority that the command will be run with can be set here. From left to right, it goes from low to high. The center position is the default value. For priorities higher than the default, you will need to provide the root password." ) );
    TQWhatsThis::add( slPriority, tr2i18n( "The priority that the command will be run with can be set here. From left to right, it goes from low to high. The center position is the default value. For priorities higher than the default, you will need to provide the root password." ) );
    cbRunAsOther->setText( tr2i18n( "Run as a different &user" ) );
    TQWhatsThis::add( cbRunAsOther, tr2i18n( "Check this option if you want to run the application with a different user id. Every process has a user id associated with it. This id code determines file access and other permissions. The password of the user is required to do this." ) );
    lbCommand->setText( tr2i18n( "Com&mand:" ) );
    TQWhatsThis::add( lbCommand, tr2i18n( "Enter the command you wish to execute or the address of the resource you want to open. This can be a remote URL like \"www.trinitydesktop.org\" or a local one like \"~/.tderc\"." ) );
    lbRunIcon->setText( TQString::null );
    TQWhatsThis::add( cbCommand, tr2i18n( "Enter the command you wish to execute or the address of the resource you want to open. This can be a remote URL like \"www.trinitydesktop.org\" or a local one like \"~/.tderc\"." ) );
    lbComment->setText( tr2i18n( "Enter the name of the application you want to run or the URL you want to view" ) );
}

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

TQMetaObject *MinicliDlgUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_MinicliDlgUI( "MinicliDlgUI", &MinicliDlgUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* MinicliDlgUI::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(
	"MinicliDlgUI", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_MinicliDlgUI.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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