Commit Graph

139 Commits

Author SHA1 Message Date
Allan Odgaard
7c1c253c86 Make “Go to Favorites” a toggle 2013-02-11 14:21:24 +01:00
Allan Odgaard
059a8a0b75 Improve Quick Look menu item title
This now also shows what it’ll display and switches to “Close Quick Look” when the panel is already showing.
2013-02-11 14:21:23 +01:00
Allan Odgaard
2c996b6b7a Improve file browser menu titles
We now write what the actions will apply to. This isn’t done for all actions, which is somewhat consistent with Finder, though I don’t know why Finder doesn’t include such description for all items, perhaps it’s seen as redundant to state for every action (and just adds noise), so only items where user could be “confused” should explicitly state what they work on.
2013-02-11 14:21:23 +01:00
Allan Odgaard
7b017d695d Rework file browser action menu 2013-02-11 14:21:23 +01:00
Allan Odgaard
af37d2e30a Skip group cells when selecting item after delete (file browser)
Presently this is only relevant for the SCM Status view, as no other data source use group cells.
2013-02-11 14:21:22 +01:00
Allan Odgaard
df8465e607 Align close button (×) with file labels
Closes #391.
2013-02-11 14:21:21 +01:00
Allan Odgaard
129784816c Don’t show SCM badges for untracked items
All of these will always have the same badge, so there’s no reason to show it (and it covers the alias badge, so there is some usability benefits beyond just the visuals).
2013-02-11 14:21:21 +01:00
Allan Odgaard
507dac1908 Let FSItem use OakFileIconImage. 2013-02-11 14:21:20 +01:00
Michael Sheets
7fa0e34a5e Restyle and add graphics to file browser action bar 2013-02-09 16:34:24 +01:00
Allan Odgaard
ae02db9baa WIP: Add action bar to file browser 2013-02-09 16:34:24 +01:00
Michael Sheets
034dd8f06b Shrink height when tabs above document is enabled 2013-02-09 16:34:24 +01:00
Michael Sheets
2200df74fd Simplify constraints and set a height for file browser header 2013-02-09 16:34:23 +01:00
Allan Odgaard
43e15b3792 Let file browser header inherit from OakGradientView 2013-02-09 16:34:23 +01:00
Allan Odgaard
9c994af1e0 Tweak OakGradientView
- Accept two NSGradient objects instead of four colors.
- Call designated initializer on super instead of self since subclass is likely calling us from its designated initializer
- Make class public
2013-02-09 16:34:23 +01:00
Michael Sheets
9a26e0df5e Move file browser divider into parent view 2013-02-09 16:34:11 +01:00
Allan Odgaard
deac51c7a1 Expose outlineView property of file browser 2013-02-08 13:55:09 +01:00
Allan Odgaard
b139ac5097 Change push_back → emplace_back (C++11)
This is mainly motivated by readability, so I only did a few select replacements.
2013-02-08 11:20:35 +01:00
Allan Odgaard
fce82f0759 Fix potential crash
Even though the code is running on the main thread, it might still run after the owning (C++) object has been destroyed.
2013-02-06 18:25:01 +01:00
Allan Odgaard
a913a512e5 Let directory data source observe the “did change” notification
This means we instantly reload after performing a file system operation.
2013-02-06 14:50:05 +01:00
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