Sophie

Sophie

distrib > Mandriva > 2009.0 > x86_64 > media > main-testing-src > by-pkgid > b3dfc5d4186094db5121b36d8eb2636e > files > 1

kdemultimedia4-4.2.4-0.6mdv2009.0.src.rpm

--- kmix/kmixdockwidget.h~	2009-03-26 15:44:23.000000000 +0100
+++ kmix/kmixdockwidget.h	2009-03-27 22:41:30.000000000 +0100
@@ -85,6 +85,7 @@
    void selectMaster();
    void handleNewMaster(QString& soundcard_id, QString& channel_id);
    void contextMenuAboutToShow();
+   void slotStartSettingsChanged(bool checked);
 };
 
 #endif
--- kmix/kmixdockwidget.cpp~	2009-03-26 15:44:23.000000000 +0100
+++ kmix/kmixdockwidget.cpp	2009-03-27 22:43:29.000000000 +0100
@@ -107,8 +107,18 @@
     _audioPlayer = Phonon::createPlayer(Phonon::MusicCategory);
     _audioPlayer->setParent(this);
   }
-}
 
+KConfigGroup config(KGlobal::config(), "Global");
+  bool startWithKde = config.readEntry("AutoStart", true );
+
+  KToggleAction *startAction = actionCollection()->add<KToggleAction>( "AutoStart" );
+  startAction->setText( i18n( "Start KMix when KDE starts" ) );
+  startAction->setChecked(startWithKde);
+  connect(startAction, SIGNAL(triggered(bool) ), this , SLOT( slotStartSettingsChanged(bool) ));
+  QAction *a3 = actionCollection()->action( "AutoStart" );
+  if ( a3 ) menu->addAction( a3 );
+
+  }
 
 void
 KMixDockWidget::createMasterVolWidget()
@@ -380,6 +390,13 @@
    }
 }
 
+void
+KMixDockWidget::slotStartSettingsChanged(bool checked)
+{
+    KConfigGroup config(KGlobal::config(), "Global");
+    config.writeEntry( "AutoStart", checked );
+    config.sync();
+}
 
 void KMixDockWidget::kmixSystrayAction(QSystemTrayIcon::ActivationReason reason)
 {