From kde-core-devel Tue Sep 20 16:33:53 2005 From: =?iso-8859-1?q?S=E9bastien_Lao=FBt?= Date: Tue, 20 Sep 2005 16:33:53 +0000 To: kde-core-devel Subject: Re: Patch: KIconDialog: Make the Enter key works! Message-Id: <200509201833.54552.slaout () linux62 ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=112723444517833 Nobody to comment on that? Le Dimanche 18 Septembre 2005 16:06, Sébastien Laoût a écrit : > Hello, > > The Enter key does not work when choosing an icon in the KIconDialog. > We are obliged to put the mouse on hand and click the button Ok, or press > Alt+O. > That annoyed me for a long time, so I decided to look at the code and fix > that bug. > > I'm sorry, I don't have KDE source libs installed and am not able to test > if that work, but I've done similar code for another project, so it should > be OK. > > In /kio/kfile/kicondialog.cpp arround line 313: > mpCanvas = new KIconCanvas(main); > > connect(mpCanvas,SIGNAL(executed(QIconViewItem*)),SLOT(slotAcceptIcons())); > +connect(mpCanvas,SIGNAL(returnPressed(QIconViewItem*)),SLOT(slotAcceptIcon >s())); mpCanvas->setMinimumSize(400, 125); > > In /kio/kfile/kicondialog.cpp arround line 346: > void KIconDialog::slotAcceptIcons() > { > d->custom=QString::null; > + actionButton(KDialogBase::Ok)->animateClick(); > slotOk(); > } > > It connect the signal QDialog::returnPressed(). > And it generate an animated click on the Ok button (like any Enter keypress > on any normal dialog). > The animated click will also be played when clicking an icon. > If that's not good, then slotAcceptIcons() need to be duplicated to only > animate when returnPressed() is emitted, and not executed(). > > Can anyone commit this change? > > Thanks, > Sébastien Laoût.