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

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

#include "editorpreferences.h"

#include <ntqvariant.h>
#include <kcolorbutton.h>
#include <toolselectionwidget.h>
#include <ntqpushbutton.h>
#include <ntqtabwidget.h>
#include <ntqframe.h>
#include <ntqcheckbox.h>
#include <ntqgroupbox.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "editorpreferences.ui.h"

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

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

    tab = new TQWidget( tabWidget2, "tab" );
    tabLayout = new TQVBoxLayout( tab, 11, 6, "tabLayout"); 

    frame6 = new TQFrame( tab, "frame6" );
    frame6->setFrameShape( TQFrame::StyledPanel );
    frame6->setFrameShadow( TQFrame::Raised );
    frame6Layout = new TQHBoxLayout( frame6, 11, 6, "frame6Layout"); 

    kcfg_AutoUnsetFuzzy = new TQCheckBox( frame6, "kcfg_AutoUnsetFuzzy" );
    frame6Layout->addWidget( kcfg_AutoUnsetFuzzy );

    kcfg_CleverEditing = new TQCheckBox( frame6, "kcfg_CleverEditing" );
    frame6Layout->addWidget( kcfg_CleverEditing );
    tabLayout->addWidget( frame6 );

    groupBox3 = new TQGroupBox( tab, "groupBox3" );
    groupBox3->setColumnLayout(0, TQt::Vertical );
    groupBox3->layout()->setSpacing( 6 );
    groupBox3->layout()->setMargin( 11 );
    groupBox3Layout = new TQVBoxLayout( groupBox3->layout() );
    groupBox3Layout->setAlignment( TQt::AlignTop );

    _kcfg_AutoCheckTools = new ToolSelectionWidget( groupBox3, "_kcfg_AutoCheckTools" );
    groupBox3Layout->addWidget( _kcfg_AutoCheckTools );

    kcfg_BeepOnError = new TQCheckBox( groupBox3, "kcfg_BeepOnError" );
    groupBox3Layout->addWidget( kcfg_BeepOnError );

    kcfg_AutoCheckColorError = new TQCheckBox( groupBox3, "kcfg_AutoCheckColorError" );
    groupBox3Layout->addWidget( kcfg_AutoCheckColorError );
    tabLayout->addWidget( groupBox3 );
    spacer8 = new TQSpacerItem( 20, 21, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout->addItem( spacer8 );
    tabWidget2->insertTab( tab, TQString::fromLatin1("") );

    tab_2 = new TQWidget( tabWidget2, "tab_2" );
    tabLayout_2 = new TQVBoxLayout( tab_2, 11, 6, "tabLayout_2"); 

    frame3 = new TQFrame( tab_2, "frame3" );
    frame3->setFrameShape( TQFrame::StyledPanel );
    frame3->setFrameShadow( TQFrame::Raised );
    frame3Layout = new TQGridLayout( frame3, 1, 1, 11, 6, "frame3Layout"); 

    kcfg_HighlightSyntax = new TQCheckBox( frame3, "kcfg_HighlightSyntax" );

    frame3Layout->addWidget( kcfg_HighlightSyntax, 0, 0 );

    kcfg_HighlightBackground = new TQCheckBox( frame3, "kcfg_HighlightBackground" );

    frame3Layout->addWidget( kcfg_HighlightBackground, 1, 0 );

    kcfg_WhitespacePoints = new TQCheckBox( frame3, "kcfg_WhitespacePoints" );

    frame3Layout->addWidget( kcfg_WhitespacePoints, 0, 1 );

    kcfg_EnableQuotes = new TQCheckBox( frame3, "kcfg_EnableQuotes" );

    frame3Layout->addWidget( kcfg_EnableQuotes, 1, 1 );
    tabLayout_2->addWidget( frame3 );

    buttonGroup1 = new TQButtonGroup( tab_2, "buttonGroup1" );
    buttonGroup1->setColumnLayout(0, TQt::Vertical );
    buttonGroup1->layout()->setSpacing( 6 );
    buttonGroup1->layout()->setMargin( 11 );
    buttonGroup1Layout = new TQHBoxLayout( buttonGroup1->layout() );
    buttonGroup1Layout->setAlignment( TQt::AlignTop );

    kcfg_LedInStatusbar = new TQRadioButton( buttonGroup1, "kcfg_LedInStatusbar" );
    buttonGroup1Layout->addWidget( kcfg_LedInStatusbar );

    radioButton2 = new TQRadioButton( buttonGroup1, "radioButton2" );
    radioButton2->setChecked( true );
    buttonGroup1Layout->addWidget( radioButton2 );
    spacer1 = new TQSpacerItem( 51, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    buttonGroup1Layout->addItem( spacer1 );

    textLabel7 = new TQLabel( buttonGroup1, "textLabel7" );
    buttonGroup1Layout->addWidget( textLabel7 );

    kcfg_LedColor = new KColorButton( buttonGroup1, "kcfg_LedColor" );
    buttonGroup1Layout->addWidget( kcfg_LedColor );
    tabLayout_2->addWidget( buttonGroup1 );
    spacer2 = new TQSpacerItem( 20, 29, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    tabLayout_2->addItem( spacer2 );
    tabWidget2->insertTab( tab_2, TQString::fromLatin1("") );
    EditorPreferencesLayout->addWidget( tabWidget2 );
    languageChange();
    resize( TQSize(627, 480).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kcfg_LedInStatusbar, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( ledWarning(bool) ) );
    connect( radioButton2, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( ledWarning(bool) ) );
    connect( kcfg_LedInStatusbar, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( toggleOther(bool) ) );

    // buddies
    textLabel7->setBuddy( kcfg_LedColor );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void EditorPreferences::languageChange()
{
    kcfg_AutoUnsetFuzzy->setText( tr2i18n( "A&utomatically unset fuzzy status" ) );
    TQWhatsThis::add( kcfg_AutoUnsetFuzzy, tr2i18n( "<qt><p><b>Automatically unset fuzzy status</b></p>\n"
"<p>If this is activated and you are editing a fuzzy entry, the fuzzy status is automatically\n"
"unset (this means the string <i>, fuzzy</i>\n"
"is removed from the entry's comment).</p></qt>" ) );
    kcfg_CleverEditing->setText( tr2i18n( "Use cle&ver editing" ) );
    TQWhatsThis::add( kcfg_CleverEditing, tr2i18n( "<qt><p><b>Use clever editing</b></p>\n"
"<p>Check this to make typing text more comfortable and let \n"
"KBabel take care of some special characters that have to \n"
"be quoted. For example typing '\\\"' will result in \n"
"'\\\\\\\"', pressing Return will automatically add whitespace \n"
"at the end of the line, pressing Shift+Return will add \n"
"'\\\\n' at the end of the line.</p>\n"
"<p>Note that this is just a hint: it is still possible to \n"
"generate syntactically incorrect text.</p></qt>" ) );
    groupBox3->setTitle( tr2i18n( "Automatic Checks" ) );
    TQWhatsThis::add( groupBox3, tr2i18n( "<qt><p><b>Error recognition</b></p>\n"
"<p>Here you can set how to show that an error occurred. \n"
"<b>Beep on error</b> beeps and <b>Change text color on error\n"
"</b> changes the color of the translated text. If none is \n"
"activated, you will still see a message in the statusbar.\n"
"</p></qt>" ) );
    kcfg_BeepOnError->setText( tr2i18n( "&Beep on error" ) );
    kcfg_AutoCheckColorError->setText( tr2i18n( "Change te&xt color on error" ) );
    tabWidget2->changeTab( tab, tr2i18n( "&General" ) );
    kcfg_HighlightSyntax->setText( tr2i18n( "H&ighlight syntax" ) );
    kcfg_HighlightBackground->setText( tr2i18n( "Highlight backgrou&nd" ) );
    kcfg_WhitespacePoints->setText( tr2i18n( "Mark &whitespaces with points" ) );
    kcfg_EnableQuotes->setText( tr2i18n( "&Show surrounding quotes" ) );
    buttonGroup1->setTitle( tr2i18n( "Status LEDs" ) );
    TQWhatsThis::add( buttonGroup1, tr2i18n( "<qt><p><b>Status LEDs</b></p>\n"
"<p>Choose here where the status LEDs are displayed and what color they have.</p></qt>" ) );
    kcfg_LedInStatusbar->setText( tr2i18n( "Display in stat&usbar" ) );
    radioButton2->setText( tr2i18n( "Display in edi&tor" ) );
    textLabel7->setText( tr2i18n( "Colo&r:" ) );
    kcfg_LedColor->setText( TQString::null );
    tabWidget2->changeTab( tab_2, tr2i18n( "A&ppearance" ) );
}

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

TQMetaObject *EditorPreferences::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_EditorPreferences( "EditorPreferences", &EditorPreferences::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* EditorPreferences::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 TQUParameter param_slot_0[] = {
	{ "show", &static_QUType_bool, 0, TQUParameter::In }
    };
    static const TQUMethod slot_0 = {"ledWarning", 1, param_slot_0 };
    static const TQUParameter param_slot_1[] = {
	{ "other", &static_QUType_bool, 0, TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"toggleOther", 1, param_slot_1 };
    static const TQUMethod slot_2 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "ledWarning(bool)", &slot_0, TQMetaData::Public },
	{ "toggleOther(bool)", &slot_1, TQMetaData::Public },
	{ "languageChange()", &slot_2, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"EditorPreferences", parentObject,
	slot_tbl, 3,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_EditorPreferences.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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