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

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

#include "scriptbuilderui.h"

#include <ntqvariant.h>
#include <kpushbutton.h>
#include <tdelistbox.h>
#include <tdelistview.h>
#include <ktextedit.h>
#include <ntqpushbutton.h>
#include <ntqsplitter.h>
#include <ntqgroupbox.h>
#include <ntqwidgetstack.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    layout5 = new TQHBoxLayout( 0, 0, 6, "layout5"); 

    NewButton = new KPushButton( this, "NewButton" );
    NewButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, NewButton->sizePolicy().hasHeightForWidth() ) );
    NewButton->setMinimumSize( TQSize( 32, 32 ) );
    NewButton->setMaximumSize( TQSize( 32, 32 ) );
    layout5->addWidget( NewButton );

    OpenButton = new KPushButton( this, "OpenButton" );
    OpenButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, OpenButton->sizePolicy().hasHeightForWidth() ) );
    OpenButton->setMinimumSize( TQSize( 32, 32 ) );
    OpenButton->setMaximumSize( TQSize( 32, 32 ) );
    layout5->addWidget( OpenButton );

    SaveButton = new KPushButton( this, "SaveButton" );
    SaveButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, SaveButton->sizePolicy().hasHeightForWidth() ) );
    SaveButton->setMinimumSize( TQSize( 32, 32 ) );
    SaveButton->setMaximumSize( TQSize( 32, 32 ) );
    layout5->addWidget( SaveButton );

    SaveAsButton = new KPushButton( this, "SaveAsButton" );
    SaveAsButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, SaveAsButton->sizePolicy().hasHeightForWidth() ) );
    SaveAsButton->setMinimumSize( TQSize( 32, 32 ) );
    SaveAsButton->setMaximumSize( TQSize( 32, 32 ) );
    layout5->addWidget( SaveAsButton );

    RunButton = new KPushButton( this, "RunButton" );
    RunButton->setMinimumSize( TQSize( 32, 32 ) );
    RunButton->setMaximumSize( TQSize( 32, 32 ) );
    layout5->addWidget( RunButton );
    spacer3 = new TQSpacerItem( 490, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout5->addItem( spacer3 );

    ScriptBuilderUILayout->addLayout( layout5, 0, 0 );

    splitter1 = new TQSplitter( this, "splitter1" );
    splitter1->setFrameShape( TQSplitter::NoFrame );
    splitter1->setFrameShadow( TQSplitter::Plain );
    splitter1->setOrientation( TQSplitter::Horizontal );

    groupBox2 = new TQGroupBox( splitter1, "groupBox2" );
    groupBox2->setFrameShape( TQGroupBox::GroupBoxPanel );
    groupBox2->setFrameShadow( TQGroupBox::Sunken );
    groupBox2->setColumnLayout(0, TQt::Vertical );
    groupBox2->layout()->setSpacing( 6 );
    groupBox2->layout()->setMargin( 4 );
    groupBox2Layout = new TQVBoxLayout( groupBox2->layout() );
    groupBox2Layout->setAlignment( TQt::AlignTop );

    layout6 = new TQHBoxLayout( 0, 0, 6, "layout6"); 

    ScriptListBox = new TDEListBox( groupBox2, "ScriptListBox" );
    ScriptListBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 1, ScriptListBox->sizePolicy().hasHeightForWidth() ) );
    layout6->addWidget( ScriptListBox );

    layout5_2 = new TQVBoxLayout( 0, 0, 6, "layout5_2"); 

    AddButton = new KPushButton( groupBox2, "AddButton" );
    AddButton->setMinimumSize( TQSize( 32, 32 ) );
    AddButton->setMaximumSize( TQSize( 32, 32 ) );
    layout5_2->addWidget( AddButton );

    RemoveButton = new KPushButton( groupBox2, "RemoveButton" );
    RemoveButton->setMinimumSize( TQSize( 32, 32 ) );
    RemoveButton->setMaximumSize( TQSize( 32, 32 ) );
    layout5_2->addWidget( RemoveButton );

    CopyButton = new KPushButton( groupBox2, "CopyButton" );
    CopyButton->setMinimumSize( TQSize( 32, 32 ) );
    CopyButton->setMaximumSize( TQSize( 32, 32 ) );
    layout5_2->addWidget( CopyButton );

    UpButton = new KPushButton( groupBox2, "UpButton" );
    UpButton->setMinimumSize( TQSize( 32, 32 ) );
    UpButton->setMaximumSize( TQSize( 32, 32 ) );
    layout5_2->addWidget( UpButton );

    DownButton = new KPushButton( groupBox2, "DownButton" );
    DownButton->setMinimumSize( TQSize( 32, 32 ) );
    DownButton->setMaximumSize( TQSize( 32, 32 ) );
    layout5_2->addWidget( DownButton );
    spacer1_2 = new TQSpacerItem( 20, 118, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout5_2->addItem( spacer1_2 );
    layout6->addLayout( layout5_2 );
    groupBox2Layout->addLayout( layout6 );

    FuncArgBox = new TQGroupBox( groupBox2, "FuncArgBox" );
    FuncArgBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 1, FuncArgBox->sizePolicy().hasHeightForWidth() ) );
    FuncArgBox->setMinimumSize( TQSize( 200, 140 ) );
    FuncArgBox->setColumnLayout(0, TQt::Vertical );
    FuncArgBox->layout()->setSpacing( 6 );
    FuncArgBox->layout()->setMargin( 4 );
    FuncArgBoxLayout = new TQVBoxLayout( FuncArgBox->layout() );
    FuncArgBoxLayout->setAlignment( TQt::AlignTop );

    ArgStack = new TQWidgetStack( FuncArgBox, "ArgStack" );
    ArgStack->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)7, 0, 1, ArgStack->sizePolicy().hasHeightForWidth() ) );

    page = new TQWidget( ArgStack, "page" );
    ArgStack->addWidget( page, 0 );
    FuncArgBoxLayout->addWidget( ArgStack );
    groupBox2Layout->addWidget( FuncArgBox );

    FunctionBrowser = new TQGroupBox( splitter1, "FunctionBrowser" );
    FunctionBrowser->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, FunctionBrowser->sizePolicy().hasHeightForWidth() ) );
    FunctionBrowser->setFrameShape( TQGroupBox::GroupBoxPanel );
    FunctionBrowser->setFrameShadow( TQGroupBox::Sunken );
    FunctionBrowser->setColumnLayout(0, TQt::Vertical );
    FunctionBrowser->layout()->setSpacing( 6 );
    FunctionBrowser->layout()->setMargin( 4 );
    FunctionBrowserLayout = new TQVBoxLayout( FunctionBrowser->layout() );
    FunctionBrowserLayout->setAlignment( TQt::AlignTop );

    splitter7 = new TQSplitter( FunctionBrowser, "splitter7" );
    splitter7->setOrientation( TQSplitter::Vertical );

    FunctionListView = new TDEListView( splitter7, "FunctionListView" );
    FunctionListView->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 2, FunctionListView->sizePolicy().hasHeightForWidth() ) );
    FunctionListView->setRootIsDecorated( true );

    FuncDoc = new KTextEdit( splitter7, "FuncDoc" );
    FuncDoc->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, FuncDoc->sizePolicy().hasHeightForWidth() ) );
    FuncDoc->setReadOnly( true );
    FunctionBrowserLayout->addWidget( splitter7 );

    ScriptBuilderUILayout->addWidget( splitter1, 1, 0 );

    layout11 = new TQHBoxLayout( 0, 0, 6, "layout11"); 

    layout10 = new TQVBoxLayout( 0, 0, 6, "layout10"); 

    AppendINDIWait = new TQCheckBox( this, "AppendINDIWait" );
    AppendINDIWait->setChecked( false );
    layout10->addWidget( AppendINDIWait );

    ReuseINDIDeviceName = new TQCheckBox( this, "ReuseINDIDeviceName" );
    ReuseINDIDeviceName->setChecked( true );
    layout10->addWidget( ReuseINDIDeviceName );
    layout11->addLayout( layout10 );
    spacer7 = new TQSpacerItem( 91, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout11->addItem( spacer7 );

    ScriptBuilderUILayout->addLayout( layout11, 2, 0 );
    languageChange();
    resize( TQSize(708, 791).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ScriptBuilderUI::languageChange()
{
    setCaption( tr2i18n( "Script Builder" ) );
    NewButton->setText( TQString::null );
    TQToolTip::add( NewButton, tr2i18n( "New Script" ) );
    TQWhatsThis::add( NewButton, tr2i18n( "Discards current script and starts a new one.  Will prompt to save any unsaved changes in the current script." ) );
    OpenButton->setText( TQString::null );
    TQToolTip::add( OpenButton, tr2i18n( "Open Script" ) );
    TQWhatsThis::add( OpenButton, tr2i18n( "Opens an existing script.  Will prompt to save any unsaved changes in the current script." ) );
    SaveButton->setText( TQString::null );
    TQToolTip::add( SaveButton, tr2i18n( "Save Script" ) );
    TQWhatsThis::add( SaveButton, tr2i18n( "Save the current script.  If the script has not been saved before, this is equivalent to \"Save As...\"" ) );
    SaveAsButton->setText( TQString::null );
    TQToolTip::add( SaveAsButton, tr2i18n( "Save Script As..." ) );
    TQWhatsThis::add( SaveAsButton, tr2i18n( "Saves the script to a file, allowing you to first specify the filename and a name for the script." ) );
    RunButton->setText( TQString::null );
    TQToolTip::add( RunButton, tr2i18n( "Test Script" ) );
    TQWhatsThis::add( RunButton, tr2i18n( "Executes the script in the KStars main window.  You may want to reposition the Script Builder tool so that the Sky map is visible.  " ) );
    groupBox2->setTitle( tr2i18n( "Current Script" ) );
    ScriptListBox->setCurrentItem( -1 );
    TQWhatsThis::add( ScriptListBox, tr2i18n( "This shows the list of commands present in the current working script.  Highlighting any command will present a widget where you can specify its arguments below.  Use the action buttons at right to copy, remove, or change the position of the selected command.  " ) );
    AddButton->setText( TQString::null );
    TQToolTip::add( AddButton, tr2i18n( "Add Function" ) );
    TQWhatsThis::add( AddButton, tr2i18n( "If a function is highlighted in the \"Function Browser\" box, this button will add it to the current working script.  The new function is inserted directly after the highlighted function in the \"Current Script\" box.\n"
"" ) );
    RemoveButton->setText( TQString::null );
    TQToolTip::add( RemoveButton, tr2i18n( "Remove Function" ) );
    TQWhatsThis::add( RemoveButton, tr2i18n( "If a function is highlighted in the \"Current Script\" box, this button will remove it from the script." ) );
    CopyButton->setText( TQString::null );
    TQToolTip::add( CopyButton, tr2i18n( "Copy Function" ) );
    TQWhatsThis::add( CopyButton, tr2i18n( "If a function is highlighted in the \"Current Script\" box, this button will add a duplicate of the function." ) );
    UpButton->setText( TQString::null );
    TQToolTip::add( UpButton, tr2i18n( "Move Up" ) );
    TQWhatsThis::add( UpButton, tr2i18n( "If a function is highlighted in the \"Current Script\" box, this button will move it up one position in the script." ) );
    DownButton->setText( TQString::null );
    TQToolTip::add( DownButton, tr2i18n( "Move Down" ) );
    TQWhatsThis::add( DownButton, tr2i18n( "If a function is highlighted in the \"Current Script\" box, this button will move it down one position in the script." ) );
    FuncArgBox->setTitle( tr2i18n( "Function Arguments" ) );
    FunctionBrowser->setTitle( tr2i18n( "Function Browser" ) );
    FuncDoc->setText( TQString::null );
    TQToolTip::add( FuncDoc, tr2i18n( "Function Help" ) );
    TQWhatsThis::add( FuncDoc, tr2i18n( "If a function is highlighted in the Function Browser, this area will show some brief documentation about the function." ) );
    AppendINDIWait->setText( tr2i18n( "Append WaitForINDIAction after any INDI action" ) );
    ReuseINDIDeviceName->setText( tr2i18n( "Reuse INDI device name" ) );
}

void ScriptBuilderUI::slotAddFunction()
{
    tqWarning( "ScriptBuilderUI::slotAddFunction(): Not implemented yet" );
}

void ScriptBuilderUI::slotMoveFunctionUp()
{
    tqWarning( "ScriptBuilderUI::slotMoveFunctionUp(): Not implemented yet" );
}

void ScriptBuilderUI::slotMoveFunctionDown()
{
    tqWarning( "ScriptBuilderUI::slotMoveFunctionDown(): Not implemented yet" );
}

void ScriptBuilderUI::slotShowDoc()
{
    tqWarning( "ScriptBuilderUI::slotShowDoc(): Not implemented yet" );
}

void ScriptBuilderUI::slotArgWidget()
{
    tqWarning( "ScriptBuilderUI::slotArgWidget(): Not implemented yet" );
}

void ScriptBuilderUI::slotNew()
{
    tqWarning( "ScriptBuilderUI::slotNew(): Not implemented yet" );
}

void ScriptBuilderUI::slotOpen()
{
    tqWarning( "ScriptBuilderUI::slotOpen(): Not implemented yet" );
}

void ScriptBuilderUI::slotSave()
{
    tqWarning( "ScriptBuilderUI::slotSave(): Not implemented yet" );
}

void ScriptBuilderUI::slotSaveAs()
{
    tqWarning( "ScriptBuilderUI::slotSaveAs(): Not implemented yet" );
}

void ScriptBuilderUI::slotCopyFunction()
{
    tqWarning( "ScriptBuilderUI::slotCopyFunction(): Not implemented yet" );
}

void ScriptBuilderUI::slotRemoveFunction()
{
    tqWarning( "ScriptBuilderUI::slotRemoveFunction(): Not implemented yet" );
}

void ScriptBuilderUI::slotRunScript()
{
    tqWarning( "ScriptBuilderUI::slotRunScript(): Not implemented yet" );
}

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

TQMetaObject *ScriptBuilderUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ScriptBuilderUI( "ScriptBuilderUI", &ScriptBuilderUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* ScriptBuilderUI::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 = {"slotAddFunction", 0, 0 };
    static const TQUMethod slot_1 = {"slotMoveFunctionUp", 0, 0 };
    static const TQUMethod slot_2 = {"slotMoveFunctionDown", 0, 0 };
    static const TQUMethod slot_3 = {"slotShowDoc", 0, 0 };
    static const TQUMethod slot_4 = {"slotArgWidget", 0, 0 };
    static const TQUMethod slot_5 = {"slotNew", 0, 0 };
    static const TQUMethod slot_6 = {"slotOpen", 0, 0 };
    static const TQUMethod slot_7 = {"slotSave", 0, 0 };
    static const TQUMethod slot_8 = {"slotSaveAs", 0, 0 };
    static const TQUMethod slot_9 = {"slotCopyFunction", 0, 0 };
    static const TQUMethod slot_10 = {"slotRemoveFunction", 0, 0 };
    static const TQUMethod slot_11 = {"slotRunScript", 0, 0 };
    static const TQUMethod slot_12 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "slotAddFunction()", &slot_0, TQMetaData::Public },
	{ "slotMoveFunctionUp()", &slot_1, TQMetaData::Public },
	{ "slotMoveFunctionDown()", &slot_2, TQMetaData::Public },
	{ "slotShowDoc()", &slot_3, TQMetaData::Public },
	{ "slotArgWidget()", &slot_4, TQMetaData::Public },
	{ "slotNew()", &slot_5, TQMetaData::Public },
	{ "slotOpen()", &slot_6, TQMetaData::Public },
	{ "slotSave()", &slot_7, TQMetaData::Public },
	{ "slotSaveAs()", &slot_8, TQMetaData::Public },
	{ "slotCopyFunction()", &slot_9, TQMetaData::Public },
	{ "slotRemoveFunction()", &slot_10, TQMetaData::Public },
	{ "slotRunScript()", &slot_11, TQMetaData::Public },
	{ "languageChange()", &slot_12, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"ScriptBuilderUI", parentObject,
	slot_tbl, 13,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ScriptBuilderUI.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool ScriptBuilderUI::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: slotAddFunction(); break;
    case 1: slotMoveFunctionUp(); break;
    case 2: slotMoveFunctionDown(); break;
    case 3: slotShowDoc(); break;
    case 4: slotArgWidget(); break;
    case 5: slotNew(); break;
    case 6: slotOpen(); break;
    case 7: slotSave(); break;
    case 8: slotSaveAs(); break;
    case 9: slotCopyFunction(); break;
    case 10: slotRemoveFunction(); break;
    case 11: slotRunScript(); break;
    case 12: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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