Commit Graph

115 Commits

Author SHA1 Message Date
Allan Odgaard
52ba0cb5c2 Add file manager support for ‘new file’ 2013-02-15 15:27:57 +01:00
Allan Odgaard
72d0b9757b Post OakFileManagerWillDeleteItemAtPath 2013-02-15 15:27:55 +01:00
Allan Odgaard
a4dc3bf977 OakFileManagerDirectoryKey → OakFileManagerPathKey
This allows us to use the same key for more than just directories. The notification name itself should indicate if the ‘path’ refers only to directories or files.
2013-02-15 15:27:54 +01:00
Allan Odgaard
b37b56075a Call super in viewWillMoveToWindow: 2013-02-14 11:31:20 +01:00
Allan Odgaard
8987a7528f Use generic file/folder icon when OakFileIconImage.path == nil 2013-02-11 14:21:20 +01:00
Michael Sheets
a9d80f5a0d Increase tab bar size one pixel
This is to match the minimum allowed size for the sidebar header when the tabs above document is enabled, also matches the height of the forthcoming tab redesign.
2013-02-09 16:34:24 +01:00
Allan Odgaard
9c994af1e0 Tweak OakGradientView
- Accept two NSGradient objects instead of four colors.
- Call designated initializer on super instead of self since subclass is likely calling us from its designated initializer
- Make class public
2013-02-09 16:34:23 +01:00
Allan Odgaard
b139ac5097 Change push_back → emplace_back (C++11)
This is mainly motivated by readability, so I only did a few select replacements.
2013-02-08 11:20:35 +01:00
Allan Odgaard
67af1bc7fe Make divider lines opaque
Without this, it is possible to move the window when clicking directly on the line (since none of the parent views are opaque).
2013-02-06 16:43:40 +01:00
Allan Odgaard
22465873ac Handle case changes on insensitive file systems
NSFileManager only provide a move function which fails with “file exists” if we make case changes on a case-insensitive file system, therefor we now explicitly test for that error and use <x-man-page://2/rename> if the source and destination refer to the same file, but the path differ.

Fixes #769.
2013-02-06 14:50:05 +01:00
Allan Odgaard
63c0300ed8 Post “directory did change” notifications
This is both to speedup file browser updates (as there is a bit of lag waiting for fs-events) and to work with file systems that doesn’t support fs-events (issue #745).
2013-02-06 14:50:04 +01:00
Allan Odgaard
37f130fe42 Don’t set gradient view as opaque
This is so that a potential NSTextField will correctly render itself as inactive when using NSBackgroundStyleRaised.
2013-02-06 14:50:04 +01:00
Michael Sheets
a6f0b75d4c Use correct syntax for including local headers 2013-02-05 08:36:04 +01:00
Allan Odgaard
e42d84fa4c Missing files still get SCM badge 2013-02-04 19:38:32 +01:00
Allan Odgaard
748558c5d3 SCM API: Update OakFileIconImage
Since the created image is a “dumb” object that can’t provoke redrawing itself, we require that SCM info is already cached for the repository containing the file for which we are creating an image. If not, there will be no SCM badge, so most users of this API should setup their own SCM info and recreate the image when SCM status changes.
2013-02-04 19:38:32 +01:00
Allan Odgaard
cef6a74df2 Make code safe against ‘nil’ clipboard entries
Should never happen in practice though.
2013-02-04 19:38:30 +01:00
Allan Odgaard
151c800239 File icon images now default to ‘existing’ 2013-02-03 10:48:34 +01:00
Allan Odgaard
044cd72c10 Use system icons for Open With menu
Previously we used our own icon image class which support SCM status, custom images for known file types, and more. This is however is unnecessary, as we know the Open With menu contains only applications, and each should use their standard icon.

This should also fix issue #510, although the issue was never diagnosed beyond git stalling while trying to get SCM status for the application icons in this menu.
2013-02-03 10:48:33 +01:00
Bob Rockefeller
0f41c946f0 Bind the grid icon to .less files
Added .less files to the OakAppKit .plist bindings file as another grid icon, to go along with the existing .css, .sass and .scss definitions.

Signed-off-by: Bob Rockefeller <bob@bobrockefeller.com>
2013-02-02 08:49:15 +01:00
Allan Odgaard
342152ea71 Remove light gray line above tabs 2013-01-30 18:55:30 +01:00
Adam Strzelecki
5f69592a1f Fixed control/tab bar label shadows
NSShadowAttributeName has no effect when using CTFrame. Use
CGContextSetShadowWithColor instead.
2013-01-30 13:20:06 +01:00
Allan Odgaard
904348d489 Add OakGradientView
This simply draws a gradient background but supports alternate colors for when the window is inactive.
2013-01-28 15:44:28 +01:00
Allan Odgaard
d68be42546 Initial divider colors were wrong for inactive windows 2013-01-28 12:42:28 +01:00
Allan Odgaard
a1a2e23ca9 Add helpers to create lines
With this we can create either a horizontal or vertical line, and don’t need to manually set a constraint for its width/height.
2013-01-28 12:42:27 +01:00
Allan Odgaard
065e9a0f13 Also use primary color when window is key
Windows like the file chooser never becomes main, so testing if window is main alone is not enough.
2013-01-25 11:01:57 +01:00
Allan Odgaard
3aea7c991a Don’t play sound when renaming files 2013-01-25 11:01:57 +01:00
Allan Odgaard
2ae9463e6e Lowercase icon file name
This corresponds to how it is spelled in the file type bindings file (although nothing actually uses this icon).
2013-01-25 11:01:57 +01:00
Allan Odgaard
8821794e3e Remove unused category methods
Long-term I want to get rid of all category methods. Adding methods to system classes is bad.
2013-01-25 11:01:56 +01:00
Allan Odgaard
fe08871c45 Inline deselectExtension code in OakSavePanel
The code is tweaked a bit compared to the category method we inlined.
2013-01-25 11:01:56 +01:00
Allan Odgaard
c467e9ab97 Our divider line view can now handle secondary color
This is used when the window is not main (if provided).
2013-01-24 11:42:33 +01:00
Allan Odgaard
67ebb34f23 Fix unreliable tab switching keys
This was broken by 645f8d91e1.

The issue is that if the user press a key not in our managed menu, then the menu delegate will no longer be asked to update the menu for keys not in this (cached) menu.

Example: If there are items for ⌘1-3 in the menu and the user press ⌥⌘N a few times (to create more tabs), then the delegate is asked to update the menu on the first press, but as ⌥⌘N is not in the menu, successive events will not cause the menu to be updated. If the user then press ⌘5 (to go to the 5’th tab), nothing will happen, because our menu only holds 3 items, and the delegate is not asked to update the menu.
2013-01-23 12:36:47 +01:00
Allan Odgaard
8cd45626ab Add OakFileManager
This is to be used with file actions done from the UI: Actions are undoable, proper dialogs will be shown for errors or to confirm permanent deletes on volumes without a trashcan (closes #589). Interface sounds will also be played (when moving, trashing, and duplicating items).

I decided not to use the asynchronous file system methods that NSWorkspace offer. Mainly because they can only be used for the initial operation, not during replay, as performing asynchronous operations during replay may cause issues if user moves quickly between items (something that seems to be an actual problem for Finder). The problem though only exist as long as we rely on NSUndoManager to manage the process.

Presently there is no API for batch operations, which leads to suboptimal action titles when performing multiple file system operations in the same undo group.
2013-01-22 19:37:14 +01:00
Allan Odgaard
645f8d91e1 Let OS handle keys for Go to Tab submenu
My memory is a little vague here, but I believe the point of handling the menu keys was to workaround a bug in NSMenu.

The bug was that NSMenu would look at (the target of) cached menu items, probably for UI validation, so potentially sending methods to unretained objects, which could lead to a crash. Several workarounds were attempted (like clearing the target property after the menu had been displayed) but the only effective one was overloading key handling.

I’m quite sure though that this bug is no longer relevant.
2013-01-22 11:00:27 +01:00
Allan Odgaard
ba58611c66 Add API to OakFileIconImage
This allows manually setting up SCM status, link badge, and similar, which avoids having OakFileIconImage do any disk access.
2013-01-20 12:49:35 +01:00
Allan Odgaard
63d734295b Cache custom icon images
Also fix it so that a file named ‘gen_html’ doesn’t get the HTML icon (as we no longer use path::rank for finding the best icon).
2013-01-20 12:49:35 +01:00
Allan Odgaard
19030a7586 Use file’s existing icon when zooming it 2013-01-20 12:49:33 +01:00
Allan Odgaard
f2ed528bb1 Improve code for showing VO tab menu
We now use standard API for showing the menu and position it relative to the VO-selected tab.
2013-01-18 15:45:43 +01:00
Boris Dušek
1bcdf4abe2 Make OakTabBarView accessible 2013-01-17 08:53:14 +01:00
Boris Dušek
7d47dd279f Make OakPasteboardSelector accessible
Issues remaining:

* VoiceOver for some reason cannot track keyboard focus
  (i.e. moving down the list with just down arrow does not move
  VoiceOver cursor). User has to move the VO cursor instead using VO-down
  (and keyboard cursor follows in this case)
* the pasteboard window isn't focused automatically for VoiceOver, user
  has to switch manually to it using VO-F2-F2
2013-01-17 08:53:13 +01:00
Allan Odgaard
87162c9897 Introduce OakCreateViewWithColor
This is useful when needing colored dividers in a layouts.
2013-01-16 04:40:20 +01:00
Allan Odgaard
44e760a7d9 Improve support for full screen mode
When opening a new window we ignore windows in full screen or on another space when searching for a window we can cascade to.

Full screen status of a window is restored after a relaunch and the bigger frame (when in full screen mode) is not stored in the session data or user defaults (as it should not be used).

Closes issue #667.
2013-01-13 11:56:07 +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
35d413225d Send method to class name instead of ‘self’
This avoids potential compiler errors where multiple methods with same signature but different parameter/result types.
2013-01-12 13:09:19 +01:00
Allan Odgaard
a166ad481c Make OakSavePanel API block-based 2013-01-08 22:48:06 +01:00
Allan Odgaard
47fa0f040c Use Objective-C literals for YES/NO 2013-01-02 01:46:48 +01:00
Allan Odgaard
3d45b788f1 Update block-based NSAlert API 2013-01-02 01:46:46 +01:00
Allan Odgaard
7428cd0939 Add workaround for 10.8 API
This should cause TextMate to once again run on 10.7 (issue #643).
2012-12-20 18:52:31 +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
Allan Odgaard
1102f8a528 Remove use of ns::attr_string
This is only motivated by easier transition to ARC (one framework at a time) as the ns/attr_string.h header contains manual memory management, which thus cannot be included by a framework using ARC, yet the code needs to be in the header since the code is template-based.
2012-12-19 19:42:34 +01:00
Allan Odgaard
71ec3d4c82 Add block-based show alert API 2012-12-16 21:27:06 +01:00