-rw-r--r-- | noncore/graphics/opie-eye/gui/imageinfoui.cpp | 2 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageinfoui.h | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageinfoui.cpp b/noncore/graphics/opie-eye/gui/imageinfoui.cpp index 039dfa3..d56d65a 100644 --- a/noncore/graphics/opie-eye/gui/imageinfoui.cpp +++ b/noncore/graphics/opie-eye/gui/imageinfoui.cpp @@ -18,97 +18,97 @@ #include <opie2/oconfig.h> #include <opie2/oconfig.h> #include <opie2/okeyconfigwidget.h> #include <opie2/odebug.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/resource.h> static const int THUMBSIZE = 128; using namespace Opie::Core; imageinfo::imageinfo(QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { m_viewManager = 0; init(name); initKeys(); } imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ),currentFile(_path) { m_viewManager = 0; init(name); initKeys(); slotChangeName(_path); } Opie::Ui::OKeyConfigManager* imageinfo::manager() { if (!m_viewManager) { initKeys(); } return m_viewManager; } void imageinfo::initKeys() { odebug << "init imageinfo keys" << oendl; m_cfg = new Opie::Core::OConfig("phunkview"); m_cfg->setGroup("Zecke_view" ); Opie::Ui::OKeyPair::List lst; lst.append( Opie::Ui::OKeyPair::upArrowKey() ); lst.append( Opie::Ui::OKeyPair::downArrowKey() ); lst.append( Opie::Ui::OKeyPair::leftArrowKey() ); lst.append( Opie::Ui::OKeyPair::rightArrowKey() ); -// lst.append( Opie::Ui::OKeyPair::returnKey() ); + lst.append( Opie::Ui::OKeyPair::returnKey() ); m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "Imageinfo-KeyBoard-Config", lst, false,this, "keyconfig name" ); m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Full Image"), "view", Resource::loadPixmap("1to1"), ViewItem, Opie::Ui::OKeyPair(Qt::Key_V, Qt::ShiftButton), this, SLOT(slotShowImage()))); m_viewManager->load(); m_viewManager->handleWidget( this ); m_viewManager->handleWidget( TextView1 ); } void imageinfo::slotShowImage() { emit dispImage(currentFile); } 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" ); PixmapLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, PixmapLabel1->sizePolicy().hasHeightForWidth() ) ); QWhatsThis::add( PixmapLabel1, tr("Displays an thumbnail of the image") ); imageinfoLayout->addWidget( PixmapLabel1 ); Line1 = new QFrame( this, "Line1" ); Line1->setFrameStyle( QFrame::HLine | QFrame::Sunken ); imageinfoLayout->addWidget( Line1 ); fnameLabel = new QLabel( this, "FnameLabel" ); imageinfoLayout->addWidget( fnameLabel); TextView1 = new QTextView( this, "TextView1" ); TextView1->setFrameShadow( QTextView::Sunken ); TextView1->setResizePolicy( QTextView::AutoOneFit ); TextView1->setBackgroundOrigin( QTextView::ParentOrigin ); TextView1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, TextView1->sizePolicy().hasHeightForWidth() ) ); // TextView1->setVScrollBarMode(QScrollView::AlwaysOn); diff --git a/noncore/graphics/opie-eye/gui/imageinfoui.h b/noncore/graphics/opie-eye/gui/imageinfoui.h index 0a5e183..0ffa423 100644 --- a/noncore/graphics/opie-eye/gui/imageinfoui.h +++ b/noncore/graphics/opie-eye/gui/imageinfoui.h @@ -1,77 +1,78 @@ #ifndef IMAGEINFO_H #define IMAGEINFO_H #include <qvariant.h> #include <qwidget.h> #include <qdialog.h> class QVBoxLayout; class QHBoxLayout; class QGridLayout; class QFrame; class QLabel; class QTextView; namespace Opie { namespace Core { class OConfig; } namespace Ui { class OKeyConfigManager; } } class imageinfo : public QWidget { Q_OBJECT enum ActionIds { ViewItem }; public: imageinfo( QWidget* parent = 0, const char* name = 0, WFlags fl =0); imageinfo(const QString&_path, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~imageinfo(); + virtual ~imageinfo(); void setDestructiveClose(); Opie::Ui::OKeyConfigManager* manager(); signals: void dispImage(const QString&); + void sig_return(); public slots: - void setPath( const QString& path ); - void slotShowImage(); + virtual void setPath( const QString& path ); + virtual void slotShowImage(); private: void init(const char* name); protected: QLabel* PixmapLabel1; QLabel* fnameLabel; QFrame* Line1; QTextView* TextView1; QVBoxLayout* imageinfoLayout; QString currentFile; Opie::Core::OConfig * m_cfg; Opie::Ui::OKeyConfigManager*m_viewManager; void initKeys(); protected slots: virtual void slot_fullInfo(const QString&, const QString&); virtual void slotThumbNail(const QString&, const QPixmap&); virtual void slotChangeName(const QString&); }; /* for testing purpose */ class infoDlg:public QDialog { Q_OBJECT public: infoDlg(const QString&,QWidget * parent=0, const char * name=0); virtual ~infoDlg(); }; #endif // IMAGEINFO_H |