diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index 3a57cfd72..c74dc792a 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -105,6 +105,7 @@ A25892640CF1F7E800CCCDDF /* StatsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A25892630CF1F7E800CCCDDF /* StatsWindowController.m */; }; A25892770CF1FCE800CCCDDF /* StatsWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A25892750CF1FCE800CCCDDF /* StatsWindow.xib */; }; A259317E0A73B2CC002F4FE7 /* TransmissionHelp in Resources */ = {isa = PBXBuildFile; fileRef = A259316A0A73B2CC002F4FE7 /* TransmissionHelp */; }; + A25AFDE90D1038AD0092A1BA /* MenuLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = A25AFDE80D1038AD0092A1BA /* MenuLabel.m */; }; A25D2CBD0CF4C73E0096A262 /* stats.c in Sources */ = {isa = PBXBuildFile; fileRef = A25D2CBB0CF4C7190096A262 /* stats.c */; }; A25D2CBE0CF4C73E0096A262 /* stats.h in Headers */ = {isa = PBXBuildFile; fileRef = A25D2CBA0CF4C7190096A262 /* stats.h */; }; A25E74650AF5097C006F11AE /* ExpandedPathToPathTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = A25E74440AF5089E006F11AE /* ExpandedPathToPathTransformer.m */; }; @@ -469,6 +470,8 @@ A25892630CF1F7E800CCCDDF /* StatsWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = StatsWindowController.m; path = macosx/StatsWindowController.m; sourceTree = ""; }; A25892760CF1FCE800CCCDDF /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = macosx/English.lproj/StatsWindow.xib; sourceTree = ""; }; A259316A0A73B2CC002F4FE7 /* TransmissionHelp */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TransmissionHelp; path = macosx/TransmissionHelp; sourceTree = ""; }; + A25AFDE70D1038AD0092A1BA /* MenuLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MenuLabel.h; path = macosx/MenuLabel.h; sourceTree = ""; }; + A25AFDE80D1038AD0092A1BA /* MenuLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MenuLabel.m; path = macosx/MenuLabel.m; sourceTree = ""; }; A25D2CBA0CF4C7190096A262 /* stats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stats.h; path = libtransmission/stats.h; sourceTree = ""; }; A25D2CBB0CF4C7190096A262 /* stats.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = stats.c; path = libtransmission/stats.c; sourceTree = ""; }; A25E74440AF5089E006F11AE /* ExpandedPathToPathTransformer.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = ExpandedPathToPathTransformer.m; path = macosx/ExpandedPathToPathTransformer.m; sourceTree = ""; }; @@ -772,6 +775,8 @@ 4D364D9F091FBB2C00377D12 /* TorrentTableView.m */, 4DCCBB3D09C3D71100D3CABF /* TorrentCell.h */, 4DCCBB3C09C3D71100D3CABF /* TorrentCell.m */, + A25AFDE70D1038AD0092A1BA /* MenuLabel.h */, + A25AFDE80D1038AD0092A1BA /* MenuLabel.m */, A26397530D0F714300D36DF2 /* ActionPopUpButton.h */, A26397540D0F714300D36DF2 /* ActionPopUpButton.m */, A2BF078E0B066E0800757C92 /* SpeedLimitToTurtleIconTransformer.h */, @@ -1718,6 +1723,7 @@ 3C7A11950D0B2EE300B5701F /* getgateway.c in Sources */, 3C7A11960D0B2EE300B5701F /* natpmp.c in Sources */, A26397550D0F714300D36DF2 /* ActionPopUpButton.m in Sources */, + A25AFDE90D1038AD0092A1BA /* MenuLabel.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/macosx/Controller.h b/macosx/Controller.h index 8940ac135..3f2154d8b 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -31,6 +31,7 @@ #import "Badger.h" #import "StatusBarView.h" #import "FilterButton.h" +#import "MenuLabel.h" #import "IPCController.h" #import @@ -62,6 +63,8 @@ IBOutlet StatusBarView * fStatusBar; IBOutlet NSButton * fStatusButton; + IBOutlet MenuLabel * fStatusTigerField; + IBOutlet NSImageView * fStatusTigerImageView; IBOutlet NSTextField * fTotalDLField, * fTotalULField; IBOutlet StatusBarView * fFilterBar; diff --git a/macosx/Controller.m b/macosx/Controller.m index 7badea8b6..2302d90c4 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -290,7 +290,15 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi //set up status bar [fStatusBar setHidden: YES]; - [fStatusBar setShowOnTiger: YES]; + + if (![NSApp isOnLeopardOrBetter]) + { + [fStatusBar setShowOnTiger: YES]; + + [fStatusButton setHidden: YES]; + [fStatusTigerField setHidden: NO]; + [fStatusTigerImageView setHidden: NO]; + } [fTotalDLField setToolTip: NSLocalizedString(@"Total download speed", "Status Bar -> speed tooltip")]; [fTotalULField setToolTip: NSLocalizedString(@"Total upload speed", "Status Bar -> speed tooltip")]; @@ -1475,6 +1483,9 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi [fStatusButton setTitle: statusString]; [fStatusButton sizeToFit]; + [fStatusTigerField setStringValue: statusString]; + [fStatusTigerField sizeToFit]; + //width ends up being too long NSRect statusFrame = [fStatusButton frame]; statusFrame.size.width -= 25.0; diff --git a/macosx/English.lproj/MainMenu.nib/classes.nib b/macosx/English.lproj/MainMenu.nib/classes.nib index e0d015d5d..d71caaf53 100644 --- a/macosx/English.lproj/MainMenu.nib/classes.nib +++ b/macosx/English.lproj/MainMenu.nib/classes.nib @@ -12,6 +12,14 @@ SUPERCLASS NSResponder + + CLASS + MenuLabel + LANGUAGE + ObjC + SUPERCLASS + NSTextField + CLASS NSMenu @@ -193,6 +201,10 @@ StatusBarView fStatusButton NSButton + fStatusTigerField + MenuLabel + fStatusTigerImageView + NSImageView fTableView TorrentTableView fTotalDLField diff --git a/macosx/English.lproj/MainMenu.nib/info.nib b/macosx/English.lproj/MainMenu.nib/info.nib index 7aa895744..ea20e7542 100644 --- a/macosx/English.lproj/MainMenu.nib/info.nib +++ b/macosx/English.lproj/MainMenu.nib/info.nib @@ -10,7 +10,7 @@ 5 IBOpenObjects - 1684 + 1480 IBSystem Version 9B18 diff --git a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib index 99dbdb7ca..cfdb835d1 100644 Binary files a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib and b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/macosx/MenuLabel.h b/macosx/MenuLabel.h new file mode 100644 index 000000000..37939b98b --- /dev/null +++ b/macosx/MenuLabel.h @@ -0,0 +1,30 @@ +/****************************************************************************** + * $Id$ + * + * Copyright (c) 2007 Transmission authors and contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + *****************************************************************************/ + +#import + +@interface MenuLabel : NSTextField +{ +} +@end diff --git a/macosx/MenuLabel.m b/macosx/MenuLabel.m new file mode 100644 index 000000000..ecf7e40e1 --- /dev/null +++ b/macosx/MenuLabel.m @@ -0,0 +1,35 @@ +/****************************************************************************** + * $Id$ + * + * Copyright (c) 2007 Transmission authors and contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + *****************************************************************************/ + +#import "MenuLabel.h" + +@implementation MenuLabel + +- (void) mouseDown: (NSEvent *) event +{ + [NSMenu popUpContextMenu: [self menu] withEvent: event forView: self]; + [super mouseDown: event]; +} + +@end