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

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

#include "mimewarningdialog.h"

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

/*
 *  Constructs a MimeWarningDialog 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.
 */
MimeWarningDialog::MimeWarningDialog( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "MimeWarningDialog" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)1, 0, 0, sizePolicy().hasHeightForWidth() ) );
    MimeWarningDialogLayout = new TQVBoxLayout( this, 11, 6, "MimeWarningDialogLayout"); 

    text1 = new TQLabel( this, "text1" );
    text1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, text1->sizePolicy().hasHeightForWidth() ) );
    MimeWarningDialogLayout->addWidget( text1 );

    text2 = new KSqueezedTextLabel( this, "text2" );
    text2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, text2->sizePolicy().hasHeightForWidth() ) );
    MimeWarningDialogLayout->addWidget( text2 );

    text3 = new TQLabel( this, "text3" );
    text3->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, text3->sizePolicy().hasHeightForWidth() ) );
    MimeWarningDialogLayout->addWidget( text3 );

    buttonGroup1 = new TQButtonGroup( this, "buttonGroup1" );
    buttonGroup1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)7, 0, 0, buttonGroup1->sizePolicy().hasHeightForWidth() ) );
    buttonGroup1->setFrameShape( TQButtonGroup::GroupBoxPanel );
    buttonGroup1->setFrameShadow( TQButtonGroup::Sunken );
    buttonGroup1->setLineWidth( 1 );
    buttonGroup1->setColumnLayout(0, TQt::Vertical );
    buttonGroup1->layout()->setSpacing( 6 );
    buttonGroup1->layout()->setMargin( 11 );
    buttonGroup1Layout = new TQVBoxLayout( buttonGroup1->layout() );
    buttonGroup1Layout->setAlignment( TQt::AlignTop );

    open_with_kde = new TQRadioButton( buttonGroup1, "open_with_kde" );
    open_with_kde->setChecked( true );
    buttonGroup1Layout->addWidget( open_with_kde );

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

    layout3 = new TQHBoxLayout( 0, 0, 6, "layout3"); 
    spacer2 = new TQSpacerItem( 24, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    layout3->addItem( spacer2 );

    always_open_as_text = new TQCheckBox( buttonGroup1, "always_open_as_text" );
    always_open_as_text->setEnabled( false );
    layout3->addWidget( always_open_as_text );
    spacer3 = new TQSpacerItem( 41, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout3->addItem( spacer3 );
    buttonGroup1Layout->addLayout( layout3 );
    MimeWarningDialogLayout->addWidget( buttonGroup1 );

    layout1 = new TQHBoxLayout( 0, 0, 6, "layout1"); 
    spacer1 = new TQSpacerItem( 101, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout1->addItem( spacer1 );

    pushButton1 = new TQPushButton( this, "pushButton1" );
    layout1->addWidget( pushButton1 );

    pushButton2 = new TQPushButton( this, "pushButton2" );
    layout1->addWidget( pushButton2 );
    MimeWarningDialogLayout->addLayout( layout1 );
    languageChange();
    resize( TQSize(404, 248).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( open_with_kde, TQ_SIGNAL( toggled(bool) ), always_open_as_text, TQ_SLOT( setDisabled(bool) ) );
    connect( open_as_text, TQ_SIGNAL( toggled(bool) ), always_open_as_text, TQ_SLOT( setEnabled(bool) ) );
    connect( pushButton2, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( pushButton1, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void MimeWarningDialog::languageChange()
{
    setCaption( tr2i18n( "Could Not Open File" ) );
    text1->setText( tr2i18n( "TDevelop could not open" ) );
    text2->setText( tr2i18n( "Some URL" ) );
    text3->setText( tr2i18n( "<qt>No suitable viewer was found for the <b>%1</b> mimetype.</qt>" ) );
    buttonGroup1->setTitle( tr2i18n( "What Do You Want to Do?" ) );
    open_with_kde->setText( tr2i18n( "Let TDE find a suitable program" ) );
    open_as_text->setText( tr2i18n( "Open it in TDevelop as plain text" ) );
    always_open_as_text->setText( tr2i18n( "Always open this mimetype as text" ) );
    pushButton1->setText( tr2i18n( "&OK" ) );
    pushButton2->setText( tr2i18n( "&Cancel" ) );
}

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

TQMetaObject *MimeWarningDialog::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_MimeWarningDialog( "MimeWarningDialog", &MimeWarningDialog::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* MimeWarningDialog::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 TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"MimeWarningDialog", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_MimeWarningDialog.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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