adium 5030:a1dbc4d24a09: Added -[AIAdium earliestLaunchedAdiumVe...
commits at adium.im
commits at adium.im
Thu Sep 6 04:36:16 UTC 2012
details: http://hg.adium.im/adium/rev/a1dbc4d24a09
revision: 5030:a1dbc4d24a09
branch: (none)
author: Evan Schoenberg
date: Wed Sep 05 23:18:36 2012 -0500
Added -[AIAdium earliestLaunchedAdiumVersion] which uses some implementation details of other classes to retroactively guess the earliest launched version and tracks it moving forward
Subject: adium 5031:1a2cd53342c5: Tab switching now defaults to ctrl+tab, matching Safari's user visible default, as per discussion on IRC today. This only applies to new users as of Adium 1.5.4 and later; anyone who has run a previous version will inherit the keep the old default of command+arrows (unless they've changed it previously, of course). Fixes #16102.
details: http://hg.adium.im/adium/rev/1a2cd53342c5
revision: 5031:1a2cd53342c5
branch: (none)
author: Evan Schoenberg
date: Wed Sep 05 23:36:01 2012 -0500
Tab switching now defaults to ctrl+tab, matching Safari's user visible default, as per discussion on IRC today. This only applies to new users as of Adium 1.5.4 and later; anyone who has run a previous version will inherit the keep the old default of command+arrows (unless they've changed it previously, of course). Fixes #16102.
diffs (173 lines):
diff -r 5065b1865e99 -r 1a2cd53342c5 Adium.xcodeproj/project.pbxproj
--- a/Adium.xcodeproj/project.pbxproj Wed Sep 05 18:25:04 2012 -0500
+++ b/Adium.xcodeproj/project.pbxproj Wed Sep 05 23:36:01 2012 -0500
@@ -627,6 +627,8 @@
34D0FDD20956186200DCB678 /* ESPersonalPreferencesPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D0FDD00956186200DCB678 /* ESPersonalPreferencesPlugin.m */; };
34D0FDD80956187700DCB678 /* ESPersonalPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D0FDD60956187700DCB678 /* ESPersonalPreferences.m */; };
34D0FF8509569FE500DCB678 /* PersonalPreferencesDefaults.plist in Resources */ = {isa = PBXBuildFile; fileRef = 34D0FF8409569FE500DCB678 /* PersonalPreferencesDefaults.plist */; };
+ 34D7F1EA15F85DD300F32F9B /* ChatCyclingDefaults-Old.plist in Resources */ = {isa = PBXBuildFile; fileRef = 34D7F1E815F85DD300F32F9B /* ChatCyclingDefaults-Old.plist */; };
+ 34D7F1EB15F85DD300F32F9B /* ChatCyclingDefaults.plist in Resources */ = {isa = PBXBuildFile; fileRef = 34D7F1E915F85DD300F32F9B /* ChatCyclingDefaults.plist */; };
34D8153A13B663650022C8C4 /* AIFacebookXMPPAccount.h in Headers */ = {isa = PBXBuildFile; fileRef = 34D8153013B663650022C8C4 /* AIFacebookXMPPAccount.h */; };
34D8153B13B663650022C8C4 /* AIFacebookXMPPAccount.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D8153113B663650022C8C4 /* AIFacebookXMPPAccount.m */; };
34D8153D13B663650022C8C4 /* AIFacebookXMPPAccountViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 34D8153313B663650022C8C4 /* AIFacebookXMPPAccountViewController.h */; };
@@ -3401,6 +3403,8 @@
34D369ED08E7544D00E15E40 /* AIColorPickerSliders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIColorPickerSliders.h; path = "Frameworks/Adium Framework/Source/AIColorPickerSliders.h"; sourceTree = "<group>"; };
34D369EE08E7544D00E15E40 /* AIColorPickerSliders.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIColorPickerSliders.m; path = "Frameworks/Adium Framework/Source/AIColorPickerSliders.m"; sourceTree = "<group>"; };
34D43504051ADC10003B2F21 /* DualWindowDefaults.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = DualWindowDefaults.plist; path = "Plugins/Dual Window Interface/DualWindowDefaults.plist"; sourceTree = "<group>"; };
+ 34D7F1E815F85DD300F32F9B /* ChatCyclingDefaults-Old.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "ChatCyclingDefaults-Old.plist"; path = "Resources/ChatCyclingDefaults-Old.plist"; sourceTree = "<group>"; };
+ 34D7F1E915F85DD300F32F9B /* ChatCyclingDefaults.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = ChatCyclingDefaults.plist; path = Resources/ChatCyclingDefaults.plist; sourceTree = "<group>"; };
34D8153013B663650022C8C4 /* AIFacebookXMPPAccount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIFacebookXMPPAccount.h; path = "Plugins/Purple Service/AIFacebookXMPPAccount.h"; sourceTree = "<group>"; };
34D8153113B663650022C8C4 /* AIFacebookXMPPAccount.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIFacebookXMPPAccount.m; path = "Plugins/Purple Service/AIFacebookXMPPAccount.m"; sourceTree = "<group>"; };
34D8153313B663650022C8C4 /* AIFacebookXMPPAccountViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIFacebookXMPPAccountViewController.h; path = "Plugins/Purple Service/AIFacebookXMPPAccountViewController.h"; sourceTree = "<group>"; };
@@ -6682,6 +6686,8 @@
children = (
34BFE20007E8E11500AD984D /* AIChatCyclingPlugin.m */,
34BFE20107E8E11500AD984D /* AIChatCyclingPlugin.h */,
+ 34D7F1E815F85DD300F32F9B /* ChatCyclingDefaults-Old.plist */,
+ 34D7F1E915F85DD300F32F9B /* ChatCyclingDefaults.plist */,
);
name = "Chat Cycling";
sourceTree = "<group>";
@@ -9750,6 +9756,8 @@
C6B545A815D338EE0005F1F8 /* SoundFileIcon at 2x.png in Resources */,
C6B545AA15D3390F0005F1F8 /* ABSearch at 2x.png in Resources */,
C61AFA9A15DD43C80001EDEF /* AboutDialog_bg at 2x.png in Resources */,
+ 34D7F1EA15F85DD300F32F9B /* ChatCyclingDefaults-Old.plist in Resources */,
+ 34D7F1EB15F85DD300F32F9B /* ChatCyclingDefaults.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff -r 5065b1865e99 -r 1a2cd53342c5 Frameworks/Adium Framework/Source/AIAdiumProtocol.h
--- a/Frameworks/Adium Framework/Source/AIAdiumProtocol.h Wed Sep 05 18:25:04 2012 -0500
+++ b/Frameworks/Adium Framework/Source/AIAdiumProtocol.h Wed Sep 05 23:36:01 2012 -0500
@@ -61,6 +61,7 @@
@property (readonly, nonatomic) NSString *cachesPath;
- (NSComparisonResult)compareVersion:(NSString *)versionA toVersion:(NSString *)versionB;
+- (NSString *)earliestLaunchedAdiumVersion;
@property (readonly, nonatomic) BOOL isQuitting;
diff -r 5065b1865e99 -r 1a2cd53342c5 Resources/ChatCyclingDefaults-Old.plist
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/ChatCyclingDefaults-Old.plist Wed Sep 05 23:36:01 2012 -0500
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Tab Switching Keys</key>
+ <integer>0</integer>
+</dict>
+</plist>
diff -r 5065b1865e99 -r 1a2cd53342c5 Resources/ChatCyclingDefaults.plist
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/ChatCyclingDefaults.plist Wed Sep 05 23:36:01 2012 -0500
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Tab Switching Keys</key>
+ <integer>5</integer>
+</dict>
+</plist>
diff -r 5065b1865e99 -r 1a2cd53342c5 Source/AIAdium.m
--- a/Source/AIAdium.m Wed Sep 05 18:25:04 2012 -0500
+++ b/Source/AIAdium.m Wed Sep 05 23:36:01 2012 -0500
@@ -72,6 +72,8 @@
#define ALWAYS_RUN_SETUP_WIZARD FALSE
+#define AIEarliestLaunchedAdiumVersionKey @"AIEarliestLaunchedAdiumVersion"
+
static NSString *prefsCategory;
@interface AIAdium ()
@@ -137,6 +139,8 @@
andSelector:@selector(handleURLEvent:withReplyEvent:)
forEventClass:kInternetEventClass
andEventID:kAEGetURL];
+
+ [self noteEarliestLaunchedAdiumVersion];
}
- (void)handleURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
@@ -989,6 +993,43 @@
return [NSApplication sharedApplication];
}
+- (NSString *)earliestLaunchedAdiumVersion
+{
+ return [[NSUserDefaults standardUserDefaults] stringForKey:AIEarliestLaunchedAdiumVersionKey];
+}
+
+- (void)noteEarliestLaunchedAdiumVersion
+{
+ if (![self earliestLaunchedAdiumVersion]) {
+ /* Either Adium has never run before on this machine, or the version which did was < 1.5.4, as that's when we started
+ * noting the earliest run version
+ */
+ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"Adium 1.3.3:Reimported Spotlight Logs"]) {
+ /* This is set by the logging plugin in every version of Adium from 1.3.3 through 1.5.3, so if it's already set,
+ * Adium 1.3.3 through 1.5.3 have launched previously. Assume 1.5.3 since we can't tell the difference.
+ */
+ [[NSUserDefaults standardUserDefaults] setObject:@"1.5.3"
+ forKey:AIEarliestLaunchedAdiumVersionKey];
+
+ } else if ([[NSUserDefaults standardUserDefaults] boolForKey:@"Adium 1.2.4 deleted blist.xml"]) {
+ /* similar story, so now we're between 1.2.4 and 1.3.2 */
+ [[NSUserDefaults standardUserDefaults] setObject:@"1.3.2"
+ forKey:AIEarliestLaunchedAdiumVersionKey];
+
+ } else if ([[NSUserDefaults standardUserDefaults] boolForKey:@"Adium 1.0.3 moved to libpurple"]) {
+ /* similar story, so now we're between 1.0.3 and 1.2.3. Really, you're just now upgrading?! */
+ [[NSUserDefaults standardUserDefaults] setObject:@"1.2.3"
+ forKey:AIEarliestLaunchedAdiumVersionKey];
+ } else {
+ /* This user has never run Adium, at least not since 1.0.3. Record the current version */
+ [[NSUserDefaults standardUserDefaults] setObject:[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey]
+ forKey:AIEarliestLaunchedAdiumVersionKey];
+
+ }
+
+ }
+}
+
#pragma mark Scripting
- (BOOL)application:(NSApplication *)sender delegateHandlesKey:(NSString *)key {
BOOL handleKey = NO;
diff -r 5065b1865e99 -r 1a2cd53342c5 Source/AIChatCyclingPlugin.m
--- a/Source/AIChatCyclingPlugin.m Wed Sep 05 18:25:04 2012 -0500
+++ b/Source/AIChatCyclingPlugin.m Wed Sep 05 23:36:01 2012 -0500
@@ -19,10 +19,14 @@
#import <Adium/AIMenuControllerProtocol.h>
#import "ESGeneralPreferencesPlugin.h"
#import <AIUtilities/AIMenuAdditions.h>
+#import <AIUtilities/AIDictionaryAdditions.h>
#define PREVIOUS_MESSAGE_MENU_TITLE AILocalizedString(@"Previous Chat",nil)
#define NEXT_MESSAGE_MENU_TITLE AILocalizedString(@"Next Chat",nil)
+#define DEFAULT_CHAT_CYCLING_PREFS @"ChatCyclingDefaults"
+#define OLD_DEFAULT_CHAT_CYCLING_PREFS @"ChatCyclingDefaults-Old"
+
/*!
* @class AIChatCyclingPlugin
* @brief Component to manage the chat cycling menu items
@@ -50,6 +54,15 @@
action:@selector(nextChat:)
keyEquivalent:@""];
[menuController addMenuItem:nextChatMenuItem toLocation:LOC_Window_Commands];
+
+ /* Adium 1.5.4+ use the new defaults for chat switching, ctrl+tab, to match Safari's default user-visible behavior */
+ NSDictionary *defaults = [NSDictionary dictionaryNamed:(([adium compareVersion:adium.earliestLaunchedAdiumVersion
+ toVersion:@"1.5.4"] == NSOrderedAscending) ?
+ OLD_DEFAULT_CHAT_CYCLING_PREFS :
+ DEFAULT_CHAT_CYCLING_PREFS)
+ forClass:[self class]];
+ [adium.preferenceController registerDefaults:defaults
+ forGroup:PREF_GROUP_CHAT_CYCLING];
//Prefs
[adium.preferenceController registerPreferenceObserver:self forGroup:PREF_GROUP_CHAT_CYCLING];
More information about the commits
mailing list