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

save block to file, fixes #1400 #1406

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

melwyncarlo
Copy link
Contributor

@melwyncarlo melwyncarlo commented Nov 16, 2021

@lordofbikes lordofbikes added PR small pull request, small diff size PR improvement pull request, changing an existing feature or behavior PR pending pull request, decision outstanding labels Apr 27, 2022
@lordofbikes lordofbikes changed the title Solved issue #1400 save block to file, fixes #1400 Apr 28, 2022
@@ -993,6 +1002,11 @@ void QC_ApplicationWindow::slotWindowActivated(QMdiSubWindow* w) {
activedMdiSubWindow=w;

QC_MDIWindow* m = qobject_cast<QC_MDIWindow*>(w);
if (w->windowTitle().contains("Block")) {
Copy link
Member

Choose a reason for hiding this comment

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

This is highly insecure.

  • The title is set with tr("Block '%1'"), thus in translated environment a block window title must not contain "Block"
  • When the drawing name itself contains "Block" we'll have wrong interpretation too

@lordofbikes
Copy link
Member

Beside my comment about insecure block window recognition, the implementation is based on hijacking slotFileSaveAs(). This is not a clean solution.
When this feature is implemented at all, the existing mechanism, using m_map with a new QAction, a separate menu entry and a separate slot for 'Save block as...' should be used.
Also I'm still unconvinced if this is really needed, only because one user didn't find the clearly visible 'Save block' button in the block list.

@lordofbikes lordofbikes added PR next release pull request, to be considered for next release and removed PR pending pull request, decision outstanding labels Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR improvement pull request, changing an existing feature or behavior PR next release pull request, to be considered for next release PR small pull request, small diff size
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants