These methods were deprecated in 10.7. Use `convertRectToScreen:` and `convertRectFromScreen:` instead. This is required for proper high resolution support.
In addition to being redundant, now that we have a global escape function, the custom shell escaping code had a bug when the path contained more than one apostrophe.
This change was prompted by the appearance of the `tabSizePopUp` button in the status bar. After dismissing the menu, the title would be disabled.
To ensure we do not have similar issues elsewhere, let's prefer the use of `NULL` to `nop:` when assigning the action for menu items unless we are sure that the menu item should always be disabled (e.g., the item is used as a label).
We override undo/redo for the file browser so that ⌘Z / ⇧⌘Z will only undo/redo file browser actions when it’s in the responder chain: b9fafd1495
This had the unfortunate side-effect of eclipsing the undo support of descendent views of the file browser, like the field editor used for renaming items.
I mainly dislike the trailing zeroes because CGFloat used to be a float but 1.0 is a double (1.0f would be a float). So better to under-specify and let the compiler figure out the proper type.
The standard doesn’t care which side the keyword is placed on, but placing it on the right makes it easier to read types.
E.g. reading “int const* const” from right to left we get “const pointer to const integer”.
This ensures that ⌘Z / ⇧⌘Z are only targeting the file browser when it has focus.
Previously these keys would act on the file browser undo stack when a view without it’s own undo/redo stack had focus, e.g. HTML output view.
While code reuse is an added benefit, the main motivation was to fix the appearance of the action popup button in the Find window. The first (placeholder) item in the Find window's action button was assigned a nop action so that when the button was clicked and it's menu validated, the "action" image would always appear as disabled.
For example if multiple files with same base name are modified or untracked, then previously it wasn’t possible to tell them apart (other than using the tool tip which show full path).
This is incase the item’s display name is different than the file’s display name, for example if the display name contains part of the path’s parent (to disambiguate it).
Previously if opening e.g. /Applications/Mail.app/Contents/Info.plist and setting project folder to /Applications and asking to Go → Current Document then nothing would happen, as the current document would be a descendent of the current (project) folder but the file browser was unable to expand the Mail.app file package to actually reveal it.
We use to pass nil to NSMenuItem initWithTitle: when clicking the SCMFolders in
SCM Status (see commit e5841fe); however, we will *probably* never encounter
this now. But it might be useful, if custom data sources are implemented for the
file browser in the future.
The services support in the file browser was mainly added to allow Quicksilver to grab the selection, I do not recall if this is why the selection was (also) made available as a regular string (in addition to the “file names pasteboard type”).
Previously when constructing a scm URL from a path, if scm was not enabled
we returned a file URL. This could result in some unexpected behavior.
For instance, when a directory was selected in the file browser,
activating "SCM Status" would just open the untracked directory.
This patch, insteads, adds a query to the scm URL that can be parsed to
determine how to handle the scm status request later on.
This will make it easier to change the logic, since 3 different parts of the file browser depend on it: accepting first responder, selecting items, and single-clicking items.
In practice it is possible to be in a parent of the Favorites folder and expand items so that the symbolic links in favorites can be selected, this commit does not handle that case, as we would then also need to handle the case where items both inside and outside the Favorites folder were selected (at the same time).
Users who do these things are probably aware of how symbolic links work, and can use “Move to Trash”.
Closes#1089