ample/Ample/MediaViewController.m

1003 lines
26 KiB
Mathematica
Raw Permalink Normal View History

2020-08-21 22:38:02 +00:00
//
// MediaViewController.m
2020-08-30 03:24:49 +00:00
// Ample
2020-08-21 22:38:02 +00:00
//
// Created by Kelvin Sherlock on 8/20/2020.
// Copyright © 2020 Kelvin Sherlock. All rights reserved.
//
#import "MediaViewController.h"
#import "TableCellView.h"
2020-08-22 04:13:23 +00:00
#define SIZEOF(x) (sizeof(x) / sizeof(x[0]))
2020-08-22 04:13:23 +00:00
@protocol MediaNode
-(BOOL)isGroupItem;
-(BOOL)isExpandable;
-(NSInteger)count;
-(NSInteger)category;
2020-08-22 04:13:23 +00:00
-(NSString *)viewIdentifier;
-(void)prepareView: (NSTableCellView *)view;
-(CGFloat)height;
-(NSInteger)index;
2020-08-22 04:13:23 +00:00
@end
@interface MediaCategory : NSObject <MediaNode> {
2020-08-21 22:38:02 +00:00
}
@property NSInteger validCount;
@property NSMutableArray *children; // URLs?
2020-08-21 22:38:02 +00:00
@property NSString *title;
@property NSInteger index;
@property NSInteger category;
@property (weak)NSOutlineView *view;
2020-08-21 22:38:02 +00:00
-(NSInteger)count;
-(id)objectAtIndex:(NSInteger)index;
-(BOOL)isGroupItem;
@end
2020-08-25 00:23:56 +00:00
@interface MediaItem : NSObject <MediaNode>
@property NSString *string;
2020-08-25 00:23:56 +00:00
@property NSURL *url;
@property BOOL valid;
@property NSInteger index;
@property NSInteger category;
@property (readonly) BOOL occupied;
2020-08-25 00:23:56 +00:00
-(NSInteger)count;
-(id)objectAtIndex:(NSInteger)index;
-(BOOL)isGroupItem;
-(void)invalidate;
@end
2020-08-21 22:38:02 +00:00
@implementation MediaCategory
+(instancetype)categoryWithTitle: (NSString *)title {
return [[self alloc] initWithTitle: title];
}
2020-08-21 22:38:02 +00:00
-(instancetype)initWithTitle: (NSString *)title {
[self setTitle: title];
return self;
}
-(NSInteger) count {
return [_children count];
}
-(id)objectAtIndex:(NSInteger)index {
return [_children objectAtIndex: index];
}
-(BOOL)isGroupItem {
return YES;
}
-(BOOL)isExpandable {
return YES;
}
2020-08-22 04:13:23 +00:00
-(NSString *)viewIdentifier {
return @"CategoryView";
}
-(void)prepareView: (NSTableCellView *)view {
2021-03-13 00:58:12 +00:00
2020-08-22 04:13:23 +00:00
}
-(CGFloat)height {
return 17;
}
2020-08-21 22:38:02 +00:00
2020-08-25 00:23:56 +00:00
-(BOOL)setItemCount: (unsigned)newCount {
2020-08-25 04:35:40 +00:00
if (newCount == _validCount) {
return NO;
}
unsigned count = (unsigned)[_children count];
2020-08-25 00:23:56 +00:00
_validCount = newCount;
if (!_children) _children = [NSMutableArray new];
2020-08-25 00:23:56 +00:00
2020-08-25 04:35:40 +00:00
for (unsigned i = count; i < newCount; ++i) {
MediaItem *item = [MediaItem new];
[item setIndex: i];
[item setCategory: _category];
[_children addObject: item];
2020-08-25 00:23:56 +00:00
}
2020-08-25 00:23:56 +00:00
// delete excess items, if blank. otherwise, mark invalid.
unsigned ix = 0;
for(MediaItem *item in _children) {
2020-08-25 04:35:40 +00:00
[item setValid: ix++ < newCount];
2020-08-25 00:23:56 +00:00
}
2020-08-25 04:35:40 +00:00
for (unsigned i = newCount; i < count; ++i) {
MediaItem *item = [_children lastObject];
if ([item occupied]) break;
2020-08-25 00:23:56 +00:00
[_children removeLastObject];
2020-08-25 00:23:56 +00:00
}
2020-08-21 22:38:02 +00:00
2020-08-25 00:23:56 +00:00
return YES;
2020-08-21 22:38:02 +00:00
}
-(BOOL)addURL: (NSURL *)url {
for (MediaItem *item in _children) {
if (![item occupied]) {
[item setUrl: url];
return NO;
}
}
// add an extra item...
if (!_children) _children = [NSMutableArray new];
NSUInteger ix = [_children count];
MediaItem *item = [MediaItem new];
[item setIndex: ix];
[item setCategory: _category];
[item setUrl: url];
[item setValid: ix < _validCount];
[_children addObject: item];
if (_view) {
NSIndexSet *set = [NSIndexSet indexSetWithIndex: ix];
[_view insertItemsAtIndexes: set
inParent: self
withAnimation: NSTableViewAnimationEffectFade];
}
return YES;
}
-(BOOL)pruneChildren {
2020-08-25 04:35:40 +00:00
NSUInteger count = [_children count];
BOOL delta = NO;
if (_validCount == count) return NO;
NSMutableIndexSet *set = [NSMutableIndexSet new];
2020-08-25 04:35:40 +00:00
for (NSInteger i = _validCount; i < count; ++i) {
MediaItem *item = [_children lastObject];
if ([item occupied]) break;
2020-08-25 04:35:40 +00:00
[_children removeLastObject];
[set addIndex: [_children count]];
2020-08-25 04:35:40 +00:00
delta = YES;
}
if (delta) {
if (_view)
[_view removeItemsAtIndexes: set inParent: self withAnimation: NSTableViewAnimationEffectFade];
2020-08-25 04:35:40 +00:00
return YES;
}
return NO;
}
2020-08-21 22:38:02 +00:00
-(BOOL)moveItemFrom: (NSInteger)oldIndex to: (NSInteger)newIndex {
if (newIndex == oldIndex) return NO;
NSUInteger count = [_children count];
if (oldIndex >= count) return NO;
2020-08-25 00:23:56 +00:00
MediaItem *item = [_children objectAtIndex: oldIndex];
[_children removeObjectAtIndex: oldIndex];
if (newIndex > oldIndex) newIndex--;
if (newIndex >= count) {
[_children addObject: item];
} else {
[_children insertObject: item atIndex: newIndex];
}
if (_view) [_view moveItemAtIndex: oldIndex inParent: self toIndex: newIndex inParent: self];
// re-index and re-validate.
unsigned ix = 0;
for (MediaItem *item in _children) {
[item setIndex: ix];
[item setValid: ix < _validCount];
// [view reloadItem: item];
++ix;
}
[self pruneChildren];
//[view reloadItem: self reloadChildren: YES];
return YES;
}
@end
2020-08-25 00:23:56 +00:00
2020-08-21 22:38:02 +00:00
@implementation MediaItem
2020-08-21 22:38:02 +00:00
-(instancetype)initWithURL: (NSURL *)url {
_url = url;
2020-08-21 22:38:02 +00:00
return self;
}
-(instancetype)initWithString: (NSString *)string {
_string = string;
return self;
}
-(NSString *)argument {
if (_string)
return _string;
// todo -- have setURL also update _string?
if (_url)
return [NSString stringWithCString: [_url fileSystemRepresentation] encoding: NSUTF8StringEncoding];
return nil;
}
+(NSSet *)keyPathsForValuesAffectingOccupied {
return [NSSet setWithObjects: @"url", @"string", nil];
}
-(BOOL)occupied {
return _url || _string;
}
2020-08-21 22:38:02 +00:00
-(NSInteger) count {
return 0;
}
-(id)objectAtIndex:(NSInteger)index {
return nil;
}
-(BOOL)isGroupItem {
return NO;
}
-(BOOL)isExpandable {
return NO;
}
2020-08-22 04:13:23 +00:00
-(NSString *)viewIdentifier {
if (_category == kIndexBitBanger) return @"BBItemView";
2021-08-07 19:12:20 +00:00
if (_category == kIndexMidiOut) return @"MidiItemView";
if (_category == kIndexMidiIn) return @"MidiItemView";
2020-08-22 04:13:23 +00:00
return @"ItemView";
}
2021-08-07 19:12:20 +00:00
-(void)prepareView: (MediaTableCellView *)view {
/* set the path tag = category. */
2021-08-07 19:12:20 +00:00
[view prepareView: _category];
#if 0
if (_category == kIndexMidiIn || _category == kIndexMidiOut || _category == kIndexBitBanger) {
return;
}
NSPathControl *pc = [view pathControl];
[pc setTag: _category + 1]; // to differentiate 0 / no path control.
2021-08-07 19:12:20 +00:00
#endif
2020-08-21 22:38:02 +00:00
}
2020-08-22 04:13:23 +00:00
-(CGFloat)height {
return 27;
}
2020-08-21 22:38:02 +00:00
2020-08-25 00:23:56 +00:00
-(void)invalidate {
if (!_valid) return;
[self setValid: NO];
2020-08-25 00:23:56 +00:00
}
2020-08-21 22:38:02 +00:00
@end
2020-08-21 22:38:02 +00:00
@interface MediaViewController () {
MediaCategory *_data[CATEGORY_COUNT];
NSMutableArray *_root;
Media _media;
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
BOOL _loadingBookmark;
2020-08-21 22:38:02 +00:00
}
@end
@implementation MediaViewController
2020-08-21 22:38:02 +00:00
-(void)awakeFromNib {
2020-08-22 04:13:23 +00:00
static unsigned first = 0;
if (first) return;
first++;
_data[kIndexFloppy8] = [MediaCategory categoryWithTitle: @"8\" Floppies"];
_data[kIndexFloppy525] = [MediaCategory categoryWithTitle: @"5.25\" Floppies"];
_data[kIndexFloppy35] = [MediaCategory categoryWithTitle: @"3.5\" Floppies"];
_data[kIndexHardDrive] = [MediaCategory categoryWithTitle: @"Hard Drives"];
_data[kIndexCDROM] = [MediaCategory categoryWithTitle: @"CD-ROMs"];
_data[kIndexCassette] = [MediaCategory categoryWithTitle: @"Cassettes"];
_data[kIndexDiskImage] = [MediaCategory categoryWithTitle: @"Hard Disk Images"]; // Mac Nubus psuedo image device
_data[kIndexBitBanger] = [MediaCategory categoryWithTitle: @"Serial Bit Banger"]; // null_modem
2020-08-25 00:23:56 +00:00
2021-07-11 03:33:20 +00:00
_data[kIndexMidiIn] = [MediaCategory categoryWithTitle: @"MIDI (In)"];
_data[kIndexMidiOut] = [MediaCategory categoryWithTitle: @"MIDI (Out)"];
_data[kIndexPicture] = [MediaCategory categoryWithTitle: @"Picture"];
_data[kIndexROM] = [MediaCategory categoryWithTitle: @"ROM"];
2021-07-11 03:33:20 +00:00
for (unsigned i = 0; i < CATEGORY_COUNT; ++i) {
[_data[i] setCategory: i];
[_data[i] setIndex: -1];
}
_root = [NSMutableArray new];
2020-08-25 00:23:56 +00:00
}
2020-08-25 04:35:40 +00:00
2020-08-26 00:13:37 +00:00
-(void)rebuildArgs {
static char* prefix[] = {
"flop", "flop", "flop", "hard", "cdrm", "cass", "disk", "bitb", "min", "mout", "pic", "rom",
2020-08-26 00:13:37 +00:00
};
static_assert(SIZEOF(prefix) == CATEGORY_COUNT, "Missing item");
2020-08-26 00:13:37 +00:00
NSMutableArray *args = [NSMutableArray new];
//unsigned counts[CATEGORY_COUNT] = { 0 };
uint64_t floppy_mask_8 = _media.floppy_mask_8;
uint64_t floppy_mask_5_25 = _media.floppy_mask_5_25;
uint64_t floppy_mask_3_5 = _media.floppy_mask_3_5;
for (unsigned j = 0; j < CATEGORY_COUNT; ++j) {
2020-08-26 00:13:37 +00:00
//uint64_t floppy_mask = _media.floppy_mask;
unsigned index = 0;
2020-08-26 00:13:37 +00:00
MediaCategory *cat = _data[j];
NSInteger valid = [cat validCount];
2020-08-26 00:13:37 +00:00
for (NSInteger i = 0; i < valid; ++i) {
MediaItem *item = [cat objectAtIndex: i];
NSString *arg = [item argument];
switch(j) {
case kIndexFloppy8:
index = ffsll(floppy_mask_8);
floppy_mask_8 &= ~(1 << (index-1));
break;
case kIndexFloppy525:
index = ffsll(floppy_mask_5_25);
floppy_mask_5_25 &= ~(1 << (index-1));
break;
case kIndexFloppy35:
index = ffsll(floppy_mask_3_5);
floppy_mask_3_5 &= ~(1 << (index-1));
break;
default:
++index;
}
if (!arg) continue;
if (!index) continue;
[args addObject: [NSString stringWithFormat: @"-%s%u", prefix[j], index]];
[args addObject: arg];
2020-08-26 00:13:37 +00:00
}
}
[self setArgs: args];
}
2020-08-25 04:35:40 +00:00
-(void)rebuildRoot {
2020-08-25 04:35:40 +00:00
NSMutableArray *tmp = [NSMutableArray new];
int ix = 0;
for (unsigned j = 0 ; j < CATEGORY_COUNT; ++j) {
2020-08-25 04:35:40 +00:00
MediaCategory *cat = _data[j];
[cat setIndex: -1];
if ([cat count]) {
[cat setIndex: ix++];
[tmp addObject: cat];
}
2020-08-25 04:35:40 +00:00
}
_root = tmp;
// todo - switch this to use removeItemsAtIndexes:inParent:withAnimation:
// and insertItemsAtIndexes:inParent:withAnimation:
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
if (!_loadingBookmark) {
[_outlineView reloadData];
[_outlineView expandItem: nil expandChildren: YES];
}
2020-08-25 04:35:40 +00:00
}
-(void)setMedia: (Media)media {
2020-08-25 00:23:56 +00:00
2021-07-11 03:33:20 +00:00
// todo -- fancy diff algorithm to animate changes.
2020-08-25 00:23:56 +00:00
MediaCategory *cat;
BOOL delta = NO;
unsigned x;
if (MediaEqual(&_media, &media)) return;
2020-08-25 04:35:40 +00:00
_media = media;
[_outlineView beginUpdates];
2020-08-25 00:23:56 +00:00
#undef _
#define _(name, index) \
x = media.name; cat = _data[index]; delta |= [cat setItemCount: x]
_(cass, kIndexCassette);
_(cdrom, kIndexCDROM);
_(hard, kIndexHardDrive);
_(floppy_3_5, kIndexFloppy35);
_(floppy_5_25, kIndexFloppy525);
_(floppy_8, kIndexFloppy8);
_(pseudo_disk, kIndexDiskImage);
_(bitbanger, kIndexBitBanger);
2021-07-11 03:33:20 +00:00
_(midiin, kIndexMidiIn);
_(midiout, kIndexMidiOut);
_(picture, kIndexPicture);
_(rom, kIndexROM);
2020-08-25 00:23:56 +00:00
2020-08-26 00:13:37 +00:00
if (delta) {
[self rebuildRoot];
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
if (!_loadingBookmark) [self rebuildArgs];
}
[_outlineView endUpdates];
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
}
-(void)resetDiskImages {
BOOL delta = NO;
for (unsigned j = 0; j < CATEGORY_COUNT; ++j) {
MediaCategory *cat = _data[j];
NSInteger count = [cat count];
for (NSInteger i = 0; i < count; ++i) {
MediaItem *item = [cat objectAtIndex: i];
if (![item occupied]) continue;
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
[item setUrl: nil];
[item setString: nil];
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
delta = YES;
}
if ([cat pruneChildren]) delta = YES;
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
}
if (delta) {
[self rebuildRoot];
if (!_loadingBookmark) [self rebuildArgs];
2020-08-26 00:13:37 +00:00
}
2020-08-21 22:38:02 +00:00
}
static NSString *kDragType = @"private.ample.media";
2020-08-21 22:38:02 +00:00
- (void)viewDidLoad {
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
2020-08-21 22:38:02 +00:00
[super viewDidLoad];
//NSOutlineView *view = [self view];
//[view expandItem: nil expandChildren: YES];
// Do view setup here.
2020-09-04 23:22:18 +00:00
2020-08-25 04:35:40 +00:00
[_outlineView reloadData];
2020-08-22 04:13:23 +00:00
[_outlineView expandItem: nil expandChildren: YES];
[_outlineView registerForDraggedTypes: @[kDragType]];
for (unsigned i = 0; i < CATEGORY_COUNT; ++i)
[_data[i] setView: _outlineView];
[nc addObserver: self selector: @selector(magicRouteNotification:) name: kNotificationDiskImageMagicRoute object: nil];
}
-(void)viewWillDisappear {
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc removeObserver: self];
for (unsigned i = 0; i < CATEGORY_COUNT; ++i)
[_data[i] setView: nil];
2020-08-21 22:38:02 +00:00
}
#pragma mark - NSOutlineViewDelegate
2020-08-22 04:13:23 +00:00
2020-08-21 22:38:02 +00:00
- (void)outlineView:(NSOutlineView *)outlineView didAddRowView:(NSTableRowView *)rowView forRow:(NSInteger)row {
}
- (void)outlineView:(NSOutlineView *)outlineView didRemoveRowView:(NSTableRowView *)rowView forRow:(NSInteger)row {
}
2020-08-22 04:13:23 +00:00
- (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id<MediaNode>)item {
2020-08-21 22:38:02 +00:00
2020-08-22 04:13:23 +00:00
NSString *ident = [item viewIdentifier];
if (!ident) return nil;
NSTableCellView *v = [outlineView makeViewWithIdentifier: ident owner: self];
[v setObjectValue: item];
2021-06-13 16:26:56 +00:00
[(id<MediaNode>)item prepareView: v];
2020-08-21 22:38:02 +00:00
return v;
}
2020-08-22 04:13:23 +00:00
- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id<MediaNode>)item {
2020-08-21 22:38:02 +00:00
return [item isExpandable];
}
- (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item {
2020-08-22 19:55:16 +00:00
return NO; //[item isGroupItem];
2020-08-21 22:38:02 +00:00
}
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldShowOutlineCellForItem:(id)item {
2020-08-22 04:13:23 +00:00
return NO;
2020-08-21 22:38:02 +00:00
}
2020-08-22 04:13:23 +00:00
/*
2020-08-21 22:38:02 +00:00
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldShowCellExpansionForTableColumn:(NSTableColumn *)tableColumn item:(id)item {
2020-08-22 04:13:23 +00:00
return NO;
2020-08-21 22:38:02 +00:00
}
2020-08-22 04:13:23 +00:00
*/
2020-08-21 22:38:02 +00:00
2020-08-22 04:13:23 +00:00
-(BOOL)outlineView:(NSOutlineView *)outlineView shouldCollapseItem:(id)item {
return NO;
}
2020-08-21 22:38:02 +00:00
#pragma mark - NSOutlineViewDataSource
// nil item indicates the root.
- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item {
if (item == nil)
return [_root count];
return [item count];
}
- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item {
if (item == nil) {
return [_root objectAtIndex: index];
}
return [item objectAtIndex: index];
}
2020-08-22 04:13:23 +00:00
-(CGFloat)outlineView:(NSOutlineView *)outlineView heightOfRowByItem:(id<MediaNode>)item {
return [item height];
}
#if 0
- (id<NSPasteboardWriting>)outlineView:(NSOutlineView *)outlineView pasteboardWriterForItem:(id<MediaNode>)item {
if ([item isGroupItem]) return nil;
NSPasteboardItem *pb = [NSPasteboardItem new];
return pb;
}
#endif
- (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pasteboard {
if ([items count] > 1) return NO;
2020-09-06 03:58:03 +00:00
//NSLog(@"%s", sel_getName(_cmd));
MediaItem *item = [items firstObject];
if (![item isKindOfClass: [MediaItem class]]) return NO;
// find the category. only allow if more than 1 item in the category.
MediaCategory *cat = nil;
for (MediaCategory *c in _root) {
NSUInteger ix = [[c children] indexOfObject: item];
if (ix != NSNotFound){
cat = c;
break;
}
}
if (!cat) return NO;
if ([cat count] < 2) return NO;
NSInteger indexes[2] = { 0, 0 };
indexes[0] = [cat index];
indexes[1] = [item index];
NSData *data = [NSData dataWithBytes: indexes length: sizeof(indexes)];
[pasteboard setData: data forType: kDragType];
return YES;
}
/*
* IF item is present, it's a MediaCategory and index is the index of the MediaItem it would be inserted as.
* IF item is nil, index is the MediaCategory index, which should be converted to moving to the end.
* IF index < 0, dragging far beyond the category list, so NOPE it.
*
*/
- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id<NSDraggingInfo>)info proposedItem:(id)item proposedChildIndex:(NSInteger)index {
if (index < 0) return NSDragOperationNone;
NSPasteboard *pb = [info draggingPasteboard];
NSData *data = [pb dataForType: kDragType];
if (!data) return NSDragOperationNone;
NSInteger indexes[2];
if ([data length] != sizeof(indexes)) return NSDragOperationNone;
[data getBytes: &indexes length: sizeof(indexes)];
2020-09-06 03:58:03 +00:00
//NSLog(@"%d - %d", (int)indexes[0], (int)indexes[1]);
2020-09-06 03:58:03 +00:00
MediaCategory *cat = item;
if (!item) {
// move to the END of the previous category.
if (index == 0) return NSDragOperationNone;
2020-09-06 03:58:03 +00:00
cat = [_root objectAtIndex: index - 1];
index = [cat count]; // -1; - interferes w/ -1 logic below.
}
2020-09-06 03:58:03 +00:00
//NSLog(@"%d - %d", (int)[(MediaCategory *)item index], (int)index);
2020-09-06 03:58:03 +00:00
if ([cat index] != indexes[0]) return NSDragOperationNone;
if (indexes[1] == index) return NSDragOperationNone;
if (indexes[1] == index-1) return NSDragOperationNone;
return NSDragOperationMove;
}
- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id<NSDraggingInfo>)info item:(id)item childIndex:(NSInteger)index {
2021-07-11 03:33:20 +00:00
2020-09-06 03:58:03 +00:00
if (index < 0) return NO;
NSPasteboard *pb = [info draggingPasteboard];
NSData *data = [pb dataForType: kDragType];
if (!data) return NSDragOperationNone;
NSInteger indexes[2];
if ([data length] != sizeof(indexes)) return NO;
[data getBytes: &indexes length: sizeof(indexes)];
//NSLog(@"%d - %d", (int)indexes[0], (int)indexes[1]);
MediaCategory *cat = item;
if (!item) {
// move to the END of the previous category.
if (index == 0) return NO;
cat = [_root objectAtIndex: index - 1];
index = [cat count]; // -1; - interferes w/ -1 logic below.
}
//NSLog(@"%d - %d", (int)[(MediaCategory *)item index], (int)index);
if ([cat index] != indexes[0]) return NO;
if (indexes[1] == index) return NO;
if (indexes[1] == index-1) return NO;
NSInteger oldIndex = indexes[1];
[_outlineView beginUpdates];
[cat moveItemFrom: oldIndex to: index];
[_outlineView endUpdates];
[self rebuildArgs];
2020-09-06 03:58:03 +00:00
//[_outlineView reloadItem: cat reloadChildren: YES];
2020-09-06 03:58:03 +00:00
return YES;
}
2020-08-21 22:38:02 +00:00
2020-08-22 04:13:23 +00:00
#pragma mark - IBActions
- (IBAction)ejectAction:(id)sender {
2020-08-22 04:13:23 +00:00
NSInteger row = [_outlineView rowForView: sender];
if (row < 0) return;
2020-08-21 22:38:02 +00:00
2020-08-22 04:13:23 +00:00
MediaItem *item = [_outlineView itemAtRow: row];
[item setUrl: nil];
[item setString: nil];
2020-08-25 04:35:40 +00:00
// if item is invalid, should attempt to remove...
if (![item valid]) {
MediaCategory *cat = [_outlineView parentForItem: item];
[_outlineView beginUpdates];
[cat pruneChildren];
// remove the entire category??
if (![cat validCount] && ![cat count]) {
NSUInteger ix = [_root indexOfObject: cat];
if (ix != NSNotFound) {
NSIndexSet *set = [NSIndexSet indexSetWithIndex: ix];
[_outlineView removeItemsAtIndexes: set
inParent: nil
withAnimation: NSTableViewAnimationEffectFade];
[_root removeObjectAtIndex: ix];
[cat setIndex: -1];
}
}
[_outlineView endUpdates];
2020-08-25 04:35:40 +00:00
}
2020-08-26 00:13:37 +00:00
[self rebuildArgs];
}
- (IBAction)pathAction:(id)sender {
NSURL *url = [(NSPathControl *)sender URL];
NSInteger tag = [sender tag] - 1;
switch(tag) {
case kIndexFloppy8:
case kIndexFloppy525:
case kIndexFloppy35:
case kIndexHardDrive:
case kIndexCDROM:
case kIndexCassette:
case kIndexDiskImage:
if (url) {
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc postNotificationName: kNotificationDiskImageAdded object: url];
}
break;
// not disk images or don't use a path control.
2021-07-11 03:33:20 +00:00
case kIndexPicture:
case kIndexMidiIn:
case kIndexMidiOut:
case kIndexBitBanger:
case kIndexROM:
default: break;
}
2020-08-26 00:13:37 +00:00
[self rebuildArgs];
2020-08-22 04:13:23 +00:00
}
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
-(IBAction)textAction: (id)sender {
[self rebuildArgs];
}
2021-08-07 19:12:20 +00:00
- (IBAction)midiAction:(id)sender {
[self rebuildArgs];
}
-(IBAction)resetMedia:(id)sender {
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
[self resetDiskImages];
}
-(void)magicRouteNotification: (NSNotification *)notification {
NSDictionary *userInfo = [notification userInfo];
id path = [userInfo objectForKey: @"path"];
if ([path isKindOfClass: [NSURL class]]) {
[self smartRouteURL: path];
return;
}
if ([path isKindOfClass: [NSString class]]) {
NSURL *url = [NSURL fileURLWithPath: path];
[self smartRouteURL: url];
return;
}
}
/*
* given a file, add it to the media list.
* TODO - how to handle if full or media type missing?
*/
-(BOOL)smartRouteURL: (NSURL *)url {
if (!url) return NO;
MediaType mt = ClassifyMediaFile(url);
if (mt < 1) return NO; // unknown / error.
unsigned ix = 0;
switch(mt) {
case MediaType_3_5: ix = kIndexFloppy35; break;
case MediaType_5_25: ix = kIndexFloppy525; break;
case MediaType_8: ix = kIndexFloppy8; break;
case MediaType_Cassette: ix = kIndexCassette; break;
case MediaType_HardDisk: ix = kIndexHardDrive; break;
case MediaType_CDROM: ix = kIndexCDROM; break;
2021-07-11 03:33:20 +00:00
case MediaType_Picture: ix = kIndexPicture; break;
case MediaType_ROM: ix = kIndexROM; break;
case MediaType_MIDI: // ix = kIndexMidiIn; break;
case MediaTypeError:
case MediaTypeUnknown:
return NO;
}
2021-07-10 15:25:25 +00:00
[_outlineView beginUpdates];
// todo -- check root, insert if necessary?
MediaCategory *cat = _data[ix];
[cat addURL: url];
2021-07-10 15:25:25 +00:00
[_outlineView endUpdates];
[self rebuildArgs];
return YES;
}
-(BOOL)smartRouteFile: (NSString *)file {
return NO;
}
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
@end
@implementation MediaViewController (Bookmark)
-(void)willLoadBookmark:(NSDictionary *)bookmark {
_loadingBookmark = YES;
[self resetDiskImages];
}
-(void)didLoadBookmark:(NSDictionary *)bookmark {
_loadingBookmark = NO;
[self rebuildRoot];
[self rebuildArgs];
}
static NSString * BookmarkStrings[] = {
@"flop_8", @"flop_525", @"flop_35", @"hard", @"cdrm", @"cass", @"disk", @"bitb", @"midiin", @"midiout", @"pic", @"rom",
};
static_assert(SIZEOF(BookmarkStrings) == CATEGORY_COUNT, "Missing item");
static int BookmarkIndex(NSString *str) {
if (!str) return -1;
for (int i = 0; i < SIZEOF(BookmarkStrings); ++i) {
if ([str isEqualToString: BookmarkStrings[i]]) return i;
}
return -1;
}
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
-(BOOL)loadBookmark: (NSDictionary *)bookmark {
// fragile - depends on order
id media = [bookmark objectForKey: @"media"];
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
if ([media isKindOfClass: [NSArray class]]) {
unsigned ix = 0;
for (NSArray *a in (NSArray *)media) {
if (ix >= CATEGORY_COUNT) {
NSLog(@"MediaViewController: too many categories.");
break;
}
MediaCategory *cat = _data[ix];
NSInteger count = [cat count];
unsigned i = 0;
for (NSString *path in a) {
if (i >= count) {
NSLog(@"MediaViewController: too many files.");
break; //
}
MediaItem *item = [cat objectAtIndex: i++];
if (![path length]) continue;
if (ix == kIndexBitBanger || ix == kIndexMidiOut || ix == kIndexMidiIn) {
[item setString: path];
} else {
NSURL *url = [NSURL fileURLWithPath: path];
[item setUrl: url];
}
}
++ix;
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
}
return YES;
}
if ([media isKindOfClass: [NSDictionary class]]) {
for (NSString *key in (NSDictionary *)media) {
NSInteger ix = BookmarkIndex(key);
if (ix < 0) {
NSLog(@"MediaViewController: unrecognized category: %@", key);
continue;
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
}
MediaCategory *cat = _data[ix];
NSInteger count = [cat count];
NSArray *a = [(NSDictionary *)media objectForKey: key];
unsigned i = 0;
for (NSString *path in a) {
if (i >= count) {
NSLog(@"MediaViewController: too many files.");
break; //
}
MediaItem *item = [cat objectAtIndex: i++];
if (![path length]) continue;
if (ix == kIndexBitBanger || ix == kIndexMidiOut || ix == kIndexMidiIn) {
[item setString: path];
} else {
NSURL *url = [NSURL fileURLWithPath: path];
[item setUrl: url];
}
}
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
}
return YES;
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
}
return NO;
}
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
static void CompressArray(NSMutableArray *array) {
for(;;) {
NSString *s = [array lastObject];
if (!s) return;
if ([s length]) return;
[array removeLastObject];
}
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
}
-(BOOL)saveBookmark: (NSMutableDictionary *)bookmark {
NSMutableDictionary *media = [NSMutableDictionary new];
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
for (unsigned ix = 0; ix < CATEGORY_COUNT; ++ix) {
MediaCategory *cat = _data[ix];
NSInteger count = [cat validCount];
if (!count) continue;
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
NSMutableArray *array = [NSMutableArray new];
for (NSInteger i = 0; i < count; ++i) {
MediaItem *item = [cat objectAtIndex: i];
NSString *s = [item argument];
if (!s) s = @"";
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
[array addObject: s];
}
CompressArray(array);
if ([array count])
[media setObject: array forKey: BookmarkStrings[ix]];
Squashed commit of the following: commit 78c81626670fdf41fa6bdd71a4243a89a0746615 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon Jun 7 00:33:48 2021 -0400 check if software set has a particular entry. commit ef5ab6b6948dc3bbbe2947ea099fcacd08435e86 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 22:20:34 2021 -0400 fix scroller background on recent disk images window. commit dee56fa50e87299b396b48361bd0a780aaaaa768 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 21:26:23 2021 -0400 update cheat sheet javascript to work with 10.11 * => functions not supported * NodeList.prototype.forEach not supported. commit b00cc05413f4ebd6d6d58f96e24303008608f3a6 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 17:10:41 2021 -0400 default full machine name for bookmark entry. commit a671cafdc98051b56b12cdd3ccd13c22f54f605a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:39:32 2021 -0400 loading a bookmark wasn't updating the media. commit 3000e0eb1b10bede3345aaab8478e9ec209f328c Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 15:38:53 2021 -0400 bump copyright year. commit 45222dacd4aa0047fae63a9112509de57139df63 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:38:23 2021 -0400 add reset w/ value for setting the item explicitely. commit cc7fde1253b71c4d8655eb4c010bbf4e61333a15 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sun Jun 6 13:37:48 2021 -0400 add checkboxes for bitbanger/share directory. The general idea is it's easier to toggle a checkbox than to type/retype a path. commit 5674b2d7f6b0e2f0b973197bf3493ad61bf46428 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:43 2021 -0400 commentary on searches with diacritics. commit ec60634dcd9c573130dc34673b4d3fe597ea2b42 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 19:11:22 2021 -0400 clean up auto-complete a little bit when setting a value directly. commit 1a182bbdab237c89d355d8294b5a4a64b785783a Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 13:08:29 2021 -0400 fix text color when value is set. There are still some bugs relating to multiple copies of the value being stored. commit 49c0bc15c73446259d8cc151cf52d6058644db76 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 12:09:44 2021 -0400 reset all controls first. commit 059797ad85b057e296cc707b4645f839bfccac13 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Sat Jun 5 10:52:06 2021 -0400 more bookmark loading. commit e5a612d9f8e7414dd15c66dbaa540b637765eeec Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:38 2021 -0400 bookmark - restore the software commit f9411a1e84df7bd46e352cc5ca995b585c2a0523 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 23:52:25 2021 -0400 clean up software / name logic. commit f628d99e4a70d65ea8703f3c182103cd3bfea969 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:21:08 2021 -0400 load bookmark... commit 0b248e6aad16cba848f88d294a1366cea5760aa0 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Fri Jun 4 00:20:42 2021 -0400 stringValue can't be nil. commit 94aac38af45c3c95cb86b176393a469279c2539e Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:04:37 2021 -0400 add bookmark menu commit 6215a0df120b6cd97f1ffea2d2db9aaa5ae61f29 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:03:29 2021 -0400 slot view needs to know the machine. commit d348c15dc56d9cee01e5417435dd236e0e541902 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:58 2021 -0400 transformer to enable/disable control based on string length. commit e14336a0094af7aa84e91da69ff59ebb9e8eea9b Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:02:14 2021 -0400 shut up compiler warning. commit 4baf545245d8d3debf8f436b36b14cca23bf7a33 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Thu Jun 3 23:01:15 2021 -0400 bookmark manager commit 0f3e6c83075a145a456728b57a499cfa35707002 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 23:54:29 2021 -0400 more (untested) bookmark code commit 8fdb149eb38952b13c4a78d7a6940c43d90870f1 Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:13:43 2021 -0400 start of bookmarking support. Untested. commit 787eac87f6ac13cd677630cbaf2538cecab27b1f Author: Kelvin Sherlock <ksherlock@gmail.com> Date: Mon May 31 16:12:45 2021 -0400 shut up warnings about content clipping. maybe it's a 10.11 thing. The size was chosen by interface builder.
2021-06-07 04:34:26 +00:00
}
[bookmark setObject: media forKey: @"media"];
return YES;
}
2020-08-21 22:38:02 +00:00
@end