kjserrordlg.cc

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './kjserrordlg.ui'
00005 **
00006 ** Created by: The User Interface Compiler ($Id: qt/main.cpp   3.3.6   edited Aug 31 2005 $)
00007 **
00008 ** WARNING! All changes made in this file will be lost!
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 "kactivelabel.h"
00021 #include "./kjserrordlg.ui.h"
00022 
00023 /*
00024  *  Constructs a KJSErrorDlg as a child of 'parent', with the
00025  *  name 'name' and widget flags set to 'f'.
00026  *
00027  *  The dialog will by default be modeless, unless you set 'modal' to
00028  *  TRUE to construct a modal dialog.
00029  */
00030 KJSErrorDlg::KJSErrorDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
00031     : QDialog( parent, name, modal, fl )
00032 {
00033     if ( !name )
00034     setName( "KJSErrorDlg" );
00035     KJSErrorDlgLayout = new QGridLayout( this, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "KJSErrorDlgLayout"); 
00036 
00037     _close = new QPushButton( this, "_close" );
00038 
00039     KJSErrorDlgLayout->addWidget( _close, 4, 2 );
00040 
00041     _clear = new QPushButton( this, "_clear" );
00042 
00043     KJSErrorDlgLayout->addWidget( _clear, 4, 1 );
00044 
00045     line1 = new QFrame( this, "line1" );
00046     line1->setFrameShape( QFrame::HLine );
00047     line1->setFrameShadow( QFrame::Sunken );
00048     line1->setFrameShape( QFrame::HLine );
00049 
00050     KJSErrorDlgLayout->addMultiCellWidget( line1, 2, 2, 0, 2 );
00051     spacer1 = new QSpacerItem( 311, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
00052     KJSErrorDlgLayout->addMultiCell( spacer1, 3, 4, 0, 0 );
00053 
00054     _errorText = new QTextBrowser( this, "_errorText" );
00055     _errorText->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 1, _errorText->sizePolicy().hasHeightForWidth() ) );
00056     _errorText->setTextFormat( QTextBrowser::RichText );
00057 
00058     KJSErrorDlgLayout->addMultiCellWidget( _errorText, 1, 1, 0, 2 );
00059 
00060     _url = new KSqueezedTextLabel( this, "_url" );
00061 
00062     KJSErrorDlgLayout->addMultiCellWidget( _url, 0, 0, 0, 2 );
00063     languageChange();
00064     resize( QSize(600, 484).expandedTo(minimumSizeHint()) );
00065     clearWState( WState_Polished );
00066 
00067     // signals and slots connections
00068     connect( _clear, SIGNAL( clicked() ), _errorText, SLOT( clear() ) );
00069     connect( _close, SIGNAL( clicked() ), this, SLOT( hide() ) );
00070 
00071     // tab order
00072     setTabOrder( _errorText, _close );
00073     setTabOrder( _close, _clear );
00074     init();
00075 }
00076 
00077 /*
00078  *  Destroys the object and frees any allocated resources
00079  */
00080 KJSErrorDlg::~KJSErrorDlg()
00081 {
00082     // no need to delete child widgets, Qt does it all for us
00083 }
00084 
00085 /*
00086  *  Sets the strings of the subwidgets using the current
00087  *  language.
00088  */
00089 void KJSErrorDlg::languageChange()
00090 {
00091     setCaption( tr2i18n( "JavaScript Errors" ) );
00092     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." ) );
00093     _close->setText( tr2i18n( "&Close" ) );
00094     _clear->setText( tr2i18n( "C&lear" ) );
00095     _url->setText( QString::null );
00096 }
00097 
00098 #include "kjserrordlg.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys