Summary: | All the Image tools freeze the Image Editor and ShowFoto when validating a value in a spinbox with the key ENTER. | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Tung NGUYEN <ntung> |
Component: | Plugin-Editor-Curves | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | caulier.gilles |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 7.6.0 | |
Sentry Crash Report: |
Description
Tung NGUYEN
2005-11-14 15:03:26 UTC
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 |