Source/AIChatCyclingPlugin.m
branchadium-1.5.4
changeset 5039 68bb3f77b1d0
parent 4084 295cfdd71c39
child 5709 7c547c4f63b0
equal deleted inserted replaced
5038:9b51ee404bc6 5039:68bb3f77b1d0
    17 #import "AIChatCyclingPlugin.h"
    17 #import "AIChatCyclingPlugin.h"
    18 #import <Adium/AIInterfaceControllerProtocol.h>
    18 #import <Adium/AIInterfaceControllerProtocol.h>
    19 #import <Adium/AIMenuControllerProtocol.h>
    19 #import <Adium/AIMenuControllerProtocol.h>
    20 #import "ESGeneralPreferencesPlugin.h"
    20 #import "ESGeneralPreferencesPlugin.h"
    21 #import <AIUtilities/AIMenuAdditions.h>
    21 #import <AIUtilities/AIMenuAdditions.h>
       
    22 #import <AIUtilities/AIDictionaryAdditions.h>
    22 
    23 
    23 #define PREVIOUS_MESSAGE_MENU_TITLE		AILocalizedString(@"Previous Chat",nil)
    24 #define PREVIOUS_MESSAGE_MENU_TITLE		AILocalizedString(@"Previous Chat",nil)
    24 #define NEXT_MESSAGE_MENU_TITLE			AILocalizedString(@"Next Chat",nil)
    25 #define NEXT_MESSAGE_MENU_TITLE			AILocalizedString(@"Next Chat",nil)
       
    26 
       
    27 #define DEFAULT_CHAT_CYCLING_PREFS		@"ChatCyclingDefaults"
       
    28 #define OLD_DEFAULT_CHAT_CYCLING_PREFS	@"ChatCyclingDefaults-Old"
    25 
    29 
    26 /*!
    30 /*!
    27  * @class AIChatCyclingPlugin
    31  * @class AIChatCyclingPlugin
    28  * @brief Component to manage the chat cycling menu items
    32  * @brief Component to manage the chat cycling menu items
    29  *
    33  *
    48 	nextChatMenuItem = [[NSMenuItem alloc] initWithTitle:NEXT_MESSAGE_MENU_TITLE 
    52 	nextChatMenuItem = [[NSMenuItem alloc] initWithTitle:NEXT_MESSAGE_MENU_TITLE 
    49 												  target:self
    53 												  target:self
    50 												  action:@selector(nextChat:)
    54 												  action:@selector(nextChat:)
    51 										   keyEquivalent:@""];
    55 										   keyEquivalent:@""];
    52 	[menuController addMenuItem:nextChatMenuItem toLocation:LOC_Window_Commands];
    56 	[menuController addMenuItem:nextChatMenuItem toLocation:LOC_Window_Commands];
       
    57 		
       
    58 	/* Adium 1.5.4+ use the new defaults for chat switching, ctrl+tab, to match Safari's default user-visible behavior */
       
    59 	NSDictionary *defaults = [NSDictionary dictionaryNamed:(([adium compareVersion:adium.earliestLaunchedAdiumVersion
       
    60 																		 toVersion:@"1.5.4"] == NSOrderedAscending) ?
       
    61 															OLD_DEFAULT_CHAT_CYCLING_PREFS :
       
    62 															DEFAULT_CHAT_CYCLING_PREFS)
       
    63 												  forClass:[self class]];
       
    64 	[adium.preferenceController registerDefaults:defaults
       
    65 											forGroup:PREF_GROUP_CHAT_CYCLING];
    53 
    66 
    54 	//Prefs
    67 	//Prefs
    55 	[adium.preferenceController registerPreferenceObserver:self forGroup:PREF_GROUP_CHAT_CYCLING];
    68 	[adium.preferenceController registerPreferenceObserver:self forGroup:PREF_GROUP_CHAT_CYCLING];
    56 }
    69 }
    57 
    70