author | alwin <alwin> | 2004-04-07 12:46:26 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-07 12:46:26 (UTC) |
commit | 9e1ecade17a77c3d50aecc4c92091d852e99e8d9 (patch) (unidiff) | |
tree | bef7f25d64890aab64f5dc0e0fcb40c64497464a /noncore/graphics/opie-eye/gui/imageview.cpp | |
parent | d581038dd7875aa65a750f099333a94f43c37ef2 (diff) | |
download | opie-9e1ecade17a77c3d50aecc4c92091d852e99e8d9.zip opie-9e1ecade17a77c3d50aecc4c92091d852e99e8d9.tar.gz opie-9e1ecade17a77c3d50aecc4c92091d852e99e8d9.tar.bz2 |
keys will now be written to config file
all view use the same config object otherwise there will be problems writing
a new config
Diffstat (limited to 'noncore/graphics/opie-eye/gui/imageview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp index 8fc258e..e43bbff 100644 --- a/noncore/graphics/opie-eye/gui/imageview.cpp +++ b/noncore/graphics/opie-eye/gui/imageview.cpp | |||
@@ -8,15 +8,19 @@ | |||
8 | 8 | ||
9 | using namespace Opie::Core; | 9 | using namespace Opie::Core; |
10 | 10 | ||
11 | ImageView::ImageView( QWidget* parent, const char* name, WFlags fl ) | 11 | ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name, WFlags fl ) |
12 | : ImageScrollView(parent,name,fl) | 12 | : ImageScrollView(parent,name,fl) |
13 | { | 13 | { |
14 | m_viewManager = 0; | 14 | m_viewManager = 0; |
15 | m_cfg = cfg; | ||
15 | initKeys(); | 16 | initKeys(); |
16 | } | 17 | } |
17 | 18 | ||
18 | ImageView::~ImageView() | 19 | ImageView::~ImageView() |
19 | { | 20 | { |
21 | if (m_viewManager) { | ||
22 | delete m_viewManager; | ||
23 | } | ||
20 | } | 24 | } |
21 | 25 | ||
22 | Opie::Ui::OKeyConfigManager* ImageView::manager() | 26 | Opie::Ui::OKeyConfigManager* ImageView::manager() |
@@ -30,8 +34,10 @@ Opie::Ui::OKeyConfigManager* ImageView::manager() | |||
30 | void ImageView::initKeys() | 34 | void ImageView::initKeys() |
31 | { | 35 | { |
32 | odebug << "init imageview keys" << oendl; | 36 | odebug << "init imageview keys" << oendl; |
33 | m_cfg = new Opie::Core::OConfig("phunkview"); | 37 | if (!m_cfg) { |
34 | m_cfg->setGroup("Zecke_view" ); | 38 | m_cfg = new Opie::Core::OConfig("phunkview"); |
39 | m_cfg->setGroup("image_view_keys" ); | ||
40 | } | ||
35 | Opie::Ui::OKeyPair::List lst; | 41 | Opie::Ui::OKeyPair::List lst; |
36 | lst.append( Opie::Ui::OKeyPair::upArrowKey() ); | 42 | lst.append( Opie::Ui::OKeyPair::upArrowKey() ); |
37 | lst.append( Opie::Ui::OKeyPair::downArrowKey() ); | 43 | lst.append( Opie::Ui::OKeyPair::downArrowKey() ); |
@@ -39,14 +45,14 @@ void ImageView::initKeys() | |||
39 | lst.append( Opie::Ui::OKeyPair::rightArrowKey() ); | 45 | lst.append( Opie::Ui::OKeyPair::rightArrowKey() ); |
40 | lst.append( Opie::Ui::OKeyPair::returnKey() ); | 46 | lst.append( Opie::Ui::OKeyPair::returnKey() ); |
41 | 47 | ||
42 | m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "Imageview-KeyBoard-Config", | 48 | m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "image_view_keys", |
43 | lst, false,this, "keyconfig name" ); | 49 | lst, false,this, "image_view_keys" ); |
44 | m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Image Info"), "view", | 50 | m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Image Info"), "imageviewinfo", |
45 | Resource::loadPixmap("1to1"), ViewInfo, | 51 | Resource::loadPixmap("1to1"), ViewInfo, |
46 | Opie::Ui::OKeyPair(Qt::Key_I,Qt::ShiftButton), | 52 | Opie::Ui::OKeyPair(Qt::Key_I,Qt::ShiftButton), |
47 | this, SLOT(slotShowImageInfo()))); | 53 | this, SLOT(slotShowImageInfo()))); |
48 | m_viewManager->load(); | ||
49 | m_viewManager->handleWidget( this ); | 54 | m_viewManager->handleWidget( this ); |
55 | m_viewManager->load(); | ||
50 | } | 56 | } |
51 | 57 | ||
52 | void ImageView::slotShowImageInfo() | 58 | void ImageView::slotShowImageInfo() |