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