diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2020-06-03 00:55:21 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2020-06-03 01:15:39 +0900 |
commit | 7f6dbcc6420bac9a9ef55eaeb523ac0bc8040bd6 (patch) | |
tree | dded5e7293fad2a0580475272e4da03385d5a578 | |
parent | 31e8d7b9730b3602acf615cd348204891290c057 (diff) | |
download | tdemultimedia-7f6dbcc6420bac9a9ef55eaeb523ac0bc8040bd6.tar.gz tdemultimedia-7f6dbcc6420bac9a9ef55eaeb523ac0bc8040bd6.zip |
KMix: added help submenu in context menu.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r-- | kmix/kmix.cpp | 19 | ||||
-rw-r--r-- | kmix/kmixdockwidget.cpp | 75 | ||||
-rw-r--r-- | kmix/kmixdockwidget.h | 9 |
3 files changed, 53 insertions, 50 deletions
diff --git a/kmix/kmix.cpp b/kmix/kmix.cpp index 69630f61..f00db82a 100644 --- a/kmix/kmix.cpp +++ b/kmix/kmix.cpp @@ -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(); } } diff --git a/kmix/kmixdockwidget.cpp b/kmix/kmixdockwidget.cpp index 125e16da..7e08f71e 100644 --- a/kmix/kmixdockwidget.cpp +++ b/kmix/kmixdockwidget.cpp @@ -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 ) @@ -85,27 +85,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() { @@ -314,7 +338,6 @@ void KMixDockWidget::resizeEvent ( TQResizeEvent * ) void KMixDockWidget::showEvent ( TQShowEvent *se ) { updatePixmap(true); - KSystemTray::showEvent(se); } void diff --git a/kmix/kmixdockwidget.h b/kmix/kmixdockwidget.h index 47e44b99..19c60ff3 100644 --- a/kmix/kmixdockwidget.h +++ b/kmix/kmixdockwidget.h @@ -30,13 +30,12 @@ class TQString; #include <ksystemtray.h> -class Mixer; +class DialogSelectMaster; class KAudioPlayer; class MixDeviceWidget; class Mixer; class ViewDockAreaPopup; class Volume; -class DialogSelectMaster; class KMixDockWidget : public KSystemTray { Q_OBJECT @@ -67,10 +66,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; |