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

List:       kde-core-devel
Subject:    PATCH - Disable All Sounds button in System Notifications
From:       Neil Stevens <neil () qualityassistant ! com>
Date:       2002-01-29 22:52:10
[Download RAW message or body]

This patch adds a button to Disable all sounds in the System Notifications 
(knotify) kcontrol module.

Try disabling all the sounds for yourself, to see why this is needed.

It adds one i18n string, and changes no strings.
-- 
Neil Stevens
neil@qualityassistant.com

Don't think of a bug as a problem.  Think of it as a call to action.

["disablesoundspatch" (text/x-diff)]

Index: knotify.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/knotify/knotify.cpp,v
retrieving revision 1.51
diff -u -r1.51 knotify.cpp
--- knotify.cpp	2002/01/25 09:49:55	1.51
+++ knotify.cpp	2002/01/29 22:50:26
@@ -110,6 +110,10 @@
     connect( volumeSlider, SIGNAL( valueChanged( int ) ), SLOT( changed() ) );
     l->setBuddy( volumeSlider );
 
+    QPushButton *soundButton = new QPushButton( box );
+    soundButton->setText( i18n("&Disable All Sounds") );
+    connect(soundButton, SIGNAL(clicked()), this, SLOT(disableAllSounds()));
+
     m_events = new Events();
     qApp->processEvents(); // let's show up
 
@@ -358,6 +362,18 @@
     }
 }
 
+void KNotifyWidget::disableAllSounds()
+{
+	for(KNApplicationListIterator app(m_events->apps()); app.current(); ++app)
+	{
+		for(KNEventListIterator event(*(*app)->eventList()); event.current(); ++event)
+		{
+			(*event)->presentation &= ~KNotifyClient::Sound;
+		}
+	}
+	updateView();
+	changed();
+}
 
 ///////////////////////////////////////////////////////////////////
 
Index: knotify.h
===================================================================
RCS file: /home/kde/kdebase/kcontrol/knotify/knotify.h,v
retrieving revision 1.19
diff -u -r1.19 knotify.h
--- knotify.h	2001/12/28 02:29:07	1.19
+++ knotify.h	2002/01/29 22:50:26
@@ -55,6 +55,7 @@
 
 public slots:
     virtual void load();
+    void disableAllSounds();
 
 private slots:
     void slotRequesterClicked( KURLRequester * );


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

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