Changeset 14725
- Timestamp:
- 01/02/2006 10:38:47 AM (3 years ago)
- Files:
-
- trunk/Plugins/Dock Icon Badging/AIDockBadger.h (modified) (1 diff)
- trunk/Plugins/Dock Icon Badging/AIDockBadger.m (modified) (5 diffs)
- trunk/Plugins/Dual Window Interface/ESDualWindowMessageAdvancedPreferences.h (modified) (1 diff)
- trunk/Plugins/Dual Window Interface/ESDualWindowMessageAdvancedPreferences.m (modified) (3 diffs)
- trunk/Resources/BadgerDefaults.plist (added)
- trunk/Resources/DockUnviewedContentDefaults.plist (added)
- trunk/Resources/English.lproj/DualWindowMessageAdvanced.nib/classes.nib (modified) (1 diff)
- trunk/Resources/English.lproj/DualWindowMessageAdvanced.nib/keyedobjects.nib (modified) (previous)
- trunk/Source/AIDockController.h (modified) (1 diff)
- trunk/Source/AIDockController.m (modified) (1 diff)
- trunk/Source/AIDockUnviewedContentPlugin.h (modified) (1 diff)
- trunk/Source/AIDockUnviewedContentPlugin.m (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Plugins/Dock Icon Badging/AIDockBadger.h
r12926 r14725 26 26 NSImage *badgeOne, *badgeTwo; 27 27 int lastUnviewedContentCount; 28 29 BOOL shouldBadge; 28 30 } 29 31 trunk/Plugins/Dock Icon Badging/AIDockBadger.m
r12987 r14725 34 34 35 35 @interface AIDockBadger (PRIVATE) 36 - (void)removeOverlay; 36 37 - (void)_setOverlay; 37 38 @end … … 48 49 overlayState = nil; 49 50 50 //Register as a chat observer (for unviewed content) 51 [[adium chatController] registerChatObserver:self]; 52 53 [[adium notificationCenter] addObserver:self 54 selector:@selector(contentAdded:) 55 name:Content_WillReceiveContent 56 object:nil]; 57 58 [[adium notificationCenter] addObserver:self 59 selector:@selector(chatClosed:) 60 name:Chat_WillClose 61 object:nil]; 62 //Prefs 63 // [[adium preferenceController] registerPreferenceObserver:self forGroup:PREF_GROUP_LIST_THEME]; 51 //Register our default preferences 52 [preferenceController registerDefaults:[NSDictionary dictionaryNamed:@"BadgerDefaults" 53 forClass:[self class]] 54 forGroup:PREF_GROUP_APPEARANCE]; 55 56 //Observe pref changes 57 [[adium preferenceController] registerPreferenceObserver:self forGroup:PREF_GROUP_APPEARANCE]; 64 58 } 65 59 … … 94 88 afterDelay:0]; 95 89 } 90 91 #pragma mark Preference observing 92 - (void)preferencesChangedForGroup:(NSString *)group key:(NSString *)key 93 object:(AIListObject *)object preferenceDict:(NSDictionary *)prefDict firstTime:(BOOL)firstTime 94 { 95 if (!key || [key isEqualToString:KEY_BADGE_DOCK_ICON]) { 96 BOOL newShouldBadge = [[prefDict objectForKey:KEY_BADGE_DOCK_ICON] boolValue]; 97 if (newShouldBadge != shouldBadge) { 98 shouldBadge = newShouldBadge; 99 100 if (shouldBadge) { 101 //Register as a chat observer (for unviewed content) 102 [[adium chatController] registerChatObserver:self]; 103 104 [[adium notificationCenter] addObserver:self 105 selector:@selector(contentAdded:) 106 name:Content_WillReceiveContent 107 object:nil]; 108 109 [[adium notificationCenter] addObserver:self 110 selector:@selector(chatClosed:) 111 name:Chat_WillClose 112 object:nil]; 113 114 } else { 115 //Remove any existing overlay 116 [self removeOverlay]; 117 118 //Stop observing 119 [[adium chatController] unregisterChatObserver:self]; 120 [[adium notificationCenter] removeObserver:self]; 121 } 122 } 123 } 124 } 96 125 97 126 #pragma mark Work methods … … 140 169 } 141 170 142 // 171 /* 172 * @brief Remove any existing dock overlay 173 */ 174 - (void)removeOverlay 175 { 176 if (overlayState) { 177 [[adium dockController] removeIconStateNamed:@"UnviewedContentCount"]; 178 [overlayState release]; overlayState = nil; 179 } 180 } 181 182 /* 183 * @brief Update our overlay to the current unviewed content count 184 */ 143 185 - (void)_setOverlay 144 186 { … … 147 189 if (contentCount != lastUnviewedContentCount) { 148 190 //Remove & release the current overlay state 149 if (overlayState) { 150 [[adium dockController] removeIconStateNamed:@"UnviewedContentCount"]; 151 [overlayState release]; overlayState = nil; 152 } 191 [self removeOverlay]; 153 192 154 193 //Create & set the new overlay state trunk/Plugins/Dual Window Interface/ESDualWindowMessageAdvancedPreferences.h
r11031 r14725 26 26 27 27 @interface ESDualWindowMessageAdvancedPreferences : AIPreferencePane { 28 IBOutlet NSButton *checkBox_animateDockIcon; 29 IBOutlet NSButton *checkBox_badgeDockIcon; 30 28 31 IBOutlet NSButton *autohide_tabBar; 29 32 IBOutlet NSButton *checkBox_allowInactiveClosing; trunk/Plugins/Dual Window Interface/ESDualWindowMessageAdvancedPreferences.m
r12821 r14725 23 23 #import <AIUtilities/AIImageAdditions.h> 24 24 25 # warning crosslink25 #import "AIDockController.h" 26 26 #import "AIInterfaceController.h" 27 27 #import "AIPreferenceWindowController.h" … … 85 85 forKey:KEY_WEBKIT_TIME_STAMP_FORMAT 86 86 group:PREF_GROUP_WEBKIT_MESSAGE_DISPLAY]; 87 88 } else if (sender == checkBox_animateDockIcon) { 89 [[adium preferenceController] setPreference:[NSNumber numberWithBool:[sender state]] 90 forKey:KEY_ANIMATE_DOCK_ICON 91 group:PREF_GROUP_APPEARANCE]; 92 93 } else if (sender == checkBox_badgeDockIcon) { 94 [[adium preferenceController] setPreference:[NSNumber numberWithBool:[sender state]] 95 forKey:KEY_BADGE_DOCK_ICON 96 group:PREF_GROUP_APPEARANCE]; 97 87 98 } 88 99 … … 105 116 NSDictionary *prefDict; 106 117 int menuIndex; 118 119 prefDict = [[adium preferenceController] preferencesForGroup:PREF_GROUP_APPEARANCE]; 120 [checkBox_animateDockIcon setState:[[prefDict objectForKey:KEY_ANIMATE_DOCK_ICON] boolValue]]; 121 [checkBox_badgeDockIcon setState:[[prefDict objectForKey:KEY_BADGE_DOCK_ICON] boolValue]]; 107 122 108 123 prefDict = [[adium preferenceController] preferencesForGroup:PREF_GROUP_DUAL_WINDOW_INTERFACE]; trunk/Resources/English.lproj/DualWindowMessageAdvanced.nib/classes.nib
r11031 r14725 41 41 "autohide_tabBar" = NSButton; 42 42 "checkBox_allowInactiveClosing" = NSButton; 43 "checkBox_animateDockIcon" = NSButton; 44 "checkBox_badgeDockIcon" = NSButton; 43 45 "checkBox_customNameFormatting" = NSButton; 44 46 "checkBox_hide" = NSButton; trunk/Source/AIDockController.h
r12834 r14725 20 20 #define Dock_IconDidChange @"Dock_IconDidChange" 21 21 22 #define PREF_GROUP_APPEARANCE @"Appearance" 23 22 24 #define KEY_ACTIVE_DOCK_ICON @"Dock Icon" 23 25 #define FOLDER_DOCK_ICONS @"Dock Icons" 26 27 #define KEY_ANIMATE_DOCK_ICON @"Animate Dock Icon on Unread Messages" 28 #define KEY_BADGE_DOCK_ICON @"Badge Dock Icon on Unread Messages" 24 29 25 30 @class AIIconState; trunk/Source/AIDockController.m
r13813 r14725 17 17 // $Id$ 18 18 19 #import "AIAppearancePreferencesPlugin.h"20 19 #import "AIDockController.h" 21 20 #import "AIInterfaceController.h" trunk/Source/AIDockUnviewedContentPlugin.h
r13421 r14725 21 21 @interface AIDockUnviewedContentPlugin : AIPlugin <AIChatObserver> { 22 22 NSMutableArray *unviewedObjectsArray; 23 BOOL unviewedState; 24 23 BOOL unviewedState; 24 25 BOOL animateDockIcon; 25 26 } 26 27 trunk/Source/AIDockUnviewedContentPlugin.m
r13421 r14725 19 19 #import "AIContentController.h" 20 20 #import "AIDockController.h" 21 #import "AIPreferenceController.h" 21 22 #import <AIUtilities/AIArrayAdditions.h> 22 23 #import <Adium/AIChat.h> 24 25 @interface AIDockUnviewedContentPlugin (PRIVATE) 26 - (void)removeAlert; 27 @end 23 28 24 29 /* … … 37 42 unviewedState = NO; 38 43 39 //Register as a chat observer (So we can catch the unviewed content status flag) 40 [[adium chatController] registerChatObserver:self]; 44 //Register our default preferences 45 [preferenceController registerDefaults:[NSDictionary dictionaryNamed:@"DockUnviewedContentDefaults" 46 forClass:[self class]] 47 forGroup:PREF_GROUP_APPEARANCE]; 41 48 42 [[adium notificationCenter] addObserver:self 43 selector:@selector(chatWillClose:) 44 name:Chat_WillClose object:nil]; 49 //Observe pref changes 50 [[adium preferenceController] registerPreferenceObserver:self forGroup:PREF_GROUP_APPEARANCE]; 45 51 } 46 52 … … 54 60 } 55 61 62 #pragma mark Preference observing 63 - (void)preferencesChangedForGroup:(NSString *)group key:(NSString *)key 64 object:(AIListObject *)object preferenceDict:(NSDictionary *)prefDict firstTime:(BOOL)firstTime 65 { 66 if (!key || [key isEqualToString:KEY_ANIMATE_DOCK_ICON]) { 67 BOOL newAnimateDockIcon = [[prefDict objectForKey:KEY_ANIMATE_DOCK_ICON] boolValue]; 68 69 if (newAnimateDockIcon != animateDockIcon) { 70 animateDockIcon = newAnimateDockIcon; 71 72 if (animateDockIcon) { 73 //Register as a chat observer (So we can catch the unviewed content status flag) 74 [[adium chatController] registerChatObserver:self]; 75 76 [[adium notificationCenter] addObserver:self 77 selector:@selector(chatWillClose:) 78 name:Chat_WillClose object:nil]; 79 80 } else { 81 [self removeAlert]; 82 83 [[adium chatController] unregisterChatObserver:self]; 84 [[adium notificationCenter] removeObserver:self]; 85 } 86 } 87 } 88 } 56 89 /* 57 90 * @brief Chat was updated … … 81 114 //If there are no more contacts with unviewed content, stop animating the dock 82 115 if ([unviewedObjectsArray count] == 0 && unviewedState) { 83 [[adium dockController] removeIconStateNamed:@"Alert"]; 84 unviewedState = NO; 116 [self removeAlert]; 85 117 } 86 118 } … … 89 121 90 122 return nil; 123 } 124 125 /*! 126 * @brief Remove any existing alert state 127 */ 128 - (void)removeAlert 129 { 130 [[adium dockController] removeIconStateNamed:@"Alert"]; 131 unviewedState = NO; 91 132 } 92 133 … … 105 146 //If there are no more contacts with unviewed content, stop animating the dock 106 147 if ([unviewedObjectsArray count] == 0 && unviewedState) { 107 [[adium dockController] removeIconStateNamed:@"Alert"]; 108 unviewedState = NO; 148 [self removeAlert]; 109 149 } 110 150 }