zephyrchat-cvs Mailing List for zChat (Page 2)
Status: Alpha
Brought to you by:
akosut
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
(26) |
Apr
(34) |
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: <ak...@us...> - 2003-04-07 21:02:03
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv11946
Modified Files:
ZChatAppController.h ZChatAppController.mm
ZChatFriendsController.h ZChatFriendsController.mm
Log Message:
Custom status messages work (mostly).
Index: ZChatAppController.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatAppController.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- ZChatAppController.h 7 Apr 2003 20:37:33 -0000 1.15
+++ ZChatAppController.h 7 Apr 2003 21:01:52 -0000 1.16
@@ -44,7 +44,7 @@
- (IBAction)showFriendsWindow:(id)sender;
- (IBAction)connect:(id)sender;
-- (IBAction)connectWithTerminal:(NSString *)terminal;
+- (void)connectWithTerminal:(NSString *)terminal;
- (IBAction)disconnect:(id)sender;
- (void)zephyrAbort:(zephyrlib::ZephyrStatus)status;
Index: ZChatAppController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatAppController.mm,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- ZChatAppController.mm 7 Apr 2003 20:37:33 -0000 1.18
+++ ZChatAppController.mm 7 Apr 2003 21:01:53 -0000 1.19
@@ -151,9 +151,13 @@
}
- (void)setTerminal:(NSString *)status {
- _mgr->SetTerminal([status stlString], new ZChatAppControllerUpdateCallback);
- _busy = true;
- [[NSNotificationCenter defaultCenter] postNotificationName:ZChatStatusNotification object:self];
+ if (_mgr == NULL) {
+ [self connectWithTerminal:status];
+ } else {
+ _mgr->SetTerminal([status stlString], new ZChatAppControllerUpdateCallback);
+ _busy = true;
+ [[NSNotificationCenter defaultCenter] postNotificationName:ZChatStatusNotification object:self];
+ }
}
@@ -161,7 +165,7 @@
[self connectWithTerminal:[_friends defaultTerminal]];
}
-- (IBAction)connectWithTerminal:(NSString *)terminal {
+- (void)connectWithTerminal:(NSString *)terminal {
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
delete _mgr;
Index: ZChatFriendsController.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendsController.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- ZChatFriendsController.h 7 Apr 2003 20:37:33 -0000 1.15
+++ ZChatFriendsController.h 7 Apr 2003 21:01:54 -0000 1.16
@@ -27,6 +27,10 @@
IBOutlet NSButton *_reloadButton;
IBOutlet NSProgressIndicator *_busyIndicator;
+
+ IBOutlet NSWindow *_statusSheet;
+ IBOutlet NSButton *_statusOKButton;
+ IBOutlet NSTextField *_statusTextField;
NSMutableArray *_data;
NSTimer *_timer;
Index: ZChatFriendsController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendsController.mm,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- ZChatFriendsController.mm 7 Apr 2003 20:37:33 -0000 1.20
+++ ZChatFriendsController.mm 7 Apr 2003 21:01:55 -0000 1.21
@@ -183,7 +183,7 @@
// Check for existing title
id <NSMenuItem> item = [_statusMenu itemWithTitle:status];
if (item != NULL) {
- if ([item tag] == away ? 2 : 1 || [item tag] == away ? 222 : 111) {
+ if (([item tag] == (away ? 2 : 1)) || ([item tag] == (away ? 222 : 111))) {
[_statusMenu selectItem:item];
return;
}
@@ -210,43 +210,52 @@
- (IBAction)changeStatus:(id)sender {
id <NSMenuItem> item = [sender selectedItem];
- NSString *terminal = nil;
switch ([item tag]) {
case -1:
[ZChatApp disconnect:nil];
- return;
+ break;
case -2:
- terminal = @"";
+ [ZChatApp zephyrHide:nil];
break;
case 1:
case 111:
- terminal = [NSString stringWithFormat:@"+%@", [item title]];
+ [ZChatApp setTerminal:[NSString stringWithFormat:@"+%@", [item title]]];
break;
case 2:
case 222:
- terminal = [NSString stringWithFormat:@"-%@", [item title]];
+ [ZChatApp setTerminal:[NSString stringWithFormat:@"-%@", [item title]]];
break;
case 11:
case 22:
/* Haul out the heavy artillery... */
- // TODO
+ [NSApp beginSheet:_statusSheet modalForWindow:[self window] modalDelegate:self
+ didEndSelector:@selector(_changeStatusSheetDidEnd:returnCode:contextInfo:)
+ contextInfo:reinterpret_cast<void *>([item tag])];
break;
}
+}
- if (terminal != nil) {
- if ([ZChatApp mgr] != nil) {
- [ZChatApp setTerminal:terminal];
- } else {
- [ZChatApp connectWithTerminal:terminal];
- }
+- (void)_changeStatusSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {
+ if (returnCode == NSOKButton) {
+ bool away = reinterpret_cast<int>(contextInfo) == 22;
+ NSString *status = [_statusTextField stringValue];
+
+ NSAssert([status length] > 0, @"Custom status cannot be empty");
+
+ [ZChatApp setTerminal:[NSString stringWithFormat:@"%c%@", away ? '-' : '+', status]];
}
}
+- (void)controlTextDidChange:(NSNotification *)notification {
+ if ([notification object] == _statusTextField) {
+ [_statusOKButton setEnabled:[[_statusTextField stringValue] length] > 0];
+ }
+}
- (void)_loginNotification:(NSNotification *)notification {
[_reloadButton setEnabled:YES];
|
|
From: <ak...@us...> - 2003-04-07 21:02:01
|
Update of /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib
In directory sc8-pr-cvs1:/tmp/cvs-serv11946/English.lproj/FriendsWindow.nib
Modified Files:
classes.nib info.nib objects.nib
Log Message:
Custom status messages work (mostly).
Index: classes.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib/classes.nib,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- classes.nib 7 Apr 2003 20:37:40 -0000 1.11
+++ classes.nib 7 Apr 2003 21:01:56 -0000 1.12
@@ -44,6 +44,9 @@
"_name" = NSTextField;
"_reloadButton" = NSButton;
"_statusMenu" = NSPopUpButton;
+ "_statusOKButton" = NSButton;
+ "_statusSheet" = NSWindow;
+ "_statusTextField" = NSTextField;
};
SUPERCLASS = NSWindowController;
}
Index: info.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib/info.nib,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- info.nib 7 Apr 2003 20:37:40 -0000 1.10
+++ info.nib 7 Apr 2003 21:01:56 -0000 1.11
@@ -3,11 +3,12 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
- <string>56 101 395 294 0 0 1024 746 </string>
+ <string>69 116 395 294 0 0 1024 746 </string>
<key>IBFramework Version</key>
<string>291.0</string>
<key>IBOpenObjects</key>
<array>
+ <integer>651</integer>
<integer>373</integer>
</array>
<key>IBSystem Version</key>
Index: objects.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib/objects.nib,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
Binary files /tmp/cvsqzdUo9 and /tmp/cvsghlMy8 differ
|
|
From: <ak...@us...> - 2003-04-07 20:38:13
|
Update of /cvsroot/zephyrchat/zchat/zChat/English.lproj In directory sc8-pr-cvs1:/tmp/cvs-serv31571/English.lproj Modified Files: Localizable.strings Log Message: Add partial status control (no custom status) Index: Localizable.strings =================================================================== RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/Localizable.strings,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- Localizable.strings 1 Apr 2003 14:37:59 -0000 1.18 +++ Localizable.strings 7 Apr 2003 20:37:39 -0000 1.19 @@ -63,6 +63,8 @@ "PING_MESSAGE" = "â¦"; +"INSTANCE_DISPLAY_FORMAT" = "[%@] "; + /* signature (username) */ "DISPLAY_USERNAME_FORMAT" = "%2$@ <%1$@>"; "POPUP_USERNAME_FORMAT" = "%@ (%@)"; |
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv31571
Modified Files:
ZCChatWindowController.h ZChatAppController.h
ZChatAppController.mm ZChatFriendsController.h
ZChatFriendsController.mm
Added Files:
status-available.tiff status-away.tiff
Log Message:
Add partial status control (no custom status)
--- NEW FILE: status-available.tiff ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: status-away.tiff ---
(This appears to be a binary file; contents omitted.)
Index: ZCChatWindowController.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZCChatWindowController.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- ZCChatWindowController.h 1 Apr 2003 15:18:39 -0000 1.15
+++ ZCChatWindowController.h 7 Apr 2003 20:37:33 -0000 1.16
@@ -81,8 +81,8 @@
* used to later remove completely the addition (with the exception of any added
* timestamp).
*/
-- (NSRange)appendMessage:(NSAttributedString *)message from:(NSString *)sender color:(NSColor *)bgColor
- textColor:(NSColor *)fgColor alignment:(NSTextAlignment)alignment;
+- (NSRange)appendMessage:(NSAttributedString *)message from:(NSString *)sender instance:(NSString *)instance
+ color:(NSColor *)bgColor textColor:(NSColor *)fgColor alignment:(NSTextAlignment)alignment;
- (NSAttributedString *)pingMessageWithColor:(NSColor *)textColor;
- (IBAction)sendMessage:(id)sender;
Index: ZChatAppController.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatAppController.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- ZChatAppController.h 29 Mar 2003 19:21:38 -0000 1.14
+++ ZChatAppController.h 7 Apr 2003 20:37:33 -0000 1.15
@@ -44,11 +44,13 @@
- (IBAction)showFriendsWindow:(id)sender;
- (IBAction)connect:(id)sender;
+- (IBAction)connectWithTerminal:(NSString *)terminal;
- (IBAction)disconnect:(id)sender;
- (void)zephyrAbort:(zephyrlib::ZephyrStatus)status;
- (IBAction)zephyrHide:(id)sender;
- (IBAction)zephyrUnhide:(id)sender;
+- (void)setTerminal:(NSString *)status;
- (BOOL)validateMenuItem:(id <NSMenuItem>)menuItem;
Index: ZChatAppController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatAppController.mm,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- ZChatAppController.mm 29 Mar 2003 19:21:38 -0000 1.17
+++ ZChatAppController.mm 7 Apr 2003 20:37:33 -0000 1.18
@@ -143,18 +143,25 @@
}
- (IBAction)zephyrHide:(id)sender {
- _mgr->SetTerminal("", new ZChatAppControllerUpdateCallback);
- _busy = true;
- [[NSNotificationCenter defaultCenter] postNotificationName:ZChatStatusNotification object:self];
+ [self setTerminal:@""];
}
- (IBAction)zephyrUnhide:(id)sender {
- _mgr->SetTerminal("Available", new ZChatAppControllerUpdateCallback);
+ [self setTerminal:[_friends defaultTerminal]];
+}
+
+- (void)setTerminal:(NSString *)status {
+ _mgr->SetTerminal([status stlString], new ZChatAppControllerUpdateCallback);
_busy = true;
[[NSNotificationCenter defaultCenter] postNotificationName:ZChatStatusNotification object:self];
}
+
- (IBAction)connect:(id)sender {
+ [self connectWithTerminal:[_friends defaultTerminal]];
+}
+
+- (IBAction)connectWithTerminal:(NSString *)terminal {
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
delete _mgr;
@@ -169,7 +176,7 @@
NSLocalizedString(@"Cancel", nil), nil,
NSLocalizedString(@"Open Preferences", nil));
if (code == NSAlertOtherReturn) {
- [self showPrefsPanel:sender];
+ [self showPrefsPanel:nil];
}
return;
@@ -191,12 +198,11 @@
// calling the ZephyrMgr constructor (because we can pause/fail there)
_mgr = new ZephyrMgr(_otCtx, [[NSRunLoop currentRunLoop] getCFRunLoop],
- [server stlString],
- "Available",
- new ZChatAppControllerLoginCallback,
- new ZChatAppControllerMessageCallback,
- address);
-
+ [server stlString], [terminal stlString],
+ new ZChatAppControllerLoginCallback,
+ new ZChatAppControllerMessageCallback,
+ address);
+
[NSApp runModalForWindow:_progressPanel];
} catch (ZephyrStatus err) {
[self zephyrAbort:err];
@@ -584,6 +590,5 @@
return result;
}
-
@end
Index: ZChatFriendsController.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendsController.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- ZChatFriendsController.h 31 Mar 2003 17:07:21 -0000 1.14
+++ ZChatFriendsController.h 7 Apr 2003 20:37:33 -0000 1.15
@@ -40,17 +40,14 @@
- (NSArray *)friends;
- (NSArray *)selectedFriends;
+- (IBAction)changeStatus:(id)sender;
+
- (IBAction)newFriend:(id)sender;
- (IBAction)delete:(id)sender;
- (IBAction)chatFriend:(id)sender;
- (IBAction)emailFriend:(id)sender;
- (IBAction)infoFriend:(id)sender;
-- (void)_selectNotification:(NSNotification *)notification;
-- (void)_busyNotification:(NSNotification *)notification;
-
-- (void)_loginNotification:(NSNotification *)notification;
-- (void)_logoutNotification:(NSNotification *)notification;
-- (void)_statusNotification:(NSNotification *)notification;
+- (NSString *)defaultTerminal;
@end
Index: ZChatFriendsController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendsController.mm,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- ZChatFriendsController.mm 1 Apr 2003 17:41:00 -0000 1.19
+++ ZChatFriendsController.mm 7 Apr 2003 20:37:33 -0000 1.20
@@ -18,6 +18,17 @@
static const NSTimeInterval ZChatFriendTimeInterval = 60.0 * 5.0; // five minutes
+@interface ZChatFriendsController (ZChatFriendsControllerPrivateMethods)
+- (void)_updateStatusMenu;
+
+- (void)_selectNotification:(NSNotification *)notification;
+- (void)_busyNotification:(NSNotification *)notification;
+
+- (void)_loginNotification:(NSNotification *)notification;
+- (void)_logoutNotification:(NSNotification *)notification;
+- (void)_statusNotification:(NSNotification *)notification;
+@end
+
@implementation ZChatFriendsController
- (id)init {
@@ -79,10 +90,21 @@
[_busyIndicator setStyle:NSProgressIndicatorSpinningStyle];
[_busyIndicator setDisplayedWhenStopped:NO];
+
+ [[_statusMenu itemAtIndex:[_statusMenu indexOfItemWithTag:1]] setImage:
+ [NSImage imageNamed:@"status-available"]];
+ [[_statusMenu itemAtIndex:[_statusMenu indexOfItemWithTag:11]] setImage:
+ [NSImage imageNamed:@"status-available"]];
+ [[_statusMenu itemAtIndex:[_statusMenu indexOfItemWithTag:2]] setImage:
+ [NSImage imageNamed:@"status-away"]];
+ [[_statusMenu itemAtIndex:[_statusMenu indexOfItemWithTag:22]] setImage:
+ [NSImage imageNamed:@"status-away"]];
}
- (void)windowDidLoad {
[self reloadFriendViews];
+ [self _updateStatusMenu];
+ [_name setStringValue:[ZChatApp mySignature]];
}
/* This is a simplified and rewritten-from-scratch version of Camino's CHStackView, which is a simplified
@@ -126,11 +148,113 @@
[_data makeObjectsPerformSelector:@selector(reset)];
}
+- (void)_updateStatusMenu {
+ /* Status menu:
+ * - Available (tag 1)
+ * - <custom available> (tag 111)
+ * - Custom... (tag 11)
+ *
+ * - Away (tag 2)
+ * - <custom away> (tag 222)
+ * - Custom... (tag 22)
+ *
+ * Hidden (tag -2)
+ *
+ * Offline (tag -1)
+ */
+
+ if ([ZChatApp mgr] == nil) {
+ [_statusMenu selectItemAtIndex:[_statusMenu indexOfItemWithTag:-1]];
+ return;
+ }
+
+ if ([ZChatApp mgr]->GetTerminal().empty()) {
+ [_statusMenu selectItemAtIndex:[_statusMenu indexOfItemWithTag:-2]];
+ return;
+ }
+
+ NSString *status = [NSString stringWithSTLString:[ZChatApp mgr]->GetTerminal()];
+ bool away = [status characterAtIndex:0] == '-';
+
+ if ([status characterAtIndex:0] == '+' || [status characterAtIndex:0] == '-') {
+ status = [status substringFromIndex:1];
+ }
+
+ // Check for existing title
+ id <NSMenuItem> item = [_statusMenu itemWithTitle:status];
+ if (item != NULL) {
+ if ([item tag] == away ? 2 : 1 || [item tag] == away ? 222 : 111) {
+ [_statusMenu selectItem:item];
+ return;
+ }
+ }
+
+ // Add a custom title
+ item = [_statusMenu itemAtIndex:[_statusMenu indexOfItemWithTag:away ? 2 : 1]];
+ int index = 1 + [_statusMenu indexOfItem:item];
+
+ [_statusMenu insertItemWithTitle:status atIndex:index];
+ [[_statusMenu itemAtIndex:index] setTag:away ? 222 : 111];
+ [[_statusMenu itemAtIndex:index] setImage:[item image]];
+
+ [_statusMenu selectItemAtIndex:index];
+}
+
+- (NSString *)defaultTerminal {
+ /* Does it seem odd to you that this is here? Me too. But we may as well store it in the nib
+ * as a menu item as anything else...
+ */
+ return [NSString stringWithFormat:@"+%@",
+ [[_statusMenu itemAtIndex:[_statusMenu indexOfItemWithTag:1]] title]];
+}
+
+- (IBAction)changeStatus:(id)sender {
+ id <NSMenuItem> item = [sender selectedItem];
+ NSString *terminal = nil;
+
+ switch ([item tag]) {
+ case -1:
+ [ZChatApp disconnect:nil];
+ return;
+
+ case -2:
+ terminal = @"";
+ break;
+
+ case 1:
+ case 111:
+ terminal = [NSString stringWithFormat:@"+%@", [item title]];
+ break;
+
+ case 2:
+ case 222:
+ terminal = [NSString stringWithFormat:@"-%@", [item title]];
+ break;
+
+ case 11:
+ case 22:
+ /* Haul out the heavy artillery... */
+ // TODO
+ break;
+ }
+
+ if (terminal != nil) {
+ if ([ZChatApp mgr] != nil) {
+ [ZChatApp setTerminal:terminal];
+ } else {
+ [ZChatApp connectWithTerminal:terminal];
+ }
+ }
+}
+
+
- (void)_loginNotification:(NSNotification *)notification {
[_reloadButton setEnabled:YES];
[_chatButton setEnabled:[[self selectedFriends] count] > 0];
-
+
[self reload:notification];
+
+ [self _updateStatusMenu];
}
- (void)_logoutNotification:(NSNotification *)notification {
@@ -138,8 +262,10 @@
[_chatButton setEnabled:NO];
[_busyIndicator stopAnimation:nil];
-
+
[self resetAll];
+
+ [self _updateStatusMenu];
}
- (void)_statusNotification:(NSNotification *)notification {
@@ -371,6 +497,8 @@
- (void)_busyNotification:(NSNotification *)notification {
[self reloadFriendViews];
+ [self _updateStatusMenu];
+
if ([ZChatApp busy]) {
[_busyIndicator startAnimation:nil];
return;
@@ -390,6 +518,7 @@
}
- (void)_abNotification:(NSNotification *)notification {
+ [_name setStringValue:[ZChatApp mySignature]];
[_data makeObjectsPerformSelector:@selector(updateNames)];
}
|
|
From: <ak...@us...> - 2003-04-07 20:37:46
|
Update of /cvsroot/zephyrchat/zchat/zChat/zChat.pbproj
In directory sc8-pr-cvs1:/tmp/cvs-serv31571/zChat.pbproj
Modified Files:
project.pbxproj
Log Message:
Add partial status control (no custom status)
Index: project.pbxproj
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/zChat.pbproj/project.pbxproj,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- project.pbxproj 31 Mar 2003 15:07:51 -0000 1.23
+++ project.pbxproj 7 Apr 2003 20:37:42 -0000 1.24
@@ -813,6 +813,28 @@
settings = {
};
};
+ 177C827304420CB100A82A15 = {
+ isa = PBXFileReference;
+ path = "status-available.tiff";
+ refType = 4;
+ };
+ 177C827404420CB200A82A15 = {
+ isa = PBXFileReference;
+ path = "status-away.tiff";
+ refType = 4;
+ };
+ 177C827504420CB200A82A15 = {
+ fileRef = 177C827304420CB100A82A15;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 177C827604420CB200A82A15 = {
+ fileRef = 177C827404420CB200A82A15;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
1783D69D0419053200A82A15 = {
children = (
1783D69E0419053200A82A15,
@@ -1228,6 +1250,8 @@
171D0C590428CD8D00A82A15,
171D0C5A0428CD8D00A82A15,
171D0C5B0428CD8D00A82A15,
+ 177C827304420CB100A82A15,
+ 177C827404420CB200A82A15,
);
isa = PBXGroup;
name = Resources;
@@ -1394,6 +1418,8 @@
1756A64C0428F77700A82A15,
173A34300430E6B600A82A15,
173A3441043227BD00A82A15,
+ 177C827504420CB200A82A15,
+ 177C827604420CB200A82A15,
);
isa = PBXResourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
|
|
From: <ak...@us...> - 2003-04-07 20:37:46
|
Update of /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib
In directory sc8-pr-cvs1:/tmp/cvs-serv31571/English.lproj/FriendsWindow.nib
Modified Files:
classes.nib info.nib objects.nib
Log Message:
Add partial status control (no custom status)
Index: classes.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib/classes.nib,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- classes.nib 31 Mar 2003 17:07:23 -0000 1.10
+++ classes.nib 7 Apr 2003 20:37:40 -0000 1.11
@@ -22,6 +22,7 @@
{CLASS = ZCFlippedView; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{
ACTIONS = {
+ changeStatus = id;
chatFriend = id;
delete = id;
emailFriend = id;
Index: info.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib/info.nib,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- info.nib 31 Mar 2003 15:07:47 -0000 1.9
+++ info.nib 7 Apr 2003 20:37:40 -0000 1.10
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
- <string>56 97 395 294 0 0 1024 746 </string>
+ <string>56 101 395 294 0 0 1024 746 </string>
<key>IBFramework Version</key>
<string>291.0</string>
<key>IBOpenObjects</key>
Index: objects.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib/objects.nib,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
Binary files /tmp/cvsYfMV9l and /tmp/cvsQFL62x differ
|
|
From: <ak...@us...> - 2003-04-05 18:12:22
|
Update of /cvsroot/zephyrchat/zchat/ZephyrLib
In directory sc8-pr-cvs1:/tmp/cvs-serv22997
Modified Files:
ZephyrMgr.cpp
Log Message:
Remove debugging statement.
Index: ZephyrMgr.cpp
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/ZephyrLib/ZephyrMgr.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- ZephyrMgr.cpp 5 Apr 2003 18:04:28 -0000 1.36
+++ ZephyrMgr.cpp 5 Apr 2003 18:12:17 -0000 1.37
@@ -352,8 +352,6 @@
* Resend any packets that have not yet been acked
*/
void zephyrlib::ZephyrMgr::ResendPackets() {
- fprintf(stderr, "ZephyrMgr::ResendPackets()\n");
-
hash_map<zpUID, ZephyrPacketStore>::iterator i;
CFAbsoluteTime now = CFAbsoluteTimeGetCurrent();
|
|
From: <ak...@us...> - 2003-04-05 18:04:32
|
Update of /cvsroot/zephyrchat/zchat/ZephyrLib
In directory sc8-pr-cvs1:/tmp/cvs-serv19807
Modified Files:
ZephyrMgr.cpp ZephyrPacket.cpp ZephyrPacket.h
Log Message:
Time a packet out if it has not been acked after 30 seconds.
Index: ZephyrMgr.cpp
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/ZephyrLib/ZephyrMgr.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- ZephyrMgr.cpp 28 Mar 2003 22:49:55 -0000 1.35
+++ ZephyrMgr.cpp 5 Apr 2003 18:04:28 -0000 1.36
@@ -29,6 +29,12 @@
*/
static const CFAbsoluteTime kZChatDistantFuture = CFAbsoluteTimeGetCurrent() + 31556925974.7;
+/* How often to resend a Zephyr packet */
+const CFTimeInterval kZChatPacketResendInterval = 1.0;
+
+/* How long to try to send a Zephyr packet before timing out */
+const CFTimeInterval kZChatPacketTimeout = 30.0;
+
namespace {
class ZephyrMgrFragmentCallback : public ZephyrSendCallback {
private:
@@ -189,7 +195,7 @@
CFRunLoopTimerContext context = { 0, this, NULL, NULL, NULL };
mResendTimer = CFRunLoopTimerCreate(kCFAllocatorDefault,
kZChatDistantFuture,
- 1.0, 0, 0, ResendCallback, &context);
+ kZChatPacketResendInterval, 0, 0, ResendCallback, &context);
CFRunLoopAddTimer(mRunLoop, mResendTimer, kCFRunLoopCommonModes);
// Send the host manager boot to the server.
@@ -346,15 +352,42 @@
* Resend any packets that have not yet been acked
*/
void zephyrlib::ZephyrMgr::ResendPackets() {
- hash_map<zpUID, ZephyrPacketStore>::iterator i;
+ fprintf(stderr, "ZephyrMgr::ResendPackets()\n");
+
+ hash_map<zpUID, ZephyrPacketStore>::iterator i;
CFAbsoluteTime now = CFAbsoluteTimeGetCurrent();
/* Find packets that are at least a second old */
for (i = mSent.begin(); i != mSent.end(); ++i) {
ZephyrPacket &packet = i->second.packet;
- if (packet.mTimestamp + 1.0 < now) {
+ if (packet.mTimestamp + packet.mResendInterval < now) {
+ if (packet.mResendInterval > kZChatPacketTimeout) {
+ // Packet has been waiting too long: time it out
+ ZephyrCallback *callback = i->second.callback;
+ mSent.erase(i);
+
+ /* If this is the last packet in the sent list, don't schedule this timer again.
+ * Otherwise, come back immediately so we can finish looking at packets.
+ */
+ if (mSent.empty()) {
+ CFRunLoopTimerSetNextFireDate(mResendTimer, kZChatDistantFuture);
+ } else {
+ CFRunLoopTimerSetNextFireDate(mResendTimer, now);
+ }
+
+ if (callback != NULL) {
+ callback->Failure(ZephyrTimeoutError);
+ callback->Release();
+ }
+
+ // Failure() might have deleted us. So it's not safe to call anything. Besides,
+ // our iterator may be invalid, thanks to the empty() call. Return immediately and try
+ // again later.
+ return;
+ }
+
// Change the time to now and resend
- packet.mTimestamp = now;
+ packet.mResendInterval += kZChatPacketResendInterval;
DeliverPacket(packet, i->second.callback, false);
}
}
@@ -818,8 +851,9 @@
mSent[inPacket.GetUID()] = zps;
/* If no resend timer is scheduled, schedule one for a second from now */
- if (CFRunLoopTimerGetNextFireDate(mResendTimer) + 1.0 > CFAbsoluteTimeGetCurrent()) {
- CFRunLoopTimerSetNextFireDate(mResendTimer, CFAbsoluteTimeGetCurrent() + 1.0);
+ if (CFRunLoopTimerGetNextFireDate(mResendTimer) + kZChatPacketResendInterval
+ > CFAbsoluteTimeGetCurrent()) {
+ CFRunLoopTimerSetNextFireDate(mResendTimer, CFAbsoluteTimeGetCurrent() + kZChatPacketResendInterval);
}
}
}
Index: ZephyrPacket.cpp
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/ZephyrLib/ZephyrPacket.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- ZephyrPacket.cpp 21 Mar 2003 20:37:24 -0000 1.14
+++ ZephyrPacket.cpp 5 Apr 2003 18:04:28 -0000 1.15
@@ -41,7 +41,8 @@
const string &inOpcode,
const string &inRecipient,
const vector<string> &inBody)
-throw (ZephyrStatus) : mBody(inBody), mBodyComplete(true), mTimestamp(CFAbsoluteTimeGetCurrent()) {
+throw (ZephyrStatus) : mBody(inBody), mBodyComplete(true), mTimestamp(CFAbsoluteTimeGetCurrent()),
+ mResendInterval(0.0) {
KClientKey sessionKey;
// GrP Add the realm to recipent and convert "*" to ""
@@ -198,7 +199,7 @@
* Construct a packet received from the server
*/
zephyrlib::ZephyrPacket::ZephyrPacket(const char *inPacket, string::size_type inLength) throw (ZephyrStatus)
- : mTimestamp(CFAbsoluteTimeGetCurrent()) {
+ : mTimestamp(CFAbsoluteTimeGetCurrent()), mResendInterval(0.0) {
/* First, split the packet up into a vector */
vector<string> fields = ZephyrUtils::FromZephyrPacket(inPacket, inLength, &mBodyComplete);
if (fields.size() <= zfNumfields) throw ZephyrUnexpectedPacketError;
@@ -220,7 +221,8 @@
*/
zephyrlib::ZephyrPacket::ZephyrPacket(const ZephyrPacket &inPacket)
: mHeaders(inPacket.mHeaders), mBody(inPacket.mBody),
- mBodyComplete(inPacket.mBodyComplete), mTimestamp(inPacket.mTimestamp) {}
+ mBodyComplete(inPacket.mBodyComplete), mTimestamp(inPacket.mTimestamp),
+ mResendInterval(inPacket.mResendInterval) {}
/* ZephyrPacket::ZephyrPacket
* --------------------------
@@ -228,7 +230,8 @@
* for acks.
*/
zephyrlib::ZephyrPacket::ZephyrPacket(const vector<string> &inHeaders, const vector<string> &inBody)
- : mHeaders(inHeaders), mBody(inBody), mBodyComplete(true), mTimestamp(CFAbsoluteTimeGetCurrent()) {}
+ : mHeaders(inHeaders), mBody(inBody), mBodyComplete(true), mTimestamp(CFAbsoluteTimeGetCurrent()),
+ mResendInterval(0.0) {}
/* ZephyrPacket::GetKind
* ---------------------
Index: ZephyrPacket.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/ZephyrLib/ZephyrPacket.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- ZephyrPacket.h 21 Mar 2003 20:37:24 -0000 1.11
+++ ZephyrPacket.h 5 Apr 2003 18:04:28 -0000 1.12
@@ -57,6 +57,7 @@
bool mBodyComplete;
CFAbsoluteTime mTimestamp;
+ CFTimeInterval mResendInterval;
/* Header utilities */
void PushHeaderString(string inStr) { mHeaders.push_back(inStr); }
|
|
From: <ak...@us...> - 2003-04-03 18:08:38
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv1867
Modified Files:
ZCChatWindowController.mm
Log Message:
Show instance when appropriate.
Correctly invite users chosen from pop-up menu.
Index: ZCChatWindowController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZCChatWindowController.mm,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- ZCChatWindowController.mm 3 Apr 2003 17:21:21 -0000 1.22
+++ ZCChatWindowController.mm 3 Apr 2003 18:08:20 -0000 1.23
@@ -328,6 +328,7 @@
[self removeMyPing];
_myDisplayedPing = [self appendMessage:[self pingMessageWithColor:[ZChatApp textColorForMe]]
from:[ZChatApp mySignature]
+ instance:nil
color:[ZChatApp colorForMe]
textColor:[ZChatApp textColorForMe]
alignment:NSNaturalTextAlignment];
@@ -367,7 +368,7 @@
* for the next input.
*/
[self removeMyPing];
- [self appendMessage:[_input attributedStringValue] from:[ZChatApp mySignature]
+ [self appendMessage:[_input attributedStringValue] from:[ZChatApp mySignature] instance:nil
color:[ZChatApp colorForMe]
textColor:[ZChatApp textColorForMe]
alignment:NSNaturalTextAlignment];
@@ -463,6 +464,7 @@
[self removePingFrom:senderString];
NSRange pingRange = [self appendMessage:[self pingMessageWithColor:[ZChatApp textColorFor:senderString]]
from:[self displayNameFor:senderString]
+ instance:nil
color:[ZChatApp colorFor:senderString]
textColor:[ZChatApp textColorFor:senderString]
alignment:NSNaturalTextAlignment];
@@ -515,9 +517,21 @@
@selector(invitationSheetDidEnd:returnCode:contextInfo:), nil, invitation,
NSLocalizedString(@"INVITATION_MESSAGE", nil), displayName,
[ZChatSubscription titleForSub:invitation->dest]);
- } else {
+ } else {
+ NSString *instance;
+
+ if ((_chatWith->dest.instance == "*" || _chatWith->dest.instance == "")
+ && !strcaseequal(message.GetInstance(), "personal") && !strcaseequal(message.GetInstance(), "urgent")
+ && !strcaseequal(message.GetInstance(), "message") && message.GetInstance() != "*"
+ && message.GetInstance() != "") {
+ instance = [NSString stringWithSTLString:message.GetInstance()];
+ } else {
+ instance = nil;
+ }
+
[self appendMessage:formattedMessage
from:displayName
+ instance:instance
color:[ZChatApp colorFor:sender]
textColor:textColor
alignment:NSNaturalTextAlignment];
@@ -549,8 +563,8 @@
return _sentMessages->find(message.GetPacket().GetUID()) != _sentMessages->end();
}
-- (NSRange)appendMessage:(NSAttributedString *)message from:(NSString *)sender color:(NSColor *)bgColor
- textColor:(NSColor *)fgColor alignment:(NSTextAlignment)alignment {
+- (NSRange)appendMessage:(NSAttributedString *)message from:(NSString *)sender instance:(NSString *)instance
+ color:(NSColor *)bgColor textColor:(NSColor *)fgColor alignment:(NSTextAlignment)alignment {
NSTextStorage *text = [_output textStorage];
bool shouldScroll = [[[_output enclosingScrollView] verticalScroller] floatValue] == 1.0;
@@ -590,7 +604,7 @@
[text appendString:sender attributes:[NSDictionary dictionaryWithObjectsAndKeys:
[NSFont boldSystemFontOfSize:[NSFont systemFontSize]], NSFontAttributeName,
fgColor, NSForegroundColorAttributeName, nil]];
-
+
/* Add some space: If the message is multi-line, add a newline, otherwise just a space */
NSRange lineRange = [[message string] lineRangeForRange:NSMakeRange(0, 0)];
if (NSMaxRange(lineRange) != [message length]) {
@@ -598,7 +612,16 @@
} else {
[text appendString:@" " attributes:nil];
}
-
+
+ /* Add the instance (if present) */
+ if (instance != nil) {
+ [text appendString:[NSString stringWithFormat:NSLocalizedString(@"INSTANCE_DISPLAY_FORMAT", nil),
+ instance]
+ attributes:[NSDictionary dictionaryWithObjectsAndKeys:
+ [NSFont systemFontOfSize:[NSFont systemFontSize]], NSFontAttributeName,
+ fgColor, NSForegroundColorAttributeName, nil]];
+ }
+
/* Add the message */
[text appendAttributedString:message];
@@ -678,6 +701,12 @@
NSString *message;
NSAssert([user length] > 0, @"User must not be blank");
+
+ /* Use only the first word */
+ NSRange ws = [user rangeOfCharacterFromSet:[NSCharacterSet whitespaceCharacterSet]];
+ if (ws.location != NSNotFound) {
+ user = [user substringToIndex:ws.location];
+ }
if ([ZephyrUtils::RemoveRealm(user) rangeOfString:@"@"].location != NSNotFound) {
NSBeginAlertSheet(NSLocalizedString(@"INVITE_GALAXY_ERR_TITLE", nil), nil, nil, nil, [self window],
|
|
From: <ak...@us...> - 2003-04-03 17:42:53
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv24019
Modified Files:
ZChatSubscription.mm
Log Message:
Show message/*/* as such.
Index: ZChatSubscription.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatSubscription.mm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- ZChatSubscription.mm 25 Mar 2003 17:02:58 -0000 1.8
+++ ZChatSubscription.mm 3 Apr 2003 17:42:48 -0000 1.9
@@ -147,15 +147,15 @@
}
+ (NSString *)titleForSub:(const zephyrlib::ZTriple &)sub {
- if (sub.klass == "message") {
+ if (strcaseequal(sub.klass, "message")) {
if (sub.recipient != "*" && sub.recipient != "") {
return [NSString stringWithSTLString:ZephyrUtils::RemoveRealm(sub.recipient)];
}
- return [NSString stringWithSTLString:sub.instance];
- }
-
- if (sub.instance == "*" || sub.instance == "") {
+ if (sub.instance != "*" && sub.instance != "") {
+ return [NSString stringWithSTLString:sub.instance];
+ }
+ } else if (sub.instance == "*" || sub.instance == "") {
return [NSString stringWithSTLString:sub.klass];
}
|
|
From: <ak...@us...> - 2003-04-03 17:21:27
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv15381
Modified Files:
ZCChatWindowController.mm
Log Message:
Mark urgent messages in red.
Index: ZCChatWindowController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZCChatWindowController.mm,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- ZCChatWindowController.mm 1 Apr 2003 15:18:40 -0000 1.21
+++ ZCChatWindowController.mm 3 Apr 2003 17:21:21 -0000 1.22
@@ -485,13 +485,18 @@
[self removePingFrom:sender];
NSString *displayName = [self displayNameFor:sender signature:signature];
+ NSColor *textColor = [ZChatApp textColorFor:sender];
+ if (strcaseequal(message.GetInstance(), "urgent")) {
+ textColor = [NSColor redColor];
+ }
+
NSAttributedString *formattedMessage
= [[NSAttributedString attributedStringWithZWGCString:
[NSString stringWithSTLString:message.GetMessage()]
defaultAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
[NSFont userFontOfSize:12.0], NSFontAttributeName,
- [ZChatApp textColorFor:sender], NSForegroundColorAttributeName,
+ textColor, NSForegroundColorAttributeName,
nil]]
unflowWithDefaultFont:[NSFont userFontOfSize:12.0]
fixedFont:[NSFont userFixedPitchFontOfSize:10.0]];
@@ -510,11 +515,11 @@
@selector(invitationSheetDidEnd:returnCode:contextInfo:), nil, invitation,
NSLocalizedString(@"INVITATION_MESSAGE", nil), displayName,
[ZChatSubscription titleForSub:invitation->dest]);
- } else {
+ } else {
[self appendMessage:formattedMessage
from:displayName
color:[ZChatApp colorFor:sender]
- textColor:[ZChatApp textColorFor:sender]
+ textColor:textColor
alignment:NSNaturalTextAlignment];
}
}
@@ -680,7 +685,7 @@
return;
}
- if (_chatWith->dest.klass == "message") {
+ if (strcaseequal(_chatWith->dest.klass, "message")) {
message = [NSString stringWithFormat:NSLocalizedString(@"INVITE_MSG_INSTANCE", nil),
[NSString stringWithSTLString:_chatWith->dest.instance]];
} else if (_chatWith->dest.instance == "*" || _chatWith->dest.instance == "") {
|
|
From: <ak...@us...> - 2003-04-03 17:21:10
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv15205
Modified Files:
NSAttributedStringAdditions.m
Log Message:
Correctly use () and <> brackets when appropriate.
Index: NSAttributedStringAdditions.m
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/NSAttributedStringAdditions.m,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- NSAttributedStringAdditions.m 29 Mar 2003 19:21:38 -0000 1.15
+++ NSAttributedStringAdditions.m 3 Apr 2003 17:21:03 -0000 1.16
@@ -426,12 +426,12 @@
leftBracket = '[';
rightBracket = ']';
} else {
- NSRange angleRange = [[self string] rangeOfString:@"]" options:nil range:longestRange];
+ NSRange angleRange = [[self string] rangeOfString:@">" options:nil range:longestRange];
if (angleRange.location == NSNotFound) {
leftBracket = '<';
rightBracket = '>';
} else {
- NSRange parenRange = [[self string] rangeOfString:@"]" options:nil range:longestRange];
+ NSRange parenRange = [[self string] rangeOfString:@")" options:nil range:longestRange];
if (parenRange.location == NSNotFound) {
leftBracket = '(';
rightBracket = ')';
|
|
From: <ak...@us...> - 2003-04-01 17:41:05
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv3126
Modified Files:
AKActionScrollView.m AKStackedView.m ZChatFriendsController.mm
Log Message:
First crack at making friends view respond to key events.
Index: AKActionScrollView.m
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/AKActionScrollView.m,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- AKActionScrollView.m 19 Mar 2003 02:46:10 -0000 1.1
+++ AKActionScrollView.m 1 Apr 2003 17:41:00 -0000 1.2
@@ -3,7 +3,12 @@
@implementation AKActionScrollView
- (void)mouseDown:(NSEvent *)event {
+ [[self window] makeFirstResponder:self];
[_delegate scrollView:self mouseDown:event];
+}
+
+- (BOOL)acceptsFirstResponder {
+ return YES;
}
@end
Index: AKStackedView.m
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/AKStackedView.m,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- AKStackedView.m 29 Mar 2003 19:21:37 -0000 1.5
+++ AKStackedView.m 1 Apr 2003 17:41:00 -0000 1.6
@@ -54,7 +54,13 @@
[[self superview] displayIfNeeded];
}
+- (BOOL)acceptsFirstResponder {
+ return YES;
+}
+
- (void)mouseDown:(NSEvent *)event {
+ [[self window] makeFirstResponder:self];
+
if (_delegate != nil) {
if ([_delegate selectViewIsSelected:self] && [event modifierFlags] & NSCommandKeyMask) {
[_delegate selectView:self setSelected:NO];
Index: ZChatFriendsController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendsController.mm,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- ZChatFriendsController.mm 31 Mar 2003 17:07:22 -0000 1.18
+++ ZChatFriendsController.mm 1 Apr 2003 17:41:00 -0000 1.19
@@ -149,6 +149,76 @@
[_data makeObjectsPerformSelector:@selector(deselect)];
}
+- (void)_moveDownDeselectOthers:(BOOL)deselect {
+ unsigned next = NSNotFound;
+ for (unsigned i = 0; i < [_data count]; ++i) {
+ if ([[_data objectAtIndex:i] selected])
+ next = i + 1;
+ }
+
+ if (next == NSNotFound) next = 0;
+ if (next >= [_data count]) next = [_data count] - 1;
+
+ if (next != NSNotFound) {
+ if (deselect) {
+ [[self selectedFriends] makeObjectsPerformSelector:@selector(deselect)];
+ }
+ [[_data objectAtIndex:next] select];
+ }
+}
+
+- (void)moveDown:(id)sender {
+ [self _moveDownDeselectOthers:YES];
+}
+
+- (void)moveDownAndModifySelection:(id)sender {
+ [self _moveDownDeselectOthers:NO];
+}
+
+- (void)_moveUpDeselectOthers:(BOOL)deselect {
+ unsigned i;
+ for (i = 0; i < [_data count]; ++i) {
+ if ([[_data objectAtIndex:i] selected]) {
+ break;
+ }
+ }
+
+ if (i > 0) --i;
+
+ if ([_data count] > 0) {
+ if (deselect) {
+ [[self selectedFriends] makeObjectsPerformSelector:@selector(deselect)];
+ }
+ [[_data objectAtIndex:i] select];
+ }
+}
+
+- (void)moveUp:(id)sender {
+ [self _moveUpDeselectOthers:YES];
+}
+
+- (void)moveUpAndModifySelection:(id)sender {
+ [self _moveUpDeselectOthers:NO];
+}
+
+- (void)moveToBeginningOfLine:(id)sender {
+ if ([_data count] > 0) {
+ [[self selectedFriends] makeObjectsPerformSelector:@selector(deselect)];
+ [[_data objectAtIndex:0] select];
+ }
+}
+
+- (void)moveToEndOfLine:(id)sender {
+ if ([_data count] > 0) {
+ [[self selectedFriends] makeObjectsPerformSelector:@selector(deselect)];
+ [[_data objectAtIndex:[_data count] - 1] select];
+ }
+}
+
+- (void)deleteBackward:(id)sender {
+ [self delete:sender];
+}
+
- (void)windowDidBecomeKey:(NSNotification *)notification {
[_friendView setNeedsDisplay:YES];
}
|
|
From: <ak...@us...> - 2003-04-01 17:41:05
|
Update of /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib In directory sc8-pr-cvs1:/tmp/cvs-serv3126/English.lproj/FriendsWindow.nib Modified Files: objects.nib Log Message: First crack at making friends view respond to key events. Index: objects.nib =================================================================== RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib/objects.nib,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 Binary files /tmp/cvsdsUZKj and /tmp/cvsWBVhgt differ |
|
From: <ak...@us...> - 2003-04-01 15:21:56
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv2051
Modified Files:
ZChatAddFriendController.mm
Log Message:
Highlight username field when adding a new friend.
Index: ZChatAddFriendController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatAddFriendController.mm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ZChatAddFriendController.mm 1 Apr 2003 14:37:58 -0000 1.5
+++ ZChatAddFriendController.mm 1 Apr 2003 15:21:52 -0000 1.6
@@ -128,6 +128,7 @@
[_lastNameField setStringValue:[_person valueForProperty:kABLastNameProperty]];
[[self window] morphToView:_newFriendView];
+ [[self window] makeFirstResponder:_usernameField];
}
- (IBAction)newPerson:(id)sender {
@@ -135,6 +136,7 @@
_person = nil;
[[self window] morphToView:_newFriendView];
+ [[self window] makeFirstResponder:_usernameField];
}
- (void)runNewFriendSheet:(NSWindow *)docWindow {
|
|
From: <ak...@us...> - 2003-04-01 15:18:46
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv510
Modified Files:
ZCChatWindowController.h ZCChatWindowController.mm
Log Message:
Show the chat-starting ping.
Index: ZCChatWindowController.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZCChatWindowController.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- ZCChatWindowController.h 29 Mar 2003 19:21:38 -0000 1.14
+++ ZCChatWindowController.h 1 Apr 2003 15:18:39 -0000 1.15
@@ -103,7 +103,7 @@
- (void)sendPing;
-- (BOOL)isChat;
+- (BOOL)isPublicChat;
- (BOOL)wasSentByMe:(const zephyrlib::ZGram &)message;
- (NSString *)displayNameFor:(NSString *)username;
Index: ZCChatWindowController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZCChatWindowController.mm,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- ZCChatWindowController.mm 29 Mar 2003 19:21:38 -0000 1.20
+++ ZCChatWindowController.mm 1 Apr 2003 15:18:40 -0000 1.21
@@ -189,7 +189,7 @@
/* If we started the chat, send a ping as soon as we open the window; this lets us check the
* recipient's location immediately.
*/
- if (_startedChat) {
+ if (_startedChat && ![self isPublicChat]) {
[self sendPing];
}
@@ -311,36 +311,34 @@
}
}
-- (BOOL)isChat {
+- (BOOL)isPublicChat {
return _chatWith->sender == "*" || _chatWith->sender == "";
}
- (void)sendPing {
- if (![self isChat]) {
+ if (!_pingSent && ![self isPublicChat]) {
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"DontSendPings"]) {
[ZChatApp mgr]->SendPing([self sendTo], new ZChatWindowPingCalback(self));
}
+ _pingSent = true;
+ }
+
+ if (_myDisplayedPing.length == 0
+ || NSMaxRange(_myDisplayedPing) != [[_output textStorage] length]) {
+ [self removeMyPing];
+ _myDisplayedPing = [self appendMessage:[self pingMessageWithColor:[ZChatApp textColorForMe]]
+ from:[ZChatApp mySignature]
+ color:[ZChatApp colorForMe]
+ textColor:[ZChatApp textColorForMe]
+ alignment:NSNaturalTextAlignment];
}
- _pingSent = true;
}
- (void)controlTextDidChange:(NSNotification *)notification {
if ([notification object] == _input) {
if ([[_input stringValue] length] > 0) {
- if (!_pingSent) {
- [self sendPing];
- }
-
- if (_myDisplayedPing.length == 0
- || NSMaxRange(_myDisplayedPing) != [[_output textStorage] length]) {
- [self removeMyPing];
- _myDisplayedPing = [self appendMessage:[self pingMessageWithColor:[ZChatApp textColorForMe]]
- from:[ZChatApp mySignature]
- color:[ZChatApp colorForMe]
- textColor:[ZChatApp textColorForMe]
- alignment:NSNaturalTextAlignment];
- }
+ [self sendPing];
} else {
[self removeMyPing];
}
@@ -710,7 +708,7 @@
- (BOOL)validateMenuItem:(id <NSMenuItem>)menuItem {
if ([menuItem action] == @selector(invite:)) {
- return [self isChat];
+ return [self isPublicChat];
} else if ([menuItem action] == @selector(addLink:)) {
return [_input currentEditor] != nil;
}
|
|
From: <ak...@us...> - 2003-04-01 14:38:04
|
Update of /cvsroot/zephyrchat/zchat/zChat/English.lproj In directory sc8-pr-cvs1:/tmp/cvs-serv8432/English.lproj Modified Files: Localizable.strings Log Message: Add localized string to Localizable.strings. Index: Localizable.strings =================================================================== RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/Localizable.strings,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Localizable.strings 27 Mar 2003 15:51:31 -0000 1.17 +++ Localizable.strings 1 Apr 2003 14:37:59 -0000 1.18 @@ -51,6 +51,9 @@ "Close" = "Close"; "Join" = "Join"; +/* Nameless AB entry */ +"No name" = "No name"; + "LINK_TEXT" = "here"; /* 12-hour timestamp */ |
|
From: <ak...@us...> - 2003-04-01 14:38:04
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv8432
Modified Files:
ZChatAddFriendController.mm
Log Message:
Add localized string to Localizable.strings.
Index: ZChatAddFriendController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatAddFriendController.mm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ZChatAddFriendController.mm 26 Mar 2003 22:09:23 -0000 1.4
+++ ZChatAddFriendController.mm 1 Apr 2003 14:37:58 -0000 1.5
@@ -251,7 +251,7 @@
NSString *name = [ZChatApp signatureForPerson:person];
if (name == nil) {
- return [[[NSAttributedString alloc] initWithString:NSLocalizedString(@"No name", nil)
+ return [[[NSAttributedString alloc] initWithString:NSLocalizedString(@"No name", @"Nameless AB entry")
attributes:[NSDictionary dictionaryWithObject:
[[NSFontManager sharedFontManager]
convertFont:[[tableColumn dataCell] font]
|
|
From: <ak...@us...> - 2003-03-31 17:08:17
|
Update of /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib
In directory sc8-pr-cvs1:/tmp/cvs-serv30657/English.lproj/FriendsWindow.nib
Modified Files:
classes.nib objects.nib
Log Message:
"Intelligent" zoom of friends window.
Index: classes.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib/classes.nib,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- classes.nib 31 Mar 2003 15:07:46 -0000 1.9
+++ classes.nib 31 Mar 2003 17:07:23 -0000 1.10
@@ -37,6 +37,7 @@
"_chatButton" = NSButton;
"_deleteButton" = NSButton;
"_emailButton" = NSButton;
+ "_friendScroller" = NSScrollView;
"_friendView" = NSView;
"_infoButton" = NSButton;
"_name" = NSTextField;
Index: objects.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib/objects.nib,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
Binary files /tmp/cvsGSnaW9 and /tmp/cvseeZkA9 differ
|
|
From: <ak...@us...> - 2003-03-31 17:08:12
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv30657
Modified Files:
ZChatFriendsController.h ZChatFriendsController.mm
Log Message:
"Intelligent" zoom of friends window.
Index: ZChatFriendsController.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendsController.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- ZChatFriendsController.h 31 Mar 2003 15:07:46 -0000 1.13
+++ ZChatFriendsController.h 31 Mar 2003 17:07:21 -0000 1.14
@@ -14,6 +14,7 @@
extern NSString * const ZChatFriendStatusNotification;
@interface ZChatFriendsController : NSWindowController <AKActionScrollViewDelegate> {
+ IBOutlet NSScrollView *_friendScroller;
IBOutlet NSView *_friendView;
IBOutlet NSPopUpButton *_statusMenu;
IBOutlet NSTextField *_name;
Index: ZChatFriendsController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendsController.mm,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- ZChatFriendsController.mm 31 Mar 2003 16:33:09 -0000 1.17
+++ ZChatFriendsController.mm 31 Mar 2003 17:07:22 -0000 1.18
@@ -157,6 +157,22 @@
[_friendView setNeedsDisplay:YES];
}
+- (NSRect)windowWillUseStandardFrame:(NSWindow *)window defaultFrame:(NSRect)newFrame {
+ NSSize scrollerSize = [NSScrollView frameSizeForContentSize:[_friendView frame].size
+ hasHorizontalScroller:[_friendScroller hasHorizontalScroller]
+ hasVerticalScroller:[_friendScroller hasVerticalScroller]
+ borderType:[_friendScroller borderType]];
+ NSRect standardFrame = [window frame];
+ standardFrame.size.height += scrollerSize.height - NSHeight([_friendScroller frame]);
+ standardFrame.origin.y -= scrollerSize.height - NSHeight([_friendScroller frame]);
+ if (NSHeight(standardFrame) < [window minSize].height) {
+ standardFrame.origin.y += [window minSize].height - NSHeight(standardFrame);
+ standardFrame.size.height = [window minSize].height;
+ }
+
+ return standardFrame;
+}
+
- (void)selectAll:(id)sender {
[_data makeObjectsPerformSelector:@selector(select)];
}
|
|
From: <ak...@us...> - 2003-03-31 16:33:51
|
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv17304
Modified Files:
ZChatFriendsController.mm
Log Message:
Use floating-point constants when doing floating-point math.
Index: ZChatFriendsController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendsController.mm,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- ZChatFriendsController.mm 31 Mar 2003 15:07:46 -0000 1.16
+++ ZChatFriendsController.mm 31 Mar 2003 16:33:09 -0000 1.17
@@ -97,13 +97,13 @@
// Make sure the data is properly sorted
[_data sortUsingSelector:@selector(compareStatus:)];
- float y = 0;
+ float y = 0.0;
NSEnumerator *e = [_data objectEnumerator];
NSView *view;
while ((view = [[e nextObject] view]) != nil) {
- [view setFrame:NSMakeRect(0, y, NSWidth([_friendView frame]), NSHeight([view frame]))];
- y += NSHeight([view frame]) + 1;
+ [view setFrame:NSMakeRect(0.0, y, NSWidth([_friendView frame]), NSHeight([view frame]))];
+ y += NSHeight([view frame]) + 1.0;
[_friendView addSubview:view];
}
|
|
From: <ak...@us...> - 2003-03-31 15:19:39
|
Update of /cvsroot/zephyrchat/zchat In directory sc8-pr-cvs1:/tmp/cvs-serv9074 Modified Files: LICENSE Log Message: Switch to MIT-style license. Index: LICENSE =================================================================== RCS file: /cvsroot/zephyrchat/zchat/LICENSE,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- LICENSE 24 Mar 2003 20:51:00 -0000 1.1 +++ LICENSE 31 Mar 2003 15:07:43 -0000 1.2 @@ -1,340 +1,20 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - 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 - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: +Copyright (c) 2001, 2003 Alexei Kosut and Greg Parker - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Update of /cvsroot/zephyrchat/zchat/zChat
In directory sc8-pr-cvs1:/tmp/cvs-serv9074/zChat
Modified Files:
ZChatFriendViewController.mm ZChatFriendsController.h
ZChatFriendsController.mm
Added Files:
ZCFlippedView.h ZCFlippedView.m
Removed Files:
CHStackView.h CHStackView.m
Log Message:
Switch to MIT-style license.
--- NEW FILE: ZCFlippedView.h ---
//
// ZCFlippedView.h
// zChat
//
// Created by Alexei Kosut on Mon Mar 31 2003.
// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
//
#import <AppKit/AppKit.h>
@interface ZCFlippedView : NSView
@end
--- NEW FILE: ZCFlippedView.m ---
//
// ZCFlippedView.m
// zChat
//
// Created by Alexei Kosut on Mon Mar 31 2003.
// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
//
#import "ZCFlippedView.h"
@implementation ZCFlippedView
- (BOOL)isFlipped {
return YES;
}
@end
Index: ZChatFriendViewController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendViewController.mm,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- ZChatFriendViewController.mm 28 Mar 2003 22:18:32 -0000 1.19
+++ ZChatFriendViewController.mm 31 Mar 2003 15:07:45 -0000 1.20
@@ -8,7 +8,6 @@
#import "ZChatFriendViewController.h"
#import "ZChatAppController.h"
-#import "CHStackView.h"
#import "ZCChatWindowController.h";
#import "ZChatFriendsController.h";
#import "ZChatFriendInfoController.h";
@@ -72,8 +71,8 @@
- (void)reset {
_locations->clear();
_busy = false;
- [[NSNotificationCenter defaultCenter] postNotificationName:StackViewReloadNotificationName
- object:[self view]];
+ [[NSNotificationCenter defaultCenter] postNotificationName:ZChatFriendStatusNotification
+ object:self];
}
- (BOOL)online {
@@ -122,8 +121,8 @@
- (IBAction)toggleCollapse:(id)sender {
_expanded = !_expanded;
- [[NSNotificationCenter defaultCenter] postNotificationName:StackViewReloadNotificationName
- object:[self view]];
+ [[NSNotificationCenter defaultCenter] postNotificationName:ZChatFriendStatusNotification
+ object:self];
}
- (void)locateSuccess:(const vector<zephyrlib::ZephyrLocation> &)locations {
@@ -157,8 +156,6 @@
_busy = false;
[[NSNotificationCenter defaultCenter] postNotificationName:ZChatFriendStatusNotification
object:self];
- [[NSNotificationCenter defaultCenter] postNotificationName:StackViewReloadNotificationName
- object:[self view]];
}
- (BOOL)selectViewIsSelected:(AKStackedView *)view {
Index: ZChatFriendsController.h
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendsController.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- ZChatFriendsController.h 26 Mar 2003 22:09:25 -0000 1.12
+++ ZChatFriendsController.h 31 Mar 2003 15:07:46 -0000 1.13
@@ -8,14 +8,13 @@
#import <Cocoa/Cocoa.h>
-#import "CHStackView.h"
#import "AKActionScrollView.h"
extern NSString * const ZChatFriendSelectNotification;
extern NSString * const ZChatFriendStatusNotification;
-@interface ZChatFriendsController : NSWindowController <CHStackViewDataSource, AKActionScrollViewDelegate> {
- IBOutlet CHStackView *_friends;
+@interface ZChatFriendsController : NSWindowController <AKActionScrollViewDelegate> {
+ IBOutlet NSView *_friendView;
IBOutlet NSPopUpButton *_statusMenu;
IBOutlet NSTextField *_name;
@@ -34,6 +33,8 @@
- (IBAction)reload:(id)sender;
- (void)resetAll;
+
+- (void)reloadFriendViews;
- (NSArray *)friends;
- (NSArray *)selectedFriends;
Index: ZChatFriendsController.mm
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/ZChatFriendsController.mm,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- ZChatFriendsController.mm 28 Mar 2003 18:57:42 -0000 1.15
+++ ZChatFriendsController.mm 31 Mar 2003 15:07:46 -0000 1.16
@@ -82,21 +82,36 @@
}
- (void)windowDidLoad {
- [_friends reloadSubviews];
-}
-
-- (int)subviewsForStackView:(CHStackView *)stackView {
- NSParameterAssert(stackView == _friends);
- return [_data count];
+ [self reloadFriendViews];
}
-- (NSView *)viewForStackView:(CHStackView *)stackView atIndex:(int)index {
- NSParameterAssert(stackView == _friends);
+/* This is a simplified and rewritten-from-scratch version of Camino's CHStackView, which is a simplified
+ * and rewritten-from-scratch version of OmniGroup's OAStackView.
+ *
+ * Yay for license-inspired rewrites.
+ */
+- (void)reloadFriendViews {
+ // Remove any existing views
+ [[_friendView subviews] makeObjectsPerformSelector:@selector(removeFromSuperviewWithoutNeedingDisplay)];
// Make sure the data is properly sorted
[_data sortUsingSelector:@selector(compareStatus:)];
- return [[_data objectAtIndex:index] view];
+ float y = 0;
+
+ NSEnumerator *e = [_data objectEnumerator];
+ NSView *view;
+ while ((view = [[e nextObject] view]) != nil) {
+ [view setFrame:NSMakeRect(0, y, NSWidth([_friendView frame]), NSHeight([view frame]))];
+ y += NSHeight([view frame]) + 1;
+
+ [_friendView addSubview:view];
+ }
+
+ // Resize the view to match the new size
+ [_friendView setFrameSize:NSMakeSize(NSWidth([_friendView frame]), y)];
+
+ [_friendView setNeedsDisplay:YES];
}
- (IBAction)reload:(id)sender {
@@ -135,11 +150,11 @@
}
- (void)windowDidBecomeKey:(NSNotification *)notification {
- [_friends setNeedsDisplay:YES];
+ [_friendView setNeedsDisplay:YES];
}
- (void)windowDidResignKey:(NSNotification *)notification {
- [_friends setNeedsDisplay:YES];
+ [_friendView setNeedsDisplay:YES];
}
- (void)selectAll:(id)sender {
@@ -204,7 +219,7 @@
ZChatFriendViewController *fvc = [[[ZChatFriendViewController alloc] initWithUser:user] autorelease];
[_data addObject:fvc];
- [_friends reloadSubviews];
+ [self reloadFriendViews];
[fvc refresh];
}
@@ -238,7 +253,7 @@
[defs setObject:array forKey:@"Friends"];
[defs synchronize];
- [_friends reloadSubviews];
+ [self reloadFriendViews];
}
}
@@ -268,6 +283,8 @@
}
- (void)_busyNotification:(NSNotification *)notification {
+ [self reloadFriendViews];
+
if ([ZChatApp busy]) {
[_busyIndicator startAnimation:nil];
return;
--- CHStackView.h DELETED ---
--- CHStackView.m DELETED ---
|
|
From: <ak...@us...> - 2003-03-31 15:19:04
|
Update of /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib
In directory sc8-pr-cvs1:/tmp/cvs-serv9074/zChat/English.lproj/FriendsWindow.nib
Modified Files:
classes.nib info.nib objects.nib
Log Message:
Switch to MIT-style license.
Index: classes.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib/classes.nib,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- classes.nib 26 Mar 2003 22:09:27 -0000 1.8
+++ classes.nib 31 Mar 2003 15:07:46 -0000 1.9
@@ -8,12 +8,6 @@
},
{CLASS = AKViewCell; LANGUAGE = ObjC; SUPERCLASS = NSCell; },
{
- CLASS = CHStackView;
- LANGUAGE = ObjC;
- OUTLETS = {mDataSource = id; };
- SUPERCLASS = NSView;
- },
- {
ACTIONS = {stopModalWithTagFrom = id; stopSheetWithTagFrom = id; };
CLASS = FirstResponder;
LANGUAGE = ObjC;
@@ -25,7 +19,7 @@
LANGUAGE = ObjC;
SUPERCLASS = NSResponder;
},
- {CLASS = ZCDisclosureButton; LANGUAGE = ObjC; SUPERCLASS = NSButton; },
+ {CLASS = ZCFlippedView; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{
ACTIONS = {
chatFriend = id;
@@ -43,7 +37,7 @@
"_chatButton" = NSButton;
"_deleteButton" = NSButton;
"_emailButton" = NSButton;
- "_friends" = CHStackView;
+ "_friendView" = NSView;
"_infoButton" = NSButton;
"_name" = NSTextField;
"_reloadButton" = NSButton;
Index: info.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib/info.nib,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- info.nib 26 Mar 2003 22:09:28 -0000 1.8
+++ info.nib 31 Mar 2003 15:07:47 -0000 1.9
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
- <string>129 92 395 294 0 0 1024 746 </string>
+ <string>56 97 395 294 0 0 1024 746 </string>
<key>IBFramework Version</key>
<string>291.0</string>
<key>IBOpenObjects</key>
Index: objects.nib
===================================================================
RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/FriendsWindow.nib/objects.nib,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
Binary files /tmp/cvs5Icevz and /tmp/cvsezOvLY differ
|
|
From: <ak...@us...> - 2003-03-31 15:19:04
|
Update of /cvsroot/zephyrchat/zchat/zChat/English.lproj/MainMenu.nib In directory sc8-pr-cvs1:/tmp/cvs-serv9074/zChat/English.lproj/MainMenu.nib Modified Files: info.nib objects.nib Log Message: Switch to MIT-style license. Index: info.nib =================================================================== RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/MainMenu.nib/info.nib,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- info.nib 25 Mar 2003 19:21:25 -0000 1.10 +++ info.nib 31 Mar 2003 15:07:48 -0000 1.11 @@ -13,8 +13,8 @@ <string>291.0</string> <key>IBOpenObjects</key> <array> - <integer>425</integer> <integer>29</integer> + <integer>425</integer> <integer>401</integer> </array> <key>IBSystem Version</key> Index: objects.nib =================================================================== RCS file: /cvsroot/zephyrchat/zchat/zChat/English.lproj/MainMenu.nib/objects.nib,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 Binary files /tmp/cvs8h3Til and /tmp/cvsg3RUdw differ |