00001 #include <klocale.h>
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "htmlpageinfo.h"
00012
00013 #include <qvariant.h>
00014 #include <qheader.h>
00015 #include <qlabel.h>
00016 #include <qlistview.h>
00017 #include <qlayout.h>
00018 #include <qtooltip.h>
00019 #include <qwhatsthis.h>
00020
00021
00022
00023
00024
00025
00026
00027
00028 KHTMLInfoDlg::KHTMLInfoDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
00029 : QDialog( parent, name, modal, fl )
00030
00031 {
00032 if ( !name )
00033 setName( "HTMLPageInfo" );
00034 setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) );
00035 HTMLPageInfoLayout = new QGridLayout( this, 1, 1, 11, 6, "HTMLPageInfoLayout");
00036
00037 TextLabel2 = new QLabel( this, "TextLabel2" );
00038 TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
00039
00040 HTMLPageInfoLayout->addWidget( TextLabel2, 0, 0 );
00041
00042 _url = new KActiveLabel( this, "_url" );
00043 _url->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, _url->sizePolicy().hasHeightForWidth() ) );
00044
00045 HTMLPageInfoLayout->addMultiCellWidget( _url, 1, 1, 1, 3 );
00046
00047 TextLabel1 = new QLabel( this, "TextLabel1" );
00048 TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
00049
00050 HTMLPageInfoLayout->addWidget( TextLabel1, 1, 0 );
00051
00052 _title = new QLabel( this, "_title" );
00053 _title->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, _title->sizePolicy().hasHeightForWidth() ) );
00054
00055 HTMLPageInfoLayout->addMultiCellWidget( _title, 0, 0, 1, 3 );
00056
00057 _headers = new QListView( this, "_headers" );
00058 _headers->addColumn( tr2i18n( "Property" ) );
00059 _headers->addColumn( tr2i18n( "Value" ) );
00060 _headers->setSelectionMode( QListView::NoSelection );
00061
00062 HTMLPageInfoLayout->addMultiCellWidget( _headers, 4, 4, 0, 3 );
00063
00064 TextLabel6 = new QLabel( this, "TextLabel6" );
00065 TextLabel6->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel6->sizePolicy().hasHeightForWidth() ) );
00066
00067 HTMLPageInfoLayout->addMultiCellWidget( TextLabel6, 3, 3, 0, 1 );
00068
00069 _lastModified = new QLabel( this, "_lastModified" );
00070 _lastModified->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, _lastModified->sizePolicy().hasHeightForWidth() ) );
00071
00072 HTMLPageInfoLayout->addMultiCellWidget( _lastModified, 2, 2, 2, 3 );
00073
00074 TextLabel4 = new QLabel( this, "TextLabel4" );
00075 TextLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel4->sizePolicy().hasHeightForWidth() ) );
00076
00077 HTMLPageInfoLayout->addMultiCellWidget( TextLabel4, 2, 2, 0, 1 );
00078 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00079 HTMLPageInfoLayout->addMultiCell( spacer, 5, 5, 0, 2 );
00080
00081 _close = new KPushButton( this, "_close" );
00082 _close->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, _close->sizePolicy().hasHeightForWidth() ) );
00083
00084 HTMLPageInfoLayout->addWidget( _close, 5, 3 );
00085 languageChange();
00086 resize( QSize(600, 519).expandedTo(minimumSizeHint()) );
00087
00088
00089 connect( _close, SIGNAL( clicked() ), this, SLOT( close() ) );
00090
00091
00092 TextLabel2->setBuddy( _title );
00093 TextLabel1->setBuddy( _url );
00094 TextLabel6->setBuddy( _headers );
00095 TextLabel4->setBuddy( _lastModified );
00096 }
00097
00098
00099
00100
00101 KHTMLInfoDlg::~KHTMLInfoDlg()
00102 {
00103
00104 }
00105
00106
00107
00108
00109
00110 void KHTMLInfoDlg::languageChange()
00111 {
00112 setCaption( tr2i18n( "Page Information" ) );
00113 TextLabel2->setText( tr2i18n( "Title:" ) );
00114 TextLabel1->setText( tr2i18n( "URL:" ) );
00115 _headers->header()->setLabel( 0, tr2i18n( "Property" ) );
00116 _headers->header()->setLabel( 1, tr2i18n( "Value" ) );
00117 TextLabel6->setText( tr2i18n( "HTTP headers:" ) );
00118 TextLabel4->setText( tr2i18n( "Last modified:" ) );
00119 _close->setText( tr2i18n( "&Close" ) );
00120 }
00121
00122 #include "htmlpageinfo.moc"