KMix: added help submenu in context menu.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 7f6dbcc642)
r14.0.x
Michele Calgaro 4 years ago
parent 8bbd10778d
commit bb13b926c3
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -194,27 +194,8 @@ KMixWindow::updateDocking()
if (m_showDockWidget)
{
// create dock widget
// !! This should be a View in the future
m_dockWidget = new KMixDockWidget( Mixer::mixers().first(), this, "mainDockWidget", m_volumeWidget, m_dockIconMuting );
/* Belongs in KMixDockWidget
// create RMB menu
TDEPopupMenu *menu = m_dockWidget->contextMenu();
// !! check this
TDEAction *a = actionCollection()->action( "dock_mute" );
if ( a ) a->plug( menu );
*/
/*
* Mail from 31.1.2005: "make sure your features are at least string complete"
* Preparation for fixing Bug #55078 - scheduled for KDE3.4.1 .
* This text will be plugged into the dock-icon popup menu.
*/
TQString selectChannel = i18n("Select Channel"); // This text will be used in KDE3.4.1 !!!
m_dockWidget->show();
}
}

@ -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

@ -30,7 +30,7 @@ class TQString;
#include <ksystemtray.h>
class Mixer;
class DialogSelectMaster;
class KAudioPlayer;
class MixDeviceWidget;
class Mixer;
@ -67,10 +67,10 @@ class KMixDockWidget : public KSystemTray {
void mousePressEvent(TQMouseEvent *);
void mouseReleaseEvent(TQMouseEvent *);
void wheelEvent(TQWheelEvent *);
void contextMenuAboutToShow( TDEPopupMenu* menu );
void contextMenuAboutToShow(TDEPopupMenu *menu);
void toggleMinimizeRestore();
void resizeEvent ( TQResizeEvent * );
void showEvent ( TQShowEvent * );
void resizeEvent(TQResizeEvent *);
void showEvent(TQShowEvent *);
private:
bool _playBeepOnVolumeChange;

Loading…
Cancel
Save