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