Changeset 1038
- Timestamp:
- Oct 29, 2006, 5:05:27 PM (16 years ago)
- Location:
- trunk/macosx
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r1037 r1038 1324 1324 BOOL shouldBeOn; 1325 1325 int hour = [[NSCalendarDate calendarDate] hourOfDay]; 1326 if (onHour < offHour) 1326 1327 if (onHour == offHour) 1328 shouldBeOn = NO; 1329 else if (onHour < offHour) 1327 1330 shouldBeOn = hour >= onHour && hour < offHour; 1328 1331 else … … 1341 1344 NSCalendarDate * currentDate = [NSCalendarDate calendarDate]; 1342 1345 if ([currentDate minuteOfHour] == 0 && [currentDate secondOfMinute] < AUTO_SPEED_LIMIT_SECONDS 1343 && [currentDate hourOfDay] == [fDefaults integerForKey: fSpeedLimitEnabled 1344 ? @"SpeedLimitAutoOffHour" : @"SpeedLimitAutoOnHour"]) 1346 && [currentDate hourOfDay] == [fDefaults integerForKey: fSpeedLimitEnabled 1347 ? @"SpeedLimitAutoOffHour" : @"SpeedLimitAutoOnHour"] 1348 && (fSpeedLimitEnabled || [fDefaults integerForKey: @"SpeedLimitAutoOnHour"] 1349 != [fDefaults integerForKey: @"SpeedLimitAutoOffHour"])) 1345 1350 { 1346 1351 [self toggleSpeedLimit: nil]; -
trunk/macosx/English.lproj/PrefsWindow.nib/info.nib
r1037 r1038 12 12 <string>294 434 563 290 0 0 1152 842 </string> 13 13 <key>41</key> 14 <string> 138 348563 317 0 0 1152 842 </string>14 <string>294 420 563 317 0 0 1152 842 </string> 15 15 <key>66</key> 16 16 <string>294 507 563 144 0 0 1152 842 </string> -
trunk/macosx/PrefsController.h
r1034 r1038 39 39 IBOutlet NSPopUpButton * fFolderPopUp, * fImportFolderPopUp, 40 40 * fDownloadSoundPopUp, * fSeedingSoundPopUp; 41 42 NSArray * fSounds; 41 43 42 44 SUUpdater * fUpdater; -
trunk/macosx/PrefsController.m
r1037 r1038 80 80 //actually set bandwidth limits 81 81 [self applySpeedSettings: nil]; 82 83 //set play sound 84 NSMutableArray * sounds = [NSMutableArray array]; 85 NSEnumerator * soundEnumerator, 86 * soundDirectoriesEnumerator = [[NSArray arrayWithObjects: @"System/Library/Sounds", 87 [NSHomeDirectory() stringByAppendingPathComponent: @"Library/Sounds"], nil] objectEnumerator]; 88 NSString * soundPath, * sound; 89 90 //get list of all sounds and sort alphabetically 91 while ((soundPath = [soundDirectoriesEnumerator nextObject])) 92 if (soundEnumerator = [[NSFileManager defaultManager] enumeratorAtPath: soundPath]) 93 while ((sound = [soundEnumerator nextObject])) 94 { 95 sound = [sound stringByDeletingPathExtension]; 96 if ([NSSound soundNamed: sound]) 97 [sounds addObject: sound]; 98 } 99 100 fSounds = [[sounds sortedArrayUsingSelector: @selector(caseInsensitiveCompare:)] retain]; 82 101 } 83 102 return self; … … 88 107 if (fNatStatusTimer) 89 108 [fNatStatusTimer invalidate]; 109 [fSounds release]; 90 110 91 111 [super dealloc]; … … 119 139 fNatStatusTimer = [NSTimer scheduledTimerWithTimeInterval: 5.0 target: self 120 140 selector: @selector(updateNatStatus) userInfo: nil repeats: YES]; 121 122 //set play sound123 NSMutableArray * sounds = [NSMutableArray array];124 NSEnumerator * soundEnumerator,125 * soundDirectoriesEnumerator = [[NSArray arrayWithObjects: @"System/Library/Sounds",126 [NSHomeDirectory() stringByAppendingPathComponent: @"Library/Sounds"], nil] objectEnumerator];127 NSString * soundPath, * sound;128 129 //get list of all sounds and sort alphabetically130 while ((soundPath = [soundDirectoriesEnumerator nextObject]))131 if (soundEnumerator = [[NSFileManager defaultManager] enumeratorAtPath: soundPath])132 while ((sound = [soundEnumerator nextObject]))133 {134 sound = [sound stringByDeletingPathExtension];135 if ([NSSound soundNamed: sound])136 [sounds addObject: sound];137 }138 139 [sounds sortUsingSelector: @selector(caseInsensitiveCompare:)];140 141 //set download sound142 [fDownloadSoundPopUp removeAllItems];143 [fDownloadSoundPopUp addItemsWithTitles: sounds];144 145 int downloadSoundIndex = [fDownloadSoundPopUp indexOfItemWithTitle: [fDefaults stringForKey: @"DownloadSound"]];146 if (downloadSoundIndex >= 0)147 [fDownloadSoundPopUp selectItemAtIndex: downloadSoundIndex];148 else149 [fDefaults setObject: [fDownloadSoundPopUp titleOfSelectedItem] forKey: @"DownloadSound"];150 151 //set seeding sound152 [fSeedingSoundPopUp removeAllItems];153 [fSeedingSoundPopUp addItemsWithTitles: sounds];154 155 int seedingSoundIndex = [fDownloadSoundPopUp indexOfItemWithTitle: [fDefaults stringForKey: @"SeedingSound"]];156 if (seedingSoundIndex >= 0)157 [fSeedingSoundPopUp selectItemAtIndex: seedingSoundIndex];158 else159 [fDefaults setObject: [fSeedingSoundPopUp titleOfSelectedItem] forKey: @"SeedingSound"];160 141 161 142 //set update check … … 359 340 if ((sound = [NSSound soundNamed: soundName])) 360 341 [sound play]; 361 362 #warning use bindings363 if (sender == fDownloadSoundPopUp)364 [fDefaults setObject: soundName forKey: @"DownloadSound"];365 else if (sender == fSeedingSoundPopUp)366 [fDefaults setObject: soundName forKey: @"SeedingSound"];367 else;368 342 } 369 343
Note: See TracChangeset
for help on using the changeset viewer.