/****************************************************************************
** Form implementation generated from reading ui file 'rpmbuildwidget.ui'
**
** Created: Sat Mar 9 00:44:12 2002
**      by:  The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "rpmbuildwidget.h"

#include <klocale.h>
#include <qframe.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qtoolbutton.h>
#include <qlayout.h>
#include <qvariant.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/* 
 *  Constructs a RPMBuildWidget which is a child of 'parent', with the 
 *  name 'name' and widget flags set to 'f' 
 */
RPMBuildWidget::RPMBuildWidget( QWidget* parent,  const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "RPMBuild" );
    resize( 467, 523 ); 
    setMinimumSize( QSize( 0, 0 ) );
    setMaximumSize( QSize( 32767, 32767 ) );
    setCaption( i18n( "RPM-Build" ) );

    GroupBox2 = new QGroupBox( this, "GroupBox2" );
    GroupBox2->setGeometry( QRect( 0, 0, 455, 335 ) ); 
    GroupBox2->setTitle( i18n( "RPM Build" ) );

    OpenSourceButton = new QToolButton( GroupBox2, "OpenSourceButton" );
    OpenSourceButton->setGeometry( QRect( 430, 20, 16, 21 ) ); 
    OpenSourceButton->setText( i18n( "..." ) );

    Line1 = new QFrame( GroupBox2, "Line1" );
    Line1->setGeometry( QRect( 10, 195, 435, 16 ) ); 
    Line1->setFrameStyle( QFrame::HLine | QFrame::Sunken );

    strCXXFLAGS = new QLineEdit( GroupBox2, "strCXXFLAGS" );
    strCXXFLAGS->setGeometry( QRect( 125, 220, 300, 22 ) ); 
    strCXXFLAGS->setText( i18n( "" ) );

    strCFLAGS = new QLineEdit( GroupBox2, "strCFLAGS" );
    strCFLAGS->setGeometry( QRect( 125, 255, 300, 22 ) ); 

    OpenPatchButton = new QToolButton( GroupBox2, "OpenPatchButton" );
    OpenPatchButton->setGeometry( QRect( 430, 55, 16, 21 ) ); 
    OpenPatchButton->setText( i18n( "..." ) );

    strSource = new QLineEdit( GroupBox2, "strSource" );
    strSource->setGeometry( QRect( 120, 20, 305, 22 ) ); 

    TextLabel7 = new QLabel( GroupBox2, "TextLabel7" );
    TextLabel7->setGeometry( QRect( 10, 90, 105, 22 ) ); 
    TextLabel7->setText( i18n( "Build-Root :" ) );

    TextLabel1_2 = new QLabel( GroupBox2, "TextLabel1_2" );
    TextLabel1_2->setGeometry( QRect( 10, 125, 105, 22 ) ); 
    TextLabel1_2->setText( i18n( "Prefix :" ) );

    TextLabel1_3 = new QLabel( GroupBox2, "TextLabel1_3" );
    TextLabel1_3->setGeometry( QRect( 10, 160, 105, 22 ) ); 
    TextLabel1_3->setText( i18n( "Configure :" ) );

    TextLabel3 = new QLabel( GroupBox2, "TextLabel3" );
    TextLabel3->setGeometry( QRect( 10, 220, 110, 22 ) ); 
    TextLabel3->setText( i18n( "CXXFLAGS :" ) );

    TextLabel2 = new QLabel( GroupBox2, "TextLabel2" );
    TextLabel2->setGeometry( QRect( 10, 255, 110, 22 ) ); 
    TextLabel2->setText( i18n( "CFLAGS :" ) );

    TextLabel1 = new QLabel( GroupBox2, "TextLabel1" );
    TextLabel1->setGeometry( QRect( 10, 20, 105, 22 ) ); 
    TextLabel1->setText( i18n( "Sourcefile :" ) );

    TextLabel2_2 = new QLabel( GroupBox2, "TextLabel2_2" );
    TextLabel2_2->setGeometry( QRect( 10, 55, 105, 22 ) ); 
    TextLabel2_2->setText( i18n( "Patch:" ) );

    strPatch = new QLineEdit( GroupBox2, "strPatch" );
    strPatch->setGeometry( QRect( 120, 55, 305, 22 ) ); 

    strBuildRoot = new QLineEdit( GroupBox2, "strBuildRoot" );
    strBuildRoot->setGeometry( QRect( 120, 90, 305, 22 ) ); 

    strPrefix = new QLineEdit( GroupBox2, "strPrefix" );
    strPrefix->setGeometry( QRect( 120, 125, 305, 22 ) ); 
    QToolTip::add(  strPrefix, i18n( "E.g. : /opt/kde2" ) );

    strConfigure = new QLineEdit( GroupBox2, "strConfigure" );
    strConfigure->setGeometry( QRect( 120, 160, 305, 22 ) ); 
    QToolTip::add(  strConfigure, i18n( "Argumente for the configure script.<br><b>--with-qt-dir=your_qt2_dir</b>" ) );

    // signals and slots connections
    connect( OpenSourceButton, SIGNAL( clicked() ), this, SLOT( slotSourceFileOpen() ) );
    connect( OpenPatchButton, SIGNAL( clicked() ), this, SLOT( slotPatchFileOpen() ) );

    // tab order
    setTabOrder( strSource, strPatch );
    setTabOrder( strPatch, strBuildRoot );
    setTabOrder( strBuildRoot, strPrefix );
    setTabOrder( strPrefix, strConfigure );
    setTabOrder( strConfigure, strCXXFLAGS );
    setTabOrder( strCXXFLAGS, strCFLAGS );
}

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

void RPMBuildWidget::slotPatchFileOpen()
{
    qWarning( "RPMBuildWidget::slotPatchFileOpen(): Not implemented yet!" );
}

void RPMBuildWidget::slotSourceFileOpen()
{
    qWarning( "RPMBuildWidget::slotSourceFileOpen(): Not implemented yet!" );
}

