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 | 57 |
1 files changed, 54 insertions, 3 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageinfoui.cpp b/noncore/graphics/opie-eye/gui/imageinfoui.cpp index 74a9ea4..039dfa3 100644 --- a/noncore/graphics/opie-eye/gui/imageinfoui.cpp +++ b/noncore/graphics/opie-eye/gui/imageinfoui.cpp | |||
@@ -13,33 +13,80 @@ | |||
13 | #include <qstring.h> | 13 | #include <qstring.h> |
14 | #include <qfileinfo.h> | 14 | #include <qfileinfo.h> |
15 | 15 | ||
16 | #include <lib/slavemaster.h> | 16 | #include "lib/slavemaster.h" |
17 | #include <lib/imagecache.h> | 17 | #include "lib/imagecache.h" |
18 | |||
19 | #include <opie2/oconfig.h> | ||
20 | #include <opie2/oconfig.h> | ||
21 | #include <opie2/okeyconfigwidget.h> | ||
22 | #include <opie2/odebug.h> | ||
18 | 23 | ||
19 | #include <qpe/qcopenvelope_qws.h> | 24 | #include <qpe/qcopenvelope_qws.h> |
20 | #include <qpe/resource.h> | 25 | #include <qpe/resource.h> |
21 | 26 | ||
22 | static const int THUMBSIZE = 128; | 27 | static const int THUMBSIZE = 128; |
23 | 28 | ||
29 | using namespace Opie::Core; | ||
24 | 30 | ||
25 | imageinfo::imageinfo(QWidget* parent, const char* name, WFlags fl ) | 31 | imageinfo::imageinfo(QWidget* parent, const char* name, WFlags fl ) |
26 | : QWidget( parent, name, fl ) | 32 | : QWidget( parent, name, fl ) |
27 | { | 33 | { |
34 | m_viewManager = 0; | ||
28 | init(name); | 35 | init(name); |
36 | initKeys(); | ||
29 | } | 37 | } |
30 | 38 | ||
31 | 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 ) |
32 | : QWidget( parent, name, fl ),currentFile(_path) | 40 | : QWidget( parent, name, fl ),currentFile(_path) |
33 | { | 41 | { |
42 | m_viewManager = 0; | ||
34 | init(name); | 43 | init(name); |
44 | initKeys(); | ||
35 | slotChangeName(_path); | 45 | slotChangeName(_path); |
36 | } | 46 | } |
47 | |||
48 | Opie::Ui::OKeyConfigManager* imageinfo::manager() | ||
49 | { | ||
50 | if (!m_viewManager) { | ||
51 | initKeys(); | ||
52 | } | ||
53 | return m_viewManager; | ||
54 | } | ||
55 | |||
56 | void imageinfo::initKeys() | ||
57 | { | ||
58 | odebug << "init imageinfo keys" << oendl; | ||
59 | m_cfg = new Opie::Core::OConfig("phunkview"); | ||
60 | m_cfg->setGroup("Zecke_view" ); | ||
61 | Opie::Ui::OKeyPair::List lst; | ||
62 | lst.append( Opie::Ui::OKeyPair::upArrowKey() ); | ||
63 | lst.append( Opie::Ui::OKeyPair::downArrowKey() ); | ||
64 | lst.append( Opie::Ui::OKeyPair::leftArrowKey() ); | ||
65 | lst.append( Opie::Ui::OKeyPair::rightArrowKey() ); | ||
66 | // lst.append( Opie::Ui::OKeyPair::returnKey() ); | ||
67 | |||
68 | m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "Imageinfo-KeyBoard-Config", | ||
69 | lst, false,this, "keyconfig name" ); | ||
70 | m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Full Image"), "view", | ||
71 | Resource::loadPixmap("1to1"), ViewItem, | ||
72 | Opie::Ui::OKeyPair(Qt::Key_V, Qt::ShiftButton), | ||
73 | this, SLOT(slotShowImage()))); | ||
74 | m_viewManager->load(); | ||
75 | m_viewManager->handleWidget( this ); | ||
76 | m_viewManager->handleWidget( TextView1 ); | ||
77 | } | ||
78 | |||
79 | void imageinfo::slotShowImage() | ||
80 | { | ||
81 | emit dispImage(currentFile); | ||
82 | } | ||
83 | |||
37 | void imageinfo::init(const char* name) { | 84 | void imageinfo::init(const char* name) { |
38 | { | 85 | { |
39 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); | 86 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); |
40 | } | 87 | } |
41 | if ( !name ) | 88 | if ( !name ) |
42 | setName( "imageinfo" ); | 89 | setName( "imageinfo" ); |
43 | resize( 289, 335 ); | 90 | resize( 289, 335 ); |
44 | setCaption( tr( "Image info" ) ); | 91 | setCaption( tr( "Image info" ) ); |
45 | imageinfoLayout = new QVBoxLayout( this ); | 92 | imageinfoLayout = new QVBoxLayout( this ); |
@@ -96,6 +143,10 @@ imageinfo::~imageinfo() | |||
96 | { | 143 | { |
97 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); | 144 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); |
98 | } | 145 | } |
146 | if (m_viewManager) { | ||
147 | m_viewManager->save(); | ||
148 | delete m_viewManager; | ||
149 | } | ||
99 | } | 150 | } |
100 | 151 | ||
101 | void imageinfo::slot_fullInfo(const QString&_path, const QString&_t) | 152 | void imageinfo::slot_fullInfo(const QString&_path, const QString&_t) |