Commit Graph

3549 Commits

Author SHA1 Message Date
Allan Odgaard
dbee4704cc Clear the countOfMatches properties after unbinding
The Replace All button’s enabled state is based on count of matches (via bindings), so unbinding would leave it possibly enabled when it should have been disabled.
2016-09-20 18:17:37 +02:00
Allan Odgaard
2e61de9f7d Do not show missing items under Recent Places in folder search 2016-09-20 18:17:06 +02:00
Allan Odgaard
e20bb55d18 Use home folder as fallback in FFFolderMenu
This is to avoid an exception when the code is used with menu items that have no represented object (which it normally wouldn’t in shipping code, but it seems it should be supported nonetheless).
2016-09-20 18:16:41 +02:00
Allan Odgaard
53a6708c08 Add API to search for documents at multiple locations 2016-09-20 18:15:20 +02:00
Allan Odgaard
330695a775 Import Find.h instead of redeclaring some of its symbols 2016-09-20 18:14:07 +02:00
Allan Odgaard
c722c0266d Include spelling languages in the bundle item chooser 2016-09-20 18:13:24 +02:00
Allan Odgaard
e3874bcecb Only set menu item image when required
The system can be updating the menu only to resolve a key equivalent, hence the image is not required. The document icon can be a little expensive to create because of the SCM badge. This would be noticeable when doing a folder search with hundres or thousands of results and then pressing ⌘1, here it would previously need to create all the document icons before responding to the key.
2016-09-20 18:12:13 +02:00
Allan Odgaard
1fad00682a Do not include final “newline” when creating image from selection
Previously searching for something with a trailing newline would have the pop-out animation (image) include an extra empty line.

An issue is when only searching for a newline, currently this results in an empty image, so we need to special-case that.
2016-09-20 18:11:23 +02:00
Allan Odgaard
10f88212e4 Use setDynamicTitle: for menu items with dynamic title
See previous commit for details.
2016-09-20 10:03:45 +02:00
Allan Odgaard
60441f69e4 Add NSMenuItem category method to be used for dynamic titles
When a menu item has a custom app shortcut it is necessary to keep the original title as we would otherwise lose the custom app shortcut defined by the user (using the original title).
2016-09-20 10:03:45 +02:00
Allan Odgaard
ad883f7211 fixup! Only set table view’s row height during sizeToFit
Incase of no choices we would set a row height of zero which is not allowed.
2016-09-19 13:12:53 +02:00
Allan Odgaard
7bddb114bc Only obtain SCM info when file chooser is showing Uncommitted Changes 2016-09-19 12:57:50 +02:00
Allan Odgaard
6f4eddf88c Avoid wrapper objects in FileChooser 2016-09-19 12:56:03 +02:00
Allan Odgaard
7cc017f343 Harmonize all implementations of sharedInstance 2016-09-19 12:54:19 +02:00
Allan Odgaard
fe831c2fc2 Declare NSMenuDelegate protocol conformance for OakOpenWithMenu 2016-09-19 12:52:46 +02:00
Allan Odgaard
41bf68e636 Remove FileChooser’s openDocuments property
List of open documents are (now) obtained from OakDocumentController.
2016-09-19 12:51:36 +02:00
Allan Odgaard
9397aed6ef Make document icon and close button update in FileChooser 2016-09-19 12:51:19 +02:00
Allan Odgaard
44d037da65 Use OakDocument’s icon for Select Tab menu items 2016-09-19 12:50:04 +02:00
Allan Odgaard
297cfa1726 Remove unused OakFileIconImage.h includes 2016-09-19 12:49:03 +02:00
Allan Odgaard
636b0fe5f8 Use OakDocument for icon and close button in Open Quickly
Currently these do not update when document properties change.
2016-09-19 12:48:46 +02:00
Allan Odgaard
238ee0cc4f Load potential backup before operating on non-loaded documents 2016-09-19 12:48:12 +02:00
Allan Odgaard
9b75a50520 Fix issue where aborting a file rename did not restore display name 2016-09-19 12:46:54 +02:00
Allan Odgaard
7a69bf3b28 Ensure untitled documents are in the LRU list after session restore 2016-09-19 12:46:07 +02:00
Allan Odgaard
de83ebf06e Introduce OakCreateCloseButton API 2016-09-19 09:01:35 +02:00
Allan Odgaard
ce639d6d09 Move close button graphics to OakAppKit 2016-09-19 08:59:34 +02:00
Allan Odgaard
bc6c05086a Include untitled document’s directory in their description 2016-09-18 13:26:13 +02:00
Allan Odgaard
05711359a0 Also return untitled documents from enumerateDocumentsAtPath:
We look at the document’s directory property to see if it is within the folder being searched.
2016-09-18 13:26:13 +02:00
Allan Odgaard
9e5c4f27b6 OakDocumentController’s openDocuments now return a sorted array 2016-09-18 13:26:13 +02:00
Allan Odgaard
abeaa0498f OakDocument’s icon now indicate when a file is missing on disk 2016-09-18 13:26:12 +02:00
Allan Odgaard
82ad6667e9 Ensure all untitled documents in a project get a directory
We should probably update the directory if the project’s project folder is changed, and we may also consider storing this in the session, at least if we set the directory during “New Tab” (based on current file browser selection).
2016-09-18 13:26:12 +02:00
Allan Odgaard
1627a62b90 Clear document’s directory property when changing path
This is just for good measure.
2016-09-18 13:26:12 +02:00
Allan Odgaard
87dafa3332 Only let untitled documents read settings via directory property 2016-09-18 13:26:12 +02:00
Allan Odgaard
a58f3b88e9 Let document window send ‘open’ to unloaded documents
When batch-opening documents we only load the selected one. Previously this meant that e.g. after session restore, using Find in Open Files would not search documents in background tabs (that had not yet been clicked).
2016-09-18 10:35:33 +02:00
Allan Odgaard
5f53075864 Disable recent tracking for non-open documents instead of non-loaded 2016-09-18 10:33:45 +02:00
Allan Odgaard
d66b2b982d Search open files using OakDocument’s isOpen property 2016-09-18 10:33:20 +02:00
Allan Odgaard
532e9742d2 Add openDocuments property to OakDocumentController
This uses OakDocument’s isOpen property to know which documents are open.

Currently not KVO compliant, but it probably should be.
2016-09-18 10:31:50 +02:00
Allan Odgaard
fa2eaa1e50 Make OakDocument’s open/isOpen separat from isLoaded
A loaded document is always open but an open document is not necessarily loaded.
2016-09-18 10:30:28 +02:00
Allan Odgaard
ddefdec649 Change document’s isOpen property to isLoaded
Since we do not load documents before the user selects them, e.g. after session restore or when opening multiple documents, it makes sense to have both an isOpen and isLoaded property, the former means “is shown somewhere in the UI” and would make it appear (e.g. in file browser) with close button etc., whereas the latter means that data has been loaded from disk, and we can safely access the buffer.
2016-09-18 10:29:21 +02:00
Allan Odgaard
cd58781f19 Increase find results update interval from 0.03 to 0.20 seconds
It looks better when we have a “full page” of results on the first update, rather than building up the first page of results file-by-file with only 0.03 seconds between each “increment”.
2016-09-18 10:29:20 +02:00
Allan Odgaard
1abd03a1a4 Skip parsing format strings w/o special characters 2016-09-18 10:27:56 +02:00
Allan Odgaard
9aafadbe25 Fix retain cycles responsible for leaked NSTableCellView objects 2016-09-18 10:26:00 +02:00
Allan Odgaard
0fa87d514d Use nicer isXYZ property getter names for tab bar view 2016-09-18 10:26:00 +02:00
Allan Odgaard
4b000cc633 Rename scannerProbeTimer variable to folder search code
This is so that the code mimics FileChooser.mm
2016-09-18 10:25:53 +02:00
Allan Odgaard
df5b79d4a3 Remove unused ‘polling’ property from file chooser 2016-09-18 10:25:18 +02:00
Allan Odgaard
2927a34882 Delay showing progress indicator in file chooser
For most projects the progress indicator would show for less than a tenth of a second, which would make it appear as flicker.

Also increase the initial poll interval to 0.02 seconds since results are updated when the search finishes (previously they were only updated by the poll timer, which is why we had to set it so low).
2016-09-18 10:24:28 +02:00
Allan Odgaard
83113e4765 Use NSUUID for documentIdentifier properties 2016-09-18 07:32:05 +02:00
Allan Odgaard
31e3f37669 Remove code that ensured re-use of document_t instances
Since document_t is now a thin wrapper and OakDocument does its own tracking to ensure we do not create multiple documents for the same path, we no longer need document_t to take care of this.
2016-09-18 07:32:05 +02:00
Allan Odgaard
aad92642dc Disable compiler warning for our Objective-C leak detector 2016-09-17 07:23:48 +02:00
Allan Odgaard
51faf0ed3c Remove WebKit workaround that no longer seems necessary
The workaround was introduced in May 2005, so the underlying issue was probably addressed a long time ago :)
2016-09-17 07:22:41 +02:00
Allan Odgaard
4307501170 Let type of kSearchMarkIdentifier be NSString 2016-09-16 15:45:18 +02:00