Changeset 7185
- Timestamp:
- Nov 29, 2008, 8:29:54 PM (12 years ago)
- Location:
- trunk/macosx
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/AddWindowController.h
r7013 r7185 64 64 65 65 - (void) updateGroupMenu: (NSNotification *) notification; 66 - (void) showGroupsWindow: (id) sender;67 66 68 67 @end -
trunk/macosx/AddWindowController.m
r7013 r7185 237 237 } 238 238 239 - (void) showGroupsWindow: (id) sender240 {241 [fGroupPopUp selectItemWithTag: fGroupValue];242 [fController showGroups: sender];243 }244 245 239 @end 246 240 … … 289 283 - (void) setGroupsMenu 290 284 { 291 NSMenu * menu = [fGroupPopUp menu];292 293 for (NSInteger i = [menu numberOfItems]-1 - 2; i >= 0; i--)294 [menu removeItemAtIndex: i];295 296 285 NSMenu * groupMenu = [[GroupsController groups] groupMenuWithTarget: self action: @selector(changeGroupValue:) isSmall: NO]; 297 [menu appendItemsFromMenu: groupMenu atIndexes: [NSIndexSet indexSetWithIndexesInRange: 298 NSMakeRange(0, [groupMenu numberOfItems])] atBottom: NO]; 286 [fGroupPopUp setMenu: groupMenu]; 299 287 } 300 288 -
trunk/macosx/Controller.h
r7017 r7185 210 210 - (void) setStatusLabel: (id) sender; 211 211 212 - (void) showGroups: (id) sender;213 212 - (void) setGroup: (id) sender; //used by delegate-generated menu items 214 213 - (void) setGroupFilter: (id) sender; -
trunk/macosx/Controller.m
r7184 r7185 2219 2219 } 2220 2220 2221 - (void) showGroups: (id) sender2222 {2223 [[GroupsWindowController groupsWindow] showWindow: self];2224 }2225 2226 2221 - (void) menuNeedsUpdate: (NSMenu *) menu 2227 2222 { -
trunk/macosx/GroupsController.h
r7081 r7185 46 46 47 47 - (void) addNewGroup; 48 - (void) removeGroupWithRowIndex es: (NSIndexSet *) rowIndexes;48 - (void) removeGroupWithRowIndex: (NSInteger) row; 49 49 50 50 - (NSIndexSet *) moveGroupsAtRowIndexes: (NSIndexSet *) indexes toRow: (NSInteger) newRow oldSelected: (NSIndexSet *) selectedIndexes; -
trunk/macosx/GroupsController.m
r7081 r7185 194 194 } 195 195 196 - (void) removeGroupWithRowIndexes: (NSIndexSet *) rowIndexes 197 { 198 NSMutableIndexSet * indexes = [NSMutableIndexSet indexSet]; 199 for (NSInteger index = [rowIndexes firstIndex]; index != NSNotFound; index = [rowIndexes indexGreaterThanIndex: index]) 200 [indexes addIndex: [[[fGroups objectAtIndex: index] objectForKey: @"Index"] intValue]]; 201 202 [fGroups removeObjectsAtIndexes: rowIndexes]; 196 - (void) removeGroupWithRowIndex: (NSInteger) row 197 { 198 NSInteger index = [[[fGroups objectAtIndex: row] objectForKey: @"Index"] intValue]; 199 [fGroups removeObjectAtIndex: index]; 203 200 204 201 [[NSNotificationCenter defaultCenter] postNotificationName: @"GroupValueRemoved" object: self userInfo: 205 [NSDictionary dictionaryWithObject: indexes forKey: @"Indexes"]];206 207 if ( [indexes containsIndex: [[NSUserDefaults standardUserDefaults] integerForKey: @"FilterGroup"]])202 [NSDictionary dictionaryWithObject: [NSNumber numberWithInt: index] forKey: @"Index"]]; 203 204 if (index == [[NSUserDefaults standardUserDefaults] integerForKey: @"FilterGroup"]) 208 205 [[NSUserDefaults standardUserDefaults] setInteger: -2 forKey: @"FilterGroup"]; 209 206 -
trunk/macosx/GroupsWindowController.h
r7184 r7185 34 34 IBOutlet NSSegmentedControl * fAddRemoveControl; 35 35 36 intfCurrentColorIndex;36 NSInteger fCurrentColorIndex; 37 37 } 38 39 + (GroupsWindowController *) groupsWindow;40 38 41 39 - (void) addRemoveGroup: (id) sender; -
trunk/macosx/GroupsWindowController.m
r7184 r7185 40 40 @implementation GroupsWindowController 41 41 42 GroupsWindowController * fGroupsWindowInstance = nil;43 + (GroupsWindowController *) groupsWindow44 {45 if (!fGroupsWindowInstance)46 fGroupsWindowInstance = [[GroupsWindowController alloc] initWithWindowNibName: @"GroupsWindow"];47 return fGroupsWindowInstance;48 }49 50 42 - (void) awakeFromNib 51 43 { 52 [[self window] setTitle: NSLocalizedString(@"Groups", "Groups -> window title")];53 44 [[[fTableView tableColumnWithIdentifier: @"Button"] dataCell] setTitle: NSLocalizedString(@"Color", "Groups -> color button")]; 54 45 … … 67 58 [fSelectedColorView addObserver: self forKeyPath: @"color" options: 0 context: NULL]; 68 59 [self updateSelectedColor]; 69 }70 71 - (void) windowWillClose: (id) sender72 {73 [[NSColorPanel sharedColorPanel] close];74 75 [fGroupsWindowInstance release];76 fGroupsWindowInstance = nil;77 60 } 78 61 … … 94 77 } 95 78 96 - (void) tableView: (NSTableView *) tableView setObjectValue: (id) object forTableColumn: (NSTableColumn *) tableColumn97 row: (NSInteger) row98 {99 [[GroupsController groups] setName: object forIndex: [[GroupsController groups] indexForRow: row]];100 [self updateSelectedColor];101 }102 103 79 - (void) tableViewSelectionDidChange: (NSNotification *) notification 104 80 { … … 111 87 if ([fTableView numberOfSelectedRows] == 1) 112 88 { 113 intindex = [[GroupsController groups] indexForRow: [fTableView selectedRow]];89 NSInteger index = [[GroupsController groups] indexForRow: [fTableView selectedRow]]; 114 90 [fSelectedColorView setColor: [[GroupsController groups] colorForIndex: index]]; 115 91 [fSelectedColorView setEnabled: YES]; … … 130 106 if (object == fSelectedColorView && [fTableView numberOfSelectedRows] == 1) 131 107 { 132 intindex = [[GroupsController groups] indexForRow: [fTableView selectedRow]];108 NSInteger index = [[GroupsController groups] indexForRow: [fTableView selectedRow]]; 133 109 [[GroupsController groups] setColor: [fSelectedColorView color] forIndex: index]; 134 110 [fTableView setNeedsDisplay: YES]; … … 140 116 if ([notification object] == fSelectedColorNameField) 141 117 { 142 intindex = [[GroupsController groups] indexForRow: [fTableView selectedRow]];118 NSInteger index = [[GroupsController groups] indexForRow: [fTableView selectedRow]]; 143 119 [[GroupsController groups] setName: [fSelectedColorNameField stringValue] forIndex: index]; 144 120 [fTableView setNeedsDisplay: YES]; … … 185 161 - (void) addRemoveGroup: (id) sender 186 162 { 187 NSIndexSet * indexes;188 189 163 switch ([[sender cell] tagForSegment: [sender selectedSegment]]) 190 164 { 165 NSInteger row; 166 191 167 case ADD_TAG: 192 168 [[GroupsController groups] addNewGroup]; … … 200 176 201 177 case REMOVE_TAG: 178 #warning refactor in color picker (fCurrentColorIndex) code) 202 179 //close color picker if corresponding row is removed 203 indexes = [fTableView selectedRowIndexes];180 row = [fTableView selectedRow]; 204 181 if ([[NSColorPanel sharedColorPanel] isVisible] 205 && [indexes containsIndex: [[GroupsController groups] rowValueForIndex: fCurrentColorIndex]])182 && row == [[GroupsController groups] rowValueForIndex: fCurrentColorIndex]) 206 183 [[NSColorPanel sharedColorPanel] close]; 207 184 208 [[GroupsController groups] removeGroupWithRowIndex es: indexes];185 [[GroupsController groups] removeGroupWithRowIndex: row]; 209 186 210 187 [fTableView deselectAll: self]; -
trunk/macosx/Torrent.m
r7155 r7185 1444 1444 - (void) checkGroupValueForRemoval: (NSNotification *) notification 1445 1445 { 1446 if (fGroupValue != -1 && [[[notification userInfo] objectForKey: @"Index es"] containsIndex: fGroupValue])1446 if (fGroupValue != -1 && [[[notification userInfo] objectForKey: @"Index"] intValue] == fGroupValue) 1447 1447 fGroupValue = -1; 1448 1448 } -
trunk/macosx/en.lproj/AddWindow.xib
r6643 r7185 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.0 2">2 <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03"> 3 3 <data> 4 4 <int key="IBDocument.SystemTarget">1050</int> 5 <string key="IBDocument.SystemVersion">9 E17</string>6 <string key="IBDocument.InterfaceBuilderVersion">67 0</string>7 <string key="IBDocument.AppKitVersion">949.3 3</string>5 <string key="IBDocument.SystemVersion">9F33</string> 6 <string key="IBDocument.InterfaceBuilderVersion">677</string> 7 <string key="IBDocument.AppKitVersion">949.34</string> 8 8 <string key="IBDocument.HIToolboxVersion">352.00</string> 9 9 <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> … … 14 14 <bool key="EncodedWithXMLCoder">YES</bool> 15 15 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 16 </object> 17 <object class="NSMutableDictionary" key="IBDocument.Metadata"> 18 <bool key="EncodedWithXMLCoder">YES</bool> 19 <object class="NSArray" key="dict.sortedKeys"> 20 <bool key="EncodedWithXMLCoder">YES</bool> 21 </object> 22 <object class="NSMutableArray" key="dict.values"> 23 <bool key="EncodedWithXMLCoder">YES</bool> 24 </object> 16 25 </object> 17 26 <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000"> … … 307 316 <int key="NSPeriodicDelay">400</int> 308 317 <int key="NSPeriodicInterval">75</int> 309 <object class="NSMenuItem" key="NSMenuItem" id="196915222"> 310 <reference key="NSMenu" ref="594668561"/> 311 <bool key="NSIsDisabled">YES</bool> 312 <bool key="NSIsSeparator">YES</bool> 313 <string key="NSTitle"/> 314 <string key="NSKeyEquiv"/> 315 <int key="NSKeyEquivModMask">1048576</int> 316 <int key="NSMnemonicLoc">2147483647</int> 317 <int key="NSState">1</int> 318 <object class="NSCustomResource" key="NSOnImage" id="42644489"> 319 <string key="NSClassName">NSImage</string> 320 <string key="NSResourceName">NSMenuCheckmark</string> 321 </object> 322 <object class="NSCustomResource" key="NSMixedImage" id="971181110"> 323 <string key="NSClassName">NSImage</string> 324 <string key="NSResourceName">NSMenuMixedState</string> 325 </object> 326 <string key="NSAction">_popUpItemAction:</string> 327 <int key="NSTag">-2</int> 328 <reference key="NSTarget" ref="693599709"/> 329 </object> 318 <nil key="NSMenuItem"/> 330 319 <bool key="NSMenuItemRespectAlignment">YES</bool> 331 320 <object class="NSMenu" key="NSMenu" id="594668561"> … … 333 322 <object class="NSMutableArray" key="NSMenuItems"> 334 323 <bool key="EncodedWithXMLCoder">YES</bool> 335 <reference ref="196915222"/>336 <object class="NSMenuItem" id="674774797">337 <reference key="NSMenu" ref="594668561"/>338 <string type="base64-UTF8" key="NSTitle">U2hvdyBHcm91cHPigKY</string>339 <string key="NSKeyEquiv"/>340 <int key="NSKeyEquivModMask">1048576</int>341 <int key="NSMnemonicLoc">2147483647</int>342 <reference key="NSOnImage" ref="42644489"/>343 <reference key="NSMixedImage" ref="971181110"/>344 <string key="NSAction">_popUpItemAction:</string>345 <int key="NSTag">-3</int>346 <reference key="NSTarget" ref="693599709"/>347 </object>348 324 </object> 349 325 </object> 350 <int key="NSSelectedIndex"> 1</int>326 <int key="NSSelectedIndex">-1</int> 351 327 <int key="NSPreferredEdge">1</int> 352 328 <bool key="NSUsesItemFromMenu">YES</bool> … … 779 755 <object class="IBConnectionRecord"> 780 756 <object class="IBActionConnection" key="connection"> 781 <string key="label">showGroupsWindow:</string>782 <reference key="source" ref="1001"/>783 <reference key="destination" ref="674774797"/>784 </object>785 <int key="connectionID">64</int>786 </object>787 <object class="IBConnectionRecord">788 <object class="IBActionConnection" key="connection">789 757 <string key="label">verifyLocalData:</string> 790 758 <reference key="source" ref="1001"/> … … 1019 987 <object class="NSMutableArray" key="children"> 1020 988 <bool key="EncodedWithXMLCoder">YES</bool> 1021 <reference ref="196915222"/>1022 <reference ref="674774797"/>1023 989 </object> 1024 990 <reference key="parent" ref="693599709"/> … … 1137 1103 <reference key="object" ref="819741823"/> 1138 1104 <reference key="parent" ref="46983627"/> 1139 </object>1140 <object class="IBObjectRecord">1141 <int key="objectID">63</int>1142 <reference key="object" ref="196915222"/>1143 <reference key="parent" ref="594668561"/>1144 </object>1145 <object class="IBObjectRecord">1146 <int key="objectID">62</int>1147 <reference key="object" ref="674774797"/>1148 <reference key="parent" ref="594668561"/>1149 1105 </object> 1150 1106 <object class="IBObjectRecord"> … … 1172 1128 <string>-3.IBPluginDependency</string> 1173 1129 <string>1.IBEditorWindowLastContentRect</string> 1174 <string>1.IBPluginDependency</string>1175 1130 <string>1.IBWindowTemplateEditedContentRect</string> 1176 1131 <string>1.NSWindowTemplate.visibleAtLaunch</string> … … 1187 1142 <string>12.IBPluginDependency</string> 1188 1143 <string>12.ImportedFromIB2</string> 1144 <string>13.IBPluginDependency</string> 1145 <string>14.IBPluginDependency</string> 1146 <string>15.IBPluginDependency</string> 1147 <string>16.IBPluginDependency</string> 1189 1148 <string>17.IBPluginDependency</string> 1190 1149 <string>17.ImportedFromIB2</string> 1150 <string>18.IBPluginDependency</string> 1191 1151 <string>19.IBPluginDependency</string> 1192 1152 <string>19.ImportedFromIB2</string> 1193 1153 <string>2.IBPluginDependency</string> 1154 <string>20.IBPluginDependency</string> 1194 1155 <string>21.IBPluginDependency</string> 1195 1156 <string>21.ImportedFromIB2</string> 1157 <string>22.IBPluginDependency</string> 1196 1158 <string>3.IBPluginDependency</string> 1197 1159 <string>3.ImportedFromIB2</string> 1198 1160 <string>33.IBPluginDependency</string> 1199 1161 <string>34.IBPluginDependency</string> 1162 <string>35.IBEditorWindowLastContentRect</string> 1200 1163 <string>35.IBPluginDependency</string> 1201 1164 <string>35.editorWindowContentRectSynchronizationRect</string> … … 1204 1167 <string>40.IBPluginDependency</string> 1205 1168 <string>40.ImportedFromIB2</string> 1169 <string>41.IBPluginDependency</string> 1206 1170 <string>42.IBPluginDependency</string> 1207 1171 <string>42.ImportedFromIB2</string> 1172 <string>43.IBPluginDependency</string> 1208 1173 <string>43.IBShouldRemoveOnLegacySave</string> 1174 <string>44.IBPluginDependency</string> 1209 1175 <string>44.IBShouldRemoveOnLegacySave</string> 1176 <string>45.IBPluginDependency</string> 1210 1177 <string>45.IBShouldRemoveOnLegacySave</string> 1211 1178 <string>46.CustomClassName</string> … … 1220 1187 <string>5.IBPluginDependency</string> 1221 1188 <string>5.ImportedFromIB2</string> 1189 <string>50.IBPluginDependency</string> 1222 1190 <string>50.IBShouldRemoveOnLegacySave</string> 1223 1191 <string>51.IBPluginDependency</string> 1224 1192 <string>51.ImportedFromIB2</string> 1193 <string>52.IBPluginDependency</string> 1225 1194 <string>52.IBShouldRemoveOnLegacySave</string> 1226 1195 <string>53.IBPluginDependency</string> 1227 1196 <string>58.IBPluginDependency</string> 1228 1197 <string>59.IBPluginDependency</string> 1229 <string>62.IBPluginDependency</string> 1230 <string>62.ImportedFromIB2</string> 1231 <string>63.IBPluginDependency</string> 1232 <string>63.ImportedFromIB2</string> 1198 <string>6.IBPluginDependency</string> 1233 1199 <string>65.IBPluginDependency</string> 1234 1200 <string>66.IBPluginDependency</string> 1201 <string>7.IBPluginDependency</string> 1202 <string>8.IBPluginDependency</string> 1235 1203 <string>9.IBPluginDependency</string> 1236 1204 <string>9.ImportedFromIB2</string> … … 1241 1209 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1242 1210 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1243 <string>{{69, 482}, {414, 493}}</string> 1244 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1245 <string>{{69, 482}, {414, 493}}</string> 1211 <string>{{69, 327}, {414, 493}}</string> 1212 <string>{{69, 327}, {414, 493}}</string> 1246 1213 <integer value="1" id="9"/> 1247 1214 <string>{196, 240}</string> … … 1258 1225 <reference ref="9"/> 1259 1226 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1260 <reference ref="9"/> 1261 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1262 <reference ref="9"/> 1263 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1264 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1265 <reference ref="9"/> 1266 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1267 <reference ref="9"/> 1268 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1269 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1227 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1228 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1229 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1230 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1231 <reference ref="9"/> 1232 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1233 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1234 <reference ref="9"/> 1235 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1236 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1237 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1238 <reference ref="9"/> 1239 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1240 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1241 <reference ref="9"/> 1242 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1243 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1244 <string>{{333, 417}, {173, 4}}</string> 1270 1245 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1271 1246 <string>{{465, 481}, {173, 33}}</string> … … 1275 1250 <reference ref="9"/> 1276 1251 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1277 <reference ref="9"/> 1278 <reference ref="9"/> 1279 <reference ref="9"/> 1252 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1253 <reference ref="9"/> 1254 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1255 <reference ref="9"/> 1256 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1257 <reference ref="9"/> 1258 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1280 1259 <reference ref="9"/> 1281 1260 <string>FileOutlineView</string> … … 1290 1269 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1291 1270 <reference ref="9"/> 1292 <reference ref="9"/> 1293 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1294 <reference ref="9"/> 1295 <reference ref="9"/> 1296 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1297 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1298 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1299 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1300 <reference ref="9"/> 1301 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1302 <reference ref="9"/> 1271 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1272 <reference ref="9"/> 1273 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1274 <reference ref="9"/> 1275 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1276 <reference ref="9"/> 1277 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1278 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1279 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1280 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1281 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1282 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1303 1283 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 1304 1284 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> … … 1461 1441 </object> 1462 1442 <int key="IBDocument.localizationMode">0</int> 1463 <string key="IBDocument.LastKnownRelativeProjectPath">../../ ../Transmission.xcodeproj</string>1443 <string key="IBDocument.LastKnownRelativeProjectPath">../../Transmission.xcodeproj</string> 1464 1444 <int key="IBDocument.defaultPropertyAccessControl">3</int> 1465 1445 </data>
Note: See TracChangeset
for help on using the changeset viewer.