Diffstat (limited to 'noncore/graphics/opie-eye/gui/imageview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.cpp | 18 |
1 files changed, 12 insertions, 6 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 @@ using namespace Opie::Core; -ImageView::ImageView( QWidget* parent, const char* name, WFlags fl ) +ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name, WFlags fl ) : ImageScrollView(parent,name,fl) { m_viewManager = 0; + m_cfg = cfg; initKeys(); } ImageView::~ImageView() { + if (m_viewManager) { + delete m_viewManager; + } } Opie::Ui::OKeyConfigManager* ImageView::manager() @@ -30,8 +34,10 @@ Opie::Ui::OKeyConfigManager* ImageView::manager() void ImageView::initKeys() { odebug << "init imageview keys" << oendl; + if (!m_cfg) { m_cfg = new Opie::Core::OConfig("phunkview"); - m_cfg->setGroup("Zecke_view" ); + m_cfg->setGroup("image_view_keys" ); + } Opie::Ui::OKeyPair::List lst; lst.append( Opie::Ui::OKeyPair::upArrowKey() ); lst.append( Opie::Ui::OKeyPair::downArrowKey() ); @@ -39,14 +45,14 @@ void ImageView::initKeys() lst.append( Opie::Ui::OKeyPair::rightArrowKey() ); lst.append( Opie::Ui::OKeyPair::returnKey() ); - m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "Imageview-KeyBoard-Config", - lst, false,this, "keyconfig name" ); - m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Image Info"), "view", + m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "image_view_keys", + lst, false,this, "image_view_keys" ); + m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Image Info"), "imageviewinfo", Resource::loadPixmap("1to1"), ViewInfo, Opie::Ui::OKeyPair(Qt::Key_I,Qt::ShiftButton), this, SLOT(slotShowImageInfo()))); - m_viewManager->load(); m_viewManager->handleWidget( this ); + m_viewManager->load(); } void ImageView::slotShowImageInfo() |