Skip to content

Commit

Permalink
disable "Generate key signatures" button for staff type change applie…
Browse files Browse the repository at this point in the history
…d to tablature staff
  • Loading branch information
Harmoniker1 committed Dec 26, 2019
1 parent 9c7e981 commit 406566c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions mscore/inspector/inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
#include "libmscore/accidental.h"
#include "libmscore/articulation.h"
#include "libmscore/fermata.h"
#include "libmscore/stafftypechange.h"
#include "libmscore/mscore.h"
#include "libmscore/stafftextbase.h"

namespace Ms {
Expand Down Expand Up @@ -502,6 +504,31 @@ InspectorStaffTypeChange::InspectorStaffTypeChange(QWidget* parent)
mapSignals();
}

//---------------------------------------------------------
// setElement
//---------------------------------------------------------

void InspectorStaffTypeChange::setElement()
{
InspectorBase::setElement();
bool hasTabStaff = false;
bool hasNonTabStaff = false;
for (Element* el : *(inspector->el())) {
StaffTypeChange* stc = toStaffTypeChange(el);
// tab staff shouldn't have key signature
if (stc->staffType()->group() == StaffGroup::TAB) {
hasTabStaff = true;
sl.genKeysig->setEnabled(false);
sl.resetGenKeysig->setEnabled(false);
}
else {
hasNonTabStaff = true;
}
}
if (hasTabStaff && !hasNonTabStaff)
sl.genKeysig->setChecked(false);
}

//---------------------------------------------------------
// InspectorVBox
//---------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions mscore/inspector/inspector.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class InspectorStaffTypeChange : public InspectorBase {

public:
InspectorStaffTypeChange(QWidget* parent);
virtual void setElement() override;
};

//---------------------------------------------------------
Expand Down

0 comments on commit 406566c

Please sign in to comment.