Commit Graph

120 Commits

Author SHA1 Message Date
Allan Odgaard
41ea4b1888 Move instance data to implementation file 2013-02-05 20:59:54 +01:00
Allan Odgaard
446f219c7a Reload updated folders on reactivation
This is done by stat’ing all visible folders and is a fallback for when fs-events is not working (e.g. network file systems).
2013-02-05 20:59:54 +01:00
Allan Odgaard
e46be6b2a2 Add memory address to FSItem description
Since table views use the memory address, and these items are for use in table views, it’s useful to see the address when printing an item.
2013-02-05 20:59:54 +01:00
Allan Odgaard
c951e00a06 File browser: Dispose all children on collapse
Previously we kept the children which had been expanded, as these had an associated record for tracking file system changes and SCM info.

However, when expanding we weren’t actually re-using the item from the cached record, so not only was this wasteful, but it caused a problem because we effectively created a new item but used the old record with the old item, and while the two items would compare is equal when using isEqualTo:, they didn’t have the same memory address, so the outline view would not consider them equal, and would thus not react on reload requests when using the older item.
2013-02-05 20:59:54 +01:00
Allan Odgaard
c182d08c5d Only access SCM info when available
Fixes #756.
2013-02-05 09:45:11 +01:00
Allan Odgaard
f99ca2408d Show non-existing paths with SCM status
This means deleted files which haven’t yet been committed show up in the file browser.
2013-02-04 19:38:32 +01:00
Allan Odgaard
6f076e0895 Remove public initializer
This is only to ensure everyone goes through the class method, which is easier to search for (constructing an FSItem from a URL is a little expensive so we wish to get rid of it where possible).
2013-02-04 19:38:32 +01:00
Allan Odgaard
6d022be813 Rework file browser directory source
We now use the new SCM callback and in general things are much simpler, cleaner, and probably faster.
2013-02-04 19:38:31 +01:00
Allan Odgaard
dae91b7159 Move instance data to implementation 2013-02-04 19:38:31 +01:00
Allan Odgaard
e599bb7379 Introduce scm::ng::root_for_path
Also change SCM implementation so that it doesn’t use objects with automatic storage, as the objects may be accessed from threads, which may run after objects with automatic storage has been destroyed.
2013-02-03 10:48:38 +01:00
Allan Odgaard
bfa3db1d79 Disallow selecting group cells in file browser
Group cells are presently only used for the SCM status data source.
2013-02-03 10:48:29 +01:00
Allan Odgaard
837bdf537b Reset mouse hover state when leaving view
The close buttons in the file browser could be stuck on their “hover” state if quickly moving mouse outside the bounds of the outline view.
2013-02-03 10:48:27 +01:00
Allan Odgaard
b51ed151d6 Auto-enable Back / Forward menu items 2013-02-03 10:48:26 +01:00
Allan Odgaard
78c5114ac6 Remove hardcoded shortcuts from keyDown:
These keys are also in the menu so no need to special-case them (unlike the other keys handled).
2013-02-03 10:47:24 +01:00
Allan Odgaard
d29337a754 SCM API: Update SCM data source 2013-02-02 10:51:59 +01:00
Allan Odgaard
4138c2a3d5 Use data source’s root item’s title in file browser header
This is instead of simply asking for the root URL’s display name, as the data source can provide a more specialized display name.
2013-02-02 10:34:23 +01:00
michael starke
e5d2d43e61 Fixed wrong color in red file labels 2013-01-31 01:26:31 +01:00
Allan Odgaard
71e884a6de Fix crash when pasting in file browser
This started after upgrading to clang-425.0.24. More info at https://github.com/sorbits/rdar/tree/master/for-in-with-ARC
2013-01-30 16:17:32 +01:00
Allan Odgaard
8e433ae3ba View → Show Invisibles now work for file browser
With focus in the file browser this menu item can now be used to toggle wether or not the include/exclude patterns should be ignored (causing everything to be shown, when ignored).
2013-01-29 15:31:11 +01:00
Allan Odgaard
9273f28a87 File browser: Keep item selected after delete
The ideal behavior would account for “nesting”, i.e. we should prefer to select an item from the same folder which we deleted from. Though Finder uses a similarly “naive” selection preservation algorithm.

Closes #717.
2013-01-28 20:37:34 +01:00
Allan Odgaard
25cfc61f9f Fix “Go to Favorites” (wrong URL used)
The URL constant for the favorites location was setup using oak::application_support() but done before the app support folder was initialized (due to the setup function being marked as a constructor).
2013-01-28 12:42:27 +01:00
Allan Odgaard
4dccc12945 Add method to move focus to document or file browser 2013-01-28 12:42:27 +01:00
Allan Odgaard
164aef5323 Use horizontal/vertical line creators 2013-01-28 12:42:27 +01:00
Allan Odgaard
7a5294936c QuickLook preview panel now zooms in/out 2013-01-25 17:44:17 +01:00
Allan Odgaard
a935aff340 Going to SCM status has the groups expanded
Previously these would not initially be expanded but the expansion state remembered. Now that we regularly clear cache of expanded URLs, it’s more tedious regularly having to expand these two groups.

It also introduce new API for having data sources return what items should be initially expanded, which probably makes sense for some data sources.
2013-01-25 13:49:16 +01:00
Allan Odgaard
5adc29189e Drop other expanded folders when revealing item
We probably should only drop expanded folders which descend from the current root, but that’s more code and the implemented behavior could be seen as “garbage collection” (keeping the memory of expanded folders low).
2013-01-25 13:15:16 +01:00
Steven Clukey
c7035ded44 Added force open in TextMate and fixed confusion when opening an alias.
Any file should be able to be opened within TextMate, so
Option-DblClick will always do that. I first noticed this with .xib
files.
Because of the order of the if statements, opening an alias to a
package or binary file (or .xib) would not have the previous if
statements applied to it.
2013-01-25 13:15:16 +01:00
Allan Odgaard
7d02a67870 Remove unused graphics 2013-01-25 11:01:57 +01:00
Allan Odgaard
b1f9259cec Render table view as having focus 2013-01-23 13:44:51 +01:00
Allan Odgaard
aa71b7ccf0 Adhere to naming convention
Given constraint-based layouts, we’re more likely to create views in code, and as helper functions are often involved, it makes sense to name them so that we can quickly get a list of all helpers (via search), either for copy/paste or for evaluating wether or not it makes sense to move all helpers to a single library.

Since helpers are declared with static storage, they do not pollute the global namespace.
2013-01-23 08:19:39 +01:00
Allan Odgaard
ef012c90f2 Add undo support to file browser
This closes #17.
2013-01-22 19:57:02 +01:00
Allan Odgaard
658c17023b Use menu validation instead of manual disabling items
This is required if some of the menu item targets are not ‘self’ as we do not know if these targets can handle the action method.
2013-01-22 19:56:18 +01:00
Allan Odgaard
f4c42bbd7a Fix double indent 2013-01-22 19:56:18 +01:00
Allan Odgaard
6ca780191b Remove undo/redo methods
This wasn’t functional (and not really in the responder chain).
2013-01-22 19:56:18 +01:00
Allan Odgaard
c874a81246 Indicate cell prefersTrackingUntilMouseUp
Not really sure if there is any difference, but at least with this, the table view should expect trackMouse:inRect:ofView:untilMouseUp: to run a local event loop (until NSLeftMouseUp).
2013-01-21 15:03:52 +01:00
Michael Sheets
6970031245 Restyle navigation bar to be more in line with Lion.
- The shading is a combination of the scope bar and textured button used in Lion/Mountain Lion.
- Add an inactive state.
- Increase click area of the forward/back buttons while decreasing the image size.
- Switch popup menu cell to NSBackgroundStyleLight, previously the text would go to gray when inactive this prevents that though it does lose the drop shadow.
- Various tweaks to alignment and spacing.
2013-01-21 00:38:26 -06:00
Allan Odgaard
19030a7586 Use file’s existing icon when zooming it 2013-01-20 12:49:33 +01:00
Allan Odgaard
0562d22716 Ensure we remove ourself from all observing
The file browser was still observing FSItemDidReloadNotification in its dealloc. Prior to ARC we used ‘self.outlineView = nil’ which removed us as observer, but after ARC we no longer execute that line.
2013-01-20 12:49:28 +01:00
Allan Odgaard
4f4a56fd7a Make OFBPathInfoCell a public class
This is temporary — if it should remain public, we should rename it and move it to the OakAppKit framework.
2013-01-18 15:45:43 +01:00
Allan Odgaard
701e26997e Fix typo in enum value 2013-01-18 15:45:43 +01:00
Allan Odgaard
d40a1fa431 Switch to generated properties 2013-01-18 15:45:43 +01:00
Allan Odgaard
3564746260 Add folder’s display name to menu items
This is only for the menu which shows when there is no selection.
2013-01-17 09:16:04 +01:00
Allan Odgaard
af8d8d3dbb Show in Finder works for multiple selected items 2013-01-17 09:16:04 +01:00
Caleb Land
cca891d74c Add “Show in Finder” context menu when no items are selected
When you control-click the empty part of the file browser and select “Show in Finder” a Finder window will open showing the currently selected folder.

You can go about this other ways, but I find that this feature complements the already existing "New Folder" menu item in the no-items-selected context menu of the file browser.

This patch is public domain.
2013-01-17 08:39:00 +01:00
Allan Odgaard
d7661fc7bb Picking “Other…” in file browser would stick
Issue #673.
2013-01-16 04:42:51 +01:00
Allan Odgaard
69904bef75 Improve look of navigation bar 2013-01-16 04:40:20 +01:00
Allan Odgaard
cd153b6605 Let selectURLs:expandChildren: deselect all
It also clears the history of non-visible items that was left selected.
2013-01-13 11:56:07 +01:00
Allan Odgaard
64f0f209da Using Go → Enclosing Folder selects the child
This is consistent with how Finder works and I think this is desired behavior to sort of track where we came from.
2013-01-13 11:56:07 +01:00
Allan Odgaard
c78c758c4a Remember current file browser selection in session data
This ensures that we restore the selection for the currently visible folder on relaunch. Selections in other folders is lost, see previous commit for more info.
2013-01-13 11:56:06 +01:00
Allan Odgaard
06fea983fc Don’t keep selected items in defaults
This means the set of selected file browser items is reset on relaunch — I’ve found that restoring selection when navigating to a folder was often not really desired.
2013-01-13 11:56:06 +01:00