Opened 14 months ago

Closed 4 months ago

#18595 closed enhancement (fixed)

[Tracker] Allow organizing of Tracker's New Templates in sub-menus

Reported by: bipolar Owned by: nobody
Priority: normal Milestone: R1/beta5
Component: Applications/Tracker Version: R1/beta4
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

It would be nice to be able to organize templates in sub-menus.

Currently, trying to add sub-folders there do not work, as those are taken to be templates themselves.

Maybe there could be a convention, say... folders starting with "_" are to be treated as containing templates to be shown in a sub-menu of Tracker's "New"?

Supporting symlinks to folders located elsewhere would be ideal (to keep templates in a git repo, for example).

Attachments (2)

Screenshot 2023-10-25 at 3.54.41.png (54.8 KB ) - added by ilzu 13 months ago.
Screenshot 2023-10-25 at 3.55.12.png (64.2 KB ) - added by ilzu 13 months ago.

Download all attachments as: .zip

Change History (12)

comment:1 by humdinger, 14 months ago

I'm bit wary of magic-naming schemes, because it's totally undiscoverable.

How about this: If a folder in /boot/home/config/settings/Tracker/Tracker\ New\ Templates contains any files, it acts like a sub-folder in Tracker's "New >" menu.

Empty folders are actual template folders (which should be sorted under the fixed "New folder" entry above the separator).

Having folder templates is useful, e.g. to create folders with attribute columns already set for purpose (artist, album, track, title for audio files) or having a custom icon.

comment:2 by waddlesplash, 13 months ago

I'd second humdinger's comment.

comment:3 by ilzu, 13 months ago

How about using an filesystem attribute to mark which folders should be used as sub-menus instead of magic naming?

Why limit template folders to empty ones? I think it would be useful to have a folder templates with some base files and sub folders. For example you could have "project template" folders with a basic BApplication and BWindow code with a makefile.

comment:4 by bipolar, 13 months ago

The magic naming thing was just the first thing that came to my mind.

I like the idea of using attributes (and allowing folders to have "template content") much more.

(is there an easy way to add new attributes to files/folders right from Tracker?)

Last edited 13 months ago by bipolar (previous) (diff)

comment:5 by humdinger, 13 months ago

Having template-folders with files inside them sounds useful, though it prevents the intuitive put-templates-in-folder-to-sub-group. But having the sub-grouping done via attribute could work, too. Especially, if the "Tracker New Templates" folder already shows the new attribute column and is already used.
For example, "C++ header", "C++ source" and "Makefile" could all get the new attribute META:category with "Development".

(is there an easy way to add new attributes to files/folders right from Tracker?)

As soon as there's a certain (editable) attribute column visible, you can click on it for any file in the folder and enter a value for that attribute. For example, open Web+ bookmarks folder, display "URL", copy an image in that folder. Now you can enter a URL for that image and it's added as META:url (as defined in the Bookmark filetype).

comment:6 by bipolar, 13 months ago

Thanks humdinger, but I guess I wasn't clear enough with my question.

As soon as there's a certain (editable) attribute column visible

Was wondering how we get to *that* point, via GUI, or if we just have to rely on using addattr on a file for the first time (when none of the files has the "column" we want to show/use).

Once "the columuns are there", yeah, using Tracker to fill in the attribute values is great.

I was just thinking that being able to actually add/rename/remove[1] attributes right from Tracker would make the use of custom attributes more discoverable/convenient from an end-user point of view.

Guess that's a topic for a different Ticket though (assuming there's not one already there somewhere).

[1] remove as in, remove the attribute, not just set its value to "".

Last edited 13 months ago by bipolar (previous) (diff)

comment:7 by humdinger, 13 months ago

or if we just have to rely on using addattr on a file for the first time (when none of the files has the "column" we want to show/use).

I don't know if there is already such a thing in Haiku's build system, but I think we'd need to have a means to add a pre-configured _trk/columns_le to the "Tracker New Templates" folder.

I was just thinking that being able to actually add/rename/remove[1] attributes right from Tracker

Doing that from the "Attributes" tab of the "Get info" window whould be a prime candidate, I'd say. Though "Get info" would then have to change to e.g. "Properties"...

comment:8 by ilzu, 13 months ago

I've been workingg on this a little bit. Currently it uses boolean attribute "_trk/_template_submenu" to determine if a directory in Tracker template directory is a template directory or a submenu.

comment:9 by ilzu, 4 months ago

I've uploaded a patch to review https://review.haiku-os.org/c/haiku/+/7832 It doesn't allow the template folders to have content yet, but I'll work on that.

comment:10 by waddlesplash, 4 months ago

Milestone: UnscheduledR1/beta5
Resolution: fixed
Status: newclosed

Patch merged in hrev57887.

Note: See TracTickets for help on using tickets.