Commit Graph

74 Commits

Author SHA1 Message Date
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
Allan Odgaard
9167035ad9 Don’t reload file browser for non-visible files
Previously we would reload the changed entries, if they were all visible, falling back on a full reload if not.

If items are not visible there should be no reason to do a full reload — I imagine the thinking was that the NSOutlineView may have previously fetched (and cached) one of the non-visible items (since one of its ancestors could just be collapsed). Since this is just a display attribute, it shouldn’t matter, even if the NSOutlineView would work like this.
2013-01-13 11:56:06 +01:00
Allan Odgaard
65a279802d Rename function name
We not only convert between NSArray and NSSet, but also the type of the contained object (NSURL ⇔ NSString).
2013-01-13 11:56:05 +01:00
Allan Odgaard
8be514ccb2 Rename byExpandingAncestors: → expandChildren:
We are expanding the children of the root item to select the provided URLs.
2013-01-13 11:56:05 +01:00
Allan Odgaard
5e291d8a22 Improve QuickLook support
Preview can now be initiated with multiple items and while the preview panel is showing, one can use arrow up/down to switch to other items (in the file browser).
2013-01-12 13:09:19 +01:00
Allan Odgaard
d6759dc9df Tidy up OakFileBrowser 2013-01-12 13:09:19 +01:00
Allan Odgaard
be1cfeb458 Improve file browser API
We now expose the root URL and allows mutating it.

We also provide the selectURL:withParentURL: method instead of the two showURL: and revealURL:.
2013-01-12 13:09:19 +01:00
Allan Odgaard
0ed119122f Refactor “reveal file” methods
Both methods are now based on selectURL:withParentURL: which contain the necessary checks (file already visible? parent actually valid?).
2013-01-12 13:09:18 +01:00
Allan Odgaard
15409e2eec Rename pushURL: → goToURL:
Also change showURL: calls into using goToURL: (when we know the URL is not a non-directory file URL that should be selected).
2013-01-12 13:09:18 +01:00
Allan Odgaard
10ef2f1034 Rename property (location → path) 2013-01-12 13:09:18 +01:00
Allan Odgaard
c323486250 Merge history controller into OakFileBrowser 2013-01-12 13:09:18 +01:00
Allan Odgaard
49c587e6bd Do not track recent locations 2013-01-12 13:09:18 +01:00
Allan Odgaard
b4066afc9a Omit recent items from file browser menu
This is a feature I have never used myself and it was somewhat limited by having the recent locations unique for each window.

If the feature should be revived it should be via a globally shared list of recent locations (and should persist across relaunch).
2013-01-12 13:09:18 +01:00
Allan Odgaard
5224d0b89c Refactor OFBHeaderView 2013-01-12 13:09:17 +01:00
Allan Odgaard
73e18d30db Merge OFBView into main controller
Using an NSView subclass wasn’t justified.
2013-01-12 13:09:17 +01:00
Allan Odgaard
87f1c109d3 Proper delegate/datasource removal 2013-01-12 13:09:17 +01:00
Allan Odgaard
3427639993 Switch to generated properties
Also remove implementation details from public header.
2013-01-12 13:09:17 +01:00
Allan Odgaard
f3f0f577bf ARC: Update OakFileBrowser framework 2013-01-12 13:09:17 +01:00
Allan Odgaard
f3c8b589b5 Replace OakStatusBar with OFBHeaderView
Presently this is non-functional but removing the OakStatusBar.h dependency makes it easier to convert to ARC, so that’ll be the next step, before actually making OFBHeaderView functional.
2013-01-12 13:09:17 +01:00
Allan Odgaard
f5ac423ecf Remove instance data from interface 2013-01-12 13:09:16 +01:00
Allan Odgaard
772e7ae1b4 Use weak pointer for file browser’s delegate 2013-01-09 02:59:18 +01:00
Allan Odgaard
293d9a8e46 Ensure DisplayName doesn’t return nil
Although I don’t know when it would return nil, issue #649 indicates that it sometimes does. We now fallback on the full URL in this case (and returning ‘«nil»’ if the url itself is nil). This should give a hint about what file system entries would fail to return a display name.
2013-01-08 22:48:06 +01:00
Jacob Bandes-Storch
b277613ecd Add "Reveal Current Document" command
This reveals the current document in the file browser, by expanding directories to reach it, rather than changing the root directory of the browser.
2013-01-08 22:48:06 +01:00
Jacob Bandes-Storch
2162082f37 Move FS utility funcs from OFB to a separate file 2013-01-05 04:21:17 +01:00
Allan Odgaard
47fa0f040c Use Objective-C literals for YES/NO 2013-01-02 01:46:48 +01:00
Allan Odgaard
33e11aedb0 Add copyWithZone: to OFBPathInfoCell
This is mainly to manually copy-construct the C++ instance counter that we use (in debug mode) to track leaks (or an erroneous extra release).

For good measure we also set the spinTimer instance variable to nil. Though this functionality isn’t presently used, so hasn’t actually caused a problem.
2012-12-28 02:47:19 +01:00
Allan Odgaard
71be61cbbb Enable ARC by default
We now explicitly disable it for targets that hasn’t yet been upgraded to ARC. This way, it’s easier to get an overview of which targets hasn’t yet been upgraded and ensures new targets has ARC enabled.
2012-12-19 19:42:36 +01:00
Joachim Mårtensson
b03ee2f6ee Use same mechanism to limit redraw in modifiedURLs 2012-12-14 18:03:37 +01:00
Joachim Mårtensson
417ecef624 Refactored calculations of touched filebrowser items into its own method 2012-12-14 18:03:36 +01:00
Joachim Mårtensson
d983d5a5d2 Limit file browser refresh on open/close
If changes are limited to visible rows, we only reload these.
2012-12-11 17:52:16 +01:00
Allan Odgaard
c995b758c8 fixup! Allow disabling document status in file browser
If ‘location’ was nil, we would implicitly create a std::string from that, which is not allowed (and crashes).
2012-11-14 11:18:51 +07:00
Josh Goebel
dc34d5c9d9 Allow disabling document status in file browser
Disabling this is achieved by setting `fileBrowserDocumentStatus` to `false` in `.tm_properties`.

Disabling it should remove potential delays after opening, closing, and saving files when file browser is showing a lot of files. It is meant as a temporary workaround until the performance issues are addressed.
2012-11-12 13:28:34 +07:00
Allan Odgaard
e1fc3993f0 Improve editor performance when file browser show lots of stuff
Delays may still be experienced when a file is opened or its “modified” state is changed but general edits should no longer be affected by how much is showing in the file browser.

This addresses issue #463.
2012-09-26 00:26:01 +02:00
Allan Odgaard
a0c4af64bd Remove trailing whitespace
Only removed from non-empty lines.
2012-09-25 14:16:50 +02:00
Allan Odgaard
56ec46e1f9 fixup! Avoid using objc_ptr 2012-09-21 01:32:41 +02:00
Allan Odgaard
ebab500ba3 Use std::map/set instead of C arrays
These types come with a find() method and avoids having to use helper functions to get the begin/end of the array (for linear search).
2012-09-20 12:22:20 +02:00
Allan Odgaard
8fd7b82cbd Remove CocoaSTL.h include 2012-09-20 12:22:20 +02:00
Allan Odgaard
4273bf968b Get rid of C++ style NSIndexSet iteration 2012-09-20 12:22:19 +02:00
Allan Odgaard
101e0560f6 Avoid using objc_ptr 2012-09-20 12:22:19 +02:00
Allan Odgaard
45763d4afc Don’t require file to get SCM info
We didn’t actually use the file itself, only its parent directory, and there are several places we want SCM info for an untitled file’s project directory, so removing the need for a file simplifies things.
2012-09-18 17:33:02 +02:00
Allan Odgaard
84104c8d9b Constrain size of splits in main window
The main window has now moved fully to constraint based layout which makes it a lot easier to tweak the layout and fixes issue #145.

Presently the option to have HTML output on the right is not supported. It will likely be back with a few other options that have been requested.

The width of file browser and height of HTML output view is always read from defaults rather than restored from previous session. Effectively this results in the same behavior except when there are multiple windows with different sizing of these splits. Unsure if per-window sizes should be brought back.
2012-09-15 15:12:58 +02:00
Allan Odgaard
31fc37edbc Remove unnecessary include 2012-09-15 15:12:57 +02:00
Allan Odgaard
baae923414 Remove resize buttons
Going forward we only allow resizing views by grabbing the dividers.
2012-09-15 15:12:57 +02:00
Allan Odgaard
2b9c27263d Auto-layout: Update file browser and HTML output 2012-09-14 17:14:55 +02:00
Allan Odgaard
4d95db8f66 Auto-layout: Implement intrinsicContentSize 2012-09-14 17:14:55 +02:00
Allan Odgaard
4b76514eeb Implement getter/setter for const& property 2012-09-12 18:30:37 +02:00
Allan Odgaard
6521ff2529 Use glob_list_t in file browser
This changes the way the include/exclude keys work: A path now *must* be matched by an include key to actually be shown.

The default value of the global include key has been changed to include “*” but if users have edited the value, they will see few or no files in the file browser.
2012-09-12 18:30:36 +02:00