Changeset 15676
- Timestamp:
- 04/07/2006 06:05:33 PM (3 years ago)
- Files:
-
- trunk/Adium.xcodeproj/project.pbxproj (modified) (7 diffs)
- trunk/Plugins/General Preferences/ESGeneralPreferences.h (modified) (2 diffs)
- trunk/Plugins/General Preferences/ESGeneralPreferences.m (modified) (4 diffs)
- trunk/Plugins/Hot Key (added)
- trunk/Plugins/Hot Key/CTGradient.h (added)
- trunk/Plugins/Hot Key/CTGradient.m (added)
- trunk/Plugins/Hot Key/NSBezierPathAdditions.h (added)
- trunk/Plugins/Hot Key/NSBezierPathAdditions.m (added)
- trunk/Plugins/Hot Key/PTHotKeyCenter.h (added)
- trunk/Plugins/Hot Key/PTHotKeyCenter.m (added)
- trunk/Plugins/Hot Key/PTHotKey.h (added)
- trunk/Plugins/Hot Key/PTHotKey.m (added)
- trunk/Plugins/Hot Key/PTKeyCombo.h (added)
- trunk/Plugins/Hot Key/PTKeyCombo.m (added)
- trunk/Plugins/Hot Key/ShortcutRecorderCell.h (added)
- trunk/Plugins/Hot Key/ShortcutRecorderCell.m (added)
- trunk/Plugins/Hot Key/ShortcutRecorder.h (added)
- trunk/Plugins/Hot Key/ShortcutRecorder.m (added)
- trunk/Resources/English.lproj/GeneralPreferences~.nib (added)
- trunk/Resources/English.lproj/GeneralPreferences~.nib/classes.nib (added)
- trunk/Resources/English.lproj/GeneralPreferences.nib/classes.nib (modified) (1 diff)
- trunk/Resources/English.lproj/GeneralPreferences~.nib/data.dependency (added)
- trunk/Resources/English.lproj/GeneralPreferences~.nib/info.nib (added)
- trunk/Resources/English.lproj/GeneralPreferences~.nib/keyedobjects.nib (added)
- trunk/Resources/English.lproj/GeneralPreferences.nib/keyedobjects.nib (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Adium.xcodeproj/project.pbxproj
r15660 r15676 1299 1299 7E824CEA06387FAF00813072 /* SHLinkManagementPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E824CDB06387FAF00813072 /* SHLinkManagementPlugin.h */; }; 1300 1300 7E824CEB06387FAF00813072 /* SHLinkManagementPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E824CDC06387FAF00813072 /* SHLinkManagementPlugin.m */; }; 1301 83B9216009E709AF008D8436 /* CTGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = 83B9215209E709AE008D8436 /* CTGradient.h */; }; 1302 83B9216109E709AF008D8436 /* CTGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 83B9215309E709AE008D8436 /* CTGradient.m */; }; 1303 83B9216209E709AF008D8436 /* NSBezierPathAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83B9215409E709AE008D8436 /* NSBezierPathAdditions.h */; }; 1304 83B9216309E709AF008D8436 /* NSBezierPathAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 83B9215509E709AE008D8436 /* NSBezierPathAdditions.m */; }; 1305 83B9216409E709AF008D8436 /* PTHotKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 83B9215609E709AE008D8436 /* PTHotKey.h */; }; 1306 83B9216509E709AF008D8436 /* PTHotKey.m in Sources */ = {isa = PBXBuildFile; fileRef = 83B9215709E709AE008D8436 /* PTHotKey.m */; }; 1307 83B9216609E709AF008D8436 /* PTHotKeyCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 83B9215809E709AE008D8436 /* PTHotKeyCenter.h */; }; 1308 83B9216709E709AF008D8436 /* PTHotKeyCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 83B9215909E709AE008D8436 /* PTHotKeyCenter.m */; }; 1309 83B9216809E709AF008D8436 /* PTKeyCombo.h in Headers */ = {isa = PBXBuildFile; fileRef = 83B9215A09E709AE008D8436 /* PTKeyCombo.h */; }; 1310 83B9216909E709AF008D8436 /* PTKeyCombo.m in Sources */ = {isa = PBXBuildFile; fileRef = 83B9215B09E709AE008D8436 /* PTKeyCombo.m */; }; 1311 83B9216A09E709AF008D8436 /* ShortcutRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 83B9215C09E709AE008D8436 /* ShortcutRecorder.h */; }; 1312 83B9216B09E709AF008D8436 /* ShortcutRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 83B9215D09E709AF008D8436 /* ShortcutRecorder.m */; }; 1313 83B9216C09E709AF008D8436 /* ShortcutRecorderCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 83B9215E09E709AF008D8436 /* ShortcutRecorderCell.h */; }; 1314 83B9216D09E709AF008D8436 /* ShortcutRecorderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 83B9215F09E709AF008D8436 /* ShortcutRecorderCell.m */; }; 1301 1315 9E124DEB07D34C7300AA91C5 /* CBGrowlAlertDetailPane.h in Headers */ = {isa = PBXBuildFile; fileRef = 9E124DE707D34C7300AA91C5 /* CBGrowlAlertDetailPane.h */; }; 1302 1316 9E124DEC07D34C7300AA91C5 /* CBGrowlAlertDetailPane.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E124DE807D34C7300AA91C5 /* CBGrowlAlertDetailPane.m */; }; … … 2758 2772 34BD0DB308D31479000BE2C0 /* AdiumChatEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AdiumChatEvents.h; path = Source/AdiumChatEvents.h; sourceTree = "<group>"; }; 2759 2773 34BD0DB408D31479000BE2C0 /* AdiumChatEvents.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AdiumChatEvents.m; path = Source/AdiumChatEvents.m; sourceTree = "<group>"; }; 2760 34BD9DA9053146CC000AB133 /* Adium.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Adium.app; sourceTree = BUILT_PRODUCTS_DIR; };2774 34BD9DA9053146CC000AB133 /* Adium.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = Adium.app; sourceTree = BUILT_PRODUCTS_DIR; }; 2761 2775 34BD9DE105314751000AB133 /* Adium.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Adium.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 2762 2776 34BD9EF10531476E000AB133 /* Stress Test.AdiumPlugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Stress Test.AdiumPlugin"; sourceTree = BUILT_PRODUCTS_DIR; }; … … 3426 3440 7E824CDB06387FAF00813072 /* SHLinkManagementPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SHLinkManagementPlugin.h; sourceTree = "<group>"; }; 3427 3441 7E824CDC06387FAF00813072 /* SHLinkManagementPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SHLinkManagementPlugin.m; sourceTree = "<group>"; }; 3442 83B9215209E709AE008D8436 /* CTGradient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CTGradient.h; path = "Plugins/Hot Key/CTGradient.h"; sourceTree = "<group>"; }; 3443 83B9215309E709AE008D8436 /* CTGradient.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CTGradient.m; path = "Plugins/Hot Key/CTGradient.m"; sourceTree = "<group>"; }; 3444 83B9215409E709AE008D8436 /* NSBezierPathAdditions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = NSBezierPathAdditions.h; path = "Plugins/Hot Key/NSBezierPathAdditions.h"; sourceTree = "<group>"; }; 3445 83B9215509E709AE008D8436 /* NSBezierPathAdditions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = NSBezierPathAdditions.m; path = "Plugins/Hot Key/NSBezierPathAdditions.m"; sourceTree = "<group>"; }; 3446 83B9215609E709AE008D8436 /* PTHotKey.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PTHotKey.h; path = "Plugins/Hot Key/PTHotKey.h"; sourceTree = "<group>"; }; 3447 83B9215709E709AE008D8436 /* PTHotKey.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PTHotKey.m; path = "Plugins/Hot Key/PTHotKey.m"; sourceTree = "<group>"; }; 3448 83B9215809E709AE008D8436 /* PTHotKeyCenter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PTHotKeyCenter.h; path = "Plugins/Hot Key/PTHotKeyCenter.h"; sourceTree = "<group>"; }; 3449 83B9215909E709AE008D8436 /* PTHotKeyCenter.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PTHotKeyCenter.m; path = "Plugins/Hot Key/PTHotKeyCenter.m"; sourceTree = "<group>"; }; 3450 83B9215A09E709AE008D8436 /* PTKeyCombo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PTKeyCombo.h; path = "Plugins/Hot Key/PTKeyCombo.h"; sourceTree = "<group>"; }; 3451 83B9215B09E709AE008D8436 /* PTKeyCombo.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PTKeyCombo.m; path = "Plugins/Hot Key/PTKeyCombo.m"; sourceTree = "<group>"; }; 3452 83B9215C09E709AE008D8436 /* ShortcutRecorder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ShortcutRecorder.h; path = "Plugins/Hot Key/ShortcutRecorder.h"; sourceTree = "<group>"; }; 3453 83B9215D09E709AF008D8436 /* ShortcutRecorder.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = ShortcutRecorder.m; path = "Plugins/Hot Key/ShortcutRecorder.m"; sourceTree = "<group>"; }; 3454 83B9215E09E709AF008D8436 /* ShortcutRecorderCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ShortcutRecorderCell.h; path = "Plugins/Hot Key/ShortcutRecorderCell.h"; sourceTree = "<group>"; }; 3455 83B9215F09E709AF008D8436 /* ShortcutRecorderCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = ShortcutRecorderCell.m; path = "Plugins/Hot Key/ShortcutRecorderCell.m"; sourceTree = "<group>"; }; 3428 3456 9C103FAE057127A500F3C158 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = "<absolute>"; }; 3429 3457 9C8C7FA403CBA21B00267226 /* AILoggerPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AILoggerPlugin.h; path = Plugins/Logger/AILoggerPlugin.h; sourceTree = "<group>"; }; … … 4868 4896 isa = PBXGroup; 4869 4897 children = ( 4898 83B920F809E70778008D8436 /* Hot Key */, 4870 4899 4B2E560406A33D85008866CF /* Chat Cycling */, 4871 4900 34C68B230778FA1300EB423C /* ESGeneralPreferencesPlugin.h */, … … 6147 6176 name = "Link Management"; 6148 6177 path = "Plugins/Link Management"; 6178 sourceTree = "<group>"; 6179 }; 6180 83B920F809E70778008D8436 /* Hot Key */ = { 6181 isa = PBXGroup; 6182 children = ( 6183 83B9215209E709AE008D8436 /* CTGradient.h */, 6184 83B9215309E709AE008D8436 /* CTGradient.m */, 6185 83B9215409E709AE008D8436 /* NSBezierPathAdditions.h */, 6186 83B9215509E709AE008D8436 /* NSBezierPathAdditions.m */, 6187 83B9215609E709AE008D8436 /* PTHotKey.h */, 6188 83B9215709E709AE008D8436 /* PTHotKey.m */, 6189 83B9215809E709AE008D8436 /* PTHotKeyCenter.h */, 6190 83B9215909E709AE008D8436 /* PTHotKeyCenter.m */, 6191 83B9215A09E709AE008D8436 /* PTKeyCombo.h */, 6192 83B9215B09E709AE008D8436 /* PTKeyCombo.m */, 6193 83B9215C09E709AE008D8436 /* ShortcutRecorder.h */, 6194 83B9215D09E709AF008D8436 /* ShortcutRecorder.m */, 6195 83B9215E09E709AF008D8436 /* ShortcutRecorderCell.h */, 6196 83B9215F09E709AF008D8436 /* ShortcutRecorderCell.m */, 6197 ); 6198 name = "Hot Key"; 6149 6199 sourceTree = "<group>"; 6150 6200 }; … … 7107 7157 34AE249D09BCCFA900A35B51 /* AIWindowDraggingView.h in Headers */, 7108 7158 342353D609D45726009FF634 /* AIAbstractLogViewerWindowController.h in Headers */, 7159 83B9216009E709AF008D8436 /* CTGradient.h in Headers */, 7160 83B9216209E709AF008D8436 /* NSBezierPathAdditions.h in Headers */, 7161 83B9216409E709AF008D8436 /* PTHotKey.h in Headers */, 7162 83B9216609E709AF008D8436 /* PTHotKeyCenter.h in Headers */, 7163 83B9216809E709AF008D8436 /* PTKeyCombo.h in Headers */, 7164 83B9216A09E709AF008D8436 /* ShortcutRecorder.h in Headers */, 7165 83B9216C09E709AF008D8436 /* ShortcutRecorderCell.h in Headers */, 7109 7166 ); 7110 7167 runOnlyForDeploymentPostprocessing = 0; … … 9076 9133 342353D709D45726009FF634 /* AIAbstractLogViewerWindowController.m in Sources */, 9077 9134 C962831709DEE5B4004235A9 /* AdiumFileTransferQuitConfirmation.m in Sources */, 9135 83B9216109E709AF008D8436 /* CTGradient.m in Sources */, 9136 83B9216309E709AF008D8436 /* NSBezierPathAdditions.m in Sources */, 9137 83B9216509E709AF008D8436 /* PTHotKey.m in Sources */, 9138 83B9216709E709AF008D8436 /* PTHotKeyCenter.m in Sources */, 9139 83B9216909E709AF008D8436 /* PTKeyCombo.m in Sources */, 9140 83B9216B09E709AF008D8436 /* ShortcutRecorder.m in Sources */, 9141 83B9216D09E709AF008D8436 /* ShortcutRecorderCell.m in Sources */, 9078 9142 ); 9079 9143 runOnlyForDeploymentPostprocessing = 0; trunk/Plugins/General Preferences/ESGeneralPreferences.h
r14818 r15676 16 16 17 17 #import <Adium/AIPreferencePane.h> 18 #import "ShortcutRecorder.h" 19 #define SYNCHRONIZE_ADIUM_HOTKEY_PREFS() CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication) 20 21 22 @class PTHotKey; 18 23 19 24 @class AIColorSelectionPopUpButton, AIFontSelectionPopUpButton; … … 35 40 IBOutlet NSTextField *label_menuItem; 36 41 IBOutlet NSTextField *label_switchTabsWith; 42 43 IBOutlet ShortcutRecorder *shortcutRecorder; 44 45 PTHotKey *globalHotKey; 46 37 47 } 38 48 trunk/Plugins/General Preferences/ESGeneralPreferences.m
r15644 r15676 20 20 #import "ESGeneralPreferences.h" 21 21 #import "ESGeneralPreferencesPlugin.h" 22 #import "PTHotKeyCenter.h" 23 #import "PTHotKey.h" 24 #import "ShortcutRecorderCell.h" 22 25 #import <AIUtilities/AIColorAdditions.h> 23 26 #import <AIUtilities/AIFontAdditions.h> … … 27 30 #import <Adium/AIStatusIcons.h> 28 31 32 29 33 @interface ESGeneralPreferences (PRIVATE) 30 34 - (NSMenu *)tabKeysMenu; … … 38 42 39 43 @implementation ESGeneralPreferences 44 45 #warning XXX in order to use shortcutrecorder you need a pallette 46 // grab to http://brok3n.org/shortcutrecorder/ShortcutRecorder-pre-dist.zip and the updated http://brok3n.org/shortcutrecorder/ShortCutRecorderCell.m in order for this to work for you. Compile the pallette and install. 47 // This comes from http://wafflesoftware.net/shortcut/ 48 49 - (void) awakeFromNib { 50 51 //Grab the default 52 53 NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults]; 54 NSString *awakePrefHotKey = nil; 55 56 if (standardUserDefaults) 57 awakePrefHotKey = [standardUserDefaults objectForKey:@"ShortcutRecorder prefHotKey"]; 58 59 NSLog(@"omg awakePrefHotKey is %@", awakePrefHotKey); 60 61 //Set the globalHotKey if there is a hotkey from above 62 63 globalHotKey = [[PTHotKey alloc] initWithIdentifier:@"SRTest" 64 keyCombo:[PTKeyCombo keyComboWithKeyCode:[shortcutRecorder keyCombo].code 65 modifiers:[shortcutRecorder cocoaToCarbonFlags: [shortcutRecorder keyCombo].flags]]]; 66 67 [globalHotKey setTarget: self]; 68 [globalHotKey setAction: @selector(hitHotKey:)]; 69 70 [[PTHotKeyCenter sharedCenter] registerHotKey: globalHotKey]; 71 72 } 73 74 75 40 76 41 77 //Preference pane properties … … 176 212 } 177 213 214 215 216 217 218 219 - (BOOL)shortcutRecorder:(ShortcutRecorder *)aRecorder isKeyCode:(signed short)keyCode andFlagsTaken:(unsigned int)flags reason:(NSString **)aReason 220 { 221 if (aRecorder == shortcutRecorder) 222 { 223 BOOL isTaken = NO; 224 225 return isTaken; 226 } 227 228 return NO; 229 } 230 231 - (void)shortcutRecorder:(ShortcutRecorder *)aRecorder keyComboDidChange:(KeyCombo)newKeyCombo 232 { 233 if (aRecorder == shortcutRecorder) 234 { 235 236 [self toggleGlobalHotKey: aRecorder]; 237 NSLog(@"%@", aRecorder); 238 NSLog(@"got to shortcutrecorder keycombodidchange:(keycombo)newcombo"); 239 } 240 } 241 242 243 244 - (void)toggleGlobalHotKey:(id)sender 245 { 246 //if (globalHotKey != nil) 247 //{ 248 // [[PTHotKeyCenter sharedCenter] unregisterHotKey: globalHotKey]; 249 // [globalHotKey release]; 250 // globalHotKey = nil; 251 //} 252 253 // if (![globalHotKeyCheckBox state]) return; 254 255 globalHotKey = [[PTHotKey alloc] initWithIdentifier:@"SRTest" 256 keyCombo:[PTKeyCombo keyComboWithKeyCode:[shortcutRecorder keyCombo].code 257 modifiers:[shortcutRecorder cocoaToCarbonFlags: [shortcutRecorder keyCombo].flags]]]; 258 259 [globalHotKey setTarget: self]; 260 [globalHotKey setAction: @selector(hitHotKey:)]; 261 262 [[PTHotKeyCenter sharedCenter] registerHotKey: globalHotKey]; 263 [self savePref]; 264 } 265 266 267 268 - (void)hitHotKey:(PTHotKey *)hotKey 269 { 270 NSString *internalObjectID, *uniqueChatID; 271 AIListObject *listObject; 272 AIChat *chat = nil; 273 274 if ((internalObjectID = [clickContext objectForKey:@"internalObjectID"])) { 275 276 if ((listObject = [[adium contactController] existingListObjectWithUniqueID:internalObjectID]) && 277 ([listObject isKindOfClass:[AIListContact class]])) { 278 279 //First look for an existing chat to avoid changing anything 280 if (!(chat = [[adium chatController] existingChatWithContact:(AIListContact *)listObject])) { 281 //If we don't find one, create one 282 chat = [[adium chatController] openChatWithContact:(AIListContact *)listObject]; 283 } 284 } 285 } else if ((uniqueChatID = [clickContext objectForKey:@"uniqueChatID"])) { 286 chat = [[adium chatController] existingChatWithUniqueChatID:uniqueChatID]; 287 288 //If we didn't find a chat, it may have closed since the notification was posted. 289 //If we have an appropriate existing list object, we can create a new chat. 290 if ((!chat) && 291 (listObject = [[adium contactController] existingListObjectWithUniqueID:uniqueChatID]) && 292 ([listObject isKindOfClass:[AIListContact class]])) { 293 294 //If the uniqueChatID led us to an existing contact, create a chat with it 295 chat = [[adium chatController] openChatWithContact:(AIListContact *)listObject]; 296 } 297 } 298 299 if (chat) { 300 //Make the chat active 301 [[adium interfaceController] setActiveChat:chat]; 302 303 //And make Adium active (needed if, for example, our notification was clicked with another app active) 304 [NSApp activateIgnoringOtherApps:YES]; 305 } 306 307 308 } 309 310 - (void) savePref{ 311 312 //Grab that pref and send it to the dungeon of the plist. Hurray for NSUD not being about to write to the domain of another app :( 313 314 CFPreferencesSetAppValue(CFSTR("ShortcutRecorder prefHotKey"), [[globalHotKey keyCombo] plistRepresentation], kCFPreferencesCurrentApplication); 315 316 //CFSTR("com.google.GmailNotifier")); 317 318 319 //Sync it, just sync it 320 321 SYNCHRONIZE_ADIUM_HOTKEY_PREFS(); 322 323 324 } 325 326 327 328 329 330 331 332 178 333 /*! 179 334 * @brief Construct our menu by hand for easy localization trunk/Resources/English.lproj/GeneralPreferences.nib/classes.nib
r13497 r15676 68 68 "popUp_sendKeys" = NSPopUpButton; 69 69 "popUp_tabKeys" = NSPopUpButton; 70 shortcutRecorder = ShortcutRecorder; 70 71 "slider_volume" = NSSlider; 71 72 };