Version: 0.8.0-rc (using KDE KDE 3.4.2) Installed from: Compiled From Sources OS: Linux For exemple, with the Blur core filter, enter the value 1 in the Smoothness spinbox and validate with the key ENTER => the filter freezes at the end of the process, the cursor has a sand glass shape. In Konsole, there are: digikam: GaussianBlur::Computation aborted... ( 0 s ) digikam: Preview Gaussian Blur failed... digikam: GaussianBlur::End of computation !!! ... ( 0 s ) This problem occurs with all the plugins which have a spinbox (Charcoal, FreeRotation, ...).
SVN commit 480380 by cgilles: Prevent Enter keys events between dialog and spinBox CCBUG : 116347 M +38 -0 imageeffect_blur.cpp M +1 -0 imageeffect_blur.h M +38 -0 imageeffect_sharpen.cpp M +1 -0 imageeffect_sharpen.h --- trunk/extragear/graphics/digikam/imageplugins/imageeffect_blur.cpp #480379:480380 @@ -301,4 +301,42 @@ delete d; } +// Backport KDialog::keyPressEvent() implementation from KDELibs to ignore Enter/Return Key events +// to prevent any conflicts between dialog keys events and SpinBox keys events. + +void ImageEffect_Blur::keyPressEvent(QKeyEvent *e) +{ + if ( e->state() == 0 ) + { + switch ( e->key() ) + { + case Key_Escape: + e->accept(); + reject(); + break; + case Key_Enter: + case Key_Return: + e->ignore(); + break; + default: + e->ignore(); + return; + } + } + else + { + // accept the dialog when Ctrl-Return is pressed + if ( e->state() == ControlButton && + (e->key() == Key_Return || e->key() == Key_Enter) ) + { + e->accept(); + accept(); + } + else + { + e->ignore(); + } + } +} + #include "imageeffect_blur.moc" --- trunk/extragear/graphics/digikam/imageplugins/imageeffect_blur.h #480379:480380 @@ -80,6 +80,7 @@ void closeEvent(QCloseEvent *e); void customEvent(QCustomEvent *event); void abortPreview(void); + void keyPressEvent(QKeyEvent *e); }; #endif /* IMAGEEFFECT_BLUR_H */ --- trunk/extragear/graphics/digikam/imageplugins/imageeffect_sharpen.cpp #480379:480380 @@ -301,4 +301,42 @@ delete d; } +// Backport KDialog::keyPressEvent() implementation from KDELibs to ignore Enter/Return Key events +// to prevent any conflicts between dialog keys events and SpinBox keys events. + +void ImageEffect_Sharpen::keyPressEvent(QKeyEvent *e) +{ + if ( e->state() == 0 ) + { + switch ( e->key() ) + { + case Key_Escape: + e->accept(); + reject(); + break; + case Key_Enter: + case Key_Return: + e->ignore(); + break; + default: + e->ignore(); + return; + } + } + else + { + // accept the dialog when Ctrl-Return is pressed + if ( e->state() == ControlButton && + (e->key() == Key_Return || e->key() == Key_Enter) ) + { + e->accept(); + accept(); + } + else + { + e->ignore(); + } + } +} + #include "imageeffect_sharpen.moc" --- trunk/extragear/graphics/digikam/imageplugins/imageeffect_sharpen.h #480379:480380 @@ -80,6 +80,7 @@ void closeEvent(QCloseEvent *e); void customEvent(QCustomEvent *event); void abortPreview(void); + void keyPressEvent(QKeyEvent *e); }; #endif /* IMAGEEFFECT_SHARPEN_H */
SVN commit 480381 by cgilles: Prevent Enter keys events between dialog and spinBox CCBUG : 116347 M +39 -1 ctrlpaneldialog.cpp M +1 -0 ctrlpaneldialog.h M +38 -0 imageguidedialog.cpp M +1 -0 imageguidedialog.h --- trunk/extragear/graphics/digikamimageplugins/common/dialogs/ctrlpaneldialog.cpp #480380:480381 @@ -62,7 +62,7 @@ i18n("&Abort"), i18n("&Save As..."), i18n("&Load...")), - m_parent(parent), m_name(name), m_tryAction(tryAction) + m_parent(parent), m_name(name), m_tryAction(tryAction) { m_currentRenderingMode = NoneRendering; m_timer = 0L; @@ -333,6 +333,44 @@ delete d; } +// Backport KDialog::keyPressEvent() implementation from KDELibs to ignore Enter/Return Key events +// to prevent any conflicts between dialog keys events and SpinBox keys events. + +void CtrlPanelDialog::keyPressEvent(QKeyEvent *e) +{ + if ( e->state() == 0 ) + { + switch ( e->key() ) + { + case Key_Escape: + e->accept(); + reject(); + break; + case Key_Enter: + case Key_Return: + e->ignore(); + break; + default: + e->ignore(); + return; + } + } + else + { + // accept the dialog when Ctrl-Return is pressed + if ( e->state() == ControlButton && + (e->key() == Key_Return || e->key() == Key_Enter) ) + { + e->accept(); + accept(); + } + else + { + e->ignore(); + } + } +} + } // NameSpace DigikamImagePlugins #include "ctrlpaneldialog.moc" --- trunk/extragear/graphics/digikamimageplugins/common/dialogs/ctrlpaneldialog.h #480380:480381 @@ -103,6 +103,7 @@ void closeEvent(QCloseEvent *e); void customEvent(QCustomEvent *event); void abortPreview(void); + void keyPressEvent(QKeyEvent *e); virtual void writeUserSettings(void){}; virtual void resetValues(void){}; --- trunk/extragear/graphics/digikamimageplugins/common/dialogs/imageguidedialog.cpp #480380:480381 @@ -401,6 +401,44 @@ delete d; } +// Backport KDialog::keyPressEvent() implementation from KDELibs to ignore Enter/Return Key events +// to prevent any conflicts between dialog keys events and SpinBox keys events. + +void ImageGuideDialog::keyPressEvent(QKeyEvent *e) +{ + if ( e->state() == 0 ) + { + switch ( e->key() ) + { + case Key_Escape: + e->accept(); + reject(); + break; + case Key_Enter: + case Key_Return: + e->ignore(); + break; + default: + e->ignore(); + return; + } + } + else + { + // accept the dialog when Ctrl-Return is pressed + if ( e->state() == ControlButton && + (e->key() == Key_Return || e->key() == Key_Enter) ) + { + e->accept(); + accept(); + } + else + { + e->ignore(); + } + } +} + } // NameSpace DigikamImagePlugins #include "imageguidedialog.moc" --- trunk/extragear/graphics/digikamimageplugins/common/dialogs/imageguidedialog.h #480380:480381 @@ -117,6 +117,7 @@ void abortPreview(void); void readSettings(void); void writeSettings(void); + void keyPressEvent(QKeyEvent *e); virtual void writeUserSettings(void){}; virtual void resetValues(void){};
Tung, Let's me hear if all is ok for you. You need to update digikam and digikamimageplugins. Gilles
Gilles, I have tested your SVN commits with all the Image plugins which have a spinbox and now the key enter works fine (no freeze). --- Tung.
ok. Then I Close it Gilles