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

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

#include "preferences.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqtabwidget.h>
#include <ntqwidget.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqcheckbox.h>
#include <ntqgroupbox.h>
#include <ntqspinbox.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqtoolbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "styledbutton.h"

/*
 *  Constructs a Preferences 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.
 */
Preferences::Preferences( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "Preferences" );
    setSizeGripEnabled( true );
    PreferencesLayout = new TQVBoxLayout( this, 11, 6, "PreferencesLayout"); 

    tabWidget = new TQTabWidget( this, "tabWidget" );

    pageGeneral = new TQWidget( tabWidget, "pageGeneral" );
    pageGeneralLayout = new TQGridLayout( pageGeneral, 1, 1, 11, 6, "pageGeneralLayout"); 

    ButtonGroup1 = new TQButtonGroup( pageGeneral, "ButtonGroup1" );
    ButtonGroup1->setColumnLayout(0, TQt::Vertical );
    ButtonGroup1->layout()->setSpacing( 6 );
    ButtonGroup1->layout()->setMargin( 11 );
    ButtonGroup1Layout = new TQGridLayout( ButtonGroup1->layout() );
    ButtonGroup1Layout->setAlignment( TQt::AlignTop );

    buttonColor = new StyledButton( ButtonGroup1, "buttonColor" );
    buttonColor->setEnabled( false );
    buttonColor->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, buttonColor->sizePolicy().hasHeightForWidth() ) );
    buttonColor->setFocusPolicy( StyledButton::TabFocus );
    buttonColor->setProperty( "scale", TQVariant( false ) );

    ButtonGroup1Layout->addWidget( buttonColor, 0, 1 );

    radioColor = new TQRadioButton( ButtonGroup1, "radioColor" );
    radioColor->setFocusPolicy( TQRadioButton::TabFocus );

    ButtonGroup1Layout->addWidget( radioColor, 0, 0 );

    radioPixmap = new TQRadioButton( ButtonGroup1, "radioPixmap" );
    radioPixmap->setChecked( true );

    ButtonGroup1Layout->addWidget( radioPixmap, 1, 0 );

    buttonPixmap = new StyledButton( ButtonGroup1, "buttonPixmap" );
    buttonPixmap->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, buttonPixmap->sizePolicy().hasHeightForWidth() ) );
    buttonPixmap->setFocusPolicy( StyledButton::TabFocus );
    buttonPixmap->setProperty( "scale", TQVariant( false ) );

    ButtonGroup1Layout->addWidget( buttonPixmap, 1, 1 );

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

    checkBoxShowGrid = new TQCheckBox( pageGeneral, "checkBoxShowGrid" );
    checkBoxShowGrid->setChecked( true );

    pageGeneralLayout->addWidget( checkBoxShowGrid, 0, 1 );

    GroupBox1 = new TQGroupBox( pageGeneral, "GroupBox1" );
    GroupBox1->setColumnLayout(0, TQt::Vertical );
    GroupBox1->layout()->setSpacing( 6 );
    GroupBox1->layout()->setMargin( 11 );
    GroupBox1Layout = new TQVBoxLayout( GroupBox1->layout() );
    GroupBox1Layout->setAlignment( TQt::AlignTop );

    checkBoxGrid = new TQCheckBox( GroupBox1, "checkBoxGrid" );
    checkBoxGrid->setChecked( true );
    GroupBox1Layout->addWidget( checkBoxGrid );

    Layout4 = new TQGridLayout( 0, 1, 1, 0, 6, "Layout4"); 

    spinGridX = new TQSpinBox( GroupBox1, "spinGridX" );
    spinGridX->setMaxValue( 50 );
    spinGridX->setMinValue( 5 );
    spinGridX->setValue( 10 );

    Layout4->addWidget( spinGridX, 0, 1 );

    spinGridY = new TQSpinBox( GroupBox1, "spinGridY" );
    spinGridY->setMaxValue( 50 );
    spinGridY->setMinValue( 5 );
    spinGridY->setValue( 10 );

    Layout4->addWidget( spinGridY, 1, 1 );

    Label1 = new TQLabel( GroupBox1, "Label1" );

    Layout4->addWidget( Label1, 0, 0 );

    Label1_2 = new TQLabel( GroupBox1, "Label1_2" );

    Layout4->addWidget( Label1_2, 1, 0 );
    GroupBox1Layout->addLayout( Layout4 );

    pageGeneralLayout->addWidget( GroupBox1, 1, 1 );
    Spacer3 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    pageGeneralLayout->addItem( Spacer3, 3, 0 );

    GroupBox5 = new TQGroupBox( pageGeneral, "GroupBox5" );
    GroupBox5->setColumnLayout(0, TQt::Vertical );
    GroupBox5->layout()->setSpacing( 6 );
    GroupBox5->layout()->setMargin( 11 );
    GroupBox5Layout = new TQVBoxLayout( GroupBox5->layout() );
    GroupBox5Layout->setAlignment( TQt::AlignTop );

    checkBoxWorkspace = new TQCheckBox( GroupBox5, "checkBoxWorkspace" );
    checkBoxWorkspace->setChecked( true );
    GroupBox5Layout->addWidget( checkBoxWorkspace );

    checkBoxSplash = new TQCheckBox( GroupBox5, "checkBoxSplash" );
    checkBoxSplash->setChecked( true );
    GroupBox5Layout->addWidget( checkBoxSplash );

    checkAutoEdit = new TQCheckBox( GroupBox5, "checkAutoEdit" );
    checkAutoEdit->setChecked( true );
    GroupBox5Layout->addWidget( checkAutoEdit );

    Label3 = new TQLabel( GroupBox5, "Label3" );
    GroupBox5Layout->addWidget( Label3 );

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

    editDocPath = new TQLineEdit( GroupBox5, "editDocPath" );
    Layout6->addWidget( editDocPath );

    buttonDocPath = new TQToolButton( GroupBox5, "buttonDocPath" );
    buttonDocPath->setFocusPolicy( TQToolButton::TabFocus );
    Layout6->addWidget( buttonDocPath );
    GroupBox5Layout->addLayout( Layout6 );

    pageGeneralLayout->addWidget( GroupBox5, 2, 0 );

    GroupBox3 = new TQGroupBox( pageGeneral, "GroupBox3" );
    GroupBox3->setColumnLayout(0, TQt::Vertical );
    GroupBox3->layout()->setSpacing( 6 );
    GroupBox3->layout()->setMargin( 11 );
    GroupBox3Layout = new TQVBoxLayout( GroupBox3->layout() );
    GroupBox3Layout->setAlignment( TQt::AlignTop );

    checkBoxBigIcons = new TQCheckBox( GroupBox3, "checkBoxBigIcons" );
    GroupBox3Layout->addWidget( checkBoxBigIcons );

    checkBoxTextLabels = new TQCheckBox( GroupBox3, "checkBoxTextLabels" );
    GroupBox3Layout->addWidget( checkBoxTextLabels );

    pageGeneralLayout->addWidget( GroupBox3, 2, 1 );
    tabWidget->insertTab( pageGeneral, TQString::fromLatin1("") );
    PreferencesLayout->addWidget( tabWidget );

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

    helpButton = new TQPushButton( this, "helpButton" );
    helpButton->setAutoDefault( true );
    Layout6_2->addWidget( helpButton );
    Horizontal_Spacing2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout6_2->addItem( Horizontal_Spacing2 );

    buttonOk = new TQPushButton( this, "buttonOk" );
    buttonOk->setAutoDefault( true );
    buttonOk->setDefault( true );
    Layout6_2->addWidget( buttonOk );

    buttonCancel = new TQPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( true );
    buttonCancel->setDefault( false );
    Layout6_2->addWidget( buttonCancel );
    PreferencesLayout->addLayout( Layout6_2 );
    languageChange();
    resize( TQSize(467, 404).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonOk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( buttonCancel, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( checkBoxGrid, TQ_SIGNAL( toggled(bool) ), spinGridX, TQ_SLOT( setEnabled(bool) ) );
    connect( checkBoxGrid, TQ_SIGNAL( toggled(bool) ), spinGridY, TQ_SLOT( setEnabled(bool) ) );
    connect( radioColor, TQ_SIGNAL( toggled(bool) ), buttonColor, TQ_SLOT( setEnabled(bool) ) );
    connect( radioPixmap, TQ_SIGNAL( toggled(bool) ), buttonPixmap, TQ_SLOT( setEnabled(bool) ) );
    connect( checkBoxShowGrid, TQ_SIGNAL( toggled(bool) ), GroupBox1, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( buttonOk, buttonCancel );
    setTabOrder( buttonCancel, tabWidget );
    setTabOrder( tabWidget, radioColor );
    setTabOrder( radioColor, radioPixmap );
    setTabOrder( radioPixmap, buttonColor );
    setTabOrder( buttonColor, buttonPixmap );
    setTabOrder( buttonPixmap, checkBoxShowGrid );
    setTabOrder( checkBoxShowGrid, checkBoxGrid );
    setTabOrder( checkBoxGrid, spinGridX );
    setTabOrder( spinGridX, spinGridY );
    setTabOrder( spinGridY, checkBoxWorkspace );
    setTabOrder( checkBoxWorkspace, checkBoxSplash );
    setTabOrder( checkBoxSplash, checkAutoEdit );
    setTabOrder( checkAutoEdit, editDocPath );
    setTabOrder( editDocPath, buttonDocPath );
    setTabOrder( buttonDocPath, checkBoxBigIcons );
    setTabOrder( checkBoxBigIcons, checkBoxTextLabels );
    setTabOrder( checkBoxTextLabels, helpButton );

    // buddies
    Label1->setBuddy( spinGridX );
    Label1_2->setBuddy( spinGridY );
    Label3->setBuddy( editDocPath );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void Preferences::languageChange()
{
    setCaption( tr2i18n( "Preferences" ) );
    TQWhatsThis::add( this, tr2i18n( "<b>Preferences</b><p>Change the preferences of TQt Designer. There is always one tab with general preferences. There may be additional tabs, depending on which plugins are installed.</p>" ) );
    ButtonGroup1->setTitle( tr2i18n( "Backgro&und" ) );
    TQToolTip::add( buttonColor, tr2i18n( "Choose a color" ) );
    TQWhatsThis::add( buttonColor, tr2i18n( "Select a color in the color dialog." ) );
    radioColor->setText( tr2i18n( "Co&lor" ) );
    TQToolTip::add( radioColor, tr2i18n( "Use a background color" ) );
    TQWhatsThis::add( radioColor, tr2i18n( "Use a background color." ) );
    radioPixmap->setText( tr2i18n( "&Pixmap" ) );
    TQToolTip::add( radioPixmap, tr2i18n( "Use a background pixmap" ) );
    TQWhatsThis::add( radioPixmap, tr2i18n( "Use a background pixmap." ) );
    TQToolTip::add( buttonPixmap, tr2i18n( "Select a pixmap" ) );
    TQWhatsThis::add( buttonPixmap, tr2i18n( "Choose a pixmap file." ) );
    checkBoxShowGrid->setText( tr2i18n( "Show &grid" ) );
    TQToolTip::add( checkBoxShowGrid, tr2i18n( "Show Grid" ) );
    TQWhatsThis::add( checkBoxShowGrid, tr2i18n( "<b>Customize the grid appearance for all forms.</b><p>When <b>Show Grid</b> is checked, all forms show a grid.</p>" ) );
    GroupBox1->setTitle( tr2i18n( "Gr&id" ) );
    TQWhatsThis::add( GroupBox1, TQString::null );
    checkBoxGrid->setText( tr2i18n( "Sn&ap to grid" ) );
    TQToolTip::add( checkBoxGrid, tr2i18n( "Snap to the grid" ) );
    TQWhatsThis::add( checkBoxGrid, tr2i18n( "<b>Customize the grid-settings for all forms.</b><p>When <b>Snap to Grid</b> is checked, the widgets snap to the grid using the the X/Y resolution.</p>" ) );
    TQToolTip::add( spinGridX, tr2i18n( "Grid resolution" ) );
    TQWhatsThis::add( spinGridX, tr2i18n( "<b>Customize the grid-settings for all forms.</b><p>When <b>Show Grid</b> is checked, a grid is shown on all forms using the X/Y resolution.</p>" ) );
    TQToolTip::add( spinGridY, tr2i18n( "Grid resolution" ) );
    TQWhatsThis::add( spinGridY, tr2i18n( "<b>Customize the grid-settings for all forms.</b><p>When <b>Show Grid</b> is checked, a grid is shown on all forms using the X/Y resolution.</p>" ) );
    Label1->setText( tr2i18n( "Grid-&X:" ) );
    Label1_2->setText( tr2i18n( "Grid-&Y:" ) );
    GroupBox5->setTitle( tr2i18n( "Ge&neral" ) );
    checkBoxWorkspace->setText( tr2i18n( "Restore last &workspace on startup" ) );
    TQToolTip::add( checkBoxWorkspace, tr2i18n( "Restore last workspace" ) );
    TQWhatsThis::add( checkBoxWorkspace, tr2i18n( "The current workspace settings will be restored the next time you start TQt Designer if this option is checked." ) );
    checkBoxSplash->setText( tr2i18n( "Show &splash screen on startup" ) );
    TQToolTip::add( checkBoxSplash, tr2i18n( "Show Splashscreen" ) );
    TQWhatsThis::add( checkBoxSplash, tr2i18n( "A splash screen is displayed when starting TQt Designer if this option is checked." ) );
    checkAutoEdit->setText( tr2i18n( "Disable data&base auto-edit in preview" ) );
    Label3->setText( tr2i18n( "&Documentation path:" ) );
    TQWhatsThis::add( editDocPath, tr2i18n( "<b>Enter the path to the documentation.</b><p>You may provide an $environment variable as the first part of the pathname.</p>" ) );
    buttonDocPath->setText( tr2i18n( "..." ) );
    TQToolTip::add( buttonDocPath, tr2i18n( "Select path" ) );
    TQWhatsThis::add( buttonDocPath, tr2i18n( "Look for the documentation path." ) );
    GroupBox3->setTitle( tr2i18n( "&Toolbars" ) );
    checkBoxBigIcons->setText( tr2i18n( "Show &big icons" ) );
    TQToolTip::add( checkBoxBigIcons, tr2i18n( "Big Icons" ) );
    TQWhatsThis::add( checkBoxBigIcons, tr2i18n( "Big icons will be used in the toolbars if this is checked." ) );
    checkBoxTextLabels->setText( tr2i18n( "Show text lab&els" ) );
    TQToolTip::add( checkBoxTextLabels, tr2i18n( "Text Labels" ) );
    TQWhatsThis::add( checkBoxTextLabels, tr2i18n( "Text labels will be usin in the toolbars if this is checked." ) );
    tabWidget->changeTab( pageGeneral, tr2i18n( "General" ) );
    helpButton->setText( tr2i18n( "&Help" ) );
    buttonOk->setText( tr2i18n( "&OK" ) );
    TQWhatsThis::add( buttonOk, tr2i18n( "Close the dialog and apply all the changes." ) );
    buttonCancel->setText( tr2i18n( "&Cancel" ) );
    TQWhatsThis::add( buttonCancel, tr2i18n( "Close the dialog and discard any changes." ) );
}

void Preferences::init()
{
}

void Preferences::destroy()
{
}

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

TQMetaObject *Preferences::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_Preferences( "Preferences", &Preferences::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* Preferences::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 TQUMethod slot_1 = {"init", 0, 0 };
    static const TQUMethod slot_2 = {"destroy", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "init()", &slot_1, TQMetaData::Protected },
	{ "destroy()", &slot_2, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"Preferences", parentObject,
	slot_tbl, 3,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_Preferences.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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