Skip to content

Commit

Permalink
fix #17723: Allow removal of remaining instrument selected
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Aug 9, 2012
1 parent 074ebfe commit 519a900
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mscore/newwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,12 @@ void InstrumentWizard::on_partiturList_itemSelectionChanged()
return;
QTreeWidgetItem* item = wi.front();
bool flag = item != 0;
bool onlyOne = (item->type() == PART_LIST_ITEM && partiturList->topLevelItemCount() == 1)
|| (item->type() == STAFF_LIST_ITEM && item->parent()->childCount() == 1);
bool onlyOneStaff = (item->type() == STAFF_LIST_ITEM) && (item->parent()->childCount() == 1);
bool first = (item->type() == PART_LIST_ITEM && partiturList->topLevelItem(0) == item)
|| (item->type() == STAFF_LIST_ITEM && item->parent()->child(0) == item);
bool last = (item->type() == PART_LIST_ITEM && partiturList->topLevelItem(partiturList->topLevelItemCount() -1) == item)
|| (item->type() == STAFF_LIST_ITEM && item->parent()->child(item->parent()->childCount() - 1) == item);
removeButton->setEnabled(flag && !onlyOne);
removeButton->setEnabled(flag && !onlyOneStaff);
upButton->setEnabled(flag && !first);
downButton->setEnabled(flag && !last);
linkedButton->setEnabled(item && item->type() == STAFF_LIST_ITEM);
Expand Down

0 comments on commit 519a900

Please sign in to comment.