khtml Library API Documentation

htmlpageinfo.cc

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