Commit 1e06bd18 authored by Jonathan Marten's avatar Jonathan Marten

Eliminate MixDeviceWidget::createShortcutsAction(), always do it

parent c4028835
......@@ -48,8 +48,7 @@ MDWEnum::MDWEnum(shared_ptr<MixDevice> md, MixDeviceWidget::MDWFlags flags, View
_label(nullptr),
_enumCombo(nullptr)
{
createWidgets();
createShortcutsAction();
createWidgets();
}
......
......@@ -76,7 +76,6 @@ MDWSlider::MDWSlider(shared_ptr<MixDevice> md, MixDeviceWidget::MDWFlags flags,
createActions();
createWidgets();
createGlobalActions();
createShortcutsAction();
// Yes, this looks odd - monitor all events sent to myself by myself?
// But it's so that wheel events over the MDWSlider background can be
......
......@@ -62,6 +62,10 @@ MixDeviceWidget::MixDeviceWidget(shared_ptr<MixDevice> md, MDWFlags flags, ViewB
m_globalActions = new KActionCollection(this);
m_shortcutsDialog = nullptr;
QAction *act = m_channelActions->addAction("keys");
act->setText(i18n("Channel Shortcuts..."));
connect(act, &QAction::triggered, this, &MixDeviceWidget::configureShortcuts);
QString name (md->id());
/* char* whatsThisChar = whatsthis.toUtf8().data();
QString w;
......@@ -75,16 +79,6 @@ MixDeviceWidget::MixDeviceWidget(shared_ptr<MixDevice> md, MDWFlags flags, ViewB
}
void MixDeviceWidget::createShortcutsAction()
{
if (m_globalActions->isEmpty()) return; // no shortcuts to define
QAction* act = m_channelActions->addAction("keys");
act->setText(i18n("Channel Shortcuts..."));
connect(act, &QAction::triggered, this, &MixDeviceWidget::configureShortcuts);
}
void MixDeviceWidget::configureShortcuts()
{
// Dialog for *global* shortcuts of this MDW
......@@ -106,10 +100,10 @@ void MixDeviceWidget::contextMenuEvent(QContextMenuEvent *ev)
createContextMenu(menu);
// the common "Channel Shortcuts" action
// The common "Channel Shortcuts" action
QAction *act = m_channelActions->action("keys");
if (act!=nullptr)
{
if (act!=nullptr && !m_globalActions->isEmpty()) // action is available, and
{ // there are shortcuts to define
menu->addSeparator();
menu->addAction(act);
}
......
......@@ -81,7 +81,6 @@ protected slots:
protected:
virtual void createContextMenu(QMenu *menu) = 0;
void contextMenuEvent(QContextMenuEvent *ev) override;
void createShortcutsAction();
Qt::Orientation orientation() const { return (m_view->orientation()); }
MixDeviceWidget::MDWFlags flags() const { return (m_flags); }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment