If we implement this Start menu then you can customize your short cuts as with every command, too.A simple Alt+number for the 10 most used workbenches would be a big improvement...
Workbench drop down list is long, too long.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Workbench drop down list is long, too long.
Re: Workbench drop down list is long, too long.
I don't think it's within my current knowledge about FreeCAD/C++ ..... unless I get some help. I think I know how to add an item to the menubar/toolbar [1] , but what command should it call or what to call to activate a workbench from a menu?wmayer wrote:If we implement this Start menu then you can customize your short cuts as with every command, too.A simple Alt+number for the 10 most used workbenches would be a big improvement...
[1] https://github.com/FreeCAD/FreeCAD_sf_m ... h.cpp#L462
Re: Workbench drop down list is long, too long.
Quick & dirty, but working solution. Requires FreeCAD restart beacuse I don't know how to call WorkbenchGroup::refreshWorkbenchList() from src/Gui/DlgSettingsWorkbenchesImp.cpp [1]
https://github.com/PrzemoF/FreeCAD_sf_m ... orkbenches
[1] https://github.com/PrzemoF/FreeCAD_sf_m ... p.cpp#L114
https://github.com/PrzemoF/FreeCAD_sf_m ... orkbenches
[1] https://github.com/PrzemoF/FreeCAD_sf_m ... p.cpp#L114
- Attachments
-
- FreeCAD_workbenches_switcher.png (171.03 KiB) Viewed 1290 times
Re: Workbench drop down list is long, too long.
Please consider using a list view with checkable items, see QListWidget and void QListWidgetItem::setFlags, It would be way more usable.
EDIT: usable in the sense that the preference window does not get that big, possibly bigger than the sceen for many workbenches
EDIT: usable in the sense that the preference window does not get that big, possibly bigger than the sceen for many workbenches
Re: Workbench drop down list is long, too long.
What about this (see the screenshot):
1 - List of all workbenches
2 - Items that would show in the "Workbench" menu
That would allow to pick most often used workbenches, change order and (as menu item) assign keyboard shortcuts.
1 - List of all workbenches
2 - Items that would show in the "Workbench" menu
That would allow to pick most often used workbenches, change order and (as menu item) assign keyboard shortcuts.
- Attachments
-
- FreeCAD_workbench_switcher.png (220.61 KiB) Viewed 1284 times
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Workbench drop down list is long, too long.
I have written a macro like this ..PrzemoF wrote: but what command should it call or what to call to activate a workbench from a menu?
Code: Select all
FreeCAD.Console.PrintMessage("I start FEM ... ")
FreeCADGui.activateWorkbench("FemWorkbench")
FreeCAD.Console.PrintMessage("started.")
and it works
- Attachments
-
- bn_655.png (17.92 KiB) Viewed 1283 times
Re: Workbench drop down list is long, too long.
Thanks! However I'll have to start a workbench from C++ which is the main part of the problem for me
Re: Workbench drop down list is long, too long.
* IMO this doesn't need to be in the preferences dialog. I would use an own dialog for this or put it to the customize panel
* as ickby said a QListWidget should be used because it's easier to deal with and if the panel gets too big it automatically add scroll bars
* IMO, it's OK to let the change take effect after a restart because it's a lot of work to update everything on the fly. And this is something you don't do all the time
* as ickby said a QListWidget should be used because it's easier to deal with and if the panel gets too big it automatically add scroll bars
* IMO, it's OK to let the change take effect after a restart because it's a lot of work to update everything on the fly. And this is something you don't do all the time
Re: Workbench drop down list is long, too long.
Implementing this in a way the end result would be modern and would satisfy all groups of users is probably quite a huge task. The way i understand this attempt it's all about providing much simpler solution for now that would work with existing set of tools (Workbench Switcher). This simple task can become harder as it first looks. For example it will affect Start up module set preference. Anyway this is the solution i use and i will mention it here as it does not need FreeCAD restart and it cleans up Workbench Switcher. Solution was provided by user @ttype:
viewtopic.php?t=4171&p=32619
http://paste.ubuntu.com/5776142/
How does it work. I can remove specific workbench i don't use by simply running one command. For example Web Workbench:
I never investigated how to add it back without FreeCAD restart. After quick look I do see there is Gui.addWorkbench function available any maybe that could be used. I am guessing Gui.listWorkbenches could be used to fill QListWidget with the list of available workbenches including 3rd Party ones?
Anyway as i use this solution i mentioned it here if it helps in any way to achieve the final goal.
Cheers.
viewtopic.php?t=4171&p=32619
http://paste.ubuntu.com/5776142/
How does it work. I can remove specific workbench i don't use by simply running one command. For example Web Workbench:
Code: Select all
Gui.removeWorkbench("WebWorkbench")
Anyway as i use this solution i mentioned it here if it helps in any way to achieve the final goal.
Cheers.
Re: Workbench drop down list is long, too long.
Again, thanks for all suggesions and opinions! Below a screenshot of "work in progress" on workbenches customisation. Please don't hold back your opinions, positive or negative
- Attachments
-
- FreeCAD_workbenches_customisation.png (169.86 KiB) Viewed 1215 times