/****************************************************************************
** Form implementation generated from reading ui file 'configwizard.ui'
**
** Created: Thu Nov 30 11:26:08 2000
**      by:  The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "configwizard.h"

#include <klineedit.h>
#include <klocale.h>
#include <qbuttongroup.h>
#include <qframe.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
#include <qwidget.h>
#include <qlayout.h>
#include <qvariant.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
/* 
 *  Constructs a ConfigWizard which is a child of 'parent', with the 
 *  name 'name' and widget flags set to 'f' 
 *
 *  The wizard will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal wizard.
 */
ConfigWizard::ConfigWizard( QWidget* parent,  const char* name, bool modal, WFlags fl )
    : KWizard( parent, name, modal, fl )
{
    if ( !name )
	setName( "ConfigWizard" );
    resize( 402, 291 ); 
    setCaption( i18n( "Configuration Wizard"  ) );

    mDistributionPage = new QWidget( this, "mDistributionPage" );
    mDistributionPageLayout = new QVBoxLayout( mDistributionPage ); 
    mDistributionPageLayout->setSpacing( 0 );
    mDistributionPageLayout->setMargin( 0 );

    mDistributionBox = new QButtonGroup( mDistributionPage, "mDistributionBox" );
    mDistributionBox->setTitle( i18n( "Choose Your Distribution"  ) );
    mDistributionBox->setColumnLayout(0, Qt::Vertical );
    mDistributionBox->layout()->setSpacing( 0 );
    mDistributionBox->layout()->setMargin( 0 );
    mDistributionBoxLayout = new QVBoxLayout( mDistributionBox->layout() );
    mDistributionBoxLayout->setAlignment( Qt::AlignTop );
    mDistributionBoxLayout->setSpacing( 6 );
    mDistributionBoxLayout->setMargin( 11 );

    mDistrib1 = new QRadioButton( mDistributionBox, "mDistrib1" );
    mDistrib1->setText( i18n( "&Debian"  ) );
    mDistrib1->setChecked( TRUE );
    mDistributionBoxLayout->addWidget( mDistrib1 );

    mDistrib2 = new QRadioButton( mDistributionBox, "mDistrib2" );
    mDistrib2->setText( i18n( "&Red Hat"  ) );
    mDistributionBoxLayout->addWidget( mDistrib2 );

    mDistrib3 = new QRadioButton( mDistributionBox, "mDistrib3" );
    mDistrib3->setText( i18n( "&SuSE"  ) );
    mDistributionBoxLayout->addWidget( mDistrib3 );

    mDistrib4 = new QRadioButton( mDistributionBox, "mDistrib4" );
    mDistrib4->setText( i18n( "&Mandrake"  ) );
    mDistributionBoxLayout->addWidget( mDistrib4 );

    mDistrib5 = new QRadioButton( mDistributionBox, "mDistrib5" );
    mDistrib5->setText( i18n( "&Corel"  ) );
    mDistributionBoxLayout->addWidget( mDistrib5 );

    mDistrib6 = new QRadioButton( mDistributionBox, "mDistrib6" );
    mDistrib6->setText( i18n( "&Other"  ) );
    mDistributionBoxLayout->addWidget( mDistrib6 );
    mDistributionPageLayout->addWidget( mDistributionBox );
    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    mDistributionPageLayout->addItem( spacer );
    addPage( mDistributionPage, i18n( "Distribution" ) );

    mPathsPage = new QWidget( this, "mPathsPage" );
    mPathsPageLayout = new QVBoxLayout( mPathsPage ); 
    mPathsPageLayout->setSpacing( 0 );
    mPathsPageLayout->setMargin( 0 );

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

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

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

    mServicesPath = new KLineEdit( mPathsPage, "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( mPathsPage, "mBrowseServices" );
    mBrowseServices->setText( i18n( "&Browse..."  ) );
    QToolTip::add(  mBrowseServices, i18n( "Select the folder containing the services" ) );
    mServicesButtonLayout->addWidget( mBrowseServices );
    mServicesLayout->addLayout( mServicesButtonLayout );
    mPathsPageLayout->addLayout( mServicesLayout );

    mSpacer = new QFrame( mPathsPage, "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 ) );
    mPathsPageLayout->addWidget( mSpacer );

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

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

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

    mRunlevelPath = new KLineEdit( mPathsPage, "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( mPathsPage, "mBrowseRunlevel" );
    mBrowseRunlevel->setText( i18n( "Br&owse..."  ) );
    QToolTip::add(  mBrowseRunlevel, i18n( "Select the folder containing the runlevel folders " ) );
    mRunlevelButtonLayout->addWidget( mBrowseRunlevel );
    mRunlevelLayout->addLayout( mRunlevelButtonLayout );
    mPathsPageLayout->addLayout( mRunlevelLayout );
    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    mPathsPageLayout->addItem( spacer_2 );
    addPage( mPathsPage, i18n( "Paths" ) );

    mFinishedPage = new QWidget( this, "mFinishedPage" );
    mFinishedPageLayout = new QVBoxLayout( mFinishedPage ); 
    mFinishedPageLayout->setSpacing( 0 );
    mFinishedPageLayout->setMargin( 0 );

    TextLabel1 = new QLabel( mFinishedPage, "TextLabel1" );
    TextLabel1->setText( i18n( "<h1>Congratulations!</h1>\n<p>\nYou have finished the initial configuration of SysV-Init Editor. <b>Press</b> the button labeled <b>Finish</b> to start editing your init-configuration.\n</p>"  ) );
    TextLabel1->setTextFormat( QLabel::RichText );
    TextLabel1->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
    mFinishedPageLayout->addWidget( TextLabel1 );
    addPage( mFinishedPage, i18n( "Configuration Complete" ) );

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

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

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

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

void ConfigWizard::chooseDistribution(int)
{
    qWarning( "ConfigWizard::chooseDistribution(int): Not implemented yet!" );
}

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

