Page MenuHome

macOS: update system recent files
Needs ReviewPublic

Authored by Ankit Meel (ankitm) on Dec 11 2020, 12:50 PM.

Details

Summary

Adds the opened file to the App's recent files list: seen in Blender dock
icon's context menu, or App Exposé.
Also add clear recent files operator in File menu -> Open Recent.
File is added to recent files in WM_OT_open_mainfile also, in
addition to WM_OT_save_mainfile.
Contributed by @Yevgeny Makarov (jenkm) also.


Less intrusive alternative is adding it to Blender app menu. It is macOS only,
does not affect Splash Screen, doesn't affect "Open Recent" submenu.


Clearing recent files programmatically:

[[NSDocumentController sharedDocumentController] clearRecentDocuments:nil];

To add the standard "Open Recent" menu:

NSMenu *recentMenu = [[NSMenu alloc] initWithTitle:@"Open Recent"];
[recentMenu performSelector:@selector(_setMenuName:) withObject:@"NSRecentDocumentsMenu"];

Diff Detail

Repository
rB Blender

Event Timeline

Yevgeny Makarov (jenkm) requested review of this revision.Dec 11 2020, 12:50 PM
Yevgeny Makarov (jenkm) created this revision.

rBcd1e6df53410: macOS/Ghost: Replace NSAutoreleasePool with @autoreleasepool @autoreleasepool is preferable to NSAutoreleasePool
Location of clearing recent items is a bit off, it's usually under File menurecent itemsclear recent in other apps.

Location of clearing recent items is a bit off, it's usually under File menurecent itemsclear recent in other apps.

Yes, but the "File" menu with only one "Open Recent" item would also be weird.

Ankit Meel (ankitm) requested changes to this revision.Apr 26 2021, 9:02 AM

Changing status; for @autoreleasepool.

This revision now requires changes to proceed.Apr 26 2021, 9:02 AM
  • Use AppKit instead of Cocoa. Skip NSString conversion. autoreleasepool.
  • Add clear recent files operator to File -> Open Recent. Corresponding implementation in Ghost.
  • Also add to recent files in WM_OT_open_mainfile
  • Revert items in Blender app menu
  • Reuse operator name as UI item name.
Ankit Meel (ankitm) retitled this revision from macOS: Implement adding files to the system's recent files to macOS: update system recent files.Oct 21 2021, 2:55 PM
Ankit Meel (ankitm) edited the summary of this revision. (Show Details)
Ankit Meel (ankitm) edited the summary of this revision. (Show Details)
Ankit Meel (ankitm) commandeered this revision.Oct 21 2021, 3:08 PM
Ankit Meel (ankitm) edited the summary of this revision. (Show Details)