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