summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/imageinfoui.cpp
Unidiff
Diffstat (limited to 'noncore/graphics/opie-eye/gui/imageinfoui.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/imageinfoui.cpp35
1 files changed, 24 insertions, 11 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageinfoui.cpp b/noncore/graphics/opie-eye/gui/imageinfoui.cpp
index 177df77..2580215 100644
--- a/noncore/graphics/opie-eye/gui/imageinfoui.cpp
+++ b/noncore/graphics/opie-eye/gui/imageinfoui.cpp
@@ -13,2 +13,3 @@
13#include <qstring.h> 13#include <qstring.h>
14#include <qfileinfo.h>
14 15
@@ -20,2 +21,4 @@
20 21
22#define THUMBSIZE 128
23
21imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WFlags fl ) 24imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WFlags fl )
@@ -32,7 +35,8 @@ imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WF
32 imageinfoLayout->setSpacing(2); 35 imageinfoLayout->setSpacing(2);
33 imageinfoLayout->setMargin(2); 36 imageinfoLayout->setMargin(4);
34 37
35 PixmapLabel1 = new QLabel( this, "PixmapLabel1" ); 38 PixmapLabel1 = new QLabel( this, "PixmapLabel1" );
36 PixmapLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1->sizePolicy().hasHeightForWidth() ) ); 39 PixmapLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, PixmapLabel1->sizePolicy().hasHeightForWidth() ) );
37 PixmapLabel1->setScaledContents( TRUE ); 40 QWhatsThis::add( PixmapLabel1, tr("Displays an thumbnail of the image") );
41
38 imageinfoLayout->addWidget( PixmapLabel1 ); 42 imageinfoLayout->addWidget( PixmapLabel1 );
@@ -47,5 +51,8 @@ imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WF
47 TextView1 = new QTextView( this, "TextView1" ); 51 TextView1 = new QTextView( this, "TextView1" );
48 TextView1->setFrameShadow( QTextView::Plain ); 52 TextView1->setFrameShadow( QTextView::Sunken );
49 QToolTip::add( TextView1, tr( "Displays info of selected image" ) ); 53 TextView1->setResizePolicy( QTextView::AutoOneFit );
50 QWhatsThis::add( TextView1, tr( "Displays info of selected image" ) ); 54 TextView1->setBackgroundOrigin( QTextView::ParentOrigin );
55 TextView1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, TextView1->sizePolicy().hasHeightForWidth() ) );
56// TextView1->setVScrollBarMode(QScrollView::AlwaysOn);
57 QWhatsThis::add( TextView1, tr("Displays info of selected image") );
51 imageinfoLayout->addWidget( TextView1 ); 58 imageinfoLayout->addWidget( TextView1 );
@@ -63,8 +70,10 @@ void imageinfo::slotChangeName(const QString&_path)
63 currentFile=_path; 70 currentFile=_path;
64 fnameLabel->setText("<qt><center><b>"+currentFile+"</b></center></qt>"); 71 QFileInfo fi(_path);
72 fnameLabel->setText("<qt><center><b>"+fi.fileName()+"</b></center></qt>");
65 SlaveMaster::self()->imageInfo( currentFile ); 73 SlaveMaster::self()->imageInfo( currentFile );
66 74
67 QPixmap*m_pix = PPixmapCache::self()->cachedImage( _path, 64, 64 ); 75 QPixmap*m_pix = PPixmapCache::self()->cachedImage( _path, THUMBSIZE,THUMBSIZE );
68 if (!m_pix) { 76 if (!m_pix) {
69 PixmapLabel1->setPixmap(QPixmap( Resource::loadPixmap( "UnknownDocument" ))); 77 PixmapLabel1->setPixmap(QPixmap( Resource::loadPixmap( "UnknownDocument" )));
78 SlaveMaster::self()->thumbNail(currentFile,THUMBSIZE,THUMBSIZE);
70 } else { 79 } else {
@@ -87,2 +96,4 @@ void imageinfo::slot_fullInfo(const QString&_path, const QString&_t)
87 t.replace(QRegExp("\n"),"<br>"); 96 t.replace(QRegExp("\n"),"<br>");
97/* t.replace(QRegeExp("<qt>","");
98 t.replace(QRegeExp("</qt>","");*/
88 TextView1->setText(t); 99 TextView1->setText(t);
@@ -93,6 +104,8 @@ void imageinfo::slotThumbNail(const QString&_path, const QPixmap&_pix)
93{ 104{
94 if (_pix.width()>0)
95 PPixmapCache::self()->insertImage( _path, _pix, 64, 64 );
96 if (_path == currentFile) { 105 if (_path == currentFile) {
97 PixmapLabel1->setPixmap( _pix ); 106 if (_pix.width()>0) {
107 PPixmapCache::self()->insertImage( _path, _pix, THUMBSIZE, THUMBSIZE );
108 PixmapLabel1->setPixmap( _pix );
109 PixmapLabel1->resize(QSize(_pix.width(),_pix.height()));
110 }
98 } 111 }