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

Added option to lock/unlock all other layers #1883

Merged
merged 5 commits into from
Feb 20, 2018

Conversation

kralle333
Copy link
Contributor

Added option to lock/unlock all other layers except for the currently selected one. Works similar to show/hide all layers function.

… selected one. Works similar to show/hide all layers function
}

undoStack->endMacro();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insert a new line at the end.

@@ -125,6 +125,11 @@ MapDocumentActionHandler::MapDocumentActionHandler(QObject *parent)
mActionToggleOtherLayers->setIcon(
QIcon(QLatin1String(":/images/16x16/show_hide_others.png")));

mActionToggleLockOtherLayers = new QAction(this);
mActionToggleLockOtherLayers->setShortcut(tr("Ctrl+Shift+U"));
Copy link
Member

@bjorn bjorn Feb 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess Ctrl+Shift+U was chosen because Ctrl+Shift+L is already taken by "Save All"? I wonder if it wouldn't be more intuitive to use Ctrl+Shift+L here and maybe drop the "Save All" shortcut again (or switch that one to Ctrl+Alt+S, which is what Notepad++ uses).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I had put the shortcut to Ctrl+Shift+L first. I agree with your suggestion.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, we can have only one Ctrl+Shift+S shortcut, and now it means both "Save As" and "Save All" (in which case neither will trigger). Please change "Save As" to Ctrl+Alt+S.

Copy link
Contributor Author

@kralle333 kralle333 Feb 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Bjorn, I can not see that Save As has the Ctrl+Shift+S shortcut. Have I overlooked it somewhere?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it happens in this line, because Ctrl+Shift+S is a common shortcut for "Save As":

mUi->actionSaveAs->setShortcuts(QKeySequence::SaveAs);

kralle333 and others added 3 commits February 19, 2018 14:31
Changed shortcut  for "Toggle Lock other Layers" to Ctrl+Shift+L
I chose to fix the code instead of the documentation, since I think
this is the behavior that is generally expected. If any not-locked
layers are found, all layers should get locked, since that is the
primary action. Unlocking happens only when all other layers are
currently locked.
@bjorn bjorn merged commit 9794037 into mapeditor:master Feb 20, 2018
@bjorn
Copy link
Member

bjorn commented Feb 20, 2018

Thanks for this useful addition!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants