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

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

#include "kjserrordlg.h"

#include <ntqvariant.h>
#include <kactivelabel.h>
#include <ntqpushbutton.h>
#include <ntqframe.h>
#include <ntqtextbrowser.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "kjserrordlg.ui.h"

/*
 *  Constructs a KJSErrorDlg 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.
 */
KJSErrorDlg::KJSErrorDlg( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "KJSErrorDlg" );
    KJSErrorDlgLayout = new TQGridLayout( this, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "KJSErrorDlgLayout"); 

    _close = new TQPushButton( this, "_close" );

    KJSErrorDlgLayout->addWidget( _close, 4, 2 );

    _clear = new TQPushButton( this, "_clear" );

    KJSErrorDlgLayout->addWidget( _clear, 4, 1 );

    line1 = new TQFrame( this, "line1" );
    line1->setFrameShape( TQFrame::HLine );
    line1->setFrameShadow( TQFrame::Sunken );
    line1->setFrameShape( TQFrame::HLine );

    KJSErrorDlgLayout->addMultiCellWidget( line1, 2, 2, 0, 2 );
    spacer1 = new TQSpacerItem( 311, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    KJSErrorDlgLayout->addMultiCell( spacer1, 3, 4, 0, 0 );

    _errorText = new TQTextBrowser( this, "_errorText" );
    _errorText->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 1, _errorText->sizePolicy().hasHeightForWidth() ) );
    _errorText->setTextFormat( TQTextBrowser::RichText );

    KJSErrorDlgLayout->addMultiCellWidget( _errorText, 1, 1, 0, 2 );

    _url = new KSqueezedTextLabel( this, "_url" );

    KJSErrorDlgLayout->addMultiCellWidget( _url, 0, 0, 0, 2 );
    languageChange();
    resize( TQSize(600, 484).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( _clear, TQ_SIGNAL( clicked() ), _errorText, TQ_SLOT( clear() ) );
    connect( _close, TQ_SIGNAL( clicked() ), this, TQ_SLOT( hide() ) );

    // tab order
    setTabOrder( _errorText, _close );
    setTabOrder( _close, _clear );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KJSErrorDlg::languageChange()
{
    setCaption( tr2i18n( "JavaScript Errors" ) );
    TQWhatsThis::add( this, tr2i18n( "This dialog provides you with notification and details of scripting errors that occur on web pages. In many cases it is due to an error in the web site as designed by its author. In other cases it is the result of a programming error in Konqueror. If you suspect the former, please contact the webmaster of the site in question. Conversely if you suspect an error in Konqueror, please file a bug report at http://bugs.trinitydesktop.org/. A test case which illustrates the problem will be appreciated." ) );
    _close->setText( tr2i18n( "&Close" ) );
    _clear->setText( tr2i18n( "C&lear" ) );
    _url->setText( TQString::null );
}

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

TQMetaObject *KJSErrorDlg::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KJSErrorDlg( "KJSErrorDlg", &KJSErrorDlg::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* KJSErrorDlg::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 = {"init", 0, 0 };
    static const TQUParameter param_slot_1[] = {
	{ "error", &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"addError", 1, param_slot_1 };
    static const TQUParameter param_slot_2[] = {
	{ "url", &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_2 = {"setURL", 1, param_slot_2 };
    static const TQUMethod slot_3 = {"clear", 0, 0 };
    static const TQUMethod slot_4 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "init()", &slot_0, TQMetaData::Public },
	{ "addError(const TQString&)", &slot_1, TQMetaData::Public },
	{ "setURL(const TQString&)", &slot_2, TQMetaData::Public },
	{ "clear()", &slot_3, TQMetaData::Public },
	{ "languageChange()", &slot_4, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"KJSErrorDlg", parentObject,
	slot_tbl, 5,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_KJSErrorDlg.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool KJSErrorDlg::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: init(); break;
    case 1: addError((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 2: setURL((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 3: clear(); break;
    case 4: languageChange(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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