#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './srkstartserverdialogbase.ui'
**
** Created: wo sep 6 18:04:15 2006
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.6   edited Aug 31 2005 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "srkstartserverdialogbase.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <krestrictedline.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/*
 *  Constructs a SRKStartServerDialogBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
SRKStartServerDialogBase::SRKStartServerDialogBase( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "StartServerDialogBase" );
    setSizeGripEnabled( FALSE );
    setModal( TRUE );
    StartServerDialogBaseLayout = new QGridLayout( this, 1, 1, 11, 6, "StartServerDialogBaseLayout"); 

    layout2 = new QHBoxLayout( 0, 0, 6, "layout2"); 

    buttonOk = new QPushButton( this, "buttonOk" );
    buttonOk->setAutoDefault( TRUE );
    buttonOk->setDefault( TRUE );
    layout2->addWidget( buttonOk );

    buttonCancel = new QPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( TRUE );
    layout2->addWidget( buttonCancel );
    spacer2 = new QSpacerItem( 400, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout2->addItem( spacer2 );

    StartServerDialogBaseLayout->addLayout( layout2, 1, 0 );

    groupBox = new QGroupBox( this, "groupBox" );
    groupBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, groupBox->sizePolicy().hasHeightForWidth() ) );
    groupBox->setColumnLayout(0, Qt::Vertical );
    groupBox->layout()->setSpacing( 6 );
    groupBox->layout()->setMargin( 11 );
    groupBoxLayout = new QGridLayout( groupBox->layout() );
    groupBoxLayout->setAlignment( Qt::AlignTop );

    textLabel2 = new QLabel( groupBox, "textLabel2" );

    groupBoxLayout->addWidget( textLabel2, 0, 0 );

    killOnExit = new QCheckBox( groupBox, "killOnExit" );

    groupBoxLayout->addWidget( killOnExit, 2, 0 );

    layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); 
    spacer3_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout7->addItem( spacer3_2 );

    layout5 = new QVBoxLayout( 0, 0, 6, "layout5"); 

    vncServerDispLbl = new QLabel( groupBox, "vncServerDispLbl" );
    vncServerDispLbl->setEnabled( TRUE );
    layout5->addWidget( vncServerDispLbl );

    vncServerResLbl = new QLabel( groupBox, "vncServerResLbl" );
    vncServerResLbl->setEnabled( TRUE );
    layout5->addWidget( vncServerResLbl );
    layout7->addLayout( layout5 );
    spacer3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout7->addItem( spacer3 );

    layout3 = new QGridLayout( 0, 1, 1, 0, 6, "layout3"); 

    vncServerXResInput = new KRestrictedLine( groupBox, "vncServerXResInput" );
    vncServerXResInput->setEnabled( TRUE );
    vncServerXResInput->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, vncServerXResInput->sizePolicy().hasHeightForWidth() ) );

    layout3->addWidget( vncServerXResInput, 1, 0 );

    vncServerYResInput = new KRestrictedLine( groupBox, "vncServerYResInput" );
    vncServerYResInput->setEnabled( TRUE );
    vncServerYResInput->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, vncServerYResInput->sizePolicy().hasHeightForWidth() ) );

    layout3->addWidget( vncServerYResInput, 1, 2 );

    vncServerResXLbl = new QLabel( groupBox, "vncServerResXLbl" );
    vncServerResXLbl->setEnabled( TRUE );

    layout3->addWidget( vncServerResXLbl, 1, 1 );

    vncServerDispInput = new KRestrictedLine( groupBox, "vncServerDispInput" );
    vncServerDispInput->setEnabled( TRUE );
    vncServerDispInput->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, vncServerDispInput->sizePolicy().hasHeightForWidth() ) );

    layout3->addWidget( vncServerDispInput, 0, 0 );
    spacer2_2 = new QSpacerItem( 111, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout3->addMultiCell( spacer2_2, 0, 0, 1, 2 );
    layout7->addLayout( layout3 );

    groupBoxLayout->addLayout( layout7, 1, 0 );

    StartServerDialogBaseLayout->addWidget( groupBox, 0, 0 );
    languageChange();
    resize( QSize(408, 187).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );

    // tab order
    setTabOrder( vncServerDispInput, vncServerXResInput );
    setTabOrder( vncServerXResInput, vncServerYResInput );
    setTabOrder( vncServerYResInput, killOnExit );
    setTabOrder( killOnExit, buttonOk );
    setTabOrder( buttonOk, buttonCancel );

    // buddies
    vncServerDispLbl->setBuddy( vncServerDispInput );
    vncServerResLbl->setBuddy( vncServerXResInput );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void SRKStartServerDialogBase::languageChange()
{
    setCaption( tr2i18n( "Start VNC server" ) );
    buttonOk->setText( tr2i18n( "&OK" ) );
    buttonOk->setAccel( QKeySequence( QString::null ) );
    buttonCancel->setText( tr2i18n( "C&ancel" ) );
    buttonCancel->setAccel( QKeySequence( tr2i18n( "Alt+A" ) ) );
    groupBox->setTitle( QString::null );
    textLabel2->setText( tr2i18n( "Launch a vnc server on this machine with these settings:" ) );
    killOnExit->setText( tr2i18n( "&kill on exit" ) );
    killOnExit->setAccel( QKeySequence( tr2i18n( "Alt+K" ) ) );
    vncServerDispLbl->setText( tr2i18n( "&display" ) );
    vncServerResLbl->setText( tr2i18n( "r&esolution" ) );
    vncServerXResInput->setText( tr2i18n( "800" ) );
    vncServerXResInput->setValidChars( tr2i18n( "0123456789" ) );
    vncServerYResInput->setText( tr2i18n( "600" ) );
    vncServerYResInput->setValidChars( tr2i18n( "0123456789" ) );
    vncServerResXLbl->setText( tr2i18n( "X" ) );
    vncServerDispInput->setText( tr2i18n( "1" ) );
    vncServerDispInput->setValidChars( tr2i18n( "0123456789" ) );
}

#include "srkstartserverdialogbase.moc"
