|
|
|
@ -22,17 +22,18 @@
|
|
|
|
|
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <tdeaction.h>
|
|
|
|
|
#include <tdelocale.h>
|
|
|
|
|
#include <tdeapplication.h>
|
|
|
|
|
#include <kpanelapplet.h>
|
|
|
|
|
#include <tdepopupmenu.h>
|
|
|
|
|
#include <tdeglobalsettings.h>
|
|
|
|
|
#include <kdialog.h>
|
|
|
|
|
#include <kaudioplayer.h>
|
|
|
|
|
#include <kiconloader.h>
|
|
|
|
|
#include <kdebug.h>
|
|
|
|
|
#include <khelpmenu.h>
|
|
|
|
|
#include <twin.h>
|
|
|
|
|
#include <tdeaction.h>
|
|
|
|
|
#include <tdeapplication.h>
|
|
|
|
|
#include <tdelocale.h>
|
|
|
|
|
#include <tdepopupmenu.h>
|
|
|
|
|
#include <tdeglobalsettings.h>
|
|
|
|
|
|
|
|
|
|
#include <tqapplication.h>
|
|
|
|
|
#include <tqcursor.h>
|
|
|
|
@ -45,7 +46,6 @@
|
|
|
|
|
#include "mixer.h"
|
|
|
|
|
#include "mixdevicewidget.h"
|
|
|
|
|
#include "kmixdockwidget.h"
|
|
|
|
|
#include "twin.h"
|
|
|
|
|
#include "viewdockareapopup.h"
|
|
|
|
|
|
|
|
|
|
KMixDockWidget::KMixDockWidget( Mixer *mixer, TQWidget *parent, const char *name, bool volumePopup, bool dockIconMuting )
|
|
|
|
@ -80,27 +80,51 @@ KMixDockWidget::~KMixDockWidget()
|
|
|
|
|
|
|
|
|
|
void KMixDockWidget::createActions()
|
|
|
|
|
{
|
|
|
|
|
// Put "Mute" selector in context menu
|
|
|
|
|
(void)new TDEToggleAction( i18n( "M&ute" ), 0, TQT_TQOBJECT(this), TQT_SLOT( dockMute() ),
|
|
|
|
|
actionCollection(), "dock_mute" );
|
|
|
|
|
TDEAction *a = actionCollection()->action( "dock_mute" );
|
|
|
|
|
TDEPopupMenu *popupMenu = contextMenu();
|
|
|
|
|
if ( a ) a->plug( popupMenu );
|
|
|
|
|
|
|
|
|
|
// Put "Select Master Channel" dialog in context menu
|
|
|
|
|
if ( m_mixer != 0 ) {
|
|
|
|
|
(void)new TDEAction( i18n("Select Master Channel..."), 0, TQT_TQOBJECT(this), TQT_SLOT(selectMaster()),
|
|
|
|
|
actionCollection(), "select_master");
|
|
|
|
|
TDEAction *a2 = actionCollection()->action( "select_master" );
|
|
|
|
|
if (a2) a2->plug( popupMenu );
|
|
|
|
|
}
|
|
|
|
|
TDEPopupMenu *popupMenu = contextMenu();
|
|
|
|
|
|
|
|
|
|
// Setup volume preview
|
|
|
|
|
if ( _playBeepOnVolumeChange ) {
|
|
|
|
|
_audioPlayer = new KAudioPlayer("KDE_Beep_Digital_1.ogg");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Put "Mute" selector in context menu
|
|
|
|
|
(void)new TDEToggleAction(i18n("M&ute"), 0, TQT_TQOBJECT(this), TQT_SLOT(dockMute()),
|
|
|
|
|
actionCollection(), "dock_mute");
|
|
|
|
|
TDEAction *a = actionCollection()->action("dock_mute");
|
|
|
|
|
if (a)
|
|
|
|
|
{
|
|
|
|
|
a->plug(popupMenu);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Put "Select Master Channel" dialog in context menu
|
|
|
|
|
if (m_mixer)
|
|
|
|
|
{
|
|
|
|
|
(void)new TDEAction(i18n("Select Master Channel..."), 0, TQT_TQOBJECT(this), TQT_SLOT(selectMaster()),
|
|
|
|
|
actionCollection(), "select_master");
|
|
|
|
|
a = actionCollection()->action("select_master");
|
|
|
|
|
if (a)
|
|
|
|
|
{
|
|
|
|
|
a->plug(popupMenu);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Show/hide mixer window (use "minimizeRestore" action
|
|
|
|
|
a = actionCollection()->action("minimizeRestore");
|
|
|
|
|
if (a)
|
|
|
|
|
{
|
|
|
|
|
a->plug(popupMenu);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Help and quit
|
|
|
|
|
popupMenu->insertSeparator();
|
|
|
|
|
popupMenu->insertItem(SmallIcon("help"), KStdGuiItem::help().text(), (new KHelpMenu(this, TDEGlobal::instance()->aboutData(), false))->menu(), false);
|
|
|
|
|
popupMenu->insertSeparator();
|
|
|
|
|
a = actionCollection()->action(KStdAction::name(KStdAction::Quit));
|
|
|
|
|
if (a)
|
|
|
|
|
{
|
|
|
|
|
a->plug(popupMenu);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Setup volume preview
|
|
|
|
|
if (_playBeepOnVolumeChange)
|
|
|
|
|
{
|
|
|
|
|
_audioPlayer = new KAudioPlayer("KDE_Beep_Digital_1.ogg");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KMixDockWidget::createMasterVolWidget()
|
|
|
|
|
{
|
|
|
|
@ -281,7 +305,6 @@ void KMixDockWidget::resizeEvent ( TQResizeEvent * )
|
|
|
|
|
void KMixDockWidget::showEvent ( TQShowEvent *se )
|
|
|
|
|
{
|
|
|
|
|
updatePixmap(true);
|
|
|
|
|
KSystemTray::showEvent(se);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|