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

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

#include "editchooser.h"

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

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

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

    EditorPart = new TQComboBox( false, GroupBox1, "EditorPart" );

    GroupBox1Layout->addWidget( EditorPart, 0, 0 );

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

    GroupBox1Layout->addWidget( TextLabel1, 1, 0 );
    EditChooserLayout->addWidget( GroupBox1 );

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

    nothing = new TQRadioButton( external_changes_group, "nothing" );
    nothing->setChecked( true );
    external_changes_groupLayout->addWidget( nothing );

    alert = new TQRadioButton( external_changes_group, "alert" );
    alert->setEnabled( true );
    external_changes_groupLayout->addWidget( alert );

    reload = new TQRadioButton( external_changes_group, "reload" );
    external_changes_groupLayout->addWidget( reload );
    EditChooserLayout->addWidget( external_changes_group );
    spacer2 = new TQSpacerItem( 20, 31, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    EditChooserLayout->addItem( spacer2 );
    languageChange();
    resize( TQSize(514, 383).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( EditorPart, TQ_SIGNAL( activated(const TQString&) ), this, TQ_SLOT( slotEditPartChanged(const TQString&) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void EditChooser::languageChange()
{
    GroupBox1->setTitle( tr2i18n( "&Embedded Editor" ) );
    TextLabel1->setText( tr2i18n( "<i>Note:</i> Changing the preferred editor will not affect\n"
"already open files." ) );
    external_changes_group->setTitle( tr2i18n( "On External Changes" ) );
    TQWhatsThis::add( external_changes_group, tr2i18n( "<p><b>Action to take when an open file is changed on disk</b></p>\n"
"<p><b>Do nothing</b> - The file will be marked as externally changed and the user will be asked to verify any attempt to overwrite it </p>\n"
"<p><b>Alert the user</b> - A dialog will alert the user that a file has changed and offer the user to reload the file</p>\n"
"<p><b>Automatically reload</b> - Any files that are not modified in memory are reloaded, and an alert is shown for any conflicts</p>" ) );
    nothing->setText( tr2i18n( "&Do nothing" ) );
    alert->setText( tr2i18n( "&Alert the user" ) );
    reload->setText( tr2i18n( "Automatically reload the file &if safe, alert the user if not" ) );
}

void EditChooser::slotEditPartChanged(const TQString&)
{
    tqWarning( "EditChooser::slotEditPartChanged(const TQString&): Not implemented yet" );
}

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

TQMetaObject *EditChooser::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_EditChooser( "EditChooser", &EditChooser::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

bool EditChooser::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: slotEditPartChanged((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 1: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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