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.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageinfoui.cpp b/noncore/graphics/opie-eye/gui/imageinfoui.cpp index 822fd88..0b3250c 100644 --- a/noncore/graphics/opie-eye/gui/imageinfoui.cpp +++ b/noncore/graphics/opie-eye/gui/imageinfoui.cpp | |||
@@ -18,64 +18,70 @@ | |||
18 | 18 | ||
19 | #include <opie2/oconfig.h> | 19 | #include <opie2/oconfig.h> |
20 | #include <opie2/okeyconfigwidget.h> | 20 | #include <opie2/okeyconfigwidget.h> |
21 | #include <opie2/odebug.h> | 21 | #include <opie2/odebug.h> |
22 | 22 | ||
23 | #include <qpe/qcopenvelope_qws.h> | 23 | #include <qpe/qcopenvelope_qws.h> |
24 | #include <qpe/resource.h> | 24 | #include <qpe/resource.h> |
25 | 25 | ||
26 | static const int THUMBSIZE = 128; | 26 | static const int THUMBSIZE = 128; |
27 | 27 | ||
28 | using namespace Opie::Core; | 28 | using namespace Opie::Core; |
29 | 29 | ||
30 | imageinfo::imageinfo(QWidget* parent, const char* name, WFlags fl ) | 30 | imageinfo::imageinfo(Opie::Core::OConfig *cfg,QWidget* parent, const char* name, WFlags fl ) |
31 | : QWidget( parent, name, fl ) | 31 | : QWidget( parent, name, fl ) |
32 | { | 32 | { |
33 | m_viewManager = 0; | 33 | m_viewManager = 0; |
34 | m_cfg = cfg; | ||
34 | init(name); | 35 | init(name); |
35 | initKeys(); | 36 | initKeys(); |
36 | } | 37 | } |
37 | 38 | ||
38 | imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WFlags fl ) | 39 | imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WFlags fl ) |
39 | : QWidget( parent, name, fl ),currentFile(_path) | 40 | : QWidget( parent, name, fl ),currentFile(_path) |
40 | { | 41 | { |
41 | m_viewManager = 0; | 42 | m_viewManager = 0; |
43 | m_cfg = 0; | ||
42 | init(name); | 44 | init(name); |
43 | initKeys(); | 45 | initKeys(); |
44 | slotChangeName(_path); | 46 | slotChangeName(_path); |
45 | } | 47 | } |
46 | 48 | ||
47 | Opie::Ui::OKeyConfigManager* imageinfo::manager() | 49 | Opie::Ui::OKeyConfigManager* imageinfo::manager() |
48 | { | 50 | { |
49 | if (!m_viewManager) { | 51 | if (!m_viewManager) { |
50 | initKeys(); | 52 | initKeys(); |
51 | } | 53 | } |
52 | return m_viewManager; | 54 | return m_viewManager; |
53 | } | 55 | } |
54 | 56 | ||
55 | void imageinfo::initKeys() | 57 | void imageinfo::initKeys() |
56 | { | 58 | { |
57 | odebug << "init imageinfo keys" << oendl; | 59 | odebug << "init imageinfo keys" << oendl; |
58 | m_cfg = new Opie::Core::OConfig("phunkview"); | 60 | #if 0 |
59 | m_cfg->setGroup("Zecke_view" ); | 61 | if (!m_cfg) { |
62 | m_cfg = new Opie::Core::OConfig("phunkview"); | ||
63 | m_cfg->setGroup("imageinfo_keys" ); | ||
64 | } | ||
65 | #endif | ||
60 | Opie::Ui::OKeyPair::List lst; | 66 | Opie::Ui::OKeyPair::List lst; |
61 | lst.append( Opie::Ui::OKeyPair::upArrowKey() ); | 67 | lst.append( Opie::Ui::OKeyPair::upArrowKey() ); |
62 | lst.append( Opie::Ui::OKeyPair::downArrowKey() ); | 68 | lst.append( Opie::Ui::OKeyPair::downArrowKey() ); |
63 | lst.append( Opie::Ui::OKeyPair::leftArrowKey() ); | 69 | lst.append( Opie::Ui::OKeyPair::leftArrowKey() ); |
64 | lst.append( Opie::Ui::OKeyPair::rightArrowKey() ); | 70 | lst.append( Opie::Ui::OKeyPair::rightArrowKey() ); |
65 | lst.append( Opie::Ui::OKeyPair::returnKey() ); | 71 | lst.append( Opie::Ui::OKeyPair::returnKey() ); |
66 | 72 | ||
67 | m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "Imageinfo-KeyBoard-Config", | 73 | m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "imageinfo_keys", |
68 | lst, false,this, "keyconfig name" ); | 74 | lst, false,this, "keyconfig name" ); |
69 | m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Full Image"), "view", | 75 | m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Full Image"), "infoview", |
70 | Resource::loadPixmap("1to1"), ViewItem, | 76 | Resource::loadPixmap("1to1"), ViewItem, |
71 | Opie::Ui::OKeyPair(Qt::Key_V, Qt::ShiftButton), | 77 | Opie::Ui::OKeyPair(Qt::Key_V, Qt::ShiftButton), |
72 | this, SLOT(slotShowImage()))); | 78 | this, SLOT(slotShowImage()))); |
73 | m_viewManager->load(); | 79 | m_viewManager->load(); |
74 | m_viewManager->handleWidget( this ); | 80 | m_viewManager->handleWidget( this ); |
75 | m_viewManager->handleWidget( TextView1 ); | 81 | m_viewManager->handleWidget( TextView1 ); |
76 | } | 82 | } |
77 | 83 | ||
78 | void imageinfo::slotShowImage() | 84 | void imageinfo::slotShowImage() |
79 | { | 85 | { |
80 | emit dispImage(currentFile); | 86 | emit dispImage(currentFile); |
81 | } | 87 | } |
@@ -134,37 +140,34 @@ void imageinfo::slotChangeName(const QString&_path) | |||
134 | SlaveMaster::self()->thumbNail(currentFile,THUMBSIZE,THUMBSIZE); | 140 | SlaveMaster::self()->thumbNail(currentFile,THUMBSIZE,THUMBSIZE); |
135 | } else { | 141 | } else { |
136 | PixmapLabel1->setPixmap(*m_pix); | 142 | PixmapLabel1->setPixmap(*m_pix); |
137 | } | 143 | } |
138 | } | 144 | } |
139 | 145 | ||
140 | imageinfo::~imageinfo() | 146 | imageinfo::~imageinfo() |
141 | { | 147 | { |
142 | { | 148 | { |
143 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); | 149 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); |
144 | } | 150 | } |
145 | if (m_viewManager) { | 151 | if (m_viewManager) { |
146 | m_viewManager->save(); | ||
147 | delete m_viewManager; | 152 | delete m_viewManager; |
148 | } | 153 | } |
149 | } | 154 | } |
150 | 155 | ||
151 | void imageinfo::slot_fullInfo(const QString&_path, const QString&_t) | 156 | void imageinfo::slot_fullInfo(const QString&_path, const QString&_t) |
152 | { | 157 | { |
153 | if (_path == currentFile) { | 158 | if (_path == currentFile) { |
154 | qDebug(_t); | 159 | qDebug(_t); |
155 | QString t = _t; | 160 | QString t = _t; |
156 | t.replace(QRegExp("\n"),"<br>"); | 161 | t.replace(QRegExp("\n"),"<br>"); |
157 | /* t.replace(QRegeExp("<qt>",""); | ||
158 | t.replace(QRegeExp("</qt>","");*/ | ||
159 | TextView1->setText(t); | 162 | TextView1->setText(t); |
160 | } | 163 | } |
161 | } | 164 | } |
162 | 165 | ||
163 | void imageinfo::slotThumbNail(const QString&_path, const QPixmap&_pix) | 166 | void imageinfo::slotThumbNail(const QString&_path, const QPixmap&_pix) |
164 | { | 167 | { |
165 | if (_path == currentFile) { | 168 | if (_path == currentFile) { |
166 | if (_pix.width()>0) { | 169 | if (_pix.width()>0) { |
167 | PPixmapCache::self()->insertImage( _path, _pix, THUMBSIZE, THUMBSIZE ); | 170 | PPixmapCache::self()->insertImage( _path, _pix, THUMBSIZE, THUMBSIZE ); |
168 | PixmapLabel1->setPixmap( _pix ); | 171 | PixmapLabel1->setPixmap( _pix ); |
169 | PixmapLabel1->resize(QSize(_pix.width(),_pix.height())); | 172 | PixmapLabel1->resize(QSize(_pix.width(),_pix.height())); |
170 | } | 173 | } |