Skip to content

Commit 4a4e7a0

Browse files
committed
BookMacster 1.19.9, shipped
1 parent 9e13327 commit 4a4e7a0

5 files changed

+99
-7
lines changed

Diff for: SSYAlert.m

+10-4
Original file line numberDiff line numberDiff line change
@@ -688,9 +688,10 @@ + (void)supportError:(NSError*)error {
688688
@"*** Note to user*** It is possible that this file may have some of your private "
689689
@"information in it, bookmarks in particular. Please skim through it before sending. "
690690
@"Delete anything which is too private, add a little note in its place, then save this file.\n\n"
691-
@"To zip this file, select it in Finder, then execute a secondary click. A secondary click "
692-
@"can also be produced by clicking it with the right/secondary mouse button, or holding down "
693-
@"the 'control' key while clicking on it. From the contextual menu which appears, click 'Compress...' "
691+
@"To zip this file, select it in Finder, then execute a secondary click. (A secondary click "
692+
@"means to click it while holding down the 'control' key, or to tap with two fingers if you "
693+
@"have a trackpad, or to use the secondary button if you have a multi-button mouse.) "
694+
@"From the contextual menu which appears, click 'Compress...' "
694695
@"A new file with a name ending in .zip will appear.\n\n"
695696
@"Please send the .zip file to our support crew, and thank you for helping us to support",
696697
appName,
@@ -711,7 +712,12 @@ + (void)supportError:(NSError*)error {
711712
buttons:nil] ;
712713

713714
mailableDescription = [NSString stringWithFormat:
714-
@"*** Please review, zip and attach file %@. ***",
715+
@"****** I M P O R T A N T I N S T R U C T I O N S ******\n\n"
716+
@"*** Please look on your Desktop and find the file named %@ ***\n"
717+
@"Review for your privacy, zip and ATTACH it before sending this.\n"
718+
@"To zip a file, perform a secondary click (right-click or control-click)\n"
719+
@"on it, then from the contextual menu which appears, click 'Compress ...'.\n"
720+
@"Attach the .zip file which appears. Thank you.\n",
715721
filename] ;
716722
}
717723
else {

Diff for: SSYLaunchdGuy.m

+12-1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ + (NSError*)warnUserIfLaunchdHangInTaskResult:(NSInteger)result
9292
// 35.0 seconds.
9393
#define LAUNCHCTL_TIMEOUT 35.0
9494

95+
/*
96+
@details TODO: See if there is a better way to do this, without using
97+
/bin/lauchctl, and NSTask in general. First, see here…
98+
http://www.opensource.apple.com/source/initng/initng-12/initng/src/launch.h
99+
http://www.opensource.apple.com/source/initng/initng-12/initng/src/launchctl.c
100+
which seems to have several useful functions, but they are not formally
101+
documented. On the other hand, the overview of the Service Management
102+
framework says that it "...provides support for loading and unloading launchd
103+
jobs and reading and manipulating job dictionaries from within an application."
104+
That's great, except the last time I look, it didn't.
105+
*/
95106
+ (BOOL)agentLoadPath:(NSString*)plistPath
96107
error_p:(NSError**)error_p {
97108
NSString* subcmd = @"load" ;
@@ -569,7 +580,7 @@ + (BOOL)removeAgentWithLabel:(NSString*)label
569580
[[NSFileManager defaultManager] createFileAtPath:cmdPath
570581
contents:data
571582
attributes:attributes] ;
572-
NSTask* task = [[NSTask alloc] init] ;
583+
NSTask* task = [[NSTask alloc] init] ;
573584
[task setLaunchPath:cmdPath] ;
574585
[task launch] ;
575586
[task release] ;

Diff for: SSYPersistentDocumentMultiMigrator.m

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ + (BOOL)migrateIfNeededStoreAtUrl:(NSURL*)url
6161
NSURL* destempUrl = nil ; // destemp means "destination/temporary"
6262

6363
// Get store metadata for the document to be opened.
64+
// If the file indicated at url will not load, Core Data will log an
65+
// "error" here. I @tryed to @catch exceptions, but got nothing.
66+
// Oh well, just ignore it.
6467
NSDictionary *storeMetadata = [NSPersistentStoreCoordinator metadataForPersistentStoreOfType:nil
6568
URL:url
6669
error:&underlyingError] ;

Diff for: SSYShortcutActuator.h

+44-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
11
#import <Cocoa/Cocoa.h>
22
#import "SRCommon.h" // for KeyCombo, also this imports <Carbon/Carbon.h>
33

4+
/*
5+
@brief Posted whenever the count of shortcuts registered with the shared
6+
actuator increases from 0 to 1
7+
8+
@details The notification object is the shared actuator. If the user defaults
9+
contains one or more shortcuts to be registered, this notification will be
10+
posted during the -init of the shared actuator.
11+
*/
412
extern NSString* const SSYShortcutActuatorDidNonemptyNotification ;
13+
14+
/*
15+
@brief Posted whenever the count of shortcuts registered with the shared
16+
actuator decreases from 1 to 0
17+
18+
@details The notification object is the shared actuator.
19+
*/
520
extern NSString* const SSYShortcutActuatorDidEmptyNotification ;
621

22+
/*
23+
@brief Posted at the conclusion of -setKeyCode:modifierFlags:selectorName:,
24+
whether or not any shortcut was actually registered or unregistered
25+
26+
@details The notification object is the actuator to which
27+
-setKeyCode:modifierFlags:selectorName: was sent.
28+
*/
29+
extern NSString* const SSYShortcutActuatorDidChangeShortcutsNotification ;
30+
31+
732

833
@interface SSYShortcutActuator : NSObject {
934
NSMutableDictionary* m_registeredShortcutInfos ;
@@ -21,7 +46,6 @@ extern NSString* const SSYShortcutActuatorDidEmptyNotification ;
2146
http://inquisitivecocoa.com/2009/04/05/key-code-translator/
2247
@param keyCode
2348
@param modifierFlags
24-
@result
2549
*/
2650
+ (NSString*)stringForKeyCode:(NSInteger)keyCode
2751
modifierFlags:(NSUInteger)modifierFlags ;
@@ -66,8 +90,27 @@ extern NSString* const SSYShortcutActuatorDidEmptyNotification ;
6690
modifierFlags:(NSUInteger)modifierFlags
6791
selectorName:(NSString*)selectorName ;
6892

93+
/*!
94+
@brief Returns the KeyCombo of the shortcut which is currently registered to
95+
invoke a give selector
96+
97+
@details If no such shortcut is currently registered, the 'code' member of
98+
the result is -1. Or use -hasKeyComboForSelectorName: instead.
99+
*/
69100
- (KeyCombo)keyComboForSelectorName:(NSString*)selectorName ;
70101

102+
/*!
103+
@brief Returns whether or not a keyboard shortcut is currently registered
104+
to invoke a given selector
105+
*/
106+
- (BOOL)hasKeyComboForSelectorName:(NSString*)selectorName ;
107+
108+
/*!
109+
@brief Returns whether or not the receiver has one or more keyboard
110+
shortcuts currently registered
111+
*/
112+
- (BOOL)hasAnyKeyCombo ;
113+
71114
- (void)disableAllShortcuts ;
72115
- (void)enableAllShortcuts ;
73116

Diff for: SSYShortcutActuator.m

+30-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
NSString* const SSYShortcutActuatorDidNonemptyNotification = @"SSYShortcutActuatorDidNonemptyNotification" ;
4949
NSString* const SSYShortcutActuatorDidEmptyNotification = @"SSYShortcutActuatorDidEmptyNotification" ;
50-
50+
NSString* const SSYShortcutActuatorDidChangeShortcutsNotification = @"SSYShortcutActuatorDidChangeShortcutsNotification" ;
5151

5252
@interface SSYShortcutActuator ()
5353

@@ -512,6 +512,32 @@ - (KeyCombo)keyComboForSelectorName:(NSString*)selectorName {
512512
return keyCombo ;
513513
}
514514

515+
- (BOOL)hasKeyComboForSelectorName:(NSString*)selectorName {
516+
return ([self keyComboForSelectorName:selectorName].code != -1) ;
517+
}
518+
519+
- (BOOL)hasAnyKeyCombo {
520+
BOOL answer = NO ;
521+
NSDictionary* shortcutInfos = [[NSUserDefaults standardUserDefaults] objectForKey:SSYShortcutActuatorKeyBindings] ;
522+
if ([shortcutInfos respondsToSelector:@selector(objectForKey:)]) {
523+
for (NSString* selectorName in shortcutInfos) {
524+
NSDictionary* shortcutInfo = [shortcutInfos objectForKey:selectorName] ;
525+
if ([shortcutInfo respondsToSelector:@selector(objectForKey:)]) {
526+
NSNumber* number = [shortcutInfo objectForKey:constKeyKeyCode] ;
527+
if ([number respondsToSelector:@selector(integerValue)]) {
528+
NSInteger value = [number integerValue] ;
529+
if (value != -1) {
530+
answer = YES ;
531+
break ;
532+
}
533+
}
534+
}
535+
}
536+
}
537+
538+
return answer ;
539+
}
540+
515541
- (void)disableAllShortcuts {
516542
[self unregisterAllShortcuts] ;
517543
[self removeAllRegisteredShortcutInfos] ;
@@ -581,6 +607,9 @@ - (void)setKeyCode:(NSInteger)keyCode
581607
// Since we've got at least one shortcut now, start observing
582608
[self postDidEmpty:NO] ;
583609
}
610+
611+
[[NSNotificationCenter defaultCenter] postNotificationName:SSYShortcutActuatorDidChangeShortcutsNotification
612+
object:self] ;
584613
}
585614

586615
@end

0 commit comments

Comments
 (0)