00001 #include <klocale.h>
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 #include "kjserrordlg.h"
00012 
00013 #include <qvariant.h>
00014 #include <qpushbutton.h>
00015 #include <qframe.h>
00016 #include <qtextbrowser.h>
00017 #include <qlayout.h>
00018 #include <qtooltip.h>
00019 #include <qwhatsthis.h>
00020 #include "./kjserrordlg.ui.h"
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 KJSErrorDlg::KJSErrorDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
00030     : QDialog( parent, name, modal, fl )
00031 {
00032     if ( !name )
00033     setName( "KJSErrorDlg" );
00034     KJSErrorDlgLayout = new QGridLayout( this, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "KJSErrorDlgLayout"); 
00035 
00036     _close = new QPushButton( this, "_close" );
00037 
00038     KJSErrorDlgLayout->addWidget( _close, 4, 2 );
00039 
00040     _clear = new QPushButton( this, "_clear" );
00041 
00042     KJSErrorDlgLayout->addWidget( _clear, 4, 1 );
00043 
00044     line1 = new QFrame( this, "line1" );
00045     line1->setFrameShape( QFrame::HLine );
00046     line1->setFrameShadow( QFrame::Sunken );
00047     line1->setFrameShape( QFrame::HLine );
00048 
00049     KJSErrorDlgLayout->addMultiCellWidget( line1, 2, 2, 0, 2 );
00050     spacer1 = new QSpacerItem( 311, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
00051     KJSErrorDlgLayout->addMultiCell( spacer1, 3, 4, 0, 0 );
00052 
00053     _errorText = new QTextBrowser( this, "_errorText" );
00054     _errorText->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 1, _errorText->sizePolicy().hasHeightForWidth() ) );
00055     _errorText->setTextFormat( QTextBrowser::RichText );
00056 
00057     KJSErrorDlgLayout->addMultiCellWidget( _errorText, 1, 1, 0, 2 );
00058 
00059     _url = new KActiveLabel( this, "_url" );
00060 
00061     KJSErrorDlgLayout->addMultiCellWidget( _url, 0, 0, 0, 2 );
00062     languageChange();
00063     resize( QSize(600, 484).expandedTo(minimumSizeHint()) );
00064     clearWState( WState_Polished );
00065 
00066     
00067     connect( _clear, SIGNAL( clicked() ), _errorText, SLOT( clear() ) );
00068     connect( _close, SIGNAL( clicked() ), this, SLOT( hide() ) );
00069 
00070     
00071     setTabOrder( _errorText, _close );
00072     setTabOrder( _close, _clear );
00073     init();
00074 }
00075 
00076 
00077 
00078 
00079 KJSErrorDlg::~KJSErrorDlg()
00080 {
00081     
00082 }
00083 
00084 
00085 
00086 
00087 
00088 void KJSErrorDlg::languageChange()
00089 {
00090     setCaption( tr2i18n( "JavaScript Errors" ) );
00091     QWhatsThis::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.kde.org/.  A test case which illustrates the problem will be appreciated." ) );
00092     _close->setText( tr2i18n( "&Close" ) );
00093     _clear->setText( tr2i18n( "C&lear" ) );
00094     _url->setText( QString::null );
00095 }
00096 
00097 #include "kjserrordlg.moc"