Commit Graph

191 Commits

Author SHA1 Message Date
Allan Odgaard
b876a6a577 Remove “Unsaved Changes” warning from find in folder dialog 2014-10-08 22:05:20 +02:00
Allan Odgaard
e4f62343f6 Save immediately after folder search‘n’replace on closed document 2014-10-08 22:03:48 +02:00
Allan Odgaard
74ae2b21dd Bump document revision after doing folder search and replace
Without this, the document would not appear as modified (if it wasn’t already).
2014-10-08 21:51:17 +02:00
Allan Odgaard
591876f3f2 Introduce FFResultsViewController
This moves a lot of view related code out of the Find singleton.
2014-10-08 12:23:56 +02:00
Allan Odgaard
23a66a40b9 Move FFResultNode to its own file 2014-10-07 22:27:59 +02:00
Allan Odgaard
4d0f4b4c03 File names in search results stay dark gray (and bold)
Since the headers use a bigger font size than the document excerpts, making file names both black and bold, like the matches, makes them too dominant.
2014-10-07 19:10:27 +02:00
Allan Odgaard
197222f93e Disable find action buttons when there is no find string 2014-10-02 11:03:40 +02:00
Allan Odgaard
c080a5d5d3 Use NSNegateBooleanTransformerName constant instead of string 2014-10-02 11:03:40 +02:00
Allan Odgaard
63dcc93ab4 Introduce table cell view subclass to avoid expensive reload 2014-09-30 17:05:53 +02:00
Allan Odgaard
106ac62bcf Use OakStatusBarFont() for find window’s status text 2014-09-30 16:58:12 +02:00
Allan Odgaard
11de15ac54 Update fonts used for find in folder results
We now use the control content font as this seems to be meant for content shown in tables. We use the standard size (of 12 points) for the headings and set the result rows to use 11 point.

The number of matches is shown with the label font as that is semantically a small font used for placing labels next to things.
2014-09-29 22:41:54 +02:00
Allan Odgaard
d1dd666fbd Remove remains from cell-based find results outline view 2014-09-29 15:12:23 +02:00
Allan Odgaard
e7bfe7b238 Fix reappearing regular expression error popover
If it was shown and dismissed, then it would show again the next time the text field content was changed (and the content was not a valid expression).
2014-09-26 23:10:24 +02:00
Allan Odgaard
279fdbbd3f Add new folder search options to action/options menu 2014-09-14 19:12:19 +02:00
Allan Odgaard
2474af5d16 Skip searching binary files
Binary files are identified by containing a null byte (after applying encoding heuristics and decoding potential UTF-16 etc.).
2014-09-14 18:28:39 +02:00
Allan Odgaard
9a3ab4c46f Add option to search linked files (rather than folders)
Also reworked API slightly to make things more explicit.
2014-09-14 18:17:00 +02:00
Allan Odgaard
2d3de8513c Using ⌘G after a folder search no longer visits removed documents 2014-09-14 17:27:00 +02:00
Allan Odgaard
0ed6ae555c Extend folder search glob when removing result and holding option
This is a quick way to exclude the file from future searches.
2014-09-14 17:14:05 +02:00
Allan Odgaard
e78a9ced21 Make glob string property settable 2014-09-14 17:11:22 +02:00
Allan Odgaard
01543db36f Show malformed match result “warning” with correct font size 2014-09-13 15:53:52 +02:00
Allan Odgaard
dd0afb381f Set regexp error popover behavior to NSPopoverBehaviorTransient
This allows using escape to close the popover.
2014-09-12 16:17:35 +02:00
Allan Odgaard
4d6a8174f0 Fix variable names in debug statement 2014-09-02 18:59:28 +02:00
Allan Odgaard
91e3c2c0de Ask for search results to fade out when being removed 2014-09-01 17:37:11 +02:00
Allan Odgaard
d2a2a9dfdd Don’t call NSOutlineView’s sizeLastColumnToFit
This doesn’t seem to be required, might only have been an issue with cell-based outline views, or perhaps only on an older version of the OS.
2014-09-01 17:37:11 +02:00
Allan Odgaard
5cc60a6d5b Use NSOutlineView’s insertItemsAtIndexes:… instead of reloadData
We wrap it in begin/endUpdates because the number of results badges might otherwise show briefly, as expansion happens post-insertion.
2014-09-01 17:37:11 +02:00
Allan Odgaard
4e5e4ef601 Add badges to show number of search results (when collapsed)
This is implemented by observing NSOutlineView’s did expand/collapse item notification and then asking for a full reload of the outline view.

None of the granular reload methods would cause the view to be recreated, and there is no “isExpanded” property that the view can bind to.

Given the above, it might be a good idea to introduce an NSTableCellView subclass / view controller for the group view and have this handle it, to avoid the overhead of asking for a full reload each time an item is expanded/collapsed (which is multiplied by number of items when using expand/collapse all).
2014-09-01 17:37:11 +02:00
Allan Odgaard
da27ee570e Remove unused cell-based outline view method 2014-09-01 17:37:11 +02:00
Allan Odgaard
33d347cedd Use toggle button for status bar instead of NSTextField subclass 2014-09-01 17:37:10 +02:00
Allan Odgaard
8940593af0 Rely on bindings for document edited and Replace All button state
Also fix an issue where it would show Replace Selected even with search results hidden.
2014-09-01 17:37:10 +02:00
Allan Odgaard
75e7ebaca2 Don’t implement the NSCopying protocol for FFResultNode
This doesn’t seem to be a requirement when using view-based NSOutlineViews, and as our implementation wasn’t actually doing any copying, better to not pretend we conform to this interface.
2014-09-01 17:37:10 +02:00
Allan Odgaard
0d04dc7efa Give the find dialog a more predictable key view loop 2014-08-30 16:19:23 +02:00
Allan Odgaard
05cf40d77b Convert tabs in search results to em-spaces
This is to decrease the tab width which technically should be doen by creating NSTextTab objects (with tab positions), but that is too complex and I think ideally we should visualize the tabs (e.g. “‣”) like we do in the search/clipboard history windows.
2014-08-30 08:51:33 +02:00
Allan Odgaard
356a21d7e7 Add button to remove search results from the list 2014-08-28 13:40:24 +02:00
Allan Odgaard
9e0d0e9b34 Limit data reload of results outline view 2014-08-28 13:40:24 +02:00
Allan Odgaard
5a45023f9e Add new method to Find class: ‘takeSearchResultToRemoveFrom:’
This can be used after a completed search to prune the results. Currently though no UI is connected to this action.
2014-08-27 09:26:56 +02:00
Allan Odgaard
7262dd9d27 Switch search results to a view-based outline view
Currently does not support dragging of the file icon nor does it show number of matches in a single file when results are collapsed.
2014-08-27 09:14:10 +02:00
Allan Odgaard
23261fe293 Use reloadDataForRowIndexes:columnIndexes: instead of reloadData:
This is mainly in preparation of switching to a view-based table view where reloadData: loses the selection (and recreates all table row views).
2014-08-27 09:12:01 +02:00
Allan Odgaard
75ae3cd52d Use bindings to track count of leafs and excluded leafs 2014-08-27 09:12:01 +02:00
Allan Odgaard
e098611387 Use the correct selected text color (for lists) 2014-08-27 09:12:01 +02:00
Allan Odgaard
0ff652d5c9 Introduce semantic convenience getters 2014-08-27 09:12:01 +02:00
Allan Odgaard
ff99f06647 Provide base directory when creating FFResultNode group nodes 2014-08-27 09:12:01 +02:00
Allan Odgaard
cebb90b6c8 Remove implementation details from Find singleton’s interface 2014-08-27 09:12:01 +02:00
Allan Odgaard
44358ad034 Rename FFResultNode property: ‘exclude’ → ‘excluded’ 2014-08-27 09:12:01 +02:00
Allan Odgaard
1ee217adc6 Rename FFResultNode property: ‘matches’ → ‘children’ 2014-08-27 09:11:58 +02:00
Allan Odgaard
860a6aa546 Let FFResultNode tree track count of leafs and excluded leafs 2014-08-27 09:10:44 +02:00
Allan Odgaard
c27082a5f6 Fix zero row height for empty match ranges 2014-08-27 09:09:00 +02:00
Allan Odgaard
0bb7acfbf3 Add ‘removeFromParent’ to FFResultNode 2014-08-24 12:12:24 +02:00
Allan Odgaard
bb41b55d16 Remove folder_scan_settings_t (API simplification) 2014-08-24 12:12:24 +02:00
Allan Odgaard
93e14c6a15 Update includes 2014-08-24 12:12:23 +02:00
Allan Odgaard
89e395df44 Abort search when closing find dialog 2014-08-24 12:12:23 +02:00