Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Preparing for 0.8.0 release

* Handle migration from 0.7.x to 0.8.0
* Remove extraneous log messages
* Rename bundle identifiers
  • Loading branch information...
commit 39d625cad4dcc312af1bbcc38ba66f92351f2815 1 parent cf63a72
@sdeken sdeken authored
View
2,946 English.lproj/MainMenu.nib/designable.nib
1,491 additions, 1,455 deletions not shown
View
BIN  English.lproj/MainMenu.nib/keyedobjects.nib
Binary file not shown
View
10 Info.plist
@@ -9,7 +9,7 @@
<key>CFBundleIconFile</key>
<string>KeyCastr</string>
<key>CFBundleIdentifier</key>
- <string>net.stephendeken.KeyCastr2</string>
+ <string>net.stephendeken.KeyCastr</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@@ -20,16 +20,16 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>0.8.0</string>
+ <key>LSUIElement</key>
+ <string>0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
- <key>LSUIElement</key>
- <string>0</string>
- <key>SUFeedURL</key>
- <string>http://stephendeken.net/software/keycastr/appcast.xml</string>
<key>SUExpectsDSASignature</key>
<true/>
+ <key>SUFeedURL</key>
+ <string>http://stephendeken.net/software/keycastr/appcast.xml</string>
<key>SUPublicDSAKey</key>
<string>
-----BEGIN PUBLIC KEY-----
View
61 KCAppController.m
@@ -50,13 +50,65 @@ -(id) init
_allowToggle = true;
_isCapturing = true;
- _startupIconPreference = [[NSUserDefaults standardUserDefaults] integerForKey:kKCPrefDisplayIcon];
return self;
}
+-(void) _mapOldPreference:(NSString*)old toNewPreference:(NSString*)new
+{
+ NSUserDefaults* ud = [NSUserDefaults standardUserDefaults];
+ [ud setObject:[ud objectForKey:old] forKey:new];
+ [ud removeObjectForKey:old];
+}
+
+-(void) _setupDefaults
+{
+ // Set up user-defaults defaults
+ KeyCombo keyCombo;
+ keyCombo.code = 1;
+ keyCombo.flags = NSShiftKeyMask | NSAlternateKeyMask;
+ NSUserDefaults* ud = [NSUserDefaults standardUserDefaults];
+ [ud registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithInt:3], kKCPrefDisplayIcon,
+ @"Default", kKCPrefSelectedVisualizer,
+ [NSNumber numberWithBool:YES], kKCPrefVisibleAtLaunch,
+ [NSData dataWithBytes:&keyCombo length:sizeof(keyCombo)], kKCPrefCapturingHotKey,
+
+ [NSArchiver archivedDataWithRootObject:[NSColor colorWithCalibratedWhite:0 alpha:0.8]], @"default.bezelColor",
+ [NSNumber numberWithFloat:2.0], @"default.fadeDelay",
+ [NSNumber numberWithFloat:0.2], @"default.fadeDuration",
+ [NSNumber numberWithFloat:16.0], @"default.fontSize",
+ [NSNumber numberWithFloat:0.5], @"default.keystrokeDelay",
+ [NSArchiver archivedDataWithRootObject:[NSColor colorWithCalibratedWhite:1 alpha:1]], @"default.textColor",
+ nil]];
+
+ if ([ud objectForKey:@"fontSize"] != nil)
+ {
+ // Clean up old 0.7.x defaults
+ [self _mapOldPreference:@"bezelColor" toNewPreference:@"default.bezelColor"];
+ [self _mapOldPreference:@"fadeDelay" toNewPreference:@"default.fadeDelay"];
+ [self _mapOldPreference:@"fontSize" toNewPreference:@"default.fontSize"];
+ [self _mapOldPreference:@"keystrokeDelay" toNewPreference:@"default.keystrokeDelay"];
+ [self _mapOldPreference:@"textColor" toNewPreference:@"default.textColor"];
+ [self _mapOldPreference:@"onlyCommandKeys" toNewPreference:@"default.commandKeysOnly"];
+ NSDictionary* oldKey = [ud objectForKey:@"ShortcutRecorder toggleCapture"];
+ if (oldKey != nil)
+ {
+ keyCombo.code = [[oldKey objectForKey:@"keyCode"] intValue];
+ keyCombo.flags = [[oldKey objectForKey:@"modifierFlags"] intValue];
+ [ud setObject:[NSData dataWithBytes:&keyCombo length:sizeof(keyCombo)] forKey:kKCPrefCapturingHotKey];
+ [ud removeObjectForKey:@"ShortcutRecorder toggleCapture"];
+ }
+ [ud removeObjectForKey:@"launchedOnce"];
+ }
+}
+
-(void) awakeFromNib
{
+ [self _setupDefaults];
+
+ _startupIconPreference = [[NSUserDefaults standardUserDefaults] integerForKey:kKCPrefDisplayIcon];
+
[NSApp activateIgnoringOtherApps:TRUE];
[self registerVisualizers];
[self setCurrentVisualizerName:[[NSUserDefaults standardUserDefaults] objectForKey:kKCPrefSelectedVisualizer]];
@@ -71,8 +123,6 @@ -(void) awakeFromNib
if (d != nil)
[d getBytes:&kc length:sizeof(kc)];
- NSLog( @"pref modifiers = %08x; keycode = %d", kc.flags, kc.code );
-
[shortcutRecorder setKeyCombo:kc];
_allowToggle = YES;
@@ -96,14 +146,11 @@ -(void) keyboardTap:(KCKeyboardTap*)tap noteKeystroke:(KCKeystroke*)keystroke
KeyCombo kc = [shortcutRecorder keyCombo];
if ([keystroke keyCode] == kc.code && ([keystroke modifiers] & (NSControlKeyMask | NSCommandKeyMask | NSShiftKeyMask | NSAlternateKeyMask)) == (kc.flags & (NSControlKeyMask | NSCommandKeyMask | NSShiftKeyMask | NSAlternateKeyMask)))
{
-NSLog(@"Toggle keystroke hit");
if (_allowToggle)
{
-NSLog(@"(toggling)");
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(stopPretending:) object:nil];
[self toggleRecording:self];
}
-else NSLog(@"(not toggling)");
return;
}
@@ -233,7 +280,6 @@ -(void) toggleRecording:(id)sender
-(void) stopPretending:(id)what
{
_allowToggle = true;
- NSLog(@"Timer expired, toggling recording");
[self toggleRecording:self];
}
@@ -241,7 +287,6 @@ -(void) pretendToDoSomethingImportant:(id)sender
{
_allowToggle = false;
[self performSelector:@selector(stopPretending:) withObject:nil afterDelay:0.1];
- NSLog(@"Menu item hit, waiting 100 ms");
}
-(NSString*) currentVisualizerName
View
1  KCDefaultVisualizer.m
@@ -176,7 +176,6 @@ -(id) initWithContentRect:(NSRect)contentRect styleMask:(int)aStyle backing:(NSB
-(void) _lineBreak:(id)sender
{
-NSLog( @"breaking line" );
_mostRecentBezelView = nil;
}
View
2  KeyCastr.xcodeproj/project.pbxproj
@@ -40,6 +40,7 @@
3D3F56410F32D266001C7272 /* ShortcutRecorder.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D3F56400F32D266001C7272 /* ShortcutRecorder.framework */; };
3D3F564E0F32D2EA001C7272 /* ShortcutRecorder.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3D3F56400F32D266001C7272 /* ShortcutRecorder.framework */; };
3D3F56CB0F337533001C7272 /* NSUserDefaults+Utility.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D3F56CA0F337533001C7272 /* NSUserDefaults+Utility.m */; };
+ 3D66FC520F539C290034ECC1 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3DF8835C0F5254F9005FD1C6 /* Sparkle.framework */; };
3DF883890F5256FF005FD1C6 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DF8835C0F5254F9005FD1C6 /* Sparkle.framework */; };
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
@@ -103,6 +104,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
+ 3D66FC520F539C290034ECC1 /* Sparkle.framework in CopyFiles */,
3D1646D10F43DCA700CA65AD /* KCVisualizer.framework in CopyFiles */,
3D3F564E0F32D2EA001C7272 /* ShortcutRecorder.framework in CopyFiles */,
);
View
2  Svelte-Info.plist
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.Svelte</string>
+ <string>net.stephendeken.KeyCastr.Svelte</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
Please sign in to comment.
Something went wrong with that request. Please try again.