Commit Graph

30 Commits

Author SHA1 Message Date
Allan Odgaard
5ee70bfe29 Use instance variable for documents array instead 2016-09-24 09:37:30 +02:00
Allan Odgaard
34e1fec7f1 Remove UI proxy implementation from DocumentWindowController 2016-09-24 09:37:30 +02:00
Allan Odgaard
965eac9342 Use KVO instead of document_t callback 2016-09-24 09:37:29 +02:00
Allan Odgaard
df0fbe8630 Preparation for removing document_ptr from DocumentWindowController 2016-09-24 09:00:25 +02:00
Allan Odgaard
e133be01b7 Rename documents property to cppDocuments
This is just to make migration easier.
2016-09-24 08:59:31 +02:00
Allan Odgaard
eef0878538 Remove document::show_browser
Instead use OakDocumentController’s showFileBrowserAtPath:
2016-09-24 08:55:18 +02:00
Allan Odgaard
ffca47a262 More code ported to OakDocument 2016-09-24 08:55:06 +02:00
Allan Odgaard
3af916629c Let OakCommand use OakDocumentController API 2016-09-24 08:33:33 +02:00
Allan Odgaard
9a4db4665d Add “show document” API to OakDocumentController
This is currently just a wrapper for the old C++ API.
2016-09-24 08:33:33 +02:00
Allan Odgaard
8f736f39cd Add key/value types for NSArray and NSDictionary return types
This is just to give us better type checking (as we probably want to change the dictionary key type to NSUUID*).
2016-09-24 08:33:32 +02:00
Allan Odgaard
aa2e86a015 Fix crash when clearing document that was never set
This would show when opening a file that prompted the user for input (e.g. unknown encoding) and then selecting cancel.
2016-09-21 20:39:42 +02:00
Allan Odgaard
6db5ac8de3 Rename performCloseOtherTabs: to performCloseOtherTabsXYZ:
Starting with macOS 10.12 the NSWindow class will swallow this method, even if we set NSWindow.allowsAutomaticWindowTabbing = NO.
2016-09-21 20:39:41 +02:00
Allan Odgaard
ad01eb1ac6 Use stringArrayForKey: where appropriate 2016-09-21 20:39:41 +02:00
Allan Odgaard
1087a68f44 Add “File Browser Items” as find dialog search target 2016-09-20 20:04:19 +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
10f88212e4 Use setDynamicTitle: for menu items with dynamic title
See previous commit for details.
2016-09-20 10:03:45 +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
44d037da65 Use OakDocument’s icon for Select Tab menu items 2016-09-19 12:50:04 +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
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
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
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
83113e4765 Use NSUUID for documentIdentifier properties 2016-09-18 07:32:05 +02:00
Allan Odgaard
676f542dac Custom scopeAttributes only worked for file pattern sections
That is [ *.diff ] worked but [ source.diff ] did not, since we looked up using only the file path, not the file type.
2016-09-16 15:39:33 +02:00
Allan Odgaard
0a2754a4c6 Add missing include 2016-09-16 15:39:33 +02:00
Allan Odgaard
a70363d4e0 Remove document_t compatibility API from FileChooser class 2016-09-14 08:39:09 +02:00
Allan Odgaard
ce5a6b4b59 Avoid unnecessary folder scanning
This should be fixed in the FileChooser class, but that is non-trivial since we need to introduce a “dirty” flag and start the search when the window is made visible or possibly at the start of the next event loop cycle.
2016-09-14 08:38:27 +02:00
Allan Odgaard
5d8ef8c259 Rename openDocuments property to openCppDocuments 2016-09-14 08:35:55 +02:00
Allan Odgaard
590fd5b71b Change type of document_t::lru from oak::date_t to NSInteger 2016-09-13 08:17:35 +02:00
Allan Odgaard
bdfdef2dde Rename file DocumentController.{mm,h} to DocumentWindowController.{mm,h} 2016-09-13 07:37:16 +02:00