Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Palette shortcut #3252

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants
@divya-urs
Copy link
Contributor

commented Jul 30, 2017

This pull request adds the ability to assign a shortcut to a palette element.
A new dialog (Palette Shortcut Manager) has been added which displays a list of palette elements in the current workspace along with the shortcut assigned to each element. A shortcut can be defined or cleared using the palette shortcut manager. The palette shortcut manager can be accessed from the preferences dialog, or by using a shortcut command.
A shortcut can also be assigned using the palette cell context menu or a shortcut command which adds a shortcut to the currently selected palette element.
Shortcuts are saved, so a shortcut defined in a session can be used in later sessions.

@divya-urs divya-urs changed the title set palette shortcut Palette Shortcut Jul 30, 2017

@divya-urs divya-urs changed the title Palette Shortcut Palette shortcut Jul 30, 2017

}
for (int i = 0; i < preferences.paletteCellList.size(); ++i) {
PaletteCellDescription* d = &preferences.paletteCellList[i];
registerPaletteShortcut(d);

This comment has been minimized.

Copy link
@Jojo-Schmitz

Jojo-Schmitz Jul 30, 2017

Contributor

indent...

This comment has been minimized.

Copy link
@lasconic

lasconic Jul 30, 2017

Member

This is a work in progress. Please refrain to nitpick for now, since the code will change quite a lot.

@@ -1462,6 +1559,7 @@ void Palette::read(XmlReader& e)
add = false; // action is not valid, don't add it to the palette.
}
}

This comment has been minimized.

Copy link
@Jojo-Schmitz

Jojo-Schmitz Jul 30, 2017

Contributor

not needed

@divya-urs divya-urs force-pushed the divya-urs:palette_shortcut branch from e36f521 to 7e51189 Aug 13, 2017

@divya-urs divya-urs force-pushed the divya-urs:palette_shortcut branch from fe7d774 to 837a1e7 Aug 21, 2017

@Jojo-Schmitz

This comment has been minimized.

Copy link
Contributor

commented Aug 22, 2017

@divya-urs: your last commit broke it, it doesn't compile anymore

@divya-urs

This comment has been minimized.

Copy link
Contributor Author

commented Aug 22, 2017

@divya-urs

This comment has been minimized.

Copy link
Contributor Author

commented Aug 23, 2017

Okay, I will check.

@Jojo-Schmitz

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2017

Looks like this added further warnings.

@divya-urs

This comment has been minimized.

Copy link
Contributor Author

commented Aug 24, 2017

@Jojo-Schmitz

This comment has been minimized.

Copy link
Contributor

commented Aug 24, 2017

Ah, so I just missunderstood what that commit was about.

@@ -1526,7 +1526,13 @@ Palette* MuseScore::newFretboardDiagramPalette()

void MuseScore::setAdvancedPalette()
{
mscore->getPaletteBox();

This comment has been minimized.

Copy link
@MarcSabatella

MarcSabatella Aug 25, 2017

Contributor

I'm not clear on what is going on with this change (or the similar one in setBasicPalette(). Can you describe?

This comment has been minimized.

Copy link
@divya-urs

divya-urs Aug 25, 2017

Author Contributor

I'm getting the shortcuts from the palette cells, and then setting those shortcuts in the new palette cells. setAdvancedPalette() and setBasicPalette() get called each time the palettes are redrawn, so the shortcuts need to be preserved by saving them before the palette box is cleared, and then setting the shortcuts in the new palette box.

This comment has been minimized.

Copy link
@MarcSabatella

MarcSabatella Aug 25, 2017

Contributor

OK, I believe that makes sense. Previously, there was no state that needed preserving - we could just rebuild these from scratch each time we needed to. Now, we need to at least remember the shortcuts assigned. I guess I was thinking somehow we might be reading/writing these on switch if there had been any customization, and the shortcuts would take care of themselves. Would that also have been a valid approach? Any advantages/disadvantages?

This comment has been minimized.

Copy link
@divya-urs

divya-urs Aug 25, 2017

Author Contributor

I think this would also be valid, but many changes would need to be made to use that approach. There were some problems if the workspace was read each time (palette shortcuts would stop working when the workspace was toggled), so to fix this, the palettes are read only on startup, and after that only the shortcuts are stored. Shortcuts are saved, stored each time the workspace is switched.

This comment has been minimized.

Copy link
@MarcSabatella

MarcSabatella Aug 25, 2017

Contributor

OK, thanks for the feedback. I was wondering if the workspace save/restore would be easier, but if not, just keep it the way it is.

@divya-urs divya-urs force-pushed the divya-urs:palette_shortcut branch from ffb567b to f53c3b3 Aug 25, 2017

@@ -1569,8 +1569,10 @@ void MuseScore::setAdvancedPalette()
preferences.paletteCellList.clear();
for (int i = 0; i < shortcuts.size(); i++) {
PaletteCell* cell = cells[i];
if (cell->name == "Show More")
if (cell->name == "Show More") {

This comment has been minimized.

Copy link
@MarcSabatella

MarcSabatella Aug 26, 2017

Contributor

I wonder if it is also worth making this a boolean flag in the cell, set when we create it, rather than keying off the name? Or if perhaps something like checking if cell->element == 0?

@divya-urs divya-urs force-pushed the divya-urs:palette_shortcut branch from 08f0843 to 0c84403 Aug 27, 2017

@divya-urs divya-urs force-pushed the divya-urs:palette_shortcut branch from 0c84403 to eec3df6 Nov 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.