adium 4147:898fdd953c65: Backed out changeset 1e84ee0e55a9, it w...

commits at adium.im commits at adium.im
Tue Aug 16 20:40:11 UTC 2011


details:	http://hg.adium.im/adium/rev/898fdd953c65
revision:	4147:898fdd953c65
branch:		(none)
author:		Patrick Steinhardt <steinhardt.p at me.com>
date:		Tue Aug 16 22:17:08 2011 +0200

Backed out changeset 1e84ee0e55a9, it was used in a NIB.
Subject: adium 4148:6e6bfe121003: Fixed context-messages showing up even if logging is entirely disabled. Fixes #12577.

details:	http://hg.adium.im/adium/rev/6e6bfe121003
revision:	4148:6e6bfe121003
branch:		(none)
author:		Patrick Steinhardt <steinhardt.p at me.com>
date:		Tue Aug 16 22:39:53 2011 +0200

Fixed context-messages showing up even if logging is entirely disabled. Fixes #12577.

diffs (206 lines):

diff -r 1e84ee0e55a9 -r 6e6bfe121003 Adium.xcodeproj/project.pbxproj
--- a/Adium.xcodeproj/project.pbxproj	Tue Aug 16 19:42:43 2011 +0200
+++ b/Adium.xcodeproj/project.pbxproj	Tue Aug 16 22:39:53 2011 +0200
@@ -624,6 +624,7 @@
 		34A9706F0C965F8E00F46006 /* AIAddBookmarkPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A9706D0C965F8E00F46006 /* AIAddBookmarkPlugin.m */; };
 		34A970740C965FC800F46006 /* AddBookmark.nib in Resources */ = {isa = PBXBuildFile; fileRef = 34A970730C965FC800F46006 /* AddBookmark.nib */; };
 		34A9707E0C96602300F46006 /* sidebarStatusAreaBackground.png in Resources */ = {isa = PBXBuildFile; fileRef = 34A9707D0C96602200F46006 /* sidebarStatusAreaBackground.png */; };
+		34AE249E09BCCFA900A35B51 /* AIWindowDraggingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 34AE249C09BCCFA900A35B51 /* AIWindowDraggingView.m */; };
 		34B1268E0B924E28003B0451 /* adiumPurpleDnsRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 34B1268C0B924E28003B0451 /* adiumPurpleDnsRequest.h */; };
 		34B1268F0B924E28003B0451 /* adiumPurpleDnsRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B1268D0B924E28003B0451 /* adiumPurpleDnsRequest.m */; };
 		34B3247A0CE4CCF400158D5F /* PurpleAccountViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 34B324780CE4CCF400158D5F /* PurpleAccountViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -3360,6 +3361,8 @@
 		34AC2FA609352C2400393D7A /* AIStatusGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIStatusGroup.m; path = "Frameworks/Adium Framework/Source/AIStatusGroup.m"; sourceTree = "<group>"; };
 		34AC36B907B5C51400145239 /* AIStatus.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AIStatus.h; path = "Frameworks/Adium Framework/Source/AIStatus.h"; sourceTree = "<group>"; };
 		34AC36BA07B5C51400145239 /* AIStatus.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = AIStatus.m; path = "Frameworks/Adium Framework/Source/AIStatus.m"; sourceTree = "<group>"; };
+		34AE249B09BCCFA900A35B51 /* AIWindowDraggingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIWindowDraggingView.h; path = Source/AIWindowDraggingView.h; sourceTree = "<group>"; };
+		34AE249C09BCCFA900A35B51 /* AIWindowDraggingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIWindowDraggingView.m; path = Source/AIWindowDraggingView.m; sourceTree = "<group>"; };
 		34AEE7DC08E3546F00AE1C78 /* ESPurpleFileReceiveRequestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ESPurpleFileReceiveRequestController.h; path = "Plugins/Purple Service/ESPurpleFileReceiveRequestController.h"; sourceTree = "<group>"; };
 		34AEE7DD08E3546F00AE1C78 /* ESPurpleFileReceiveRequestController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ESPurpleFileReceiveRequestController.m; path = "Plugins/Purple Service/ESPurpleFileReceiveRequestController.m"; sourceTree = "<group>"; };
 		34AEE7E808E35A5800AE1C78 /* ESPurpleRequestAbstractWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ESPurpleRequestAbstractWindowController.h; path = "Plugins/Purple Service/ESPurpleRequestAbstractWindowController.h"; sourceTree = "<group>"; };
@@ -7388,6 +7391,8 @@
 				34607F0F09B2296A000DB3D2 /* AIHoveringPopUpButton.h */,
 				34607EE609B228FE000DB3D2 /* AIContactListNameButton.h */,
 				34607EE709B228FE000DB3D2 /* AIContactListNameButton.m */,
+				34AE249B09BCCFA900A35B51 /* AIWindowDraggingView.h */,
+				34AE249C09BCCFA900A35B51 /* AIWindowDraggingView.m */,
 				34891C120D4B75EE00AEF48C /* AIStandardListScrollView.h */,
 				34891C130D4B75EE00AEF48C /* AIStandardListScrollView.m */,
 			);
@@ -10395,6 +10400,7 @@
 				34607EE909B228FE000DB3D2 /* AIContactListNameButton.m in Sources */,
 				34607F1009B2296A000DB3D2 /* AIHoveringPopUpButtonCell.m in Sources */,
 				34607F1209B2296A000DB3D2 /* AIHoveringPopUpButton.m in Sources */,
+				34AE249E09BCCFA900A35B51 /* AIWindowDraggingView.m in Sources */,
 				342353D709D45726009FF634 /* AILogViewerWindowController.m in Sources */,
 				34107B4C09E9923D001CC042 /* AIGuestAccountWindowController.m in Sources */,
 				9ECB03E709F2A9D900996F44 /* AIDictionaryDebug.m in Sources */,
diff -r 1e84ee0e55a9 -r 6e6bfe121003 Source/AIWindowDraggingView.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Source/AIWindowDraggingView.h	Tue Aug 16 22:39:53 2011 +0200
@@ -0,0 +1,23 @@
+/* 
+ * Adium is the legal property of its developers, whose names are listed in the copyright file included
+ * with this source distribution.
+ * 
+ * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License as published by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along with this program; if not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+ at interface AIWindowDraggingView : NSView {
+    NSPoint originalMouseLocation;
+	NSRect	windowFrame;
+	BOOL	inLeftMouseEvent;	
+}
+
+ at end
diff -r 1e84ee0e55a9 -r 6e6bfe121003 Source/AIWindowDraggingView.m
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Source/AIWindowDraggingView.m	Tue Aug 16 22:39:53 2011 +0200
@@ -0,0 +1,87 @@
+/* 
+ * Adium is the legal property of its developers, whose names are listed in the copyright file included
+ * with this source distribution.
+ * 
+ * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License as published by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+ * Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along with this program; if not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#import "AIWindowDraggingView.h"
+
+/*!
+ * @class AIWindowDraggingView
+ * @brief This NSView subclass makes the window move when it is dragged by the view itself (but not by subviews).
+ *
+ * The code is, for reference, a stripped down version of the code powering AIBorderlessWindow's dragging movements.
+ *
+ * On mouse down, the window's frame is noted; deltas as the mouse moves are used to determine the window's
+ * own movements.
+ */
+ at implementation AIWindowDraggingView
+/*!
+ * @brief Mouse dragged
+ */
+- (void)mouseDragged:(NSEvent *)theEvent
+{
+	NSWindow	*window = [self window];
+	NSPoint		currentLocation, newOrigin;
+	NSRect		newWindowFrame;
+	
+	/* If we get here and aren't yet in a left mouse event, which can happen if the user began dragging while
+	 * a contextual menu is showing, start off from the right position by getting our originalMouseLocation.
+	 */		
+	if (!inLeftMouseEvent) {
+		//Grab the mouse location in global coordinates
+		originalMouseLocation = [window convertBaseToScreen:[theEvent locationInWindow]];
+		windowFrame = [window frame];
+		inLeftMouseEvent = YES;		
+	}
+	
+	newOrigin = windowFrame.origin;
+	newWindowFrame = windowFrame;
+	
+	//Grab the current mouse location to compare with the location of the mouse when the drag started (stored in mouseDown:)
+	currentLocation = [NSEvent mouseLocation];
+	newOrigin.x += (currentLocation.x - originalMouseLocation.x);
+	newOrigin.y += currentLocation.y - originalMouseLocation.y;
+	
+	newWindowFrame.origin = newOrigin;
+	
+	[[NSNotificationCenter defaultCenter] postNotificationName:NSWindowWillMoveNotification object:window];
+	[window setFrameOrigin:newWindowFrame.origin];
+	[[NSNotificationCenter defaultCenter] postNotificationName:NSWindowDidMoveNotification object:window];		
+}
+
+/*!
+ * @brief Mouse down
+ *
+ * We start tracking the a drag operation here when the user first clicks the mouse without command presed
+ * to establish the initial location.
+ */
+- (void)mouseDown:(NSEvent *)theEvent
+{
+	NSWindow	*window = [self window];
+	
+	//grab the mouse location in global coordinates
+	originalMouseLocation = [window convertBaseToScreen:[theEvent locationInWindow]];
+	windowFrame = [window frame];
+	inLeftMouseEvent = YES;
+}
+
+/*!
+ * @brief Mouse up
+ */
+- (void)mouseUp:(NSEvent *)theEvent
+{
+	inLeftMouseEvent = NO;
+}
+
+ at end
diff -r 1e84ee0e55a9 -r 6e6bfe121003 Source/DCMessageContextDisplayPlugin.m
--- a/Source/DCMessageContextDisplayPlugin.m	Tue Aug 16 19:42:43 2011 +0200
+++ b/Source/DCMessageContextDisplayPlugin.m	Tue Aug 16 22:39:53 2011 +0200
@@ -73,11 +73,12 @@
 	
 	//Setup our preferences
     [adium.preferenceController registerDefaults:[NSDictionary dictionaryNamed:CONTEXT_DISPLAY_DEFAULTS
-																		forClass:[self class]] 
-										  forGroup:PREF_GROUP_CONTEXT_DISPLAY];
+																	  forClass:[self class]] 
+										forGroup:PREF_GROUP_CONTEXT_DISPLAY];
 	
 	//Observe preference changes for whether or not to display message history
 	[adium.preferenceController registerPreferenceObserver:self forGroup:PREF_GROUP_CONTEXT_DISPLAY];
+	[adium.preferenceController registerPreferenceObserver:self forGroup:PREF_GROUP_LOGGING];
 	
 	sharedInstance = self;
 }
@@ -94,17 +95,25 @@
 - (void)preferencesChangedForGroup:(NSString *)group key:(NSString *)key
 								object:(AIListObject *)object preferenceDict:(NSDictionary *)prefDict firstTime:(BOOL)firstTime
 {
-	if (!object) {		
-		shouldDisplay = [[prefDict objectForKey:KEY_DISPLAY_CONTEXT] boolValue];
-		linesToDisplay = [[prefDict objectForKey:KEY_DISPLAY_LINES] integerValue];
-
+	if (!object) {
+		if ([group isEqualToString:PREF_GROUP_LOGGING]) {
+			shouldDisplay = [[prefDict objectForKey:KEY_LOGGER_ENABLE] boolValue]
+				&& [[adium.preferenceController preferenceForKey:KEY_DISPLAY_CONTEXT
+														   group:PREF_GROUP_CONTEXT_DISPLAY] boolValue];
+		} else if ([group isEqualToString:PREF_GROUP_CONTEXT_DISPLAY]) {
+			shouldDisplay = [[prefDict objectForKey:KEY_DISPLAY_CONTEXT] boolValue]
+				&& [[adium.preferenceController preferenceForKey:KEY_LOGGER_ENABLE
+														  group:PREF_GROUP_LOGGING] boolValue];
+			linesToDisplay = [[prefDict objectForKey:KEY_DISPLAY_LINES] integerValue];
+		}
+		
 		if (shouldDisplay && linesToDisplay > 0 && !isObserving) {
 			//Observe new message windows only if we aren't already observing them
 			isObserving = YES;
 			[[NSNotificationCenter defaultCenter] addObserver:self
-										   selector:@selector(addContextDisplayToWindow:)
-											   name:Chat_DidOpen 
-											 object:nil];
+													 selector:@selector(addContextDisplayToWindow:)
+														 name:Chat_DidOpen 
+													   object:nil];
 			
 		} else if (isObserving && (!shouldDisplay || linesToDisplay <= 0)) {
 			//Remove observer




More information about the commits mailing list