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

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

#include "uichooser.h"

#include <ntqvariant.h>
#include <kdialog.h>
#include <ntqpushbutton.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqgroupbox.h>
#include <ntqcheckbox.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

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

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

    AlwaysShowTabs = new TQRadioButton( TabModeGroup, "AlwaysShowTabs" );
    AlwaysShowTabs->setChecked( true );
    TabModeGroupLayout->addWidget( AlwaysShowTabs );

    NeverShowTabs = new TQRadioButton( TabModeGroup, "NeverShowTabs" );
    TabModeGroupLayout->addWidget( NeverShowTabs );
    layout1->addWidget( TabModeGroup );

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

    DoNotCloseOnHover = new TQRadioButton( HoverCloseGroup, "DoNotCloseOnHover" );
    DoNotCloseOnHover->setChecked( true );
    HoverCloseGroupLayout->addWidget( DoNotCloseOnHover );

    DoCloseOnHover = new TQRadioButton( HoverCloseGroup, "DoCloseOnHover" );
    HoverCloseGroupLayout->addWidget( DoCloseOnHover );
    layout1->addWidget( HoverCloseGroup );
    UIChooserLayout->addLayout( layout1 );

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

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

    IconsOnly = new TQRadioButton( IDEAlButtonGroup, "IconsOnly" );
    IDEAlButtonGroupLayout->addWidget( IconsOnly );

    TextOnly = new TQRadioButton( IDEAlButtonGroup, "TextOnly" );
    TextOnly->setChecked( true );
    IDEAlButtonGroupLayout->addWidget( TextOnly );

    TextAndIcons = new TQRadioButton( IDEAlButtonGroup, "TextAndIcons" );
    IDEAlButtonGroupLayout->addWidget( TextAndIcons );
    layout2->addWidget( IDEAlButtonGroup );

    TabbedBrowsingGroup = new TQGroupBox( this, "TabbedBrowsingGroup" );
    TabbedBrowsingGroup->setColumnLayout(0, TQt::Vertical );
    TabbedBrowsingGroup->layout()->setSpacing( KDialog::spacingHint() );
    TabbedBrowsingGroup->layout()->setMargin( KDialog::marginHint() );
    TabbedBrowsingGroupLayout = new TQGridLayout( TabbedBrowsingGroup->layout() );
    TabbedBrowsingGroupLayout->setAlignment( TQt::AlignTop );

    OpenNewTabAfterCurrent = new TQCheckBox( TabbedBrowsingGroup, "OpenNewTabAfterCurrent" );

    TabbedBrowsingGroupLayout->addWidget( OpenNewTabAfterCurrent, 0, 0 );

    ShowTabIcons = new TQCheckBox( TabbedBrowsingGroup, "ShowTabIcons" );

    TabbedBrowsingGroupLayout->addWidget( ShowTabIcons, 1, 0 );

    ShowCloseTabsButton = new TQCheckBox( TabbedBrowsingGroup, "ShowCloseTabsButton" );

    TabbedBrowsingGroupLayout->addWidget( ShowCloseTabsButton, 2, 0 );
    layout2->addWidget( TabbedBrowsingGroup );
    UIChooserLayout->addLayout( layout2 );

    textLabel1 = new TQLabel( this, "textLabel1" );
    textLabel1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)3, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) );
    textLabel1->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignCenter ) );
    UIChooserLayout->addWidget( textLabel1 );
    languageChange();
    resize( TQSize(540, 529).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( AlwaysShowTabs, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( maybeEnableCloseOnHover(bool) ) );
    connect( NeverShowTabs, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( maybeEnableCloseOnHover(bool) ) );
    connect( ShowTabIcons, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( maybeEnableCloseOnHover(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void UIChooser::languageChange()
{
    setCaption( tr2i18n( "UIChooser" ) );
    TabModeGroup->setTitle( tr2i18n( "Use Tabs" ) );
    TQWhatsThis::add( TabModeGroup, tr2i18n( "Some prefer not to have a tab bar and switch between documents using other means. Kate is one example of this." ) );
    AlwaysShowTabs->setText( tr2i18n( "Al&ways" ) );
    NeverShowTabs->setText( tr2i18n( "Ne&ver" ) );
    HoverCloseGroup->setTitle( tr2i18n( "Use Close on Hover" ) );
    TQWhatsThis::add( HoverCloseGroup, tr2i18n( "The document tab can optionally be used to close the document, by clicking on the tab icon." ) );
    DoNotCloseOnHover->setText( tr2i18n( "No" ) );
    DoCloseOnHover->setText( tr2i18n( "&Yes" ) );
    IDEAlButtonGroup->setTitle( tr2i18n( "Toolview Tab Layout" ) );
    TQWhatsThis::add( IDEAlButtonGroup, tr2i18n( "Three different modes for the IDEAl toolview tabs. \"Text and icons\" is the most informative, but takes a lot of space. Those with a smaller screen will typically want \"Icons\"." ) );
    IconsOnly->setText( tr2i18n( "Icons" ) );
    TextOnly->setText( tr2i18n( "Te&xt" ) );
    TextAndIcons->setText( tr2i18n( "Text and icons" ) );
    TabbedBrowsingGroup->setTitle( tr2i18n( "Tabbed Browsing" ) );
    TQWhatsThis::add( TabbedBrowsingGroup, tr2i18n( "Some extra options for the document tabbar." ) );
    OpenNewTabAfterCurrent->setText( tr2i18n( "Open &new tab after current tab" ) );
    ShowTabIcons->setText( tr2i18n( "&Show icons on document tabs" ) );
    ShowCloseTabsButton->setText( tr2i18n( "Show close &button in tab bar" ) );
    textLabel1->setText( tr2i18n( "Note: Changes will take effect after TDevelop is restarted" ) );
}

void UIChooser::maybeEnableCloseOnHover(bool)
{
    tqWarning( "UIChooser::maybeEnableCloseOnHover(bool): Not implemented yet" );
}

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

TQMetaObject *UIChooser::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_UIChooser( "UIChooser", &UIChooser::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* UIChooser::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 TQUParameter param_slot_1[] = {
	{ 0, &static_QUType_bool, 0, TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"maybeEnableCloseOnHover", 1, param_slot_1 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "maybeEnableCloseOnHover(bool)", &slot_1, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"UIChooser", parentObject,
	slot_tbl, 2,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_UIChooser.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool UIChooser::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: maybeEnableCloseOnHover((bool)static_QUType_bool.get(_o+1)); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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