From 4c9ee3c6a3eabea2cc8b7804fc889b47c89568f5 Mon Sep 17 00:00:00 2001 From: Kurt Hindenburg Date: Sat, 19 Jun 2004 19:18:52 +0000 Subject: [PATCH] Check that the sound system is enabled before setting bell to System Notification (BR71551). svn path=/trunk/kdebase/konsole/; revision=322009 --- konsole/konsole.cpp | 14 ++++++++++++++ konsole/konsole.h | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/konsole/konsole.cpp b/konsole/konsole.cpp index 7772cb3b..ccb867c9 100644 --- a/konsole/konsole.cpp +++ b/konsole/konsole.cpp @@ -1337,6 +1337,15 @@ void Konsole::slotTabbarToggleDynamicHide() switchToFlat(); } + +// Check to see if the system-wide sound system is enabled. +void Konsole::checkSoundSystem() +{ + KConfig *arts_config = new KConfig("kcmartsrc"); + arts_config->setGroup("Arts"); + b_soundSystemEnabled = arts_config->readBoolEntry("StartServer", false); +} + /* ------------------------------------------------------------------------- */ /* */ /* Configuration */ @@ -1495,6 +1504,11 @@ void Konsole::readProperties(KConfig* config, const QString &schema, bool global n_scroll = QMIN(config->readUnsignedNumEntry("scrollbar",TEWidget::SCRRIGHT),2); n_tabbar = QMIN(config->readUnsignedNumEntry("tabbar",TabBottom),2); n_bell = QMIN(config->readUnsignedNumEntry("bellmode",TEWidget::BELLSYSTEM),2); + + checkSoundSystem(); + if ( !b_soundSystemEnabled && (n_bell == BELLNOTIFY) ) + n_bell = BELLSYSTEM; + // Options that should be applied to all sessions ///////////// // (1) set menu items and Konsole members diff --git a/konsole/konsole.h b/konsole/konsole.h index 13b4166a..8d000171 100644 --- a/konsole/konsole.h +++ b/konsole/konsole.h @@ -111,6 +111,8 @@ public: enum TabPosition { TabNone, TabTop, TabBottom }; enum TabViewModes { ShowIconAndText = 0, ShowTextOnly = 1, ShowIconOnly = 2 }; + enum { BELLSYSTEM=0, BELLNOTIFY=1, BELLVISUAL=2 }; // From TEWidget.h + public slots: void activateSession(int position); void activateSession(QWidget*); @@ -264,6 +266,8 @@ private: bool eventFilter( QObject *o, QEvent *e ); + void checkSoundSystem(); + QPtrList activeTEs(); QPtrDict action2session; @@ -397,6 +401,9 @@ private: bool b_histEnabled:1; bool b_fullScripting:1; bool b_showstartuptip:1; + + bool b_soundSystemEnabled; + unsigned int m_histSize; int m_separator_id;