Opened 6 years ago

Last modified 5 years ago

#5760 new Enhancement

Add a filter in Properties -> Files

Reported by: JoelSjogren Owned by:
Priority: Normal Milestone: None Set
Component: Transmission Version: 2.84+
Severity: Normal Keywords: filter, search, files
Cc:

Description

Problem

Say the torrent you are using has a lot of files, maybe even a lot of folders; and you want to download only the pdf files. What do you do? You right-click the torrent, choose Properties, go to the Files section and start a long-winded uncheck-check-check-scroll-check... process to get only the files that you want. There ought to be a better way.

Idea

We could add a search bar in Properties -> Files, like the one in the main window. Using it, the user should be able to filter out a subset of the files using a search phrase like .pdf and manipulate the subset as if it was a torrent on its own.

What files to match

  • If a file is matching based on its filename then all its parent directories match recursively.
  • If a directory is matching based on its filename then all its children match recursively.

We may define filename matching however we want, but to maintain consistency in the interface, we should use the same criterion as the search bar in the main window.

Attachments (3)

1.patch (9.2 KB) - added by JoelSjogren 6 years ago.
2.patch (8.1 KB) - added by JoelSjogren 5 years ago.
3.patch (8.2 KB) - added by JoelSjogren 5 years ago.

Download all attachments as: .zip

Change History (8)

Changed 6 years ago by JoelSjogren

comment:1 Changed 6 years ago by JoelSjogren

This is what I've done so far. It seems to be working. Do you like it?

comment:2 Changed 6 years ago by JoelSjogren

Oops, I accidentally included a change related to another ticket (the stuff about "incomplete"). I woke up this night and just thought, ***. It will not be included in future versions of the patch.

Changed 5 years ago by JoelSjogren

comment:3 Changed 5 years ago by JoelSjogren

Here's an updated patch which does not contain any other stuff. I've also corrected some warning messages, but there are two kinds left: "unused parameter" and "no previous declaration". What should I do about them?

file-list.c:902:1: warning: no previous declaration for ‘hide_all’ [-Wmissing-declarations]
 hide_all (GtkTreeModel * model, GtkTreePath * path,
 ^
file-list.c: In function ‘hide_all’:
file-list.c:902:47: warning: unused parameter ‘path’ [-Wunused-parameter]
 hide_all (GtkTreeModel * model, GtkTreePath * path,
                                               ^
file-list.c:903:33: warning: unused parameter ‘data’ [-Wunused-parameter]
    GtkTreeIter * iter, gpointer data)
                                 ^
file-list.c: At top level:
file-list.c:911:1: warning: no previous declaration for ‘show_matching’ [-Wmissing-declarations]
 show_matching (GtkTreeModel * model, GtkTreePath * path,
 ^
file-list.c: In function ‘show_matching’:
file-list.c:911:52: warning: unused parameter ‘path’ [-Wunused-parameter]
 show_matching (GtkTreeModel * model, GtkTreePath * path,
                                                    ^
file-list.c: At top level:
file-list.c:996:1: warning: no previous declaration for ‘update_visible_column’ [-Wmissing-declarations]
 update_visible_column (FileData * data, char * key)

comment:4 Changed 5 years ago by mike.dld

"No previous declaration" -> declare local functions static. "Unused parameter" -> mark with G_GNUC_UNUSED (GTK+ macro) or UNUSED (our own macro), as done elsewhere in the same file.

Changed 5 years ago by JoelSjogren

comment:5 Changed 5 years ago by JoelSjogren

Thank you. I've fixed those warnings now. If you need a torrent to try the feature with, try https://torrentz.eu/643bb4ee48fc4dcb9cce902236c989132e27733d (but don't download the content :). You can search for ".ape" or "booklet", and notice that by clicking the topmost checkbox, you affect the download state of all matching files.

Note: See TracTickets for help on using tickets.