Opened 3 years ago

Last modified 3 years ago

#13721 new bug

BFilePanel with B_DIRECTORY_NODE allows file selection

Reported by: kallisti5 Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by kallisti5)

Per the documentation:

If the setting includes B_DIRECTORY_NODE and the user selects and
Opens (i.e. clicks the Open button) a directory or a symlink to
a directory, the directory (or symlink) is delivered to your
target. If it doesn't include B_DIRECTORY_NODE and the user Opens
a directory (or symlink to a directory), the directory is entered
(the contents of the directory are displayed in the file list).

Specifying B_DIRECTORY_NODE only results in a BFilePanel which can:

  • Open directories.
  • Open files if you double-click them

Given the documentation, one would expect B_DIRECTORY_NODE without B_FILE_NODE to not allow users to select files.

Change History (5)

comment:1 by kallisti5, 3 years ago

Description: modified (diff)

comment:2 by kallisti5, 3 years ago

Description: modified (diff)

EDIT: Clarified description. This only occurs if you "double click" files in the BFilePane to select them. Clicking OK blocks your attempt to open.

I feel like the correct solution would be to just hide non-directories when B_DIRECTORY_NODE is the setting.

comment:3 by kallisti5, 3 years ago

Example usage:

    folderPanel = new BFilePanel(B_OPEN_PANEL, NULL, NULL, B_DIRECTORY_NODE);

comment:4 by korli, 3 years ago

Could it be related to #13463?

comment:5 by kallisti5, 3 years ago

Doesn't appear so. That seems more related to the enabled/disable state of the button. In my tests, the button remains enabled when selecting files, but doesn't do anything on files. (Which seems correct


Note: See TracTickets for help on using tickets.