summaryrefslogtreecommitdiff
authorzecke <zecke>2004-10-08 21:34:32 (UTC)
committer zecke <zecke>2004-10-08 21:34:32 (UTC)
commit16afa90172c9b1facaa8888780ed8bb8bd93598c (patch) (unidiff)
tree3642810e51ceaacff2f6fba499e78d0cff0121b9
parent0c3966672847b3b81c96c942727178368ac70e65 (diff)
downloadopie-16afa90172c9b1facaa8888780ed8bb8bd93598c.zip
opie-16afa90172c9b1facaa8888780ed8bb8bd93598c.tar.gz
opie-16afa90172c9b1facaa8888780ed8bb8bd93598c.tar.bz2
Use KeyPressed instead of KeyReleased for the Accelerator
Key in the Image Display component. This fixes the double 'next' problem when going from the browser to the viewer/display
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp
index b4f3110..5522131 100644
--- a/noncore/graphics/opie-eye/gui/imageview.cpp
+++ b/noncore/graphics/opie-eye/gui/imageview.cpp
@@ -22,15 +22,13 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name
22 initKeys(); 22 initKeys();
23} 23}
24 24
25ImageView::~ImageView() 25ImageView::~ImageView()
26{ 26{
27 odebug << "Delete Imageview" << oendl; 27 odebug << "Delete Imageview" << oendl;
28 if (m_viewManager) { 28 delete m_viewManager;
29 delete m_viewManager;
30 }
31} 29}
32 30
33Opie::Core::OKeyConfigManager* ImageView::manager() 31Opie::Core::OKeyConfigManager* ImageView::manager()
34{ 32{
35 if (!m_viewManager) { 33 if (!m_viewManager) {
36 initKeys(); 34 initKeys();
@@ -52,12 +50,20 @@ void ImageView::initKeys()
52 lst.append( Opie::Core::OKeyPair::rightArrowKey() ); 50 lst.append( Opie::Core::OKeyPair::rightArrowKey() );
53 lst.append( Opie::Core::OKeyPair(Qt::Key_Escape,0)); 51 lst.append( Opie::Core::OKeyPair(Qt::Key_Escape,0));
54 52
55 m_viewManager = new Opie::Core::OKeyConfigManager(m_cfg, "image_view_keys", 53 m_viewManager = new Opie::Core::OKeyConfigManager(m_cfg, "image_view_keys",
56 lst, false,this, "image_view_keys" ); 54 lst, false,this, "image_view_keys" );
57 55
56 /**
57 * Handle KeyEvents when they're pressed. This avoids problems
58 * with 'double next' on Return.
59 * The Return press would switch to this view and the return
60 * release would emit the dispNext Signal.
61 */
62 m_viewManager->setEventMask( Opie::Core::OKeyConfigManager::MaskPressed );
63
58 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("View Image Info"), "imageviewinfo", 64 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("View Image Info"), "imageviewinfo",
59 Resource::loadPixmap("1to1"), ViewInfo, 65 Resource::loadPixmap("1to1"), ViewInfo,
60 Opie::Core::OKeyPair(Qt::Key_I,0), 66 Opie::Core::OKeyPair(Qt::Key_I,0),
61 this, SLOT(slotShowImageInfo()))); 67 this, SLOT(slotShowImageInfo())));
62 68
63 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Toggle autorotate"), "imageautorotate", 69 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Toggle autorotate"), "imageautorotate",
@@ -143,13 +149,13 @@ void ImageView::focusInEvent(QFocusEvent *)
143 odebug << "Focus in (view)" << oendl; 149 odebug << "Focus in (view)" << oendl;
144 //if (fullScreen()) parentWidget()->showNormal(); 150 //if (fullScreen()) parentWidget()->showNormal();
145 if (m_ignore_next_in){m_ignore_next_in=false;return;} 151 if (m_ignore_next_in){m_ignore_next_in=false;return;}
146 if (fullScreen()) enableFullscreen(); 152 if (fullScreen()) enableFullscreen();
147} 153}
148 154
149void ImageView::hide() 155void ImageView::hide()
150{ 156{
151 if (fullScreen()) { 157 if (fullScreen()) {
152 m_ignore_next_in = true; 158 m_ignore_next_in = true;
153 showNormal(); 159 showNormal();
154 } 160 }
155 QWidget::hide(); 161 QWidget::hide();