Commit Graph

629 Commits

Author SHA1 Message Date
Allan Odgaard
e70791ee89 Rename a bunch of constants to fix deprecation warnings (10.12) 2018-06-16 22:55:30 +02:00
Allan Odgaard
3fb653ebf0 Do not provide graphics context when creating a fake NSEvent
This is not required and 10.12 makes accessing the NSEvent’s context property deprecated, as it always (did?) return nil.
2018-06-16 22:55:30 +02:00
Allan Odgaard
c11b81b9da Use MBCreateMenu for a few pop-up menus 2018-04-30 15:30:48 +07:00
Ronald Wampler
9f2eb76223 Explicitly close OakChoiceMenu
On 10.13, just setting our instance of OakChoiceMenu to `nil` no longer seem to close our window.
2018-02-06 17:08:03 +07:00
Ronald Wampler
f3cd0b0797 Resolve ambiguous autolayout issues
Most of these layout changes are related to the common pattern we used to set constraints for "dividers", where one of the dividers is specified to be connected to both edges of its superview then setting the other dividers' constraints to have equal widths (e.g., @"H:|[divider(==divider2,==divider3)]"). On 10.12, this now appears to result in ambiguous layout. We can resolve it by connecting at least one of the edges for each divider to its superview.
2017-05-31 21:58:31 +02:00
Ronald Wampler
038acacca9 Avoid use of NSRunAlertPanel (10.9)
Although this is actually deprecated in 10.10, new APIs are available in 10.9 and it will make addressing deprecation warnings when upgrading to 10.10 easier.
2017-05-31 21:58:31 +02:00
Ronald Wampler
30891b1a62 Remove OakShowAlertForWindow wrapper (10.9) 2017-05-31 10:03:41 +02:00
Ronald Wampler
dfc9db4413 Use our NSAlert category method for creating NSAlert objects 2017-05-31 10:03:41 +02:00
Ronald Wampler
9fae8a3192 Update deployment target to 10.9 for all xib files 2017-05-31 10:03:41 +02:00
Allan Odgaard
3450724cc4 Introduce enableResponsiveScroll user defaults 2016-11-15 23:03:25 +07:00
Allan Odgaard
690e8d22b0 Do not run modal event loop when doing command preflight actions
Preflight actions could show dialogs (such as a save dialog) which would then be unresponsive, since we were running a modal event loop.
2016-11-02 23:02:18 +07:00
Allan Odgaard
9d980a07df Remove NSPrincipalClass from framework bundles’s Info.plist
This is not something which is used anywhere and a few of the frameworks does not have a principal class.
2016-10-31 17:30:30 +07:00
Allan Odgaard
3dc185cb67 Do not wrap executeBundleCommand:variables: in auto refresh 2016-10-11 13:02:36 +02:00
Allan Odgaard
2feb4a497a Use crash_reporter_info_t’s convenience constructor
Also change most ‘crashInfo’ variable names to just ‘info’ to be consistent.
2016-10-07 22:14:33 +02:00
Allan Odgaard
daa0b801e9 Abort drag scroll timer if left mouse is no longer down
Based on diagnostic reports it would appear that the drag scroll timer can outlive the document. The timer is currently stopped on mouseUp: but this is probably not an event we should assume is always sent, for example if the application is made inactive while the mouse button is down, we may never see it being released.
2016-10-07 10:02:58 +02:00
Allan Odgaard
1fa5bc7fae Implement command auto refresh for document change, save, and close 2016-10-03 22:05:39 +02:00
Allan Odgaard
0556886d99 Add class to manage “command refresh” 2016-10-03 22:05:39 +02:00
Allan Odgaard
acd76d52f6 Use NSTimer instead of OakTimer 2016-10-01 09:03:25 +02:00
Allan Odgaard
4dea28811c Let OakTextView run modal event loop waiting for command 2016-09-27 21:34:55 +02:00
Allan Odgaard
ede6b4b026 Change named parameter completionHandler: to outputHandler:
The handler is only called for commands with output to insert into the text view, hence completionHandler is a misnomer.
2016-09-27 21:29:03 +02:00
Allan Odgaard
d8312b833e Rely on NSUUID overload of to_s 2016-09-26 11:09:16 +02:00
Allan Odgaard
dc5028f039 Let text view and find window show documents using OakDocumentController 2016-09-24 08:33:33 +02:00
Allan Odgaard
28da74ca01 Add diagnostics info related to framework crash 2016-09-24 08:33:32 +02:00
Jacob Bandes-Storch
f36ce366f4 Make OakPopOutAnimation window a child of the main window 2016-09-21 21:00:51 -07:00
Allan Odgaard
981b7a6d8f Move undo grouping to OakDocumentEditor 2016-09-21 20:39:42 +02:00
Allan Odgaard
808563c934 Remove unnecessary overloads of requiresConstraintBasedLayout
It should only be necessary to overload this method (to return YES) when the system is unable to figure out by itself, that it should enable constraint-based layout for the window in which the view is placed.
2016-09-21 20:39:41 +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
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
5f53075864 Disable recent tracking for non-open documents instead of non-loaded 2016-09-18 10:33:45 +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
f1fef3315e Add callback.document.did-change-scm-status
This is useful for SCM gutter marks which should update after committing or reverting changes in the current document.
2016-09-13 23:49:17 +02:00
Jacob Bandes-Storch
d6652ff4e8 Hide previous pop-out animations when showing a new one 2016-09-12 23:50:46 -07:00
Ronald Wampler
9c8caa21ec fixup! Only set table view’s row height during sizeToFit
We need to set the row height after calling sizeToFit on textField.
2016-09-12 09:50:56 -04:00
Allan Odgaard
7b291185fe Only set table view’s row height during sizeToFit
The initial dimension of the OakChoiceMenu could be incorrect because the row height had not been updated.

This broke in c270b0c5af
2016-09-12 08:47:10 +02:00
Allan Odgaard
553e89ceb6 Update include statements and link declarations 2016-09-11 12:47:39 +02:00
Allan Odgaard
da5fdd78a8 Remove document_t from OakDocumentView
This also updates the commit window to only use OakDocument API.

The bundle editor and document controller still require updating.
2016-09-11 08:49:32 +02:00
Allan Odgaard
9f4ff49529 Change kBookmarkIdentifier → OakDocumentBookmarkIdentifier 2016-09-11 08:46:11 +02:00
Allan Odgaard
149dfd884d Prepare to drop cppDocument property 2016-09-11 08:45:12 +02:00
Allan Odgaard
ebf6ae9346 Rename document property to cppDocument as intermediate refactoring step 2016-09-11 08:43:46 +02:00
Allan Odgaard
cdcb5a4836 Use OakDocument API to load/close document
We sort of assume that OakDocumentView is only given documents which are already loaded.
2016-09-11 08:43:04 +02:00
Allan Odgaard
f2289039da Calling document_t::show/hide is now done by DocumentController
This is only done for LRU tracking so it sort of makes sense to move this outside the document view itself (e.g. commit window and bundle editor does not require any LRU tracking).
2016-09-11 08:42:20 +02:00
Allan Odgaard
1e6102fb6e Observe OakDocumentMarksDidChangeNotification instead of adding callback 2016-09-11 08:42:01 +02:00
Allan Odgaard
ec0be36078 Post OakDocumentMarksDidChangeNotification when changing marks
This is instead of posting the GVColumnDataSourceDidChange notification.
2016-09-11 08:40:55 +02:00
Allan Odgaard
b9f7d23283 Make all tabSize properties use NSUInteger as their type 2016-09-11 08:40:22 +02:00
Allan Odgaard
102f22e266 Rename property isMacroRecording → isRecordingMacro/recordingMacro 2016-09-11 08:38:27 +02:00
Allan Odgaard
91190cdf9f No need to have dealloc clear properties with weak storage 2016-09-11 08:36:52 +02:00
Allan Odgaard
76183d63dd Observe OakDocument for fileType, tabSize, and softTabs 2016-09-11 08:36:30 +02:00
Allan Odgaard
dae362060d Fix crash if symbol chooser was open when closing window
This was introduced in 50dabac467.
2016-09-11 08:34:46 +02:00
Allan Odgaard
b57cde0886 Improve implementation of document_view_t::has_marks
The previous version was proportional in time with number of marks, since it requested (a copy of) all the marks.
2016-09-11 08:33:07 +02:00