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

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

#include "xineramawidget.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqtable.h>
#include <ntqbuttongroup.h>
#include <ntqcheckbox.h>
#include <ntqlabel.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "kdialog.h"
#include "xineramawidget.ui.h"

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

    headTable = new TQTable( this, "headTable" );
    headTable->setNumCols( headTable->numCols() + 1 );
    headTable->horizontalHeader()->setLabel( headTable->numCols() - 1, tr2i18n( "X Coordinate" ) );
    headTable->setNumCols( headTable->numCols() + 1 );
    headTable->horizontalHeader()->setLabel( headTable->numCols() - 1, tr2i18n( "Y Coordinate" ) );
    headTable->setNumCols( headTable->numCols() + 1 );
    headTable->horizontalHeader()->setLabel( headTable->numCols() - 1, tr2i18n( "Width" ) );
    headTable->setNumCols( headTable->numCols() + 1 );
    headTable->horizontalHeader()->setLabel( headTable->numCols() - 1, tr2i18n( "Height" ) );
    headTable->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)1, 0, 0, headTable->sizePolicy().hasHeightForWidth() ) );
    headTable->setVScrollBarMode( TQTable::Auto );
    headTable->setHScrollBarMode( TQTable::Auto );
    headTable->setNumRows( 2 );
    headTable->setNumCols( 4 );
    headTable->setShowGrid( true );
    headTable->setReadOnly( true );
    headTable->setSelectionMode( TQTable::NoSelection );
    headTable->setFocusStyle( TQTable::FollowStyle );

    XineramaWidgetLayout->addMultiCellWidget( headTable, 1, 1, 0, 1 );

    ButtonGroup1 = new TQButtonGroup( this, "ButtonGroup1" );
    ButtonGroup1->setColumnLayout(0, TQt::Vertical );
    ButtonGroup1->layout()->setSpacing( KDialog::spacingHint() );
    ButtonGroup1->layout()->setMargin( KDialog::marginHint() );
    ButtonGroup1Layout = new TQVBoxLayout( ButtonGroup1->layout() );
    ButtonGroup1Layout->setAlignment( TQt::AlignTop );

    _enableXinerama = new TQCheckBox( ButtonGroup1, "_enableXinerama" );
    ButtonGroup1Layout->addWidget( _enableXinerama );

    _enableResistance = new TQCheckBox( ButtonGroup1, "_enableResistance" );
    _enableResistance->setEnabled( false );
    ButtonGroup1Layout->addWidget( _enableResistance );

    _enablePlacement = new TQCheckBox( ButtonGroup1, "_enablePlacement" );
    _enablePlacement->setEnabled( false );
    ButtonGroup1Layout->addWidget( _enablePlacement );

    _enableMaximize = new TQCheckBox( ButtonGroup1, "_enableMaximize" );
    _enableMaximize->setEnabled( false );
    ButtonGroup1Layout->addWidget( _enableMaximize );

    _enableFullscreen = new TQCheckBox( ButtonGroup1, "_enableFullscreen" );
    _enableFullscreen->setEnabled( false );
    ButtonGroup1Layout->addWidget( _enableFullscreen );

    XineramaWidgetLayout->addMultiCellWidget( ButtonGroup1, 0, 0, 0, 1 );

    _identify = new TQPushButton( this, "_identify" );

    XineramaWidgetLayout->addWidget( _identify, 3, 1 );
    spacer2 = new TQSpacerItem( 431, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    XineramaWidgetLayout->addItem( spacer2, 3, 0 );

    layout2 = new TQGridLayout( 0, 1, 1, 0, KDialog::spacingHint(), "layout2"); 

    TextLabel2 = new TQLabel( this, "TextLabel2" );
    TextLabel2->setEnabled( false );

    layout2->addWidget( TextLabel2, 0, 0 );

    _ksplashDisplay = new TQComboBox( false, this, "_ksplashDisplay" );
    _ksplashDisplay->setEnabled( false );

    layout2->addWidget( _ksplashDisplay, 1, 1 );

    TextLabel2_2 = new TQLabel( this, "TextLabel2_2" );
    TextLabel2_2->setEnabled( false );

    layout2->addWidget( TextLabel2_2, 1, 0 );

    _unmanagedDisplay = new TQComboBox( false, this, "_unmanagedDisplay" );
    _unmanagedDisplay->setEnabled( false );

    layout2->addWidget( _unmanagedDisplay, 0, 1 );

    XineramaWidgetLayout->addMultiCellLayout( layout2, 2, 2, 0, 1 );
    languageChange();
    resize( TQSize(658, 389).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( _enableXinerama, TQ_SIGNAL( toggled(bool) ), _enableResistance, TQ_SLOT( setEnabled(bool) ) );
    connect( _enableXinerama, TQ_SIGNAL( toggled(bool) ), _enablePlacement, TQ_SLOT( setEnabled(bool) ) );
    connect( _enableXinerama, TQ_SIGNAL( toggled(bool) ), _enableMaximize, TQ_SLOT( setEnabled(bool) ) );
    connect( _enableXinerama, TQ_SIGNAL( toggled(bool) ), TextLabel2, TQ_SLOT( setEnabled(bool) ) );
    connect( _enableXinerama, TQ_SIGNAL( toggled(bool) ), _unmanagedDisplay, TQ_SLOT( setEnabled(bool) ) );
    connect( _enableXinerama, TQ_SIGNAL( clicked() ), this, TQ_SLOT( emitConfigChanged() ) );
    connect( _enableResistance, TQ_SIGNAL( clicked() ), this, TQ_SLOT( emitConfigChanged() ) );
    connect( _enablePlacement, TQ_SIGNAL( clicked() ), this, TQ_SLOT( emitConfigChanged() ) );
    connect( _enableMaximize, TQ_SIGNAL( clicked() ), this, TQ_SLOT( emitConfigChanged() ) );
    connect( _unmanagedDisplay, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( emitConfigChanged() ) );
    connect( _enableXinerama, TQ_SIGNAL( toggled(bool) ), TextLabel2_2, TQ_SLOT( setEnabled(bool) ) );
    connect( _enableXinerama, TQ_SIGNAL( toggled(bool) ), _ksplashDisplay, TQ_SLOT( setEnabled(bool) ) );
    connect( _ksplashDisplay, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( emitConfigChanged() ) );
    connect( _enableFullscreen, TQ_SIGNAL( clicked() ), this, TQ_SLOT( emitConfigChanged() ) );
    connect( _enableXinerama, TQ_SIGNAL( toggled(bool) ), _enableFullscreen, TQ_SLOT( setEnabled(bool) ) );

    // buddies
    TextLabel2->setBuddy( _unmanagedDisplay );
    TextLabel2_2->setBuddy( _unmanagedDisplay );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void XineramaWidget::languageChange()
{
    headTable->horizontalHeader()->setLabel( 0, tr2i18n( "X Coordinate" ) );
    headTable->horizontalHeader()->setLabel( 1, tr2i18n( "Y Coordinate" ) );
    headTable->horizontalHeader()->setLabel( 2, tr2i18n( "Width" ) );
    headTable->horizontalHeader()->setLabel( 3, tr2i18n( "Height" ) );
    ButtonGroup1->setTitle( tr2i18n( "Multiple Monitor Support" ) );
    _enableXinerama->setText( tr2i18n( "Enable multiple monitor virtual desktop support" ) );
    _enableResistance->setText( tr2i18n( "Enable multiple monitor window resistance support" ) );
    _enablePlacement->setText( tr2i18n( "Enable multiple monitor window placement support" ) );
    _enableMaximize->setText( tr2i18n( "Enable multiple monitor window maximize support" ) );
    _enableFullscreen->setText( tr2i18n( "Enable multiple monitor window fullscreen support" ) );
    _identify->setText( tr2i18n( "&Identify All Displays" ) );
    TextLabel2->setText( tr2i18n( "Show unmanaged windows on:" ) );
    TextLabel2_2->setText( tr2i18n( "Show TDE splash screen on:" ) );
}

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

TQMetaObject *XineramaWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_XineramaWidget( "XineramaWidget", &XineramaWidget::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* XineramaWidget::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 = {"emitConfigChanged", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "emitConfigChanged()", &slot_1, TQMetaData::Private }
    };
    static const TQUMethod signal_0 = {"configChanged", 0, 0 };
    static const TQMetaData signal_tbl[] = {
	{ "configChanged()", &signal_0, TQMetaData::Public }
    };
    metaObj = TQMetaObject::new_metaobject(
	"XineramaWidget", parentObject,
	slot_tbl, 2,
	signal_tbl, 1,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_XineramaWidget.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

// TQ_SIGNAL configChanged
void XineramaWidget::configChanged()
{
    activate_signal( staticMetaObject()->signalOffset() + 0 );
}

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

bool XineramaWidget::tqt_emit( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: configChanged(); break;
    default:
	return TQWidget::tqt_emit(_id,_o);
    }
    return true;
}
#ifndef TQT_NO_PROPERTIES

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

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