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

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

#include "stationsconfig.h"

#include <ntqvariant.h>
#include <kiconloader.h>
#include <kdialog.h>
#include <knuminput.h>
#include <kpushbutton.h>
#include <tdelistview.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    mAddButton = new KPushButton( this, "mAddButton" );

    stationsConfigLayout->addWidget( mAddButton, 2, 1 );

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

    stationsConfigLayout->addWidget( textLabel2, 0, 2 );

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

    stationsConfigLayout->addWidget( textLabel1, 0, 0 );
    spacer1 = new TQSpacerItem( 20, 86, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    stationsConfigLayout->addItem( spacer1, 1, 1 );

    mSelectedStations = new TDEListView( this, "mSelectedStations" );
    mSelectedStations->addColumn( tr2i18n( "Selected" ) );
    mSelectedStations->header()->setClickEnabled( false, mSelectedStations->header()->count() - 1 );
    mSelectedStations->header()->setResizeEnabled( false, mSelectedStations->header()->count() - 1 );
    mSelectedStations->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)7, 1, 0, mSelectedStations->sizePolicy().hasHeightForWidth() ) );
    mSelectedStations->setResizeMode( TDEListView::LastColumn );
    mSelectedStations->setFullWidth( false );
    mSelectedStations->setItemsMovable( false );
    mSelectedStations->setAutoOpen( false );

    stationsConfigLayout->addMultiCellWidget( mSelectedStations, 1, 4, 2, 2 );

    mRemoveButton = new KPushButton( this, "mRemoveButton" );

    stationsConfigLayout->addWidget( mRemoveButton, 3, 1 );
    spacer2 = new TQSpacerItem( 20, 85, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    stationsConfigLayout->addItem( spacer2, 4, 1 );

    mAllStations = new TDEListView( this, "mAllStations" );
    mAllStations->addColumn( tr2i18n( "All" ) );
    mAllStations->header()->setClickEnabled( false, mAllStations->header()->count() - 1 );
    mAllStations->header()->setResizeEnabled( false, mAllStations->header()->count() - 1 );
    mAllStations->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)7, 1, 0, mAllStations->sizePolicy().hasHeightForWidth() ) );
    mAllStations->setRootIsDecorated( true );
    mAllStations->setResizeMode( TDEListView::LastColumn );
    mAllStations->setFullWidth( false );
    mAllStations->setItemsMovable( false );
    mAllStations->setAutoOpen( false );

    stationsConfigLayout->addMultiCellWidget( mAllStations, 1, 4, 0, 0 );

    layout1 = new TQHBoxLayout( 0, 0, KDialog::spacingHint(), "layout1"); 

    mExit = new KPushButton( this, "mExit" );
    layout1->addWidget( mExit );

    mUpdate = new KPushButton( this, "mUpdate" );
    layout1->addWidget( mUpdate );

    stationsConfigLayout->addMultiCellLayout( layout1, 5, 5, 0, 2 );
    languageChange();
    resize( TQSize(374, 315).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( mAddButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( addStation() ) );
    connect( mRemoveButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( removeStation() ) );
    connect( mUpdate, TQ_SIGNAL( clicked() ), this, TQ_SLOT( updateStations() ) );
    connect( mExit, TQ_SIGNAL( clicked() ), this, TQ_SLOT( exitWeatherService() ) );
    connect( mSelectedStations, TQ_SIGNAL( selectionChanged(TQListViewItem*) ), this, TQ_SLOT( selectionChanged(TQListViewItem*) ) );

    // tab order
    setTabOrder( mAllStations, mSelectedStations );
    setTabOrder( mSelectedStations, mAddButton );
    setTabOrder( mAddButton, mRemoveButton );
    setTabOrder( mRemoveButton, mExit );
    setTabOrder( mExit, mUpdate );

    // buddies
    textLabel2->setBuddy( mSelectedStations );
    textLabel1->setBuddy( mAllStations );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void stationsConfig::languageChange()
{
    mAddButton->setText( tr2i18n( "A&dd" ) );
    textLabel2->setText( tr2i18n( "Se&lected stations:" ) );
    textLabel1->setText( tr2i18n( "A&vailable stations:" ) );
    mSelectedStations->header()->setLabel( 0, tr2i18n( "Selected" ) );
    mRemoveButton->setText( tr2i18n( "&Remove" ) );
    mAllStations->header()->setLabel( 0, tr2i18n( "All" ) );
    mExit->setText( tr2i18n( "&Stop Weather Service" ) );
    mUpdate->setText( tr2i18n( "&Update All" ) );
}

void stationsConfig::exitWeatherService()
{
    tqWarning( "stationsConfig::exitWeatherService(): Not implemented yet" );
}

void stationsConfig::removeStation()
{
    tqWarning( "stationsConfig::removeStation(): Not implemented yet" );
}

void stationsConfig::updateStations()
{
    tqWarning( "stationsConfig::updateStations(): Not implemented yet" );
}

void stationsConfig::addStation()
{
    tqWarning( "stationsConfig::addStation(): Not implemented yet" );
}

void stationsConfig::selectionChanged(TQListViewItem*)
{
    tqWarning( "stationsConfig::selectionChanged(TQListViewItem*): Not implemented yet" );
}

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

TQMetaObject *stationsConfig::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_stationsConfig( "stationsConfig", &stationsConfig::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* stationsConfig::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 = {"exitWeatherService", 0, 0 };
    static const TQUMethod slot_1 = {"removeStation", 0, 0 };
    static const TQUMethod slot_2 = {"updateStations", 0, 0 };
    static const TQUMethod slot_3 = {"addStation", 0, 0 };
    static const TQUParameter param_slot_4[] = {
	{ 0, &static_QUType_ptr, "TQListViewItem", TQUParameter::In }
    };
    static const TQUMethod slot_4 = {"selectionChanged", 1, param_slot_4 };
    static const TQUMethod slot_5 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "exitWeatherService()", &slot_0, TQMetaData::Public },
	{ "removeStation()", &slot_1, TQMetaData::Public },
	{ "updateStations()", &slot_2, TQMetaData::Public },
	{ "addStation()", &slot_3, TQMetaData::Public },
	{ "selectionChanged(TQListViewItem*)", &slot_4, TQMetaData::Public },
	{ "languageChange()", &slot_5, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"stationsConfig", parentObject,
	slot_tbl, 6,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_stationsConfig.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool stationsConfig::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: exitWeatherService(); break;
    case 1: removeStation(); break;
    case 2: updateStations(); break;
    case 3: addStation(); break;
    case 4: selectionChanged((TQListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 5: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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