Changeset 191
- Timestamp:
- Apr 3, 2006, 7:29:09 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 7 deleted
- 10 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile
r134 r191 1 1 include Makefile.config 2 2 include Makefile.common 3 4 ifneq ($(SYSTEM),Darwin) 3 5 4 6 SRCS = transmissioncli.c … … 7 9 CFLAGS += -Ilibtransmission 8 10 9 all: transmissioncli 10 ifeq ($(SYSTEM),Darwin) 11 $(MAKE) -C macosx 12 endif 11 all: transmissioncli transmission-gtk transmission-beos 12 13 lib: 14 $(MAKE) -C libtransmission 13 15 14 16 transmissioncli: lib $(OBJS) 15 17 $(CC) -o $@ $(OBJS) libtransmission/libtransmission.a $(LDFLAGS) 16 18 17 lib: 18 $(MAKE) -C libtransmission 19 transmission-gtk: 20 ifeq ($(GTK),yes) 21 $(MAKE) -C gtk 22 endif 23 24 transmission-beos: 25 ifeq ($(SYSTEM),BeOS) 26 $(MAKE) -C beos 27 endif 19 28 20 29 %.o: %.c Makefile.config Makefile.common Makefile 21 30 $(CC) $(CFLAGS) -o $@ -c $< 22 31 23 package-macosx:24 $(RM) tmp "Transmission $(VERSION_STRING)" \25 Transmission-$(VERSION_STRING).dmg && \26 mkdir -p tmp/Transmission.app && \27 ditto macosx/build/Debug/Transmission.app tmp/Transmission.app && \28 ditto AUTHORS tmp/AUTHORS.txt && \29 ditto LICENSE tmp/LICENSE.txt && \30 ditto NEWS tmp/NEWS.txt && \31 strip -S tmp/Transmission.app/Contents/MacOS/Transmission && \32 ( echo "[InternetShortcut]"; \33 echo "URL=http://transmission.m0k.org/" ) > \34 tmp/Homepage.url && \35 ( echo "[InternetShortcut]"; \36 echo "URL=http://transmission.m0k.org/forum/" ) > \37 tmp/Forums.url && \38 ( echo "[InternetShortcut]"; \39 echo "URL=http://transmission.m0k.org/contribute.php" ) > \40 tmp/Contribute.url && \41 mv tmp "Transmission $(VERSION_STRING)" && \42 hdiutil create -format UDZO -srcfolder \43 "Transmission $(VERSION_STRING)" Transmission-$(VERSION_STRING).dmg && \44 rm -rf "Transmission $(VERSION_STRING)"45 46 32 clean: 47 33 $(RM) transmissioncli $(OBJS) 48 34 $(MAKE) -C libtransmission clean 49 ifeq ($(SYSTEM),Darwin) 50 $(MAKE) -C macosx clean 35 ifeq ($(GTK),yes) 36 $(MAKE) -C gtk clean 37 endif 38 ifeq ($(SYSTEM),BeOS) 39 $(MAKE) -C beos clean 51 40 endif 52 41 … … 56 45 57 46 include .depend 47 48 else 49 50 all: 51 make -C macosx 52 xcodebuild -alltargets -activeconfiguration | grep -v "^$$" 53 54 clean: 55 xcodebuild -alltargets -activeconfiguration clean | grep -v "^$$" 56 make -C macosx clean 57 58 MAKELINK = printf "[InternetShortcut]\nURL=http://%s\n" 59 60 package: 61 $(RM) tmp "Transmission $(VERSION_STRING)" \ 62 Transmission-$(VERSION_STRING).dmg && \ 63 mkdir -p tmp && \ 64 cp -r Transmission.app tmp/ && \ 65 cp AUTHORS tmp/AUTHORS.txt && \ 66 cp LICENSE tmp/LICENSE.txt && \ 67 cp NEWS tmp/NEWS.txt && \ 68 strip -S tmp/Transmission.app/Contents/MacOS/Transmission && \ 69 $(MAKELINK) "transmission.m0k.org/" > tmp/Homepage.url && \ 70 $(MAKELINK) "transmission.m0k.org/forum" > tmp/Forums.url && \ 71 $(MAKELINK) "transmission.m0k.org/contribute.php" > tmp/Contribute.url && \ 72 mv tmp "Transmission $(VERSION_STRING)" && \ 73 hdiutil create -format UDZO -srcfolder \ 74 "Transmission $(VERSION_STRING)" Transmission-$(VERSION_STRING).dmg && \ 75 rm -rf "Transmission $(VERSION_STRING)" 76 77 endif -
trunk/Makefile.common
r134 r191 3 3 VERSION_STRING = 0.6-svn 4 4 5 RM = rm -Rf 6 CFLAGS += -g -Wall -W -O3 -funroll-loops 7 CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE 8 CFLAGS += -DVERSION_MAJOR=$(VERSION_MAJOR) 9 CFLAGS += -DVERSION_MINOR=$(VERSION_MINOR) 10 CFLAGS += -DVERSION_STRING=\"$(VERSION_STRING)\" 11 CFLAGS += -DSYS_$(shell echo $(SYSTEM) | dd conv=ucase 2>/dev/null) 5 RM = rm -Rf 6 MOREFLAGS = -g -Wall -W -O3 -funroll-loops -D_FILE_OFFSET_BITS=64 \ 7 -D_LARGEFILE_SOURCE -D_GNU_SOURCE \ 8 -DVERSION_MAJOR=$(VERSION_MAJOR) \ 9 -DVERSION_MINOR=$(VERSION_MINOR) \ 10 -DVERSION_STRING=\"$(VERSION_STRING)\" \ 11 -DSYS_$(shell echo $(SYSTEM) | tr a-z A-Z) 12 CFLAGS += $(MOREFLAGS) 13 CXXFLAGS += $(MOREFLAGS) 12 14 13 15 ifeq ($(SYSTEM),BeOS) 16 CXXFLAGS += -Wno-multichar 14 17 ifeq ($(BEOS_NETSERVER),yes) 15 18 CFLAGS += -DBEOS_NETSERVER … … 18 21 LDFLAGS += -lbind -lsocket 19 22 endif 20 endif21 ifeq ($(SYSTEM),Darwin)22 CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i38623 endif24 25 ifeq ($(MATH),yes)26 LDFLAGS += -lm27 23 endif 28 24 -
trunk/libtransmission/Makefile
r135 r191 10 10 11 11 libtransmission.a: $(OBJS) 12 ifeq ($(SYSTEM),Darwin)13 libtool -static $(OBJS) -o $@14 else15 12 ar ru $@ $(OBJS) 16 13 ranlib $@ 17 endif18 14 19 15 %.o: %.c ../Makefile.config ../Makefile.common Makefile … … 25 21 .depend: $(SRCS) Makefile 26 22 $(RM) .depend 27 $(foreach SRC, $(SRCS), $(CC) -MM $(SRC) -D__TRANSMISSION__>> .depend;)23 $(foreach SRC, $(SRCS), $(CC) -MM $(SRC) $(CFLAGS) >> .depend;) 28 24 29 25 include .depend -
trunk/macosx/Badger.h
r103 r191 13 13 @interface Badger : NSObject { 14 14 15 NSImage * fDockIcon, * fBadgedDockIcon,16 * fBadge, * fUploadBadge, * fDownloadBadge;15 NSImage * fDockIcon, * fBadgedDockIcon, 16 * fBadge, * fUploadBadge, * fDownloadBadge; 17 17 18 NS Dictionary* fAttributes;18 NSMutableDictionary * fAttributes; 19 19 20 int fCompleted;21 BOOL fSpeedShown;20 int fCompleted; 21 BOOL fSpeedShown; 22 22 } 23 23 -
trunk/macosx/Badger.m
r162 r191 23 23 #import "Badger.h" 24 24 #import "StringAdditions.h" 25 #import "Utils.h" 25 26 26 27 @interface Badger (Private) … … 42 43 fDownloadBadge = [NSImage imageNamed: @"DownloadBadge"]; 43 44 44 NSShadow * stringShadow = [[NSShadow alloc] init]; 45 [stringShadow setShadowOffset: NSMakeSize(2, -2)]; 46 [stringShadow setShadowBlurRadius: 4]; 47 48 fAttributes = [[NSDictionary dictionaryWithObjectsAndKeys: 49 [NSColor whiteColor], NSForegroundColorAttributeName, 50 [NSFont fontWithName: @"Helvetica-Bold" size: 28], NSFontAttributeName, 51 stringShadow, NSShadowAttributeName, 52 nil] retain]; 53 [stringShadow release]; 45 46 fAttributes = [[NSMutableDictionary dictionaryWithObjectsAndKeys: 47 [NSColor whiteColor], NSForegroundColorAttributeName, 48 [NSFont fontWithName: @"Helvetica-Bold" size: 28], NSFontAttributeName, 49 nil] retain]; 50 51 if( OSX_VERSION >= 10.3 ) 52 { 53 NSShadow * stringShadow = [[NSShadow alloc] init]; 54 [stringShadow setShadowOffset: NSMakeSize(2, -2)]; 55 [stringShadow setShadowBlurRadius: 4]; 56 [fAttributes setObject: stringShadow 57 forKey: NSShadowAttributeName]; 58 [stringShadow release]; 59 } 54 60 55 61 fCompleted = 0; -
trunk/macosx/Controller.m
r169 r191 329 329 330 330 [panel setPrompt: @"Select Download Folder"]; 331 [panel setMessage: [NSString stringWithFormat:332 @"Select the download folder for %@",333 [torrentPath lastPathComponent]]];334 331 [panel setAllowsMultipleSelection: NO]; 335 332 [panel setCanChooseFiles: NO]; 336 333 [panel setCanChooseDirectories: YES]; 334 335 if( [panel respondsToSelector: @selector(setMessage:)] ) 336 /* >= 10.3 */ 337 [panel setMessage: [NSString stringWithFormat: 338 @"Select the download folder for %@", 339 [torrentPath lastPathComponent]]]; 337 340 338 341 [panel beginSheetForDirectory: NULL file: NULL types: NULL … … 676 679 { 677 680 [cell setTorrent: [fTorrents objectAtIndex: rowIndex]]; 678 [cell setTextColor: ( [fWindow isKeyWindow] && 679 rowIndex == [fTableView selectedRow] ) ? 680 [NSColor whiteColor] : [NSColor blackColor]]; 681 682 if( OSX_VERSION >= 10.3 && [fWindow isKeyWindow] && 683 rowIndex == [fTableView selectedRow] ) 684 [cell setTextColor: [NSColor whiteColor]]; 685 else 686 [cell setTextColor: [NSColor blackColor]]; 681 687 } 682 688 … … 1142 1148 if (!fCheckIsAutomatic) 1143 1149 { 1144 NSAlert * dialog = [[NSAlert alloc] init]; 1145 [dialog addButtonWithTitle: @"OK"]; 1146 [dialog setMessageText: @"Error checking for updates."]; 1147 [dialog setInformativeText: 1148 @"Transmission was not able to check the latest version available."]; 1149 [dialog setAlertStyle: NSInformationalAlertStyle]; 1150 1151 [dialog runModal]; 1152 [dialog release]; 1150 if( OSX_VERSION >= 10.3 ) 1151 { 1152 NSAlert * dialog = [[NSAlert alloc] init]; 1153 [dialog addButtonWithTitle: @"OK"]; 1154 [dialog setMessageText: @"Error checking for updates."]; 1155 [dialog setInformativeText: 1156 @"Transmission was not able to check the latest version available."]; 1157 [dialog setAlertStyle: NSInformationalAlertStyle]; 1158 1159 [dialog runModal]; 1160 [dialog release]; 1161 } 1162 else 1163 /* XXX */; 1153 1164 } 1154 1165 return; … … 1172 1183 } 1173 1184 1174 result = [currentSub compare: webSub options: NSNumericSearch]; 1175 if (result != NSOrderedSame) 1176 { 1177 if (result == NSOrderedAscending) 1178 webGreater = YES; 1179 break; 1180 } 1185 if( OSX_VERSION >= 10.3 ) 1186 { 1187 result = [currentSub compare: webSub options: NSNumericSearch]; 1188 if (result != NSOrderedSame) 1189 { 1190 if (result == NSOrderedAscending) 1191 webGreater = YES; 1192 break; 1193 } 1194 } 1195 else 1196 /* XXX */; 1181 1197 } 1182 1198 1183 1199 if (webGreater) 1184 1200 { 1185 NSAlert * dialog = [[NSAlert alloc] init]; 1186 [dialog addButtonWithTitle: @"Go to Website"]; 1187 [dialog addButtonWithTitle:@"Cancel"]; 1188 [dialog setMessageText: @"New version is available!"]; 1189 [dialog setInformativeText: [NSString stringWithFormat: 1190 @"A newer version (%@) is available for download from the Transmission website.", webVersion]]; 1191 [dialog setAlertStyle: NSInformationalAlertStyle]; 1192 1193 if ([dialog runModal] == NSAlertFirstButtonReturn) 1194 [self linkHomepage: nil]; 1195 1196 [dialog release]; 1201 if( OSX_VERSION >= 10.3 ) 1202 { 1203 NSAlert * dialog = [[NSAlert alloc] init]; 1204 [dialog addButtonWithTitle: @"Go to Website"]; 1205 [dialog addButtonWithTitle:@"Cancel"]; 1206 [dialog setMessageText: @"New version is available!"]; 1207 [dialog setInformativeText: [NSString stringWithFormat: 1208 @"A newer version (%@) is available for download from the Transmission website.", webVersion]]; 1209 [dialog setAlertStyle: NSInformationalAlertStyle]; 1210 1211 if ([dialog runModal] == NSAlertFirstButtonReturn) 1212 [self linkHomepage: nil]; 1213 1214 [dialog release]; 1215 } 1216 else 1217 /* XXX */; 1197 1218 } 1198 1219 else if (!fCheckIsAutomatic) 1199 1220 { 1200 NSAlert * dialog = [[NSAlert alloc] init]; 1201 [dialog addButtonWithTitle: @"OK"]; 1202 [dialog setMessageText: @"No new versions are available."]; 1203 [dialog setInformativeText: [NSString stringWithFormat: 1204 @"You are running the most current version of Transmission (%@).", currentVersion]]; 1205 [dialog setAlertStyle: NSInformationalAlertStyle]; 1206 1207 [dialog runModal]; 1208 [dialog release]; 1221 if( OSX_VERSION >= 10.3 ) 1222 { 1223 NSAlert * dialog = [[NSAlert alloc] init]; 1224 [dialog addButtonWithTitle: @"OK"]; 1225 [dialog setMessageText: @"No new versions are available."]; 1226 [dialog setInformativeText: [NSString stringWithFormat: 1227 @"You are running the most current version of Transmission (%@).", currentVersion]]; 1228 [dialog setAlertStyle: NSInformationalAlertStyle]; 1229 1230 [dialog runModal]; 1231 [dialog release]; 1232 } 1233 else 1234 /* XXX */; 1209 1235 } 1210 1236 else; -
trunk/macosx/Makefile
r134 r191 1 1 include ../Makefile.config 2 2 include ../Makefile.common 3 4 SRCS = $(shell ls *.m *.h *.plist)5 6 Transmission.app: $(SRCS) Info.plist7 xcodebuild -configuration Debug | grep -v "^$$"8 3 9 4 Info.plist: Info.plist.in ../Makefile.common … … 12 7 13 8 clean: 14 $(RM) Info.plist build9 $(RM) Info.plist -
trunk/macosx/PrefsController.m
r162 r191 78 78 [[fPrefsWindow standardWindowButton: NSWindowToolbarButton] 79 79 setFrame: NSZeroRect]; 80 81 [fToolbar setSelectedItemIdentifier: TOOLBAR_GENERAL]; 80 81 if( [fToolbar respondsToSelector: @selector(setSelectedItemIdentifier:) ] ) 82 [fToolbar setSelectedItemIdentifier: TOOLBAR_GENERAL]; 82 83 [self setPrefView: fGeneralView]; 83 84 … … 180 181 } 181 182 183 /* Only used on OS X >= 10.3 */ 182 184 - (NSArray *) toolbarSelectableItemIdentifiers: (NSToolbar *)toolbar 183 185 { … … 344 346 windowRect.size.height += difference; 345 347 346 [fPrefsWindow setTitle: [fToolbar selectedItemIdentifier]]; 348 if( [fToolbar respondsToSelector: @selector(selectedItemIdentifier) ] ) 349 [fPrefsWindow setTitle: [fToolbar selectedItemIdentifier]]; 347 350 [fPrefsWindow setContentView: fBlankView]; 348 351 [fPrefsWindow setFrame:windowRect display: YES animate: YES]; -
trunk/macosx/TorrentTableView.m
r168 r191 24 24 #import "Controller.h" 25 25 #import "Torrent.h" 26 #import "Utils.h" 26 27 27 28 @implementation TorrentTableView … … 101 102 if( row >= 0 ) 102 103 { 103 [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row] 104 byExtendingSelection: NO]; 104 if( OSX_VERSION >= 10.3 ) 105 [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row] 106 byExtendingSelection: NO]; 107 else 108 [self selectRow: row byExtendingSelection: NO]; 105 109 } 106 110 else … … 152 156 if( row >= 0 ) 153 157 { 154 [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row] 155 byExtendingSelection: NO]; 158 if( OSX_VERSION >= 10.3 ) 159 [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row] 160 byExtendingSelection: NO]; 161 else 162 [self selectRow: row byExtendingSelection: NO]; 156 163 return fContextRow; 157 164 } -
trunk/macosx/Utils.h
r34 r191 22 22 23 23 #define NS_ELLIPSIS [NSString stringWithUTF8String: "\xE2\x80\xA6"] 24 #define OSX_VERSION [[[NSDictionary dictionaryWithContentsOfFile: \ 25 @"/System/Library/CoreServices/SystemVersion.plist"] \ 26 objectForKey: @"ProductVersion"] floatValue]
Note: See TracChangeset
for help on using the changeset viewer.