From: Florian J. <flo...@gm...> - 2013-01-16 09:30:07
|
Am 16.01.2013 06:10, schrieb Tim E. Real: > On January 15, 2013 11:47:09 PM Tim E. Real wrote: >> - Fixed Pianoroll/Drum Ctl+V paste bug was pasting into other parts: >> Always paste into current part. >> TODO: Score Editor still not working because there never seems to be >> a current part! Must ask Florian... > > The bug was if you tried to Ctl+V paste notes to some /other/ part on > some other track, it was still pasting into the original part instead. > > Florian, in each of the Pianoroll, Drum Editor, and Score Editor I changed > the menu command routines, one line in each "case CMD_PASTE" section. > > In the case of the Score Editor, the routine is: > > ScoreEdit::menu_command() > > and like the others, the line in "case CMD_PASTE" changed from: > > MusECore::paste_notes(3072); > > to: > > MusECore::paste_notes(3072, false, true, score_canvas->get_selected_part()); > > However, unlike the other editors, score_canvas->get_selected_part() > always seems to return NULL, ie there never seems to be a selected part. IIRC, you select a part by clicking (or modifying) a note on it. (in mousePressEvent, set_selected_part(set_it->source_part);) QMessageBox::information(this, tr("Ambiguous part"), tr("There are two or more possible parts you could add the note to, but none matches the selected part. Please select the destination part by clicking on any note belonging to it and try again, or add a new stave containing only the destination part.")); Plus, the score editor IIRC might try to be smart and select whichever part actually exists on the destination location. > > One can directly see this when the "paste with dialog" is opened in a Score: > The checkbox labeled "Put everything into the (selected) part" is always > grayed out, even when pasting to /this/ part. This is because the ScoreCanvas > selected_part member always seems to be NULL. > > I tired to see where selected_part should be set, found something > odd looking but I'm not sure what's going on: > > void ScoreCanvas::update_parts() > { > if (selected_part!=NULL) //if it's null, let it be null > selected_part=MusECore::partFromSerialNumber(selected_part_index); > ... > } that's only for the serial number: if one modifies a part, we must update out pointer to it, i.e. search for the current part with that serial number. greetings flo |