[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    [PATCH] kdebase/kcontrol/knotify APPLY OK Inconsistency
From:       Willy De la Court <Willy.DelaCourt () pandora ! be>
Date:       2003-03-31 18:29:02
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Patch comments
- ------------------------------------------------------
Apply diabled when nothing is changed
Ok only saves when something is changed
- ------------------------------------------------------

I'll wait 2 days for comments on this before commiting.
- -- 
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 = 784E E18F 7F85 9C7C AC1A D5FB FE08 686C 37C7 A689
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+iIju/ghobDfHpokRApsaAKCpAltMz98kex3s5ES1Q4z2pspv+gCeL8g3
A0FcPFE+wT88p9PabwcOKbM=
=9ALO
-----END PGP SIGNATURE-----

["knotify.applyok.patch" (text/x-diff)]

Index: knotify.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/knotify/knotify.cpp,v
retrieving revision 1.62
diff -u -p -r1.62 knotify.cpp
--- knotify.cpp	15 Mar 2003 18:20:55 -0000	1.62
+++ knotify.cpp	31 Mar 2003 18:19:48 -0000
@@ -230,8 +230,13 @@ PlayerSettingsDialog::PlayerSettingsDial
     volumeSlider->setOrientation( Horizontal );
     volumeSlider->setRange( 0, 100 );
     l->setBuddy( volumeSlider );
-
     load();
+    dataChanged = false;
+    enableButton(Apply, false);
+    connect( cbExternal, SIGNAL( toggled( bool ) ), this, SLOT( slotChanged() ) );
+    connect( volumeSlider, SIGNAL( valueChanged ( int ) ), this, SLOT( slotChanged() ) );
+    connect( reqExternal, SIGNAL( urlSelected( const QString& ) ), this, SLOT( slotChanged() ) );
+    connect( reqExternal, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotChanged() ) );
 }
 
 void PlayerSettingsDialog::load()
@@ -261,6 +266,8 @@ void PlayerSettingsDialog::save()
 void PlayerSettingsDialog::slotApply()
 {
     save();
+    dataChanged = false;
+    enableButton(Apply, false);
     kapp->dcopClient()->send("knotify", "", "reconfigure()", "");
 
     KDialogBase::slotApply();
@@ -269,8 +276,14 @@ void PlayerSettingsDialog::slotApply()
 // reimplements KDialogBase::slotOk()
 void PlayerSettingsDialog::slotOk()
 {
-    slotApply();
+    if( dataChanged )
+        slotApply();
     KDialogBase::slotOk();
+}
+void PlayerSettingsDialog::slotChanged()
+{
+    dataChanged = true;
+    enableButton(Apply, true);
 }
 
 void PlayerSettingsDialog::externalToggled( bool on )
Index: knotify.h
===================================================================
RCS file: /home/kde/kdebase/kcontrol/knotify/knotify.h,v
retrieving revision 1.24
diff -u -p -r1.24 knotify.h
--- knotify.h	24 Oct 2002 18:00:27 -0000	1.24
+++ knotify.h	31 Mar 2003 18:19:48 -0000
@@ -87,11 +87,13 @@ protected slots:
     virtual void slotApply();
     virtual void slotOk();
     void externalToggled( bool on );
+    void slotChanged();
 
 private:
     QCheckBox *cbExternal;
     KURLRequester *reqExternal;
     QSlider *volumeSlider;
+    bool dataChanged;
 
 };
 

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic