Remapping the file path for the Home button in Pathpilot

More
20 Oct 2021 16:33 #223683 by tormachstorm
I have only just been introduced to the whole Linux Pathpilot thing so I can't say that I know where to look when it comes to remapping buttons in the UI. I have searched around the files on the Linux machine trying to familiarize myself with how the files are setup. I have even messed around in the .glade file found in \python\images\tormach_mil_ui.glade but it doesn't seem to have the Home button in the editor. I'm to find a way to modify the PathPilot UI in a way so that the home button under the file tab is remapped to take you to a specific folder rather than the main root folder if that makes sense.
Attachments:

Please Log in or Create an account to join the conversation.

More
20 Oct 2021 23:14 #223719 by sharmstr
If I remember correctly, mappings are in the python files. The first place I'd look is tormach_file_util.py. Its been over a year since I've played with it, but I think I'm right.

Please Log in or Create an account to join the conversation.

More
25 Oct 2021 12:04 #224250 by tormachstorm
Thanks for responding I'm glad to know that "Tormach_file_util.py" is probably the correct area to look seeing that word find sees many mentions of the home button in the file "Tormach_file_util.py". even so I can't seem to understand how you change the button mapping so that the home button takes you to a specific folder of your choosing rather than the default folder "gcode".

I feel like this line is what needs to be changed DEFAULT_RESTRICTED_DIR = os.path.join(os.getenv('HOME'), 'gcode') and change it to DEFAULT_RESTRICTED_DIR = os.path.join(os.getenv('HOME'), 'untitled folder') ("untitled folder" is the folder is a generic name we will use it for explanation purposes) would I be correct? if so I have changed this and saved the file after the changes were made but when I tried this in Pathpilot the home button seemed to be still mapped the default 'gcode' file.
Attachments:

Please Log in or Create an account to join the conversation.

More
25 Oct 2021 16:17 - 25 Oct 2021 16:18 #224278 by sharmstr
Check out ui_common.py.

restricted_dir is set there. Changing this will make the home button go there. However, it will also become your default folder. This might cause other issues since pp is so reliant on that gcode folder. You probably want to make your own routines instead.

There's also constants.py with has GCODE_BASE_PATH.  Same issues with above though.
Last edit: 25 Oct 2021 16:18 by sharmstr.

Please Log in or Create an account to join the conversation.

More
25 Oct 2021 16:42 - 25 Oct 2021 16:43 #224282 by sharmstr
Ignore the above.

Just change the on_home_button_release function in tormach_file_util.py.

example
self.set_current_directory(os.path.join(os.getenv('HOME')) + os.path.sep + 'gcode/untitled folder')
Last edit: 25 Oct 2021 16:43 by sharmstr.

Please Log in or Create an account to join the conversation.

More
26 Oct 2021 17:22 #224406 by tormachstorm
That seems to work, thanks a lot!
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: cncbasher
Time to create page: 0.069 seconds
Powered by Kunena Forum