htmlpageinfo.cc

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './htmlpageinfo.ui'
00005 **
00006 ** Created: Sat Jun 17 14:28:08 2006
00007 **      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.5   edited Aug 31 12:13 $)
00008 **
00009 ** WARNING! All changes made in this file will be lost!
00010 ****************************************************************************/
00011 
00012 #include "htmlpageinfo.h"
00013 
00014 #include <qvariant.h>
00015 #include <kdialog.h>
00016 #include <qpushbutton.h>
00017 #include <qgroupbox.h>
00018 #include <qlabel.h>
00019 #include <kactivelabel.h>
00020 #include <qheader.h>
00021 #include <qlistview.h>
00022 #include <kpushbutton.h>
00023 #include <qlayout.h>
00024 #include <qtooltip.h>
00025 #include <qwhatsthis.h>
00026 #include "kactivelabel.h"
00027 #include "kpushbutton.h"
00028 
00029 /*
00030  *  Constructs a KHTMLInfoDlg as a child of 'parent', with the
00031  *  name 'name' and widget flags set to 'f'.
00032  *
00033  *  The dialog will by default be modeless, unless you set 'modal' to
00034  *  TRUE to construct a modal dialog.
00035  */
00036 KHTMLInfoDlg::KHTMLInfoDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
00037     : QDialog( parent, name, modal, fl )
00038 {
00039     if ( !name )
00040     setName( "HTMLPageInfo" );
00041     setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) );
00042     HTMLPageInfoLayout = new QGridLayout( this, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "HTMLPageInfoLayout"); 
00043 
00044     groupBox2 = new QGroupBox( this, "groupBox2" );
00045     groupBox2->setColumnLayout(0, Qt::Vertical );
00046     groupBox2->layout()->setSpacing( KDialog::spacingHint() );
00047     groupBox2->layout()->setMargin( KDialog::marginHint() );
00048     groupBox2Layout = new QHBoxLayout( groupBox2->layout() );
00049     groupBox2Layout->setAlignment( Qt::AlignTop );
00050 
00051     layout1 = new QGridLayout( 0, 1, 1, 0, KDialog::spacingHint(), "layout1"); 
00052 
00053     urlLabel = new QLabel( groupBox2, "urlLabel" );
00054     urlLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, urlLabel->sizePolicy().hasHeightForWidth() ) );
00055 
00056     layout1->addWidget( urlLabel, 1, 0 );
00057 
00058     _title = new KActiveLabel( groupBox2, "_title" );
00059     _title->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 1, 0, _title->sizePolicy().hasHeightForWidth() ) );
00060 
00061     layout1->addWidget( _title, 0, 1 );
00062 
00063     _url = new KActiveLabel( groupBox2, "_url" );
00064     _url->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 1, 0, _url->sizePolicy().hasHeightForWidth() ) );
00065 
00066     layout1->addWidget( _url, 1, 1 );
00067 
00068     _lastModified = new QLabel( groupBox2, "_lastModified" );
00069     _lastModified->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 1, 0, _lastModified->sizePolicy().hasHeightForWidth() ) );
00070 
00071     layout1->addWidget( _lastModified, 2, 1 );
00072 
00073     titleLabel = new QLabel( groupBox2, "titleLabel" );
00074     titleLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, titleLabel->sizePolicy().hasHeightForWidth() ) );
00075 
00076     layout1->addWidget( titleLabel, 0, 0 );
00077 
00078     _lmLabel = new QLabel( groupBox2, "_lmLabel" );
00079     _lmLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, _lmLabel->sizePolicy().hasHeightForWidth() ) );
00080 
00081     layout1->addWidget( _lmLabel, 2, 0 );
00082 
00083     _eLabel = new QLabel( groupBox2, "_eLabel" );
00084     _eLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, _eLabel->sizePolicy().hasHeightForWidth() ) );
00085 
00086     layout1->addWidget( _eLabel, 3, 0 );
00087 
00088     _encoding = new KActiveLabel( groupBox2, "_encoding" );
00089     _encoding->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 1, 0, _encoding->sizePolicy().hasHeightForWidth() ) );
00090 
00091     layout1->addWidget( _encoding, 3, 1 );
00092     groupBox2Layout->addLayout( layout1 );
00093 
00094     HTMLPageInfoLayout->addMultiCellWidget( groupBox2, 0, 0, 0, 1 );
00095 
00096     groupBox1 = new QGroupBox( this, "groupBox1" );
00097     groupBox1->setColumnLayout(0, Qt::Vertical );
00098     groupBox1->layout()->setSpacing( KDialog::spacingHint() );
00099     groupBox1->layout()->setMargin( KDialog::marginHint() );
00100     groupBox1Layout = new QVBoxLayout( groupBox1->layout() );
00101     groupBox1Layout->setAlignment( Qt::AlignTop );
00102 
00103     _headers = new QListView( groupBox1, "_headers" );
00104     _headers->addColumn( tr2i18n( "Property" ) );
00105     _headers->addColumn( tr2i18n( "Value" ) );
00106     _headers->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 1, 1, _headers->sizePolicy().hasHeightForWidth() ) );
00107     _headers->setSelectionMode( QListView::NoSelection );
00108     _headers->setResizeMode( QListView::LastColumn );
00109     groupBox1Layout->addWidget( _headers );
00110 
00111     HTMLPageInfoLayout->addMultiCellWidget( groupBox1, 1, 1, 0, 1 );
00112 
00113     _close = new KPushButton( this, "_close" );
00114     _close->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, _close->sizePolicy().hasHeightForWidth() ) );
00115     _close->setDefault( TRUE );
00116 
00117     HTMLPageInfoLayout->addWidget( _close, 2, 1 );
00118     Spacer3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00119     HTMLPageInfoLayout->addItem( Spacer3, 2, 0 );
00120     languageChange();
00121     resize( QSize(550, 519).expandedTo(minimumSizeHint()) );
00122     clearWState( WState_Polished );
00123 
00124     // signals and slots connections
00125     connect( _close, SIGNAL( clicked() ), this, SLOT( close() ) );
00126 
00127     // tab order
00128     setTabOrder( _close, _url );
00129     setTabOrder( _url, _headers );
00130 
00131     // buddies
00132     urlLabel->setBuddy( _url );
00133     titleLabel->setBuddy( _title );
00134     _lmLabel->setBuddy( _lastModified );
00135     _eLabel->setBuddy( _encoding );
00136 }
00137 
00138 /*
00139  *  Destroys the object and frees any allocated resources
00140  */
00141 KHTMLInfoDlg::~KHTMLInfoDlg()
00142 {
00143     // no need to delete child widgets, Qt does it all for us
00144 }
00145 
00146 /*
00147  *  Sets the strings of the subwidgets using the current
00148  *  language.
00149  */
00150 void KHTMLInfoDlg::languageChange()
00151 {
00152     setCaption( tr2i18n( "Document Information" ) );
00153     groupBox2->setTitle( tr2i18n( "General" ) );
00154     urlLabel->setText( tr2i18n( "URL:" ) );
00155     titleLabel->setText( tr2i18n( "Title:" ) );
00156     _lmLabel->setText( tr2i18n( "Last modified:" ) );
00157     _eLabel->setText( tr2i18n( "Document encoding:" ) );
00158     groupBox1->setTitle( tr2i18n( "HTTP Headers" ) );
00159     _headers->header()->setLabel( 0, tr2i18n( "Property" ) );
00160     _headers->header()->setLabel( 1, tr2i18n( "Value" ) );
00161     _close->setText( tr2i18n( "&Close" ) );
00162 }
00163 
00164 #include "htmlpageinfo.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys