/****************************************************************************
** Form implementation generated from reading ui file 'pathconfig.ui'
**
** Created: Sat Nov 25 14:32:01 2000
**      by:  The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "pathconfig.h"

#include <kdialog.h>
#include <klineedit.h>
#include <klocale.h>
#include <qframe.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qvariant.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/* 
 *  Constructs a PathConfiguration which is a child of 'parent', with the 
 *  name 'name' and widget flags set to 'f' 
 */
PathConfiguration::PathConfiguration( QWidget* parent,  const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "PathConfiguration" );
    resize( 305, 168 ); 
    setCaption( i18n( "Path Configuration"  ) );
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, sizePolicy().hasHeightForWidth() ) );
    PathConfigurationLayout = new QVBoxLayout( this ); 
    PathConfigurationLayout->setSpacing( 0 );
    PathConfigurationLayout->setMargin( 0 );

    mServicesLayout = new QVBoxLayout; 
    mServicesLayout->setSpacing( 0 );
    mServicesLayout->setMargin( 0 );

    mServicesLabel = new QLabel( this, "mServicesLabel" );
    mServicesLabel->setText( i18n( "&Service path:"  ) );
    mServicesLayout->addWidget( mServicesLabel );

    mServicesButtonLayout = new QHBoxLayout; 
    mServicesButtonLayout->setSpacing( 0 );
    mServicesButtonLayout->setMargin( 0 );

    mServicesPath = new KLineEdit( this, "mServicesPath" );
    mServicesPath->setMinimumSize( QSize( 100, 0 ) );
    mServicesPath->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)5, mServicesPath->sizePolicy().hasHeightForWidth() ) );
    mServicesPath->setFocusPolicy( KLineEdit::StrongFocus );
    QToolTip::add(  mServicesPath, i18n( "Enter the path to the folder containing the services" ) );
    mServicesButtonLayout->addWidget( mServicesPath );

    mBrowseServices = new QPushButton( this, "mBrowseServices" );
    mBrowseServices->setText( i18n( "&Browse..."  ) );
    QToolTip::add(  mBrowseServices, i18n( "Select the folder containing the services" ) );
    mServicesButtonLayout->addWidget( mBrowseServices );
    mServicesLayout->addLayout( mServicesButtonLayout );
    PathConfigurationLayout->addLayout( mServicesLayout );

    mSpacer = new QFrame( this, "mSpacer" );
    mSpacer->setFrameShadow( QFrame::Plain );
    mSpacer->setFrameShape( QFrame::NoFrame );
    mSpacer->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, mSpacer->sizePolicy().hasHeightForWidth() ) );
    mSpacer->setMinimumSize( QSize( 0, 10 ) );
    PathConfigurationLayout->addWidget( mSpacer );

    mRunlevelLayout = new QVBoxLayout; 
    mRunlevelLayout->setSpacing( 0 );
    mRunlevelLayout->setMargin( 0 );

    mRunlevelLabel = new QLabel( this, "mRunlevelLabel" );
    mRunlevelLabel->setText( i18n( "&Runlevel path:"  ) );
    mRunlevelLayout->addWidget( mRunlevelLabel );

    mRunlevelButtonLayout = new QHBoxLayout; 
    mRunlevelButtonLayout->setSpacing( 0 );
    mRunlevelButtonLayout->setMargin( 0 );

    mRunlevelPath = new KLineEdit( this, "mRunlevelPath" );
    mRunlevelPath->setMinimumSize( QSize( 100, 0 ) );
    mRunlevelPath->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)5, mRunlevelPath->sizePolicy().hasHeightForWidth() ) );
    mRunlevelPath->setFocusPolicy( KLineEdit::StrongFocus );
    QToolTip::add(  mRunlevelPath, i18n( "Enter the path to the folder containing the runlevel folders" ) );
    mRunlevelButtonLayout->addWidget( mRunlevelPath );

    mBrowseRunlevel = new QPushButton( this, "mBrowseRunlevel" );
    mBrowseRunlevel->setText( i18n( "Br&owse..."  ) );
    QToolTip::add(  mBrowseRunlevel, i18n( "Select the folder containing the runlevel folders " ) );
    mRunlevelButtonLayout->addWidget( mBrowseRunlevel );
    mRunlevelLayout->addLayout( mRunlevelButtonLayout );
    PathConfigurationLayout->addLayout( mRunlevelLayout );
    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    PathConfigurationLayout->addItem( spacer );

    // signals and slots connections
    connect( mBrowseServices, SIGNAL( clicked() ), this, SLOT( browseServices() ) );
    connect( mBrowseRunlevel, SIGNAL( clicked() ), this, SLOT( browseRunlevels() ) );

    // tab order
    setTabOrder( mServicesPath, mBrowseServices );
    setTabOrder( mBrowseServices, mRunlevelPath );
    setTabOrder( mRunlevelPath, mBrowseRunlevel );

    // buddies
    mServicesLabel->setBuddy( mServicesPath );
    mRunlevelLabel->setBuddy( mRunlevelPath );
}

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

void PathConfiguration::browseServices()
{
    qWarning( "PathConfiguration::browseServices(): Not implemented yet!" );
}

void PathConfiguration::browseRunlevels()
{
    qWarning( "PathConfiguration::browseRunlevels(): Not implemented yet!" );
}

