From kde-devel Mon Mar 31 20:11:21 2003 From: Willy De la Court Date: Mon, 31 Mar 2003 20:11:21 +0000 To: kde-devel Subject: [PATCH] kdebase/kicker/ui APPLY OK Inconsistency X-MARC-Message: https://marc.info/?l=kde-devel&m=104914167228919 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_pDKi+1/BXlbOun4" --Boundary-00=_pDKi+1/BXlbOun4 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Description: clearsigned data Content-Disposition: inline =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Patch comments =2D ------------------------------------------------------ UI Inconsistency OK APPLY buttons Apply diabled when nothing is changed Ok only saves when something is changed =2D ------------------------------------------------------ I'll wait 2 days for comments on this before commiting. =2D --=20 Simple things make people happy. Willy De la Court PGP Public Key at http://www.linux-lovers.be/download/public_key.asc PGP Key fingerprint =3D 784E E18F 7F85 9C7C AC1A D5FB FE08 686C 37C7 A689 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+iKDp/ghobDfHpokRAkkbAJoDdNqyyQ9vGm+SZ+3pEvZIfnMYbQCeJepC +/8CWYTpZ9ryA0y91fZ6IWo=3D =3Djvf+ =2D----END PGP SIGNATURE----- --Boundary-00=_pDKi+1/BXlbOun4 Content-Type: text/x-diff; charset="us-ascii"; name="kicker_ui.applyok.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kicker_ui.applyok.patch" Index: customSize_dlg.cpp =================================================================== RCS file: /home/kde/kdebase/kicker/ui/customSize_dlg.cpp,v retrieving revision 1.1 diff -u -p -r1.1 customSize_dlg.cpp --- customSize_dlg.cpp 12 Jun 2002 02:39:09 -0000 1.1 +++ customSize_dlg.cpp 31 Mar 2003 20:07:53 -0000 @@ -71,6 +71,9 @@ customSizeDialog::customSizeDialog(QWidg setMinMax(); setCurrentSize(); + dataChanged = false; + enableButton(Apply, false); + connect( sizeInput, SIGNAL( valueChanged(int) ), this, SLOT( slotChanged() ) ); } customSizeDialog::~customSizeDialog() @@ -85,6 +88,8 @@ void customSizeDialog::setMinMax(int min void customSizeDialog::setCurrentSize(int currentSize) { sizeInput->setValue(currentSize); + dataChanged = false; + enableButton(Apply, false); } int customSizeDialog::size() @@ -92,16 +97,24 @@ int customSizeDialog::size() return sizeInput->value(); } -void customSizeDialog::slotOk() +void customSizeDialog::slotOk() { - slotApply(); + if( dataChanged ) + slotApply(); KDialogBase::slotOk(); } void customSizeDialog::slotApply() { + dataChanged = false; + enableButton(Apply, false); emit newCustomSize(size()); } +void customSizeDialog::slotChanged() +{ + dataChanged = true; + enableButton(Apply, true); +} #include "customSize_dlg.moc" Index: customSize_dlg.h =================================================================== RCS file: /home/kde/kdebase/kicker/ui/customSize_dlg.h,v retrieving revision 1.1 diff -u -p -r1.1 customSize_dlg.h --- customSize_dlg.h 12 Jun 2002 02:39:09 -0000 1.1 +++ customSize_dlg.h 31 Mar 2003 20:07:53 -0000 @@ -47,9 +47,13 @@ class customSizeDialog : public KDialogB protected slots: virtual void slotOk(); virtual void slotApply(); + void slotChanged(); protected: KIntNumInput* sizeInput; + + private: + bool dataChanged; }; #endif // FORM1_H --Boundary-00=_pDKi+1/BXlbOun4-- >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<