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

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

#include "makelayout.h"

#include <ntqvariant.h>
#include <kpushbutton.h>
#include <kcombobox.h>
#include <klineedit.h>
#include <kurlrequester.h>
#include <ktextbrowser.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqtabwidget.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "queryview.h"

/*
 *  Constructs a MakeLayout as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
MakeLayout::MakeLayout( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "MakeLayout" );
    MakeLayoutLayout = new TQVBoxLayout( this, 11, 6, "MakeLayoutLayout"); 

    layout10 = new TQGridLayout( 0, 1, 1, 0, 6, "layout10"); 

    textLabel1 = new TQLabel( this, "textLabel1" );

    layout10->addWidget( textLabel1, 0, 0 );

    m_pCommandHistory = new KHistoryCombo( this, "m_pCommandHistory" );
    m_pCommandHistory->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, m_pCommandHistory->sizePolicy().hasHeightForWidth() ) );

    layout10->addWidget( m_pCommandHistory, 1, 1 );

    m_pRootURL = new KURLRequester( this, "m_pRootURL" );

    layout10->addWidget( m_pRootURL, 0, 1 );

    textLabel2 = new TQLabel( this, "textLabel2" );

    layout10->addWidget( textLabel2, 1, 0 );
    MakeLayoutLayout->addLayout( layout10 );

    tabWidget2 = new TQTabWidget( this, "tabWidget2" );

    tab = new TQWidget( tabWidget2, "tab" );
    tabLayout = new TQVBoxLayout( tab, 11, 6, "tabLayout"); 

    m_pOutputBrowser = new KTextBrowser( tab, "m_pOutputBrowser" );
    tabLayout->addWidget( m_pOutputBrowser );
    tabWidget2->insertTab( tab, TQString::fromLatin1("") );

    tab_2 = new TQWidget( tabWidget2, "tab_2" );
    tabLayout_2 = new TQVBoxLayout( tab_2, 11, 6, "tabLayout_2"); 

    m_pErrorView = new QueryView( tab_2, "m_pErrorView" );
    tabLayout_2->addWidget( m_pErrorView );
    tabWidget2->insertTab( tab_2, TQString::fromLatin1("") );
    MakeLayoutLayout->addWidget( tabWidget2 );

    layout7 = new TQHBoxLayout( 0, 0, 6, "layout7"); 
    spacer1 = new TQSpacerItem( 520, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout7->addItem( spacer1 );

    m_pMakeButton = new TQPushButton( this, "m_pMakeButton" );
    m_pMakeButton->setDefault( true );
    layout7->addWidget( m_pMakeButton );

    m_pStopButton = new TQPushButton( this, "m_pStopButton" );
    m_pStopButton->setEnabled( false );
    layout7->addWidget( m_pStopButton );

    m_pCloseButton = new TQPushButton( this, "m_pCloseButton" );
    layout7->addWidget( m_pCloseButton );
    MakeLayoutLayout->addLayout( layout7 );
    languageChange();
    resize( TQSize(768, 642).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_pCloseButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( close() ) );
    connect( m_pMakeButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotMake() ) );
    connect( m_pStopButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotStop() ) );
    connect( m_pCommandHistory, TQ_SIGNAL( returnPressed() ), this, TQ_SLOT( slotMake() ) );

    // tab order
    setTabOrder( m_pRootURL, m_pCommandHistory );
    setTabOrder( m_pCommandHistory, m_pMakeButton );
    setTabOrder( m_pMakeButton, m_pStopButton );
    setTabOrder( m_pStopButton, m_pCloseButton );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void MakeLayout::languageChange()
{
    setCaption( tr2i18n( "KScope - Make" ) );
    textLabel1->setText( tr2i18n( "Root Directory:" ) );
    textLabel2->setText( tr2i18n( "Command:" ) );
    tabWidget2->changeTab( tab, tr2i18n( "Output" ) );
    tabWidget2->changeTab( tab_2, tr2i18n( "Errors a&nd Warnings" ) );
    m_pMakeButton->setText( tr2i18n( "&Make" ) );
    m_pStopButton->setText( tr2i18n( "&Stop" ) );
    m_pCloseButton->setText( tr2i18n( "&Close" ) );
}

void MakeLayout::slotStop()
{
    tqWarning( "MakeLayout::slotStop(): Not implemented yet" );
}

void MakeLayout::slotMake()
{
    tqWarning( "MakeLayout::slotMake(): Not implemented yet" );
}

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

TQMetaObject *MakeLayout::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_MakeLayout( "MakeLayout", &MakeLayout::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* MakeLayout::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 TQUMethod slot_1 = {"slotStop", 0, 0 };
    static const TQUMethod slot_2 = {"slotMake", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "slotStop()", &slot_1, TQMetaData::Protected },
	{ "slotMake()", &slot_2, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"MakeLayout", parentObject,
	slot_tbl, 3,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_MakeLayout.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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