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

[Macros Dialog]Add preference to begin search for unique suggested fi… #5035

Closed
wants to merge 1 commit into from

Conversation

mwganson
Copy link
Contributor

…lename with current @NNN rather than always 001

Currently, when using Duplicate button in Macros dialog the search for a suggested filename always begins with "@001", ignoring the current "@NNN" if the macro has already been duplicated and already has "@NNN". Some examples of current implementation:

some_macro.FCMacro (original)
some_macro@001.FCMacro (first duplicate)
some_macro@002.FCMacro (2nd duplicate)

If some_macro@001.FCMacro is deleted and we now have:

some_macro.FCMacro
some_macro@002.FCMacro

If we choose to duplicate some_macro@002.FCMacro the suggested name will be some_macro@001.FCMacro because the search for a unique filename always begins with 001.

With this PR if the user sets the preference (DuplicateFrom001) to false in the above scenario when the user duplicates some_macro@002.FCMacro the suggested name will be some_macro@003.FCMacro.

This is a feature requested by Mario, most prolific author of macros in the community.

https://forum.freecadweb.org/viewtopic.php?p=276152#p276152

Thank you for creating a pull request to contribute to FreeCAD! To ease integration, we ask you to conform to the following items. Pull requests which don't satisfy all the items below might be rejected. If you are in doubt with any of the items below, don't hesitate to ask for help in the FreeCAD forum!

  • Your pull request is confined strictly to a single module. That is, all the files changed by your pull request are either in App, Base, Gui or one of the Mod subfolders. If you need to make changes in several locations, make several pull requests and wait for the first one to be merged before submitting the next ones
  • In case your pull request does more than just fixing small bugs, make sure you discussed your ideas with other developers on the FreeCAD forum
  • Your branch is rebased on latest master git pull --rebase upstream master
  • All FreeCAD unit tests are confirmed to pass by running ./bin/FreeCAD --run-test 0
  • All commit messages are well-written ex: Fixes typo in Draft Move command text
  • Your pull request is well written and has a good description, and its title starts with the module name, ex: Draft: Fixed typos
  • Commit messages include issue #<id> or fixes #<id> where <id> is the FreeCAD bug tracker issue number in case a particular commit solves or is related to an existing issue on the tracker. Ex: Draft: fix typos - fixes #0004805

And please remember to update the Wiki with the features added or changed once this PR is merged.
Note: If you don't have wiki access, then please mention your contribution on the 0.20 Changelog Forum Thread.


Copy link
Member

@chennes chennes left a comment

Choose a reason for hiding this comment

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

This compiles, runs, and works as advertised. My only hesitation is whether it's worth having a visible preference in the Preferences dialog for so small a tweak -- maybe we should discuss either making this an invisible preference, or just making this the standard behavior and dropping the preference altogether.

FreeCAD#4949)

* [PD] Add new need active body dialog

Intended for use wherever an active body is needed but none exists. The dialog
contains a list with the bodies present in the document, with an extra option to
make a new body. Custom text can be provided if needed.

This commit also replaces the warnings used by "new sketch" and "primitive"
command with this new dialog.

Addresses issue FreeCAD#4288.

[Macros Dialog] search for unique name beginning with current backup number when using duplicate
@mwganson
Copy link
Contributor Author

I tried to squash the first commit, but goofed it up. I might have to close this one and open another.

@mwganson mwganson closed this Sep 17, 2021
@mwganson mwganson deleted the macroduplicate branch September 17, 2021 15:28
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.

None yet

3 participants