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

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

#include "telescopewizard.h"

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

/*
 *  Constructs a telescopeWizard 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.
 */
telescopeWizard::telescopeWizard( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setProperty( "name", "telescopeWizard" );
    setProperty( "sizePolicy", TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) );
    setProperty( "minimumSize", TQSize( 500, 300 ) );
    setProperty( "maximumSize", TQSize( 800, 300 ) );
    setProperty( "sizeGripEnabled", TQVariant( true ) );
    telescopeWizardLayout = new TQGridLayout( this, 1, 1, 0, 6, "telescopeWizardLayout"); 

    layout12 = new TQHBoxLayout( 0, 10, 6, "layout12"); 

    helpB = new TQPushButton( this, "helpB" );
    helpB->setProperty( "autoDefault", TQVariant( false ) );
    layout12->addWidget( helpB );
    spacer2 = new TQSpacerItem( 56, 11, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout12->addItem( spacer2 );

    backB = new TQPushButton( this, "backB" );
    layout12->addWidget( backB );

    nextB = new TQPushButton( this, "nextB" );
    nextB->setProperty( "autoDefault", TQVariant( true ) );
    nextB->setProperty( "default", TQVariant( true ) );
    layout12->addWidget( nextB );

    telescopeWizardLayout->addLayout( layout12, 1, 1 );

    wizardContainer = new TQWidgetStack( this, "wizardContainer" );

    introPage = new TQWidget( wizardContainer, "introPage" );
    introPageLayout = new TQGridLayout( introPage, 1, 1, 0, 6, "introPageLayout"); 

    intoPageLabel = new TQLabel( introPage, "intoPageLabel" );
    intoPageLabel->setProperty( "sizePolicy", TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, intoPageLabel->sizePolicy().hasHeightForWidth() ) );
    intoPageLabel->setProperty( "alignment", int( TQLabel::WordBreak | TQLabel::AlignVCenter ) );

    introPageLayout->addWidget( intoPageLabel, 0, 0 );
    wizardContainer->addWidget( introPage, 0 );

    modelPage = new TQWidget( wizardContainer, "modelPage" );
    modelPageLayout = new TQVBoxLayout( modelPage, 0, 6, "modelPageLayout"); 

    modelPageLabel = new TQLabel( modelPage, "modelPageLabel" );
    modelPageLabel->setProperty( "alignment", int( TQLabel::WordBreak | TQLabel::AlignTop ) );
    modelPageLayout->addWidget( modelPageLabel );
    spacer5_2 = new TQSpacerItem( 20, 25, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    modelPageLayout->addItem( spacer5_2 );

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

    telescopeCombo = new TQComboBox( false, modelPage, "telescopeCombo" );
    layout10->addWidget( telescopeCombo );
    spacer3 = new TQSpacerItem( 196, 16, TQSizePolicy::Minimum, TQSizePolicy::Minimum );
    layout10->addItem( spacer3 );
    modelPageLayout->addLayout( layout10 );
    spacer5 = new TQSpacerItem( 20, 25, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    modelPageLayout->addItem( spacer5 );

    textLabel1 = new TQLabel( modelPage, "textLabel1" );
    modelPageLayout->addWidget( textLabel1 );
    wizardContainer->addWidget( modelPage, 1 );

    telescopePage = new TQWidget( wizardContainer, "telescopePage" );
    telescopePageLayout = new TQGridLayout( telescopePage, 1, 1, 0, 6, "telescopePageLayout"); 

    telescopePageInfo = new TQLabel( telescopePage, "telescopePageInfo" );
    telescopePageInfo->setProperty( "sizePolicy", TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, telescopePageInfo->sizePolicy().hasHeightForWidth() ) );
    telescopePageInfo->setProperty( "alignment", int( TQLabel::WordBreak | TQLabel::AlignTop ) );

    telescopePageLayout->addWidget( telescopePageInfo, 0, 0 );
    wizardContainer->addWidget( telescopePage, 2 );

    localPage = new TQWidget( wizardContainer, "localPage" );
    localPageLayout = new TQVBoxLayout( localPage, 0, 6, "localPageLayout"); 

    localPageLabel = new TQLabel( localPage, "localPageLabel" );
    localPageLabel->setProperty( "alignment", int( TQLabel::WordBreak | TQLabel::AlignTop ) );
    localPageLayout->addWidget( localPageLabel );
    spacer4_2_2 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    localPageLayout->addItem( spacer4_2_2 );

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

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

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

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

    timeLabel = new TQLabel( localPage, "timeLabel" );
    layout2->addWidget( timeLabel );

    timeOut = new TQLabel( localPage, "timeOut" );
    TQFont timeOut_font(  timeOut->font() );
    timeOut_font.setBold( true );
    timeOut->setFont( timeOut_font ); 
    layout2->addWidget( timeOut );
    layout6->addLayout( layout2 );

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

    dateLabel = new TQLabel( localPage, "dateLabel" );
    layout3->addWidget( dateLabel );

    dateOut = new TQLabel( localPage, "dateOut" );
    TQFont dateOut_font(  dateOut->font() );
    dateOut_font.setBold( true );
    dateOut->setFont( dateOut_font ); 
    layout3->addWidget( dateOut );
    layout6->addLayout( layout3 );
    layout13->addLayout( layout6 );

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

    locationLabel = new TQLabel( localPage, "locationLabel" );
    layout4->addWidget( locationLabel );

    locationOut = new TQLabel( localPage, "locationOut" );
    TQFont locationOut_font(  locationOut->font() );
    locationOut_font.setBold( true );
    locationOut->setFont( locationOut_font ); 
    layout4->addWidget( locationOut );
    layout13->addLayout( layout4 );
    layout14->addLayout( layout13 );

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

    setTimeB = new TQPushButton( localPage, "setTimeB" );
    layout11->addWidget( setTimeB );

    setLocationB = new TQPushButton( localPage, "setLocationB" );
    layout11->addWidget( setLocationB );
    layout14->addLayout( layout11 );
    localPageLayout->addLayout( layout14 );
    spacer4_2 = new TQSpacerItem( 20, 40, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    localPageLayout->addItem( spacer4_2 );
    wizardContainer->addWidget( localPage, 3 );

    portPage = new TQWidget( wizardContainer, "portPage" );
    portPageLayout = new TQVBoxLayout( portPage, 0, 6, "portPageLayout"); 

    portPageLabel = new TQLabel( portPage, "portPageLabel" );
    portPageLabel->setProperty( "sizePolicy", TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, portPageLabel->sizePolicy().hasHeightForWidth() ) );
    portPageLabel->setProperty( "alignment", int( TQLabel::WordBreak | TQLabel::AlignTop ) );
    portPageLayout->addWidget( portPageLabel );
    spacer6_2 = new TQSpacerItem( 20, 25, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    portPageLayout->addItem( spacer6_2 );

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

    portLabel = new TQLabel( portPage, "portLabel" );
    layout17->addWidget( portLabel );

    portIn = new KLineEdit( portPage, "portIn" );
    layout17->addWidget( portIn );
    spacer4 = new TQSpacerItem( 141, 16, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout17->addItem( spacer4 );
    portPageLayout->addLayout( layout17 );
    spacer6 = new TQSpacerItem( 20, 25, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    portPageLayout->addItem( spacer6 );
    wizardContainer->addWidget( portPage, 4 );

    telescopeWizardLayout->addWidget( wizardContainer, 0, 1 );

    wizardPix = new TQLabel( this, "wizardPix" );
    wizardPix->setProperty( "scaledContents", TQVariant( true ) );

    telescopeWizardLayout->addMultiCellWidget( wizardPix, 0, 1, 0, 0 );
    languageChange();
    resize( TQSize(609, 300).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void telescopeWizard::languageChange()
{
    setProperty( "caption", tr2i18n( "Telescope Wizard" ) );
    helpB->setProperty( "text", tr2i18n( "&Help" ) );
    backB->setProperty( "text", tr2i18n( "&Back" ) );
    nextB->setProperty( "text", tr2i18n( "&Next" ) );
    intoPageLabel->setProperty( "text", tr2i18n( "Welcome to the <b>KStars Telescope Setup Wizard!</b>\n"
"<br><br>\n"
"This Wizard will help you to connect to your telescope and control it from KStars. You will be asked to verify some basic information.\n"
"<br>\n"
"<br>You can get extended information on telescope support in KStars by pressing the <tt>help</tt> button at any point during the Wizard.\n"
"<br><br>\n"
"Please click next to continue." ) );
    modelPageLabel->setProperty( "text", tr2i18n( "<h3>1. Telescope Model</h3>\n"
"\n"
"Please select your telescope model from the list below. Click next after selecting a model." ) );
    textLabel1->setProperty( "text", tr2i18n( "<b>Tip</b>\n"
"<br>Some non-Meade telescopes support a subset of the LX200 command set. Select <tt>LX200 Generic</tt> to control such devices." ) );
    telescopePageInfo->setProperty( "text", tr2i18n( "<h3>2. Align Your Telescope</h3>\n"
"\n"
"You need to align your telescope before you can control it properly from KStars. Please refer to your telescope manual for alignment instructions.\n"
"<br><br>\n"
"After a successful alignment, connect your telescope's RS232 interface to your computer's serial or USB port.\n"
"<br><br><br>Click next to continue." ) );
    localPageLabel->setProperty( "text", tr2i18n( "<h3>3. Verify Local Settings</h3>\n"
"\n"
"Verify if the following time, date, and location settings are correct. If any of the settings are incorrect, you can correct them via the <tt>Set time</tt> and <tt>Set Location</tt> buttons.\n"
"" ) );
    timeLabel->setProperty( "text", tr2i18n( "<b>Time</b>" ) );
    timeOut->setProperty( "text", TQString::null );
    dateLabel->setProperty( "text", tr2i18n( "<b>Date</b>" ) );
    dateOut->setProperty( "text", TQString::null );
    locationLabel->setProperty( "text", tr2i18n( "<b>Location</b>" ) );
    locationOut->setProperty( "text", TQString::null );
    setTimeB->setProperty( "text", tr2i18n( "Set Time..." ) );
    setLocationB->setProperty( "text", tr2i18n( "Set Location..." ) );
    portPageLabel->setProperty( "text", tr2i18n( "<h3>4. Determine Connection Port</h3>\n"
"\n"
"Enter the port number your telescope is connected to. If you only have one serial port in your computer, the port is usually <tt>/dev/ttyS0</tt>\n"
"<br><br>If you are unsure about the port number, you can leave the field empty and KStars will try to scan the ports for attached telescopes. Beware that the autoscan process might take a few minutes to complete. " ) );
    portLabel->setProperty( "text", tr2i18n( "<b>Port:</b>" ) );
}

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

TQMetaObject *telescopeWizard::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_telescopeWizard( "telescopeWizard", &telescopeWizard::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* telescopeWizard::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(
	"telescopeWizard", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_telescopeWizard.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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