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

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

#include "scriptnamedialog.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <ntqlabel.h>
#include <ntqpushbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a ScriptNameDialog as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qdialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qdialog.
 */
ScriptNameDialog::ScriptNameDialog( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setProperty( "name", "ScriptNameDialog" );
    setProperty( "sizeGripEnabled", TQVariant( true ) );
    ScriptNameDialogLayout = new TQVBoxLayout( this, 11, 6, "ScriptNameDialogLayout"); 

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

    ScriptName = new KLineEdit( this, "ScriptName" );

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

    textLabel1 = new TQLabel( this, "textLabel1" );
    textLabel1->setProperty( "frameShape", "NoFrame" );
    textLabel1->setProperty( "frameShadow", "Plain" );

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

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

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

    AuthorName = new KLineEdit( this, "AuthorName" );

    layout3->addWidget( AuthorName, 1, 1 );
    ScriptNameDialogLayout->addLayout( layout3 );

    layout2 = new TQHBoxLayout( 0, 0, 6, "layout2"); 
    Horizontal_Spacing2 = new TQSpacerItem( 330, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout2->addItem( Horizontal_Spacing2 );

    OKButton = new TQPushButton( this, "OKButton" );
    OKButton->setProperty( "autoDefault", TQVariant( true ) );
    layout2->addWidget( OKButton );

    CancelButton = new TQPushButton( this, "CancelButton" );
    CancelButton->setProperty( "enabled", TQVariant( false ) );
    CancelButton->setProperty( "autoDefault", TQVariant( true ) );
    CancelButton->setProperty( "default", TQVariant( true ) );
    layout2->addWidget( CancelButton );
    ScriptNameDialogLayout->addLayout( layout2 );
    languageChange();
    resize( TQSize(403, 143).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( OKButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( CancelButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ScriptNameDialog::languageChange()
{
    setProperty( "caption", tr2i18n( "Enter Name for Script" ) );
    TQToolTip::add( ScriptName, tr2i18n( "Enter name for the script" ) );
    TQWhatsThis::add( ScriptName, tr2i18n( "Enter a name for the script.  This is not the file name, just a short descriptive line of text." ) );
    textLabel1->setProperty( "text", tr2i18n( "Script name:" ) );
    textLabel2->setProperty( "text", tr2i18n( "Author:" ) );
    TQToolTip::add( AuthorName, tr2i18n( "Enter author's name" ) );
    OKButton->setProperty( "text", tr2i18n( "&OK" ) );
    CancelButton->setProperty( "text", tr2i18n( "&Cancel" ) );
    TQWhatsThis::add( CancelButton, tr2i18n( "Press Ok to accept the script name and author name, and open the Save File Dialog." ) );
}

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

TQMetaObject *ScriptNameDialog::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ScriptNameDialog( "ScriptNameDialog", &ScriptNameDialog::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* ScriptNameDialog::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 = TQDialog::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"ScriptNameDialog", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ScriptNameDialog.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool ScriptNameDialog::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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