Patch for KMix

Christian Esken c.esken at cityweb.de
Sat Nov 29 22:05:30 GMT 2003


Hi,

here is a patch for KMix, that hides the "Advanced"  checkbox if it is unused. 
This fix is for all users using OSS (many many Linux users still use OSS, 
addditionaly a lot of *BSD* users).
OK to commit?

Chris

Index: kmixerwidget.cpp
===================================================================
RCS file: /home/kde/kdemultimedia/kmix/kmixerwidget.cpp,v
retrieving revision 1.60
diff -u -r1.60 kmixerwidget.cpp
--- kmixerwidget.cpp    24 Nov 2003 20:45:32 -0000      1.60
+++ kmixerwidget.cpp    29 Nov 2003 21:57:43 -0000
@@ -160,6 +160,7 @@
    // create devices
    MixSet mixSet = m_mixer->getMixSet();
    MixDevice *mixDevice = mixSet.first();
+   bool hasSwitches = false; // so we know whether showing the "advanced" 
checkbox makes sense
    for ( ; mixDevice != 0; mixDevice = mixSet.next())
    {
       MixDeviceWidget *mdw;
@@ -196,6 +197,7 @@
          if( mixDevice->isSwitch() )
          {
             m_devSwitchLayout->addWidget( mdw, row, col );
+            hasSwitches = true;
             col++;

                                if( col > 3 )
@@ -232,7 +234,10 @@
         hideShowDetail->setText( i18n("Advanced") );

                balanceAndDetail->addSpacing( 10 );
-               balanceAndDetail->addWidget( hideShowDetail);
+               if ( hasSwitches )
+                  balanceAndDetail->addWidget( hideShowDetail);
+               else
+                 hideShowDetail->hide();
                balanceAndDetail->addWidget( m_balanceSlider );
                balanceAndDetail->addWidget( mixerName );
                balanceAndDetail->addSpacing( 10 );




More information about the kde-core-devel mailing list