summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/imageinfoui.cpp
Side-by-side diff
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.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageinfoui.cpp b/noncore/graphics/opie-eye/gui/imageinfoui.cpp
index 3463ba6..74a9ea4 100644
--- a/noncore/graphics/opie-eye/gui/imageinfoui.cpp
+++ b/noncore/graphics/opie-eye/gui/imageinfoui.cpp
@@ -10,29 +10,40 @@
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>
#include <qstring.h>
#include <qfileinfo.h>
#include <lib/slavemaster.h>
#include <lib/imagecache.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/resource.h>
-#define THUMBSIZE 128
+static const int THUMBSIZE = 128;
+
+
+imageinfo::imageinfo(QWidget* parent, const char* name, WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ init(name);
+}
imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl ),currentFile(_path)
{
+ init(name);
+ slotChangeName(_path);
+}
+void imageinfo::init(const char* name) {
{
QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" );
}
if ( !name )
setName( "imageinfo" );
resize( 289, 335 );
setCaption( tr( "Image info" ) );
imageinfoLayout = new QVBoxLayout( this );
imageinfoLayout->setSpacing(2);
imageinfoLayout->setMargin(4);
PixmapLabel1 = new QLabel( this, "PixmapLabel1" );
@@ -53,25 +64,24 @@ imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WF
TextView1->setResizePolicy( QTextView::AutoOneFit );
TextView1->setBackgroundOrigin( QTextView::ParentOrigin );
TextView1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, TextView1->sizePolicy().hasHeightForWidth() ) );
// TextView1->setVScrollBarMode(QScrollView::AlwaysOn);
QWhatsThis::add( TextView1, tr("Displays info of selected image") );
imageinfoLayout->addWidget( TextView1 );
SlaveMaster* master = SlaveMaster::self();
connect( master, SIGNAL(sig_fullInfo(const QString&, const QString&)),
this, SLOT(slot_fullInfo(const QString&, const QString&)) );
connect(master, SIGNAL( sig_thumbNail(const QString&, const QPixmap&)),
this, SLOT(slotThumbNail(const QString&, const QPixmap&)));
- slotChangeName(_path);
}
void imageinfo::slotChangeName(const QString&_path)
{
currentFile=_path;
QFileInfo fi(_path);
fnameLabel->setText("<qt><center><b>"+fi.fileName()+"</b></center></qt>");
SlaveMaster::self()->imageInfo( currentFile );
QPixmap*m_pix = PPixmapCache::self()->cachedImage( _path, THUMBSIZE,THUMBSIZE );
if (!m_pix) {
PixmapLabel1->setPixmap(QPixmap( Resource::loadPixmap( "UnknownDocument" )));
@@ -102,26 +112,41 @@ void imageinfo::slot_fullInfo(const QString&_path, const QString&_t)
void imageinfo::slotThumbNail(const QString&_path, const QPixmap&_pix)
{
if (_path == currentFile) {
if (_pix.width()>0) {
PPixmapCache::self()->insertImage( _path, _pix, THUMBSIZE, THUMBSIZE );
PixmapLabel1->setPixmap( _pix );
PixmapLabel1->resize(QSize(_pix.width(),_pix.height()));
}
}
}
+void imageinfo::setPath( const QString& str ) {
+ slotChangeName( str );
+}
+
+void imageinfo::setDestructiveClose() {
+ WFlags fl = getWFlags();
+ /* clear it just in case */
+ fl &= ~WDestructiveClose;
+ fl |= WDestructiveClose;
+ setWFlags( fl );
+}
+
+
/* for testing */
infoDlg::infoDlg(const QString&fname,QWidget * parent, const char * name)
:QDialog(parent,name,true,WStyle_ContextHelp)
{
QVBoxLayout*dlglayout = new QVBoxLayout(this);
dlglayout->setSpacing(2);
dlglayout->setMargin(1);
imageinfo*inf = new imageinfo(fname,this);
dlglayout->addWidget(inf);
}
infoDlg::~infoDlg()
{
}
+
+