disable note entry in toolbar pulldown menu

This commit is contained in:
Werner Schweer 2016-10-10 10:38:43 +02:00
parent cfbff1ea49
commit 2df77e9e1d
2 changed files with 12 additions and 10 deletions

View file

@ -791,7 +791,6 @@ MuseScore::MuseScore()
entryTools = addToolBar("");
entryTools->setObjectName("entry-tools");
connect(entryTools, SIGNAL(visibilityChanged(bool)), SLOT(toolbarVisibilityChanged(bool)));
populateNoteInputMenu();
@ -5258,18 +5257,20 @@ QFileInfoList MuseScore::recentScores() const
}
//---------------------------------------------------------
// toolbarVisibilityChanged
// This disables the ability to hide the connected
// widget.
// createPopupMenu
//---------------------------------------------------------
void MuseScore::toolbarVisibilityChanged(bool val)
QMenu* MuseScore::createPopupMenu()
{
if (!val) {
QObject* s = sender();
QWidget* w = static_cast<QWidget*>(s);
w->setVisible(true);
QMenu* m = QMainWindow::createPopupMenu();
QList<QAction*> al = m->actions();
for (QAction* a : al) {
if (a->text() == "Text Tools")
m->removeAction(a);
else if (a->text() == "Note Input")
a->setEnabled(false);
}
return m;
}
}

View file

@ -510,7 +510,8 @@ class MuseScore : public QMainWindow, public MuseScoreCore {
void switchLayoutMode(int);
void showMidiImportPanel();
void changeWorkspace(QAction*);
void toolbarVisibilityChanged(bool);
virtual QMenu* createPopupMenu() override;
public slots:
virtual void cmd(QAction* a);