Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Use new literal syntax"

This reverts commit c17060d.

Conflicts:

	Classes/Controllers/GrowlController.m
	Classes/Dialogs/DCC/DCCFileTransferCell.m
	Classes/IRC/IRCChannel.m
	Classes/Views/KeyRecorder/KeyRecorder.m
  • Loading branch information...
commit 4760c511a7600d99fdcfadf65ff9b44058a00f03 1 parent 2d9e554
@psychs authored
Showing with 1,462 additions and 1,271 deletions.
  1. +12 −0 Classes/Controllers/AppController.h
  2. +37 −47 Classes/Controllers/AppController.m
  3. +203 −0 Classes/Controllers/GrowlController.m
  4. +4 −0 Classes/Controllers/ImageDownloadManager.h
  5. +0 −4 Classes/Controllers/ImageDownloadManager.m
  6. +3 −0  Classes/Controllers/LimeChatApplication.h
  7. +0 −3  Classes/Controllers/LimeChatApplication.m
  8. +25 −0 Classes/Controllers/MenuController.h
  9. +10 −34 Classes/Controllers/MenuController.m
  10. +4 −0 Classes/Controllers/NickCompletinStatus.h
  11. +0 −4 Classes/Controllers/NickCompletinStatus.m
  12. +5 −0 Classes/Controllers/Notifications/GrowlNotificationController.h
  13. +2 −7 Classes/Controllers/Notifications/GrowlNotificationController.m
  14. +3 −0  Classes/Controllers/Notifications/UserNotificationController.h
  15. +1 −4 Classes/Controllers/Notifications/UserNotificationController.m
  16. +4 −0 Classes/Controllers/TwitterAvatarURLManager.h
  17. +5 −9 Classes/Controllers/TwitterAvatarURLManager.m
  18. +8 −0 Classes/Dialogs/ChannelDialog.h
  19. +0 −9 Classes/Dialogs/ChannelDialog.m
  20. +16 −0 Classes/Dialogs/DCC/DCCController.h
  21. +17 −33 Classes/Dialogs/DCC/DCCController.m
  22. +13 −0 Classes/Dialogs/DCC/DCCFileTransferCell.h
  23. +12 −25 Classes/Dialogs/DCC/DCCFileTransferCell.m
  24. +21 −0 Classes/Dialogs/DCC/DCCReceiver.h
  25. +0 −21 Classes/Dialogs/DCC/DCCReceiver.m
  26. +20 −0 Classes/Dialogs/DCC/DCCSender.h
  27. +1 −21 Classes/Dialogs/DCC/DCCSender.m
  28. +4 −0 Classes/Dialogs/IgnoreItemSheet.h
  29. +2 −7 Classes/Dialogs/IgnoreItemSheet.m
  30. +3 −0  Classes/Dialogs/InviteSheet.h
  31. +4 −8 Classes/Dialogs/InviteSheet.m
  32. +6 −0 Classes/Dialogs/ListDialog.h
  33. +17 −24 Classes/Dialogs/ListDialog.m
  34. +5 −0 Classes/Dialogs/ModeSheet.h
  35. +0 −6 Classes/Dialogs/ModeSheet.m
  36. +2 −0  Classes/Dialogs/NickSheet.h
  37. +0 −3  Classes/Dialogs/NickSheet.m
  38. +12 −0 Classes/Dialogs/PasteSheet.h
  39. +26 −38 Classes/Dialogs/PasteSheet.m
  40. +19 −0 Classes/Dialogs/Preferences/PreferencesController.h
  41. +5 −24 Classes/Dialogs/Preferences/PreferencesController.m
  42. +3 −0  Classes/Dialogs/Preferences/SoundWrapper.h
  43. +0 −3  Classes/Dialogs/Preferences/SoundWrapper.m
  44. +8 −0 Classes/Dialogs/ServerDialog.h
  45. +12 −21 Classes/Dialogs/ServerDialog.m
  46. +3 −0  Classes/Dialogs/SheetBase.h
  47. +0 −4 Classes/Dialogs/SheetBase.m
  48. +3 −0  Classes/Dialogs/TopicSheet.h
  49. +0 −4 Classes/Dialogs/TopicSheet.m
  50. +3 −0  Classes/Dialogs/WelcomeDialog.h
  51. +18 −22 Classes/Dialogs/WelcomeDialog.m
  52. +4 −0 Classes/Dialogs/WhoisDialog.h
  53. +0 −5 Classes/Dialogs/WhoisDialog.m
  54. +1 −1  Classes/Helpers/NSArrayHelper.m
  55. +20 −21 Classes/Helpers/NSColorHelper.m
  56. +11 −11 Classes/Helpers/NSDictionaryHelper.m
  57. +1 −1  Classes/Helpers/NSLocaleHelper.m
  58. +2 −2 Classes/Helpers/NSPasteboardHelper.m
  59. +1 −1  Classes/Helpers/NSStringHelper.m
  60. +1 −1  Classes/Helpers/URLOpener.m
  61. +21 −0 Classes/IRC/IRCChannel.h
  62. +11 −32 Classes/IRC/IRCChannel.m
  63. +15 −0 Classes/IRC/IRCChannelConfig.h
  64. +9 −24 Classes/IRC/IRCChannelConfig.m
  65. +14 −0 Classes/IRC/IRCChannelMode.h
  66. +0 −14 Classes/IRC/IRCChannelMode.m
  67. +55 −0 Classes/IRC/IRCClient.h
  68. +17 −72 Classes/IRC/IRCClient.m
  69. +39 −0 Classes/IRC/IRCClientConfig.h
  70. +20 −59 Classes/IRC/IRCClientConfig.m
  71. +23 −0 Classes/IRC/IRCConnection.h
  72. +1 −24 Classes/IRC/IRCConnection.m
  73. +12 −0 Classes/IRC/IRCISupportInfo.h
  74. +1 −13 Classes/IRC/IRCISupportInfo.m
  75. +7 −0 Classes/IRC/IRCMessage.h
  76. +2 −9 Classes/IRC/IRCMessage.m
  77. +7 −0 Classes/IRC/IRCPrefix.h
  78. +0 −7 Classes/IRC/IRCPrefix.m
  79. +7 −0 Classes/IRC/IRCSendingMessage.h
  80. +2 −9 Classes/IRC/IRCSendingMessage.m
  81. +7 −0 Classes/IRC/IRCTreeItem.h
  82. +0 −7 Classes/IRC/IRCTreeItem.m
  83. +18 −0 Classes/IRC/IRCUser.h
  84. +0 −18 Classes/IRC/IRCUser.m
  85. +9 −0 Classes/IRC/IRCUserMode.h
  86. +0 −9 Classes/IRC/IRCUserMode.m
  87. +38 −0 Classes/IRC/IRCWorld.h
  88. +20 −58 Classes/IRC/IRCWorld.m
  89. +4 −0 Classes/IRC/IRCWorldConfig.h
  90. +3 −7 Classes/IRC/IRCWorldConfig.m
  91. +10 −0 Classes/IRC/IgnoreItem.h
  92. +9 −19 Classes/IRC/IgnoreItem.m
  93. +5 −0 Classes/IRC/TimerCommand.h
  94. +0 −5 Classes/IRC/TimerCommand.m
  95. +32 −0 Classes/Library/AsyncSocket.h
  96. +42 −78 Classes/Library/AsyncSocket.m
  97. +7 −0 Classes/Library/FileLogger.h
  98. +0 −7 Classes/Library/FileLogger.m
  99. +12 −0 Classes/Library/GistClient.h
  100. +7 −19 Classes/Library/GistClient.m
  101. +3 −0  Classes/Library/HostResolver.h
  102. +3 −6 Classes/Library/HostResolver.m
  103. +3 −0  Classes/Library/HotKeyManager.h
  104. +0 −3  Classes/Library/HotKeyManager.m
  105. +4 −0 Classes/Library/IconController.h
  106. +0 −4 Classes/Library/IconController.m
  107. +11 −0 Classes/Library/ImageSizeCheckClient.h
  108. +1 −12 Classes/Library/ImageSizeCheckClient.m
  109. +4 −0 Classes/Library/InputHistory.h
  110. +4 −8 Classes/Library/InputHistory.m
  111. +5 −0 Classes/Library/KeyEventHandler.h
  112. +13 −18 Classes/Library/KeyEventHandler.m
  113. +23 −0 Classes/Library/TCPClient.h
  114. +0 −23 Classes/Library/TCPClient.m
  115. +8 −0 Classes/Library/TCPServer.h
  116. +0 −8 Classes/Library/TCPServer.m
  117. +6 −0 Classes/Library/Timer.h
  118. +0 −6 Classes/Library/Timer.m
  119. +8 −0 Classes/Library/TwitterImageURLClient.h
  120. +0 −8 Classes/Library/TwitterImageURLClient.m
  121. +4 −4 Classes/Library/YAML/SyckInput.m
  122. +4 −0 Classes/Library/YAML/YAMLCategories.h
  123. +12 −14 Classes/Library/YAML/YAMLCategories.m
  124. +4 −0 Classes/Preferences/CustomJSFile.h
  125. +0 −4 Classes/Preferences/CustomJSFile.m
  126. +5 −0 Classes/Preferences/LogTheme.h
  127. +0 −5 Classes/Preferences/LogTheme.m
  128. +39 −0 Classes/Preferences/OtherTheme.h
  129. +9 −48 Classes/Preferences/OtherTheme.m
  130. +3 −3 Classes/Preferences/Preferences.m
  131. +6 −0 Classes/Preferences/ViewTheme.h
  132. +3 −9 Classes/Preferences/ViewTheme.m
  133. +4 −0 Classes/Views/FieldEditorTextView.h
  134. +0 −4 Classes/Views/FieldEditorTextView.m
  135. +1 −1  Classes/Views/InputTextField.m
  136. +4 −0 Classes/Views/KeyRecorder/KeyCodeTranslator.h
  137. +0 −4 Classes/Views/KeyRecorder/KeyCodeTranslator.m
  138. +9 −0 Classes/Views/KeyRecorder/KeyRecorder.h
  139. +2 −12 Classes/Views/KeyRecorder/KeyRecorder.m
  140. +4 −0 Classes/Views/ListView.h
  141. +0 −4 Classes/Views/ListView.m
  142. +4 −4 Classes/Views/Log/ImageURLParser.m
  143. +36 −0 Classes/Views/Log/LogController.h
  144. +11 −47 Classes/Views/Log/LogController.m
  145. +15 −0 Classes/Views/Log/LogLine.h
  146. +0 −15 Classes/Views/Log/LogLine.m
  147. +12 −0 Classes/Views/Log/LogPolicy.h
  148. +3 −15 Classes/Views/Log/LogPolicy.m
  149. +8 −0 Classes/Views/Log/LogScriptEventSink.h
  150. +0 −8 Classes/Views/Log/LogScriptEventSink.m
  151. +4 −0 Classes/Views/Log/LogView.h
  152. +0 −4 Classes/Views/Log/LogView.m
  153. +5 −0 Classes/Views/Log/WebViewAutoScroll.h
  154. +0 −5 Classes/Views/Log/WebViewAutoScroll.m
  155. +3 −0  Classes/Views/MainWindow.h
  156. +0 −3  Classes/Views/MainWindow.m
  157. +4 −0 Classes/Views/MarkedScroller.h
  158. +0 −4 Classes/Views/MarkedScroller.m
  159. +9 −0 Classes/Views/MemberList/MemberListView.h
  160. +1 −10 Classes/Views/MemberList/MemberListView.m
  161. +3 −0  Classes/Views/MemberList/MemberListViewCell.h
  162. +8 −11 Classes/Views/MemberList/MemberListViewCell.m
  163. +9 −0 Classes/Views/ServerTreeView.h
  164. +0 −9 Classes/Views/ServerTreeView.m
  165. +7 −0 Classes/Views/ThinSplitView.h
  166. +0 −7 Classes/Views/ThinSplitView.m
  167. +3 −0  Classes/Views/TreeView.h
  168. +0 −3  Classes/Views/TreeView.m
View
12 Classes/Controllers/AppController.h
@@ -45,6 +45,18 @@
IBOutlet NSMenu* urlMenu;
IBOutlet NSMenu* addrMenu;
IBOutlet NSMenu* chanMenu;
+
+ WelcomeDialog* welcomeDialog;
+ id<NotificationController> notifier;
+ DCCController* dcc;
+ FieldEditorTextView* fieldEditor;
+ IRCWorld* world;
+ ViewTheme* viewTheme;
+ InputHistory* inputHistory;
+ NickCompletinStatus* completionStatus;
+
+ BOOL threeColumns;
+ BOOL terminating;
}
@end
View
84 Classes/Controllers/AppController.m
@@ -24,19 +24,6 @@
@implementation AppController
-{
- WelcomeDialog* welcomeDialog;
- id<NotificationController> notifier;
- DCCController* dcc;
- FieldEditorTextView* fieldEditor;
- IRCWorld* world;
- ViewTheme* viewTheme;
- InputHistory* inputHistory;
- NickCompletinStatus* completionStatus;
-
- BOOL threeColumns;
- BOOL terminating;
-}
- (void)dealloc
{
@@ -448,7 +435,7 @@ - (void)loadWindowState
int y = [dic intForKey:@"y"];
int w = [dic intForKey:@"w"];
int h = [dic intForKey:@"h"];
- id spellCheckingValue = dic[@"spell_checking"];
+ id spellCheckingValue = [dic objectForKey:@"spell_checking"];
[window setFrame:NSMakeRect(x, y, w, h) display:YES];
rootSplitter.position = [dic intForKey:@"root"];
@@ -606,15 +593,18 @@ - (void)completeNick:(BOOL)forward
CGFloat firstUserWeight = 0;
if (commandMode) {
- lowerChoices = @[@"action", @"away", @"ban", @"clear", @"close",
- @"ctcp", @"ctcpreply", @"cycle", @"dehalfop", @"deop",
- @"devoice", @"halfop", @"hop", @"ignore", @"invite",
- @"ison", @"join", @"kick", @"leave", @"list",
- @"me", @"mode", @"msg", @"nick", @"notice",
- @"op", @"part", @"pong", @"privmsg", @"query",
- @"quit", @"quote", @"raw", @"rejoin", @"timer",
- @"topic", @"umode", @"unban", @"unignore", @"voice",
- @"weights", @"who", @"whois", @"whowas"];
+ choices = [NSArray arrayWithObjects:
+ @"action", @"away", @"ban", @"clear", @"close",
+ @"ctcp", @"ctcpreply", @"cycle", @"dehalfop", @"deop",
+ @"devoice", @"halfop", @"hop", @"ignore", @"invite",
+ @"ison", @"join", @"kick", @"leave", @"list",
+ @"me", @"mode", @"msg", @"nick", @"notice",
+ @"op", @"part", @"pong", @"privmsg", @"query",
+ @"quit", @"quote", @"raw", @"rejoin", @"timer",
+ @"topic", @"umode", @"unban", @"unignore", @"voice",
+ @"weights", @"who", @"whois", @"whowas",
+ nil];
+ lowerChoices = choices;
}
else {
NSMutableArray* users = [[channel.members mutableCopy] autorelease];
@@ -645,7 +635,7 @@ - (void)completeNick:(BOOL)forward
int i = 0;
for (NSString* s in lowerChoices) {
if ([s hasPrefix:lowerPre]) {
- [currentChoices addObject:choices[i]];
+ [currentChoices addObject:[choices objectAtIndex:i]];
[currentLowerChoices addObject:s];
}
++i;
@@ -657,7 +647,7 @@ - (void)completeNick:(BOOL)forward
if (!currentChoices.count) {
if (current.length) return;
if (!commandMode && !twitterMode && firstUserWeight > 0) {
- NSString* firstChoice = choices[0];
+ NSString* firstChoice = [choices objectAtIndex:0];
[currentChoices addObject:firstChoice];
[currentLowerChoices addObject:[firstChoice lowercaseString]];
}
@@ -684,10 +674,10 @@ - (void)completeNick:(BOOL)forward
--index;
}
}
- t = currentChoices[index];
+ t = [currentChoices objectAtIndex:index];
}
else {
- t = currentChoices[0];
+ t = [currentChoices objectAtIndex:0];
}
// add suffix
@@ -852,7 +842,7 @@ - (void)move:(MoveKind)dir target:(MoveKind)target
if (n == start) break;
- client = world.clients[n];
+ client = [world.clients objectAtIndex:n];
if (client) {
if (target == MOVE_ACTIVE) {
if (client.isLoggedIn) {
@@ -1069,7 +1059,7 @@ - (void)registerKeyHandlers
- (void)welcomeDialog:(WelcomeDialog*)sender onOK:(NSDictionary*)config
{
- NSString* host = config[@"host"];
+ NSString* host = [config objectForKey:@"host"];
NSString* name = host;
NSString* hostPattern = @"^[^\\s]+\\s+\\(([^()]+)\\)";
@@ -1079,29 +1069,29 @@ - (void)welcomeDialog:(WelcomeDialog*)sender onOK:(NSDictionary*)config
name = [host substringWithRange:[result rangeAtIndex:1]];
}
- NSString* nick = config[@"nick"];
+ NSString* nick = [config objectForKey:@"nick"];
NSString* user = [[nick lowercaseString] safeUsername];
NSString* realName = nick;
NSMutableArray* channels = [NSMutableArray array];
- for (NSString* s in config[@"channels"]) {
- [channels addObject:@{
- @"name": s,
- @"auto_join": @YES,
- @"console": @YES,
- @"growl": @YES,
- @"mode": @"+sn",
- }];
+ for (NSString* s in [config objectForKey:@"channels"]) {
+ [channels addObject:[NSDictionary dictionaryWithObjectsAndKeys:
+ s, @"name",
+ [NSNumber numberWithBool:YES], @"auto_join",
+ [NSNumber numberWithBool:YES], @"console",
+ [NSNumber numberWithBool:YES], @"growl",
+ @"+sn", @"mode",
+ nil]];
}
NSMutableDictionary* dic = [NSMutableDictionary dictionary];
- dic[@"host"] = host;
- dic[@"name"] = name;
- dic[@"nick"] = nick;
- dic[@"username"] = user;
- dic[@"realname"] = realName;
- dic[@"channels"] = channels;
- dic[@"auto_connect"] = config[@"autoConnect"];
+ [dic setObject:host forKey:@"host"];
+ [dic setObject:name forKey:@"name"];
+ [dic setObject:nick forKey:@"nick"];
+ [dic setObject:user forKey:@"username"];
+ [dic setObject:realName forKey:@"realname"];
+ [dic setObject:channels forKey:@"channels"];
+ [dic setObject:[config objectForKey:@"autoConnect"] forKey:@"auto_connect"];
if ([NSLocale prefersJapaneseLanguage]) {
NSString* net = [host lowercaseString];
@@ -1110,10 +1100,10 @@ - (void)welcomeDialog:(WelcomeDialog*)sender onOK:(NSDictionary*)config
|| [net contains:@"quakenet"]
|| [net contains:@"mozilla"]
|| [net contains:@"ustream"]) {
- dic[@"encoding"] = [NSNumber numberWithLong:NSUTF8StringEncoding];
+ [dic setObject:[NSNumber numberWithLong:NSUTF8StringEncoding] forKey:@"encoding"];
}
else {
- dic[@"encoding"] = [NSNumber numberWithLong:NSISO2022JPStringEncoding];
+ [dic setObject:[NSNumber numberWithLong:NSISO2022JPStringEncoding] forKey:@"encoding"];
}
}
View
203 Classes/Controllers/GrowlController.m
@@ -0,0 +1,203 @@
+// LimeChat is copyrighted free software by Satoshi Nakagawa <psychs AT limechat DOT net>.
+// You can redistribute it and/or modify it under the terms of the GPL version 2 (see the file GPL.txt).
+
+#import "GrowlController.h"
+#import "IRCWorld.h"
+#import "Preferences.h"
+
+
+#define GROWL_MSG_LOGIN @"Logged in"
+#define GROWL_MSG_DISCONNECT @"Disconnected"
+#define GROWL_MSG_HIGHLIGHT @"Highlight message received"
+#define GROWL_MSG_NEW_TALK @"New private message started"
+#define GROWL_MSG_CHANNEL_MSG @"Channel message received"
+#define GROWL_MSG_CHANNEL_NOTICE @"Channel notice received"
+#define GROWL_MSG_TALK_MSG @"Private message received"
+#define GROWL_MSG_TALK_NOTICE @"Private notice received"
+#define GROWL_MSG_KICKED @"Kicked out from channel"
+#define GROWL_MSG_INVITED @"Invited to channel"
+#define GROWL_MSG_FILE_RECEIVE_REQUEST @"File receive requested"
+#define GROWL_MSG_FILE_RECEIVE_SUCCEEDED @"File receive succeeded"
+#define GROWL_MSG_FILE_RECEIVE_FAILED @"File receive failed"
+#define GROWL_MSG_FILE_SEND_SUCCEEDED @"File send succeeded"
+#define GROWL_NSG_FILE_SEND_FAILED @"File send failed"
+
+#define CLICK_INTERVAL 2
+
+
+@implementation GrowlController
+
+@synthesize owner;
+
+- (id)init
+{
+ self = [super init];
+ if (self) {
+ [GrowlApplicationBridge setGrowlDelegate:self];
+ }
+ return self;
+}
+
+- (void)dealloc
+{
+ [lastClickedContext release];
+ [super dealloc];
+}
+
+- (void)notify:(GrowlNotificationType)type title:(NSString*)title desc:(NSString*)desc context:(id)context
+{
+ if (![Preferences growlEnabledForEvent:type]) return;
+
+ int priority = 0;
+ BOOL sticky = [Preferences growlStickyForEvent:type];
+ NSString* kind = nil;
+
+ switch (type) {
+ case GROWL_HIGHLIGHT:
+ kind = GROWL_MSG_HIGHLIGHT;
+ priority = 1;
+ title = [NSString stringWithFormat:@"Highlight: %@", title];
+ break;
+ case GROWL_NEW_TALK:
+ kind = GROWL_MSG_NEW_TALK;
+ priority = 1;
+ title = @"New Private Message";
+ break;
+ case GROWL_CHANNEL_MSG:
+ kind = GROWL_MSG_CHANNEL_MSG;
+ break;
+ case GROWL_CHANNEL_NOTICE:
+ kind = GROWL_MSG_CHANNEL_NOTICE;
+ title = [NSString stringWithFormat:@"Notice: %@", title];
+ break;
+ case GROWL_TALK_MSG:
+ kind = GROWL_MSG_TALK_MSG;
+ title = @"Private Message";
+ break;
+ case GROWL_TALK_NOTICE:
+ kind = GROWL_MSG_TALK_NOTICE;
+ title = @"Private Notice";
+ break;
+ case GROWL_KICKED:
+ kind = GROWL_MSG_KICKED;
+ title = [NSString stringWithFormat:@"Kicked: %@", title];
+ break;
+ case GROWL_INVITED:
+ kind = GROWL_MSG_INVITED;
+ title = [NSString stringWithFormat:@"Invited: %@", title];
+ break;
+ case GROWL_LOGIN:
+ kind = GROWL_MSG_LOGIN;
+ title = [NSString stringWithFormat:@"Logged in: %@", title];
+ break;
+ case GROWL_DISCONNECT:
+ kind = GROWL_MSG_DISCONNECT;
+ title = [NSString stringWithFormat:@"Disconnected: %@", title];
+ break;
+ case GROWL_FILE_RECEIVE_REQUEST:
+ kind = GROWL_MSG_FILE_RECEIVE_REQUEST;
+ desc = [NSString stringWithFormat:@"From %@\n%@", title, desc];
+ title = @"File receive request";
+ context = @"dcc";
+ break;
+ case GROWL_FILE_RECEIVE_SUCCESS:
+ kind = GROWL_MSG_FILE_RECEIVE_SUCCEEDED;
+ desc = [NSString stringWithFormat:@"From %@\n%@", title, desc];
+ title = @"File receive succeeded";
+ context = @"dcc";
+ break;
+ case GROWL_FILE_RECEIVE_ERROR:
+ kind = GROWL_MSG_FILE_RECEIVE_FAILED;
+ desc = [NSString stringWithFormat:@"From %@\n%@", title, desc];
+ title = @"File receive failed";
+ context = @"dcc";
+ break;
+ case GROWL_FILE_SEND_SUCCESS:
+ kind = GROWL_MSG_FILE_SEND_SUCCEEDED;
+ desc = [NSString stringWithFormat:@"To %@\n%@", title, desc];
+ title = @"File send succeeded";
+ context = @"dcc";
+ break;
+ case GROWL_FILE_SEND_ERROR:
+ kind = GROWL_NSG_FILE_SEND_FAILED;
+ desc = [NSString stringWithFormat:@"To %@\n%@", title, desc];
+ title = @"File send failed";
+ context = @"dcc";
+ break;
+ default:
+ break;
+ }
+
+
+ [GrowlApplicationBridge notifyWithTitle:title
+ description:desc
+ notificationName:kind
+ iconData:nil
+ priority:priority
+ isSticky:sticky
+ clickContext:context];
+}
+
+- (NSDictionary*)registrationDictionaryForGrowl
+{
+ NSMutableDictionary* dic = [NSMutableDictionary dictionary];
+ NSArray* all = [NSArray arrayWithObjects:
+ GROWL_MSG_LOGIN, GROWL_MSG_DISCONNECT, GROWL_MSG_HIGHLIGHT,
+ GROWL_MSG_NEW_TALK, GROWL_MSG_CHANNEL_MSG, GROWL_MSG_CHANNEL_NOTICE,
+ GROWL_MSG_TALK_MSG, GROWL_MSG_TALK_NOTICE, GROWL_MSG_KICKED,
+ GROWL_MSG_INVITED, GROWL_MSG_FILE_RECEIVE_REQUEST, GROWL_MSG_FILE_RECEIVE_SUCCEEDED,
+ GROWL_MSG_FILE_RECEIVE_FAILED, GROWL_MSG_FILE_SEND_SUCCEEDED, GROWL_NSG_FILE_SEND_FAILED,
+ nil];
+ [dic setObject:all forKey:GROWL_NOTIFICATIONS_ALL];
+ [dic setObject:all forKey:GROWL_NOTIFICATIONS_DEFAULT];
+ return dic;
+}
+
+- (void)growlNotificationWasClicked:(id)context
+{
+ CFAbsoluteTime now = CFAbsoluteTimeGetCurrent();
+
+ if (now - lastClickedTime < CLICK_INTERVAL) {
+ if (lastClickedContext && [lastClickedContext isEqual:context]) {
+ return;
+ }
+ }
+
+ lastClickedTime = now;
+ [lastClickedContext release];
+ lastClickedContext = [context retain];
+
+ [owner.window makeKeyAndOrderFront:nil];
+ [NSApp activateIgnoringOtherApps:YES];
+
+ if ([context isEqualToString:@"dcc"]) {
+ [owner.dcc show:YES];
+ }
+ else if ([context isKindOfClass:[NSString class]]) {
+ NSString* s = context;
+ NSArray* ary = [s componentsSeparatedByString:@" "];
+ if (ary.count >= 2) {
+ int uid = [[ary objectAtIndex:0] intValue];
+ int cid = [[ary objectAtIndex:1] intValue];
+
+ IRCClient* u = [owner findClientById:uid];
+ IRCChannel* c = [owner findChannelByClientId:uid channelId:cid];
+ if (c) {
+ [owner select:c];
+ }
+ else if (u) {
+ [owner select:u];
+ }
+ }
+ else if (ary.count == 1) {
+ int uid = [[ary objectAtIndex:0] intValue];
+
+ IRCClient* u = [owner findClientById:uid];
+ if (u) {
+ [owner select:u];
+ }
+ }
+ }
+}
+
+@end
View
4 Classes/Controllers/ImageDownloadManager.h
@@ -7,6 +7,10 @@
@interface ImageDownloadManager : NSObject
+{
+ __weak IRCWorld* world;
+ NSMutableSet* checkers;
+}
@property (nonatomic, weak) IRCWorld* world;
View
4 Classes/Controllers/ImageDownloadManager.m
@@ -10,10 +10,6 @@
@implementation ImageDownloadManager
-{
- __weak IRCWorld* world;
- NSMutableSet* checkers;
-}
@synthesize world;
View
3  Classes/Controllers/LimeChatApplication.h
@@ -6,6 +6,9 @@
@interface LimeChatApplication : NSApplication
+{
+ HotKeyManager* hotkey;
+}
- (void)registerHotKey:(int)keyCode modifierFlags:(NSUInteger)modFlags;
- (void)unregisterHotKey;
View
3  Classes/Controllers/LimeChatApplication.m
@@ -12,9 +12,6 @@
@implementation LimeChatApplication
-{
- HotKeyManager* hotkey;
-}
- (id)init
{
View
25 Classes/Controllers/MenuController.h
@@ -24,6 +24,31 @@
IBOutlet NSMenuItem* closeWindowItem;
IBOutlet NSMenuItem* closeCurrentPanelItem;
IBOutlet NSMenuItem* checkForUpdateItem;
+
+ __weak AppController* app;
+ __weak IRCWorld* world;
+ __weak MainWindow* window;
+ __weak InputTextField* text;
+ __weak ServerTreeView* tree;
+ __weak MemberListView* memberList;
+
+ NSString* pointedUrl;
+ NSString* pointedAddress;
+ NSString* pointedNick;
+ NSString* pointedChannelName;
+
+ id sparkleUpdater;
+ PreferencesController* preferencesController;
+ NSMutableArray* serverDialogs;
+ NSMutableArray* channelDialogs;
+ NickSheet* nickSheet;
+ ModeSheet* modeSheet;
+ TopicSheet* topicSheet;
+ PasteSheet* pasteSheet;
+ InviteSheet* inviteSheet;
+ NSOpenPanel* fileSendPanel;
+ NSArray* fileSendTargets;
+ int fileSendUID;
}
@property (nonatomic, weak) AppController* app;
View
44 Classes/Controllers/MenuController.m
@@ -35,33 +35,6 @@
@implementation MenuController
-{
-
- __weak AppController* app;
- __weak IRCWorld* world;
- __weak MainWindow* window;
- __weak InputTextField* text;
- __weak ServerTreeView* tree;
- __weak MemberListView* memberList;
-
- NSString* pointedUrl;
- NSString* pointedAddress;
- NSString* pointedNick;
- NSString* pointedChannelName;
-
- id sparkleUpdater;
- PreferencesController* preferencesController;
- NSMutableArray* serverDialogs;
- NSMutableArray* channelDialogs;
- NickSheet* nickSheet;
- ModeSheet* modeSheet;
- TopicSheet* topicSheet;
- PasteSheet* pasteSheet;
- InviteSheet* inviteSheet;
- NSOpenPanel* fileSendPanel;
- NSArray* fileSendTargets;
- int fileSendUID;
-}
@synthesize app;
@synthesize world;
@@ -335,20 +308,20 @@ - (NSArray*)selectedMembers:(NSMenuItem*)sender
if ([self isNickMenu:sender]) {
IRCUser* m = [[IRCUser new] autorelease];
m.nick = pointedNick;
- return @[m];
+ return [NSArray arrayWithObject:m];
}
else {
- return @[];
+ return [NSArray array];
}
}
else {
if ([self isNickMenu:sender]) {
IRCUser* m = [c findMember:pointedNick];
if (m) {
- return @[m];
+ return [NSArray arrayWithObject:m];
}
else {
- return @[];
+ return [NSArray array];
}
}
else {
@@ -500,7 +473,10 @@ - (void)pasteSheetOnCancel:(PasteSheet*)sender
- (void)pasteSheetWillClose:(PasteSheet*)sender
{
NSSize size = pasteSheet.size;
- NSDictionary* dic = @{@"w": [NSNumber numberWithInt:size.width], @"h": [NSNumber numberWithInt:size.height]};
+ NSDictionary* dic = [NSDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithInt:size.width], @"w",
+ [NSNumber numberWithInt:size.height], @"h",
+ nil];
[Preferences saveWindowState:dic name:@"paste_sheet"];
if (!pasteSheet.isShortText) {
@@ -532,7 +508,7 @@ - (void)onPaste:(id)sender
multiLine = YES;
}
else if (lines.count == 2) {
- NSString* lastLine = lines[1];
+ NSString* lastLine = [lines objectAtIndex:1];
multiLine = lastLine.length > 0;
}
IRCChannel* c = world.selectedChannel;
@@ -594,7 +570,7 @@ - (void)onUseSelectionForFind:(id)sender
}
else if ([t respondsToSelector:@selector(writeSelectionToPasteboard:type:)]) {
NSPasteboard* pb = [NSPasteboard pasteboardWithName:NSFindPboard];
- [pb declareTypes:@[NSStringPboardType] owner:nil];
+ [pb declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil];
[t writeSelectionToPasteboard:pb type:NSStringPboardType];
}
}
View
4 Classes/Controllers/NickCompletinStatus.h
@@ -5,6 +5,10 @@
@interface NickCompletinStatus : NSObject
+{
+ NSString* text;
+ NSRange range;
+}
@property (nonatomic, strong) NSString* text;
@property (nonatomic) NSRange range;
View
4 Classes/Controllers/NickCompletinStatus.m
@@ -5,10 +5,6 @@
@implementation NickCompletinStatus
-{
- NSString* text;
- NSRange range;
-}
@synthesize text;
@synthesize range;
View
5 Classes/Controllers/Notifications/GrowlNotificationController.h
@@ -6,6 +6,11 @@
@interface GrowlNotificationController : NSObject <NotificationController, GrowlApplicationBridgeDelegate>
+{
+ __weak id<NotificationControllerDelegate> delegate;
+ id lastClickedContext;
+ CFAbsoluteTime lastClickedTime;
+}
@property (nonatomic, weak) id<NotificationControllerDelegate> delegate;
View
9 Classes/Controllers/Notifications/GrowlNotificationController.m
@@ -25,11 +25,6 @@
@implementation GrowlNotificationController
-{
- __weak id<NotificationControllerDelegate> delegate;
- id lastClickedContext;
- CFAbsoluteTime lastClickedTime;
-}
@synthesize delegate;
@@ -142,8 +137,8 @@ - (NSDictionary*)registrationDictionaryForGrowl
GROWL_MSG_FILE_RECEIVE_FAILED, GROWL_MSG_FILE_SEND_SUCCEEDED, GROWL_NSG_FILE_SEND_FAILED];
NSMutableDictionary* dic = [NSMutableDictionary dictionary];
- dic[GROWL_NOTIFICATIONS_ALL] = all;
- dic[GROWL_NOTIFICATIONS_DEFAULT] = all;
+ [dic setObject:all forKey:GROWL_NOTIFICATIONS_ALL];
+ [dic setObject:all forKey:GROWL_NOTIFICATIONS_DEFAULT];
return dic;
}
View
3  Classes/Controllers/Notifications/UserNotificationController.h
@@ -5,6 +5,9 @@
@interface UserNotificationController : NSObject <NotificationController, NSUserNotificationCenterDelegate>
+{
+ __weak id<NotificationControllerDelegate> delegate;
+}
@property (nonatomic, weak) id<NotificationControllerDelegate> delegate;
View
5 Classes/Controllers/Notifications/UserNotificationController.m
@@ -8,9 +8,6 @@
@implementation UserNotificationController
-{
- __weak id<NotificationControllerDelegate> delegate;
-}
@synthesize delegate;
@@ -105,7 +102,7 @@ - (void)notify:(UserNotificationType)type title:(NSString*)title desc:(NSString*
- (void)userNotificationCenter:(NSUserNotificationCenter*)sender didActivateNotification:(NSUserNotification*)note
{
BOOL actionButtonClicked = note.activationType == NSUserNotificationActivationTypeActionButtonClicked;
- [delegate notificationControllerDidActivateNotification:note.userInfo[USER_NOTIFICATION_CONTEXT_KEY] actionButtonClicked:actionButtonClicked];
+ [delegate notificationControllerDidActivateNotification:[note.userInfo objectForKey:USER_NOTIFICATION_CONTEXT_KEY] actionButtonClicked:actionButtonClicked];
}
@end
View
4 Classes/Controllers/TwitterAvatarURLManager.h
@@ -8,6 +8,10 @@
@interface TwitterAvatarURLManager : NSObject
+{
+ NSMutableDictionary* connections;
+ NSMutableDictionary* imageUrls;
+}
+ (TwitterAvatarURLManager*)instance;
View
14 Classes/Controllers/TwitterAvatarURLManager.m
@@ -6,10 +6,6 @@
@implementation TwitterAvatarURLManager
-{
- NSMutableDictionary* connections;
- NSMutableDictionary* imageUrls;
-}
- (id)init
{
@@ -42,7 +38,7 @@ - (void)dealloc
- (NSString*)imageURLForTwitterScreenName:(NSString*)screenName
{
- return imageUrls[screenName];
+ return [imageUrls objectForKey:screenName];
}
- (BOOL)fetchImageURLForTwitterScreenName:(NSString*)screenName
@@ -51,19 +47,19 @@ - (BOOL)fetchImageURLForTwitterScreenName:(NSString*)screenName
return NO;
}
- NSString* url = imageUrls[screenName];
+ NSString* url = [imageUrls objectForKey:screenName];
if (url) {
return NO;
}
- if (connections[screenName]) {
+ if ([connections objectForKey:screenName]) {
return NO;
}
TwitterImageURLClient *client = [[TwitterImageURLClient new] autorelease];
client.delegate = self;
client.screenName = screenName;
- connections[screenName] = client;
+ [connections setObject:client forKey:screenName];
[client getImageURL];
return YES;
@@ -80,7 +76,7 @@ - (void)twitterImageURLClient:(TwitterImageURLClient*)sender didGetImageURL:(NSS
NSString* screenName = sender.screenName;
if (screenName.length && imageUrl.length) {
- imageUrls[screenName] = imageUrl;
+ [imageUrls setObject:imageUrl forKey:screenName];
[[NSNotificationCenter defaultCenter] postNotificationName:TwitterAvatarURLManagerDidGetImageURLNotification object:screenName];
}
}
View
8 Classes/Dialogs/ChannelDialog.h
@@ -17,6 +17,14 @@
IBOutlet NSButton* consoleCheck;
IBOutlet NSButton* growlCheck;
IBOutlet NSButton* okButton;
+
+ __weak id delegate;
+ __weak NSWindow* parentWindow;
+ int uid;
+ int cid;
+ IRCChannelConfig* config;
+
+ BOOL isSheet;
}
@property (nonatomic, weak) id delegate;
View
9 Classes/Dialogs/ChannelDialog.m
@@ -7,15 +7,6 @@
@implementation ChannelDialog
-{
- __weak id delegate;
- __weak NSWindow* parentWindow;
- int uid;
- int cid;
- IRCChannelConfig* config;
-
- BOOL isSheet;
-}
@synthesize delegate;
@synthesize window;
View
16 Classes/Dialogs/DCC/DCCController.h
@@ -12,6 +12,22 @@
@interface DCCController : NSWindowController
+{
+ __weak id delegate;
+ __weak IRCWorld* world;
+ __weak NSWindow* mainWindow;
+
+ BOOL loaded;
+ NSMutableArray* receivers;
+ NSMutableArray* senders;
+
+ Timer* timer;
+
+ IBOutlet ListView* receiverTable;
+ IBOutlet ListView* senderTable;
+ IBOutlet ThinSplitView* splitter;
+ IBOutlet NSButton* clearButton;
+}
@property (nonatomic, weak) id delegate;
@property (nonatomic, weak) IRCWorld* world;
View
50 Classes/Dialogs/DCC/DCCController.m
@@ -17,22 +17,6 @@
@implementation DCCController
-{
- __weak id delegate;
- __weak IRCWorld* world;
- __weak NSWindow* mainWindow;
-
- BOOL loaded;
- NSMutableArray* receivers;
- NSMutableArray* senders;
-
- Timer* timer;
-
- IBOutlet ListView* receiverTable;
- IBOutlet ListView* senderTable;
- IBOutlet ThinSplitView* splitter;
- IBOutlet NSButton* clearButton;
-}
@synthesize delegate;
@synthesize world;
@@ -163,7 +147,7 @@ - (void)addSenderWithUID:(int)uid nick:(NSString*)nick fileName:(NSString*)fileN
NSFileManager* fm = [NSFileManager defaultManager];
NSDictionary* attr = [fm attributesOfItemAtPath:fileName error:NULL];
if (!attr) return;
- NSNumber* sizeNum = attr[NSFileSize];
+ NSNumber* sizeNum = [attr objectForKey:NSFileSize];
long long size = [sizeNum longLongValue];
if (!size) return;
@@ -228,7 +212,7 @@ - (void)updateClearButton
BOOL enabled = NO;
for (int i=receivers.count-1; i>=0; --i) {
- DCCReceiver* e = receivers[i];
+ DCCReceiver* e = [receivers objectAtIndex:i];
if (e.status == DCC_ERROR || e.status == DCC_COMPLETE || e.status == DCC_STOP) {
enabled = YES;
break;
@@ -237,7 +221,7 @@ - (void)updateClearButton
if (!enabled) {
for (int i=senders.count-1; i>=0; --i) {
- DCCSender* e = senders[i];
+ DCCSender* e = [senders objectAtIndex:i];
if (e.status == DCC_ERROR || e.status == DCC_COMPLETE || e.status == DCC_STOP) {
enabled = YES;
break;
@@ -284,7 +268,7 @@ - (void)saveWindowState
- (void)destroyReceiverAtIndex:(int)i
{
- DCCReceiver* e = receivers[i];
+ DCCReceiver* e = [receivers objectAtIndex:i];
e.delegate = nil;
[e close];
@@ -298,7 +282,7 @@ - (void)destroyReceiverAtIndex:(int)i
- (void)destroySenderAtIndex:(int)i
{
- DCCSender* e = senders[i];
+ DCCSender* e = [senders objectAtIndex:i];
e.delegate = nil;
[e close];
@@ -323,7 +307,7 @@ - (BOOL)validateMenuItem:(NSMenuItem *)item
NSMutableArray* sel = [NSMutableArray array];
NSIndexSet* indexes = [receiverTable selectedRowIndexes];
for (NSUInteger i=[indexes firstIndex]; i!=NSNotFound; i=[indexes indexGreaterThanIndex:i]) {
- [sel addObject:receivers[i]];
+ [sel addObject:[receivers objectAtIndex:i]];
}
switch (tag) {
@@ -367,7 +351,7 @@ - (BOOL)validateMenuItem:(NSMenuItem *)item
NSMutableArray* sel = [NSMutableArray array];
NSIndexSet* indexes = [senderTable selectedRowIndexes];
for (NSUInteger i=[indexes firstIndex]; i!=NSNotFound; i=[indexes indexGreaterThanIndex:i]) {
- [sel addObject:senders[i]];
+ [sel addObject:[senders objectAtIndex:i]];
}
switch (tag) {
@@ -396,14 +380,14 @@ - (BOOL)validateMenuItem:(NSMenuItem *)item
- (void)clear:(id)sender
{
for (int i=receivers.count-1; i>=0; --i) {
- DCCReceiver* e = receivers[i];
+ DCCReceiver* e = [receivers objectAtIndex:i];
if (e.status == DCC_ERROR || e.status == DCC_COMPLETE || e.status == DCC_STOP) {
[self destroyReceiverAtIndex:i];
}
}
for (int i=senders.count-1; i>=0; --i) {
- DCCSender* e = senders[i];
+ DCCSender* e = [senders objectAtIndex:i];
if (e.status == DCC_ERROR || e.status == DCC_COMPLETE || e.status == DCC_STOP) {
[self destroySenderAtIndex:i];
}
@@ -417,7 +401,7 @@ - (void)startReceiver:(id)sender
{
NSIndexSet* indexes = [receiverTable selectedRowIndexes];
for (NSUInteger i=[indexes firstIndex]; i!=NSNotFound; i=[indexes indexGreaterThanIndex:i]) {
- DCCReceiver* e = receivers[i];
+ DCCReceiver* e = [receivers objectAtIndex:i];
[e open];
}
@@ -429,7 +413,7 @@ - (void)stopReceiver:(id)sender
{
NSIndexSet* indexes = [receiverTable selectedRowIndexes];
for (NSUInteger i=[indexes firstIndex]; i!=NSNotFound; i=[indexes indexGreaterThanIndex:i]) {
- DCCReceiver* e = receivers[i];
+ DCCReceiver* e = [receivers objectAtIndex:i];
[e close];
}
@@ -454,7 +438,7 @@ - (void)openReceiver:(id)sender
NSIndexSet* indexes = [receiverTable selectedRowIndexes];
for (NSUInteger i=[indexes firstIndex]; i!=NSNotFound; i=[indexes indexGreaterThanIndex:i]) {
- DCCReceiver* e = receivers[i];
+ DCCReceiver* e = [receivers objectAtIndex:i];
[ws openFile:e.downloadFileName];
}
@@ -468,7 +452,7 @@ - (void)revealReceivedFileInFinder:(id)sender
NSIndexSet* indexes = [receiverTable selectedRowIndexes];
for (NSUInteger i=[indexes firstIndex]; i!=NSNotFound; i=[indexes indexGreaterThanIndex:i]) {
- DCCReceiver* e = receivers[i];
+ DCCReceiver* e = [receivers objectAtIndex:i];
[ws selectFile:e.downloadFileName inFileViewerRootedAtPath:nil];
}
@@ -480,7 +464,7 @@ - (void)startSender:(id)sender
{
NSIndexSet* indexes = [senderTable selectedRowIndexes];
for (NSUInteger i=[indexes firstIndex]; i!=NSNotFound; i=[indexes indexGreaterThanIndex:i]) {
- DCCSender* e = senders[i];
+ DCCSender* e = [senders objectAtIndex:i];
[e open];
}
@@ -492,7 +476,7 @@ - (void)stopSender:(id)sender
{
NSIndexSet* indexes = [senderTable selectedRowIndexes];
for (NSUInteger i=[indexes firstIndex]; i!=NSNotFound; i=[indexes indexGreaterThanIndex:i]) {
- DCCSender* e = senders[i];
+ DCCSender* e = [senders objectAtIndex:i];
[e close];
}
@@ -671,7 +655,7 @@ - (void)tableView:(NSTableView *)sender willDisplayCell:(DCCFileTransferCell*)c
if (sender == senderTable) {
if (row < 0 || senders.count <= row) return;
- DCCSender* e = senders[row];
+ DCCSender* e = [senders objectAtIndex:row];
double speed = e.speed;
c.sendingItem = YES;
@@ -689,7 +673,7 @@ - (void)tableView:(NSTableView *)sender willDisplayCell:(DCCFileTransferCell*)c
else {
if (row < 0 || receivers.count <= row) return;
- DCCReceiver* e = receivers[row];
+ DCCReceiver* e = [receivers objectAtIndex:row];
double speed = e.speed;
c.sendingItem = NO;
View
13 Classes/Dialogs/DCC/DCCFileTransferCell.h
@@ -17,6 +17,19 @@ typedef enum {
@interface DCCFileTransferCell : NSCell
+{
+ NSString* peerNick;
+ long long processedSize;
+ long long size;
+ long long speed;
+ long long timeRemaining;
+ DCCFileTransferStatus status;
+ NSString* error;
+
+ NSProgressIndicator* progressBar;
+ NSImage* icon;
+ BOOL sendingItem;
+}
@property (nonatomic, strong) NSString* peerNick;
@property (nonatomic) long long processedSize;
View
37 Classes/Dialogs/DCC/DCCFileTransferCell.m
@@ -17,19 +17,6 @@
@implementation DCCFileTransferCell
-{
- NSString* peerNick;
- long long processedSize;
- long long size;
- long long speed;
- long long timeRemaining;
- DCCFileTransferStatus status;
- NSString* error;
-
- NSProgressIndicator* progressBar;
- NSImage* icon;
- BOOL sendingItem;
-}
@synthesize peerNick;
@synthesize processedSize;
@@ -104,12 +91,12 @@ - (void)drawInteriorWithFrame:(NSRect)frame inView:(NSView*)view
fnameColor = [NSColor blackColor];
}
- NSDictionary* fnameAttrs = @{
- NSParagraphStyleAttributeName: [DCCFileTransferCell fileNameStyle],
- NSFontAttributeName: [NSFont systemFontOfSize:12],
- NSForegroundColorAttributeName: fnameColor,
- };
-
+ NSDictionary* fnameAttrs = [NSDictionary dictionaryWithObjectsAndKeys:
+ [[self class] fileNameStyle], NSParagraphStyleAttributeName,
+ [NSFont systemFontOfSize:12], NSFontAttributeName,
+ fnameColor, NSForegroundColorAttributeName,
+ nil];
+
[fname drawInRect:fnameRect withAttributes:fnameAttrs];
if (progressBar) {
@@ -141,12 +128,12 @@ - (void)drawInteriorWithFrame:(NSRect)frame inView:(NSView*)view
statusColor = [NSColor grayColor];
}
- NSDictionary* statusAttrs = @{
- NSParagraphStyleAttributeName: [DCCFileTransferCell statusStyle],
- NSFontAttributeName: [NSFont systemFontOfSize:11],
- NSForegroundColorAttributeName: statusColor,
- };
-
+ NSDictionary* statusAttrs = [NSDictionary dictionaryWithObjectsAndKeys:
+ [[self class] statusStyle], NSParagraphStyleAttributeName,
+ [NSFont systemFontOfSize:11], NSFontAttributeName,
+ statusColor, NSForegroundColorAttributeName,
+ nil];
+
NSMutableString* statusStr = [NSMutableString string];
if (sendingItem) {
View
21 Classes/Dialogs/DCC/DCCReceiver.h
@@ -7,6 +7,27 @@
@interface DCCReceiver : NSObject
+{
+ __weak id delegate;
+ int uid;
+ NSString* peerNick;
+ NSString* host;
+ int port;
+ long long size;
+ long long processedSize;
+ DCCFileTransferStatus status;
+ NSString* error;
+ NSString* path;
+ NSString* fileName;
+ NSString* downloadFileName;
+ NSImage* icon;
+ NSProgressIndicator* progressBar;
+
+ TCPClient* sock;
+ NSFileHandle* file;
+ NSMutableArray* speedRecords;
+ double currentRecord;
+}
@property (nonatomic, weak) id delegate;
@property (nonatomic) int uid;
View
21 Classes/Dialogs/DCC/DCCReceiver.m
@@ -9,27 +9,6 @@
@implementation DCCReceiver
-{
- __weak id delegate;
- int uid;
- NSString* peerNick;
- NSString* host;
- int port;
- long long size;
- long long processedSize;
- DCCFileTransferStatus status;
- NSString* error;
- NSString* path;
- NSString* fileName;
- NSString* downloadFileName;
- NSImage* icon;
- NSProgressIndicator* progressBar;
-
- TCPClient* sock;
- NSFileHandle* file;
- NSMutableArray* speedRecords;
- double currentRecord;
-}
@synthesize delegate;
@synthesize uid;
View
20 Classes/Dialogs/DCC/DCCSender.h
@@ -7,6 +7,26 @@
@interface DCCSender : NSObject
+{
+ __weak id delegate;
+ int uid;
+ NSString* peerNick;
+ int port;
+ NSString* fileName;
+ NSString* fullFileName;
+ long long size;
+ long long processedSize;
+ DCCFileTransferStatus status;
+ NSString* error;
+ NSImage* icon;
+ NSProgressIndicator* progressBar;
+
+ TCPServer* sock;
+ TCPClient* client;
+ NSFileHandle* file;
+ NSMutableArray* speedRecords;
+ double currentRecord;
+}
@property (nonatomic, weak) id delegate;
@property (nonatomic) int uid;
View
22 Classes/Dialogs/DCC/DCCSender.m
@@ -12,26 +12,6 @@
@implementation DCCSender
-{
- __weak id delegate;
- int uid;
- NSString* peerNick;
- int port;
- NSString* fileName;
- NSString* fullFileName;
- long long size;
- long long processedSize;
- DCCFileTransferStatus status;
- NSString* error;
- NSImage* icon;
- NSProgressIndicator* progressBar;
-
- TCPServer* sock;
- TCPClient* client;
- NSFileHandle* file;
- NSMutableArray* speedRecords;
- double currentRecord;
-}
@synthesize delegate;
@synthesize uid;
@@ -77,7 +57,7 @@ - (void)setFullFileName:(NSString *)value
NSFileManager* fm = [NSFileManager defaultManager];
NSDictionary* attr = [fm attributesOfItemAtPath:fullFileName error:NULL];
if (attr) {
- NSNumber* sizeNum = attr[NSFileSize];
+ NSNumber* sizeNum = [attr objectForKey:NSFileSize];
size = [sizeNum longLongValue];
}
else {
View
4 Classes/Dialogs/IgnoreItemSheet.h
@@ -17,6 +17,10 @@
IBOutlet NSTextField* messageText;
IBOutlet ListView* channelTable;
IBOutlet NSButton* deleteChannelButton;
+
+ IgnoreItem* ignore;
+ BOOL newItem;
+ NSMutableArray* channels;
}
@property (nonatomic, strong) IgnoreItem* ignore;
View
9 Classes/Dialogs/IgnoreItemSheet.m
@@ -5,11 +5,6 @@
@implementation IgnoreItemSheet
-{
- IgnoreItem* ignore;
- BOOL newItem;
- NSMutableArray* channels;
-}
@synthesize ignore;
@synthesize newItem;
@@ -174,12 +169,12 @@ - (NSInteger)numberOfRowsInTableView:(NSTableView *)sender
- (id)tableView:(NSTableView *)sender objectValueForTableColumn:(NSTableColumn *)column row:(NSInteger)row
{
- return channels[row];
+ return [channels objectAtIndex:row];
}
- (void)tableView:(NSTableView *)sender setObjectValue:(id)obj forTableColumn:(NSTableColumn *)column row:(NSInteger)row
{
- channels[row] = obj;
+ [channels replaceObjectAtIndex:row withObject:obj];
}
- (void)tableViewSelectionDidChange:(NSNotification *)note
View
3  Classes/Dialogs/InviteSheet.h
@@ -9,6 +9,9 @@
{
IBOutlet NSTextField* titleLabel;
IBOutlet NSPopUpButton* channelPopup;
+
+ NSArray* nicks;
+ int uid;
}
@property (nonatomic, strong) NSArray* nicks;
View
12 Classes/Dialogs/InviteSheet.m
@@ -5,10 +5,6 @@
@implementation InviteSheet
-{
- NSArray* nicks;
- int uid;
-}
@synthesize nicks;
@synthesize uid;
@@ -32,15 +28,15 @@ - (void)startWithChannels:(NSArray*)channels
{
NSString* target;
if (nicks.count == 1) {
- target = nicks[0];
+ target = [nicks objectAtIndex:0];
}
else if (nicks.count == 2) {
- NSString* first = nicks[0];
- NSString* second = nicks[1];
+ NSString* first = [nicks objectAtIndex:0];
+ NSString* second = [nicks objectAtIndex:1];
target = [NSString stringWithFormat:@"%@ and %@", first, second];
}
else {
- target = [NSString stringWithFormat:@"%lu users", nicks.count];
+ target = [NSString stringWithFormat:@"%d users", (int)nicks.count];
}
titleLabel.stringValue = [NSString stringWithFormat:@"Invite %@ to:", target];
View
6 Classes/Dialogs/ListDialog.h
@@ -10,6 +10,12 @@
IBOutlet ListView* table;
IBOutlet NSSearchField* filterText;
IBOutlet NSButton* updateButton;
+
+ __weak id delegate;
+ NSMutableArray* list;
+ NSMutableArray* filteredList;
+ int sortKey;
+ NSComparisonResult sortOrder;
}
@property (nonatomic, weak) id delegate;
View
41 Classes/Dialogs/ListDialog.m
@@ -7,13 +7,6 @@
@implementation ListDialog
-{
- __weak id delegate;
- NSMutableArray* list;
- NSMutableArray* filteredList;
- int sortKey;
- NSComparisonResult sortOrder;
-}
@synthesize delegate;
@synthesize sortKey;
@@ -51,8 +44,8 @@ - (void)show
if (![self.window isVisible]) {
NSDictionary* dic = [Preferences loadWindowStateWithName:@"channel_list_window"];
if (dic) {
- NSDictionary* win = dic[@"window"];
- NSArray* cols = dic[@"tablecols"];
+ NSDictionary* win = [dic objectForKey:@"window"];
+ NSArray* cols = [dic objectForKey:@"tablecols"];
double x = [win doubleForKey:@"x"];
double y = [win doubleForKey:@"y"];
@@ -90,7 +83,7 @@ - (void)clear
- (void)addChannel:(NSString*)channel count:(int)count topic:(NSString*)topic
{
- NSArray* item = @[channel, [NSNumber numberWithInt:count], topic];
+ NSArray* item = [NSArray arrayWithObjects:channel, [NSNumber numberWithInt:count], topic, nil];
NSString* filter = [filterText stringValue];
if (filter.length) {
@@ -119,7 +112,7 @@ static NSInteger compareItems(NSArray* self, NSArray* other, void* context)
int key = dialog.sortKey;
NSComparisonResult order = dialog.sortOrder;
- NSString* mine = self[key];
+ NSString* mine = [self objectAtIndex:key];
NSString* others = [other objectAtIndex:key];
NSComparisonResult result;
@@ -151,7 +144,7 @@ - (void)sortedInsert:(NSArray*)item inArray:(NSMutableArray*)ary
while (right - left > THRESHOLD) {
int pivot = (left + right) / 2;
- if (compareItems(ary[pivot], item, self) == NSOrderedDescending) {
+ if (compareItems([ary objectAtIndex:pivot], item, self) == NSOrderedDescending) {
right = pivot;
}
else {
@@ -160,7 +153,7 @@ - (void)sortedInsert:(NSArray*)item inArray:(NSMutableArray*)ary
}
for (int i=left; i<right; ++i) {
- if (compareItems(ary[i], item, self) == NSOrderedDescending) {
+ if (compareItems([ary objectAtIndex:i], item, self) == NSOrderedDescending) {
[ary insertObject:item atIndex:i];
return;
}
@@ -194,9 +187,9 @@ - (void)onJoin:(id)sender
NSIndexSet* indexes = [table selectedRowIndexes];
for (NSUInteger i=[indexes firstIndex]; i!=NSNotFound; i=[indexes indexGreaterThanIndex:i]) {
- NSArray* item = ary[i];
+ NSArray* item = [ary objectAtIndex:i];
if ([delegate respondsToSelector:@selector(listDialogOnJoin:channel:)]) {
- [delegate listDialogOnJoin:self channel:item[0]];
+ [delegate listDialogOnJoin:self channel:[item objectAtIndex:0]];
}
}
}
@@ -210,8 +203,8 @@ - (void)onSearchFieldChange:(id)sender
if (filter.length) {
NSMutableArray* ary = [NSMutableArray new];
for (NSArray* item in list) {
- NSString* channel = item[0];
- NSString* topic = item[2];
+ NSString* channel = [item objectAtIndex:0];
+ NSString* topic = [item objectAtIndex:2];
if ([channel rangeOfString:filter options:NSCaseInsensitiveSearch].location != NSNotFound
|| [topic rangeOfString:filter options:NSCaseInsensitiveSearch].location != NSNotFound) {
[ary addObject:item];
@@ -228,8 +221,8 @@ - (BOOL)loadWindowState
NSDictionary* dic = [Preferences loadWindowStateWithName:@"channel_list_window"];
if (!dic) return NO;
- NSDictionary* win = dic[@"window"];
- NSArray* cols = dic[@"tablecols"];
+ NSDictionary* win = [dic objectForKey:@"window"];
+ NSArray* cols = [dic objectForKey:@"tablecols"];
double x = [win doubleForKey:@"x"];
double y = [win doubleForKey:@"y"];
@@ -260,7 +253,7 @@ - (void)saveWindowState
[cols addObject:[NSNumber numberWithDouble:col.width]];
}
- NSDictionary* dic = @{@"window": win, @"tablecols": cols};
+ NSDictionary* dic = [NSDictionary dictionaryWithObjectsAndKeys:win, @"window", cols, @"tablecols", nil];
[Preferences saveWindowState:dic name:@"channel_list_window"];
}
@@ -278,17 +271,17 @@ - (NSInteger)numberOfRowsInTableView:(NSTableView *)sender
- (id)tableView:(NSTableView *)sender objectValueForTableColumn:(NSTableColumn *)column row:(NSInteger)row
{
NSArray* ary = filteredList ?: list;
- NSArray* item = ary[row];
+ NSArray* item = [ary objectAtIndex:row];
NSString* col = [column identifier];
if ([col isEqualToString:@"chname"]) {
- return item[0];
+ return [item objectAtIndex:0];
}
else if ([col isEqualToString:@"count"]) {
- return item[1];
+ return [item objectAtIndex:1];
}
else {
- return item[2];
+ return [item objectAtIndex:2];
}
}
View
5 Classes/Dialogs/ModeSheet.h
@@ -20,6 +20,11 @@
IBOutlet NSButton* lCheck;
IBOutlet NSTextField* kText;
IBOutlet NSTextField* lText;
+
+ IRCChannelMode* mode;
+ NSString* channelName;
+ int uid;
+ int cid;
}
@property (nonatomic, strong) IRCChannelMode* mode;
View
6 Classes/Dialogs/ModeSheet.m
@@ -5,12 +5,6 @@
@implementation ModeSheet
-{
- IRCChannelMode* mode;
- NSString* channelName;
- int uid;
- int cid;
-}
@synthesize mode;
@synthesize channelName;
View
2  Classes/Dialogs/NickSheet.h
@@ -9,6 +9,8 @@
{
IBOutlet NSTextField* currentText;
IBOutlet NSTextField* newText;
+
+ int uid;
}
@property (nonatomic) int uid;
View
3  Classes/Dialogs/NickSheet.m
@@ -5,9 +5,6 @@
@implementation NickSheet
-{
- int uid;
-}
@synthesize uid;
View
12 Classes/Dialogs/PasteSheet.h
@@ -15,6 +15,18 @@
IBOutlet NSPopUpButton* commandPopup;
IBOutlet NSProgressIndicator* uploadIndicator;
IBOutlet NSTextField* errorLabel;
+
+ NSString* nick;
+ int uid;
+ int cid;
+ NSString* originalText;
+ NSString* syntax;
+ NSString* command;
+ NSSize size;
+ BOOL editMode;
+ BOOL isShortText;
+
+ GistClient* gist;
}
@property (nonatomic, strong) NSString* nick;
View
64 Classes/Dialogs/PasteSheet.m
@@ -10,19 +10,6 @@
@implementation PasteSheet
-{
- NSString* nick;
- int uid;
- int cid;
- NSString* originalText;
- NSString* syntax;
- NSString* command;
- NSSize size;
- BOOL editMode;
- BOOL isShortText;
-
- GistClient* gist;
-}
@synthesize nick;
@synthesize uid;
@@ -41,32 +28,33 @@ - (id)init
[NSBundle loadNibNamed:@"PasteSheet" owner:self];
if (!SYNTAXES) {
- SYNTAXES = [@[@"privmsg", @"notice", @"c", @"css", @"diff", @"html",
- @"java", @"javascript", @"php", @"plain text", @"python",
- @"ruby", @"sql", @"shell script", @"perl", @"haskell",
- @"scheme", @"objective-c"] retain];
+ SYNTAXES = [[NSArray arrayWithObjects:
+ @"privmsg", @"notice", @"c", @"css", @"diff", @"html",
+ @"java", @"javascript", @"php", @"plain text", @"python",
+ @"ruby", @"sql", @"shell script", @"perl", @"haskell",
+ @"scheme", @"objective-c",
+ nil] retain];
}
if (!SYNTAX_EXT_MAP) {
- SYNTAX_EXT_MAP = @{
- @"c": @".c",
- @"css": @".css",
- @"diff": @".diff",
- @"haskell": @".hs",
- @"html": @".html",
- @"java": @".java",
- @"javascript": @".js",
- @"objective-c": @".m",
- @"perl": @".pl",
- @"php": @".aw",
- @"plain_text": @".txt",
- @"python": @".py",
- @"ruby": @".rb",
- @"scheme": @".scm",
- @"shell_script": @".sh",
- @"sql": @".sql",
- };
- [SYNTAX_EXT_MAP retain];
+ SYNTAX_EXT_MAP = [[NSDictionary dictionaryWithObjectsAndKeys:
+ @".c", @"c",
+ @".css", @"css",
+ @".diff", @"diff",
+ @".hs", @"haskell",
+ @".html", @"html",
+ @".java", @"java",
+ @".js", @"javascript",
+ @".m", @"objective-c",
+ @".pl", @"perl",
+ @".aw", @"php",
+ @".txt", @"plain_text",
+ @".py", @"python",
+ @".rb", @"ruby",
+ @".scm", @"scheme",
+ @".sh", @"shell script",
+ @".sql", @"sql",
+ nil, nil] retain];
}
}
return self;
@@ -115,7 +103,7 @@ - (void)pasteOnline:(id)sender
}
NSString* s = bodyText.string;
- NSString* fileType = SYNTAX_EXT_MAP[[self syntaxFromTag:syntaxPopup.selectedTag]];
+ NSString* fileType = [SYNTAX_EXT_MAP objectForKey:[self syntaxFromTag:syntaxPopup.selectedTag]];
if (!fileType) {
fileType = @".txt";
}
@@ -187,7 +175,7 @@ - (int)tagFromSyntax:(NSString*)s
- (NSString*)syntaxFromTag:(int)tag
{
if (0 <= tag && tag < SYNTAXES.count) {
- return SYNTAXES[tag];
+ return [SYNTAXES objectAtIndex:tag];
}
return nil;
}
View
19 Classes/Dialogs/Preferences/PreferencesController.h
@@ -9,6 +9,25 @@
@interface PreferencesController : NSWindowController
+{
+ __weak id delegate;
+
+ IBOutlet KeyRecorder* hotKey;
+
+ IBOutlet NSTableView* keywordsTable;
+ IBOutlet NSTableView* excludeWordsTable;
+ IBOutlet NSArrayController* keywordsArrayController;
+ IBOutlet NSArrayController* excludeWordsArrayController;
+ IBOutlet NSPopUpButton* transcriptFolderButton;
+ IBOutlet NSPopUpButton* themeButton;
+ IBOutlet NSTableView* soundsTable;
+
+ NSMutableArray* sounds;
+ NSOpenPanel* transcriptFolderOpenPanel;
+ NSFont* logFont;
+ NSFont* inputFont;
+ BOOL changingLogFont;
+}
@property (nonatomic, weak) id delegate;
@property (nonatomic, strong) NSString* fontDisplayName;
View
29 Classes/Dialogs/Preferences/PreferencesController.m
@@ -15,25 +15,6 @@
@implementation PreferencesController
-{
- __weak id delegate;
-
- IBOutlet KeyRecorder* hotKey;
-
- IBOutlet NSTableView* keywordsTable;
- IBOutlet NSTableView* excludeWordsTable;
- IBOutlet NSArrayController* keywordsArrayController;
- IBOutlet NSArrayController* excludeWordsArrayController;
- IBOutlet NSPopUpButton* transcriptFolderButton;
- IBOutlet NSPopUpButton* themeButton;
- IBOutlet NSTableView* soundsTable;
-
- NSMutableArray* sounds;
- NSOpenPanel* transcriptFolderOpenPanel;
- NSFont* logFont;
- NSFont* inputFont;
- BOOL changingLogFont;
-}
@synthesize delegate;
@@ -65,7 +46,7 @@ - (void)awakeFromNib
if (version >= 0x1080) {
NSArray* columns = [soundsTable tableColumns];
if (columns.count > 3) {
- [soundsTable removeTableColumn:columns[2]];
+ [soundsTable removeTableColumn:[columns objectAtIndex:2]];
}
}
}
@@ -239,7 +220,7 @@ - (NSArray*)availableSounds
{
static NSArray* ary;
if (!ary) {
- ary = [@[@"-", @"Beep", @"Basso", @"Blow", @"Bottle", @"Frog", @"Funk", @"Glass", @"Hero", @"Morse", @"Ping", @"Pop", @"Purr", @"Sosumi", @"Submarine", @"Tink"] retain];
+ ary = [[NSArray arrayWithObjects:@"-", @"Beep", @"Basso", @"Blow", @"Bottle", @"Frog", @"Funk", @"Glass", @"Hero", @"Morse", @"Ping", @"Pop", @"Purr", @"Sosumi", @"Submarine", @"Tink", nil] retain];
}
return ary;
}
@@ -378,7 +359,7 @@ - (void)updateTheme
[[themeButton itemAtIndex:0] setTag:0];
NSFileManager* fm = [NSFileManager defaultManager];
- NSArray* ary = @[[ViewTheme resourceBasePath], [ViewTheme userBasePath]];
+ NSArray* ary = [NSArray arrayWithObjects:[ViewTheme resourceBasePath], [ViewTheme userBasePath], nil];
int tag = 0;
for (NSString* path in ary) {
@@ -420,8 +401,8 @@ - (void)updateTheme
return;
}
- NSString* kind = kindAndName[0];
- NSString* name = kindAndName[1];
+ NSString* kind = [kindAndName objectAtIndex:0];
+ NSString* name = [kindAndName objectAtIndex:1];
int targetTag = 0;
if (![kind isEqualToString:@"resource"]) {
View
3  Classes/Dialogs/Preferences/SoundWrapper.h
@@ -9,6 +9,9 @@
@interface SoundWrapper : NSObject
+{
+ UserNotificationType eventType;
+}
@property (nonatomic, readonly) NSString* displayName;
@property (nonatomic, strong) NSString* sound;
View
3  Classes/Dialogs/Preferences/SoundWrapper.m
@@ -7,9 +7,6 @@
@implementation SoundWrapper
-{
- UserNotificationType eventType;
-}
- (id)initWithEventType:(UserNotificationType)aEventType
{
View
8 Classes/Dialogs/ServerDialog.h
@@ -53,6 +53,14 @@
IBOutlet NSButton* deleteIgnoreButton;
IBOutlet NSButton* okButton;
+
+ __weak id delegate;
+ __weak NSWindow* parentWindow;
+ int uid;
+ IRCClientConfig* config;
+
+ ChannelDialog* channelSheet;
+ IgnoreItemSheet* ignoreSheet;
}
@property (nonatomic, weak) id delegate;
View
33 Classes/Dialogs/ServerDialog.m
@@ -11,19 +11,10 @@
#define IGNORE_TAB_INDEX 3
#define TABLE_ROW_TYPE @"row"
-#define TABLE_ROW_TYPES @[TABLE_ROW_TYPE]
+#define TABLE_ROW_TYPES [NSArray arrayWithObject:TABLE_ROW_TYPE]
@implementation ServerDialog
-{
- __weak id delegate;
- __weak NSWindow* parentWindow;
- int uid;
- IRCClientConfig* config;
-
- ChannelDialog* channelSheet;
- IgnoreItemSheet* ignoreSheet;
-}
@synthesize delegate;
@synthesize parentWindow;
@@ -232,7 +223,7 @@ - (void)ok:(id)sender
// remove invalid ignores
NSMutableArray* ignores = config.ignores;
for (int i=ignores.count-1; i>=0; --i) {
- IgnoreItem* g = ignores[i];
+ IgnoreItem* g = [ignores objectAtIndex:i];
if (!g.isValid) {
[ignores removeObjectAtIndex:i];
}
@@ -288,7 +279,7 @@ - (void)addChannel:(id)sender
conf = [[IRCChannelConfig new] autorelease];
}
else {
- IRCChannelConfig* c = config.channels[sel];
+ IRCChannelConfig* c = [config.channels objectAtIndex:sel];
conf = [[c mutableCopy] autorelease];
conf.name = @"";
}
@@ -307,7 +298,7 @@ - (void)editChannel:(id)sender
{
NSInteger sel = [channelTable selectedRow];
if (sel < 0) return;
- IRCChannelConfig* c = [[config.channels[sel] mutableCopy] autorelease];
+ IRCChannelConfig* c = [[[config.channels objectAtIndex:sel] mutableCopy] autorelease];
[channelSheet release];
channelSheet = [ChannelDialog new];
@@ -338,7 +329,7 @@ - (void)channelDialogOnOK:(ChannelDialog*)sender
[config.channels addObject:conf];
}
else {
- config.channels[n] = conf;
+ [config.channels replaceObjectAtIndex:n withObject:conf];
}
[self reloadChannelTable];
@@ -393,7 +384,7 @@ - (void)editIgnore:(id)sender
ignoreSheet = [IgnoreItemSheet new];
ignoreSheet.delegate = self;
ignoreSheet.window = self.window;
- ignoreSheet.ignore = config.ignores[sel];
+ ignoreSheet.ignore = [config.ignores objectAtIndex:sel];
[ignoreSheet start];
}
@@ -448,7 +439,7 @@ - (NSInteger)numberOfRowsInTableView:(NSTableView *)sender
- (id)tableView:(NSTableView *)sender objectValueForTableColumn:(NSTableColumn *)column row:(NSInteger)row
{
if (sender == channelTable) {
- IRCChannelConfig* c = config.channels[row];
+ IRCChannelConfig* c = [config.channels objectAtIndex:row];
NSString* columnId = [column identifier];
if ([columnId isEqualToString:@"name"]) {
@@ -462,7 +453,7 @@ - (id)tableView:(NSTableView *)sender objectValueForTableColumn:(NSTableColumn *
}
}
else {
- IgnoreItem* g = config.ignores[row];
+ IgnoreItem* g = [config.ignores objectAtIndex:row];
NSString* columnId = [column identifier];
if ([columnId isEqualToString:@"nick"]) {
@@ -479,7 +470,7 @@ - (id)tableView:(NSTableView *)sender objectValueForTableColumn:(NSTableColumn *
- (void)tableView:(NSTableView *)sender setObjectValue:(id)obj forTableColumn:(NSTableColumn *)column row:(NSInteger)row
{
if (sender == channelTable) {
- IRCChannelConfig* c = config.channels[row];
+ IRCChannelConfig* c = [config.channels objectAtIndex:row];
NSString* columnId = [column identifier];
if ([columnId isEqualToString:@"join"]) {
@@ -516,7 +507,7 @@ - (void)tableViewDoubleClicked:(id)sender
- (BOOL)tableView:(NSTableView *)sender writeRowsWithIndexes:(NSIndexSet *)rows toPasteboard:(NSPasteboard *)pboard
{
if (sender == channelTable) {
- NSArray* ary = @[[NSNumber numberWithInt:[rows firstIndex]]];
+ NSArray* ary = [NSArray arrayWithObject:[NSNumber numberWithInt:[rows firstIndex]]];
[pboard declareTypes:TABLE_ROW_TYPES owner:self];
[pboard setPropertyList:ary forType:TABLE_ROW_TYPE];
}
@@ -548,10 +539,10 @@ - (BOOL)tableView:(NSTableView *)sender acceptDrop:(id < NSDraggingInfo >)info r
NSPasteboard* pboard = [info draggingPasteboard];
if (op == NSTableViewDropAbove && [pboard availableTypeFromArray:TABLE_ROW_TYPES]) {
NSArray* selectedRows = [pboard propertyListForType:TABLE_ROW_TYPE];
- int sel = [selectedRows[0] intValue];
+ int sel = [[selectedRows objectAtIndex:0] intValue];
NSMutableArray* ary = config.channels;
- IRCChannelConfig* target = ary[sel];
+ IRCChannelConfig* target = [ary objectAtIndex:sel];
[[target retain] autorelease];
NSMutableArray* low = [[[ary subarrayWithRange:NSMakeRange(0, row)] mutableCopy] autorelease];
View
3  Classes/Dialogs/SheetBase.h
@@ -9,6 +9,9 @@
IBOutlet NSWindow* sheet;
IBOutlet NSButton* okButton;
IBOutlet NSButton* cancelButton;
+
+ __weak id delegate;
+ __weak NSWindow* window;
}
@property (nonatomic, weak) id delegate;
View
4 Classes/Dialogs/SheetBase.m
@@ -5,10 +5,6 @@
@implementation SheetBase
-{
- __weak id delegate;
- __weak NSWindow* window;
-}