Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 171366 Details for
Bug 246347
>=kde-base/kmix-4.1.3 has now a volume bar for special keys in laptops
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
kmix keyboard shortcuts
kubuntu_02_kmix_keyboard_shortcuts.diff (text/plain), 4.46 KB, created by
Peter
on 2008-11-10 21:02:27 UTC
(
hide
)
Description:
kmix keyboard shortcuts
Filename:
MIME Type:
Creator:
Peter
Created:
2008-11-10 21:02:27 UTC
Size:
4.46 KB
patch
obsolete
>Index: kdemultimedia-4.1.2/kmix/kmix.h >=================================================================== >--- kdemultimedia-4.1.2.orig/kmix/kmix.h 2008-11-02 23:12:00.169635871 -0500 >+++ kdemultimedia-4.1.2/kmix/kmix.h 2008-11-02 23:14:29.069635452 -0500 >@@ -29,6 +29,8 @@ > class QLabel; > #include <qlist.h> > #include <QVBoxLayout> >+#include <QProgressBar> >+#include <QTimer> > class KTabWidget; > > // KDE >@@ -115,6 +117,9 @@ > QLabel *m_errorLabel; > ViewDockAreaPopup *_dockAreaPopup; > unsigned int m_configVersion; >+ QProgressBar* volumeDisplay; >+ QTimer* volumeDisplayTimer; >+ void showVolumeDisplay(); > > private slots: > void saveConfig(); >@@ -124,6 +129,10 @@ > void plugged( const char* driverName, const QString& udi, QString& dev); > void unplugged( const QString& udi); > void hideOrClose(); >+ void slotIncreaseVolume(); >+ void slotDecreaseVolume(); >+ void slotHideVolumeDisplay(); >+ void slotMute(); > }; > > #endif // KMIX_H >Index: kdemultimedia-4.1.2/kmix/kmix.cpp >=================================================================== >--- kdemultimedia-4.1.2.orig/kmix/kmix.cpp 2008-11-02 23:12:00.081635859 -0500 >+++ kdemultimedia-4.1.2/kmix/kmix.cpp 2008-11-02 23:14:54.528636526 -0500 >@@ -25,6 +25,7 @@ > // include files for QT > #include <QCheckBox> > #include <QLabel> >+#include <QDesktopWidget> > #include <qradiobutton.h> > #include <KTabWidget> > >@@ -122,6 +123,32 @@ > action = actionCollection()->addAction("toggle_channels_currentview"); > action->setText(i18n("Configure &Channels...")); > connect(action, SIGNAL(triggered(bool) ), SLOT(slotConfigureCurrentView())); >+ >+ KAction* globalAction = actionCollection()->addAction("increase_volume"); >+ globalAction->setText(i18n("Increase Volume")); >+ globalAction->setGlobalShortcut(KShortcut(Qt::Key_VolumeUp)); >+ connect(globalAction, SIGNAL(triggered(bool) ), SLOT(slotIncreaseVolume())); >+ >+ globalAction = actionCollection()->addAction("decrease_volume"); >+ globalAction->setText(i18n("Decrease Volume")); >+ globalAction->setGlobalShortcut(KShortcut(Qt::Key_VolumeDown)); >+ connect(globalAction, SIGNAL(triggered(bool) ), SLOT(slotDecreaseVolume())); >+ >+ globalAction = actionCollection()->addAction("mute"); >+ globalAction->setText(i18n("Mute")); >+ globalAction->setGlobalShortcut(KShortcut(Qt::Key_VolumeMute)); >+ connect(globalAction, SIGNAL(triggered(bool) ), SLOT(slotMute())); >+ >+ volumeDisplay = new QProgressBar(); >+ volumeDisplay->setWindowFlags(Qt::X11BypassWindowManagerHint); >+ QDesktopWidget* desktop = KApplication::kApplication()->desktop(); >+ QRect rect = desktop->screenGeometry(); >+ int width = (rect.width()/2) - (volumeDisplay->width()/2); >+ int height = (rect.height()/2) - (volumeDisplay->height()/2); >+ volumeDisplay->move(width, height); >+ volumeDisplayTimer = new QTimer(this); >+ connect(volumeDisplayTimer, SIGNAL(timeout()), this, SLOT(slotHideVolumeDisplay())); >+ > createGUI( "kmixui.rc" ); > } > >@@ -570,6 +597,58 @@ > } > } > >+void KMixWindow::slotIncreaseVolume() >+{ >+ Mixer* mixer = Mixer::getGlobalMasterMixer(); >+ MixDevice *master = mixer->getLocalMasterMD(); >+ mixer->setMute(master->id(), false); >+ mixer->increaseVolume(master->id()); >+ showVolumeDisplay(); >+} >+ >+void KMixWindow::slotDecreaseVolume() >+{ >+ Mixer* mixer = Mixer::getGlobalMasterMixer(); >+ MixDevice *master = mixer->getLocalMasterMD(); >+ mixer->setMute(master->id(), false); >+ mixer->decreaseVolume(master->id()); >+ showVolumeDisplay(); >+} >+ >+void KMixWindow::showVolumeDisplay() >+{ >+ Mixer* mixer = Mixer::getGlobalMasterMixer(); >+ int currentVolume = mixer->masterVolume(); >+ volumeDisplay->setValue(currentVolume); >+ if (mixer->mute("Master:0")) { >+ volumeDisplay->setValue(0); >+ } >+ volumeDisplay->show(); >+ >+ //FIXME, how to get this to work before it is displayed for the first time? >+ QDesktopWidget* desktop = KApplication::kApplication()->desktop(); >+ QRect rect = desktop->screenGeometry(); >+ int width = (rect.width()/2) - (volumeDisplay->width()/2); >+ int height = (rect.height()/2) - (volumeDisplay->height()/2); >+ volumeDisplay->move(width, height); >+ >+ volumeDisplayTimer->setInterval(2000); >+ volumeDisplayTimer->start(); >+} >+ >+void KMixWindow::slotHideVolumeDisplay() >+{ >+ volumeDisplay->hide(); >+} >+ >+void KMixWindow::slotMute() >+{ >+ Mixer* mixer = Mixer::getGlobalMasterMixer(); >+ MixDevice *master = mixer->getLocalMasterMD(); >+ mixer->toggleMute(master->id()); >+ showVolumeDisplay(); >+} >+ > void KMixWindow::quit() > { > // kDebug(67100) << "quit";
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 246347
: 171366