From: Mitchell Livingston Date: Sat, 8 Sep 2012 20:22:05 +0000 (+0000) Subject: add in placeholder code so thatInfoGeneralView can be localized with a strings file... X-Git-Tag: 2.70~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e139ed0ebd1b649754563d030db6c78d9ce16c06;p=transmission add in placeholder code so thatInfoGeneralView can be localized with a strings file after 2.7 --- diff --git a/macosx/InfoGeneralViewController.h b/macosx/InfoGeneralViewController.h index bc41b6be9..4e1119bab 100644 --- a/macosx/InfoGeneralViewController.h +++ b/macosx/InfoGeneralViewController.h @@ -38,6 +38,14 @@ IBOutlet NSTextView * fCommentView; IBOutlet NSButton * fRevealDataButton; + + //remove when we switch to auto layout on 10.7 + IBOutlet NSTextField * fPiecesLabel, * fHashLabel, * fSecureLabel, + * fCreatorLabel, * fDateCreatedLabel, + * fCommentLabel, + * fDataLocationLabel; + IBOutlet NSTextField * fInfoSectionLabel, * fWhereSectionLabel; + IBOutlet NSScrollView * fCommentScrollView; } - (void) setInfoForTorrents: (NSArray *) torrents; diff --git a/macosx/InfoGeneralViewController.m b/macosx/InfoGeneralViewController.m index 8e5c62abf..aa606ad3c 100644 --- a/macosx/InfoGeneralViewController.m +++ b/macosx/InfoGeneralViewController.m @@ -51,6 +51,51 @@ [super dealloc]; } +#warning uncomment after 2.7 +/*- (void) awakeFromNib +{ + #warning remove when 10.7-only with auto layout + [fInfoSectionLabel sizeToFit]; + [fWhereSectionLabel sizeToFit]; + + NSArray * labels = @[ fPiecesLabel, fHashLabel, fSecureLabel, fCreatorLabel, fDateCreatedLabel, fCommentLabel, fDataLocationLabel ]; + + CGFloat oldMaxWidth = 0.0, newMaxWidth = 0.0; + NSTextField * oldLongestLabel = nil; + for (NSTextField * label in labels) + { + const CGFloat oldWidth = [label bounds].size.width; + if (oldWidth > oldMaxWidth) + { + oldMaxWidth = oldWidth; + oldLongestLabel = label; + } + + [label sizeToFit]; + const CGFloat newWidth = [label bounds].size.width; + if (newWidth > newMaxWidth) + newMaxWidth = newWidth; + } + + for (NSTextField * label in labels) + { + NSRect frame = [label frame]; + frame.origin.x = [oldLongestLabel frame].origin.x; + frame.origin.x += newMaxWidth - frame.size.width; + [label setFrame: frame]; + } + + NSArray * fields = @[ fPiecesField, fHashField, fSecureField, fCreatorField, fDateCreatedField, fCommentScrollView, fDataLocationField ]; + + for (NSView * field in fields) { + const CGFloat widthIncrease = newMaxWidth - oldMaxWidth; + NSRect frame = [field frame]; + frame.origin.x += widthIncrease; + frame.size.width -= widthIncrease; + [field setFrame: frame]; + } +}*/ + - (void) setInfoForTorrents: (NSArray *) torrents { //don't check if it's the same in case the metadata changed diff --git a/macosx/en.lproj/InfoGeneralView.xib b/macosx/en.lproj/InfoGeneralView.xib index 4c08219b9..6f096c949 100644 --- a/macosx/en.lproj/InfoGeneralView.xib +++ b/macosx/en.lproj/InfoGeneralView.xib @@ -2,26 +2,26 @@ 1060 - 11D50 - 2177 - 1138.32 - 568.00 + 12B19 + 2549 + 1187 + 624.00 com.apple.InterfaceBuilder.CocoaPlugin - 2177 + 2549 - NSTextField + NSBox + NSButton + NSButtonCell NSCustomObject - NSScrollView - NSTextFieldCell - NSScroller NSCustomView - NSButtonCell NSDateFormatter - NSButton + NSScrollView + NSScroller + NSTextField + NSTextFieldCell NSTextView - NSBox com.apple.InterfaceBuilder.CocoaPlugin @@ -50,9 +50,10 @@ {{37, 176}, {41, 14}} + YES - 67239424 + 67108864 71303168 Pieces: @@ -80,6 +81,7 @@ + NO @@ -87,9 +89,10 @@ {{79, 176}, {261, 14}} + YES - 67239488 + 67108928 272631808 @@ -98,6 +101,7 @@ + NO @@ -105,9 +109,10 @@ {{10, 43}, {330, 5}} + {0, 0} - 67239424 + 67108864 0 Box @@ -140,9 +145,10 @@ {{9, 189}, {118, 17}} + YES - 67239424 + 67108864 272629760 Torrent Information @@ -154,6 +160,7 @@ + NO @@ -161,9 +168,10 @@ {{35, 144}, {43, 14}} + YES - 67239424 + 67108864 71303168 Secure: @@ -171,6 +179,7 @@ + NO @@ -178,9 +187,10 @@ {{79, 144}, {261, 14}} + YES - 67239488 + 67108928 272631808 @@ -189,6 +199,7 @@ + NO @@ -196,9 +207,10 @@ {{24, 10}, {54, 14}} + YES - 67239424 + 67108864 71303168 Data File: @@ -206,6 +218,7 @@ + NO @@ -213,9 +226,10 @@ {{79, 10}, {242, 14}} + YES - 69336641 + 69206081 272632320 @@ -224,6 +238,7 @@ + NO @@ -231,9 +246,10 @@ {{9, 23}, {40, 17}} + YES - 67239424 + 67108864 272629760 Where @@ -241,6 +257,7 @@ + NO @@ -248,9 +265,10 @@ {{326, 10}, {14, 14}} + YES - 67239424 + 67108864 134217728 RevealDataFile @@ -259,7 +277,7 @@ 2843 - 138690815 + 138690560 134 NSImage @@ -274,6 +292,7 @@ 400 75 + NO @@ -281,9 +300,10 @@ {{30, 128}, {48, 14}} + YES - 67239424 + 67108864 71303168 Creator: @@ -291,6 +311,7 @@ + NO @@ -298,9 +319,10 @@ {{79, 128}, {261, 14}} + YES - 69336641 + 69206081 272631808 @@ -309,6 +331,7 @@ + NO @@ -316,9 +339,10 @@ {{10, 112}, {68, 14}} + YES - 67239424 + 67108864 71303168 Created On: @@ -326,6 +350,7 @@ + NO @@ -333,9 +358,10 @@ {{79, 112}, {261, 14}} + YES - 67239488 + 67108928 272631808 @@ -352,6 +378,7 @@ + NO @@ -359,9 +386,10 @@ {{18, 96}, {60, 14}} + YES - 67239424 + 67108864 71303168 Comment: @@ -369,6 +397,7 @@ + NO @@ -376,9 +405,10 @@ {{43, 160}, {35, 14}} + YES - 67239424 + 67108864 71303168 Hash: @@ -386,6 +416,7 @@ + NO @@ -393,9 +424,10 @@ {{79, 160}, {261, 14}} + YES - 69336641 + 69206081 272631808 @@ -404,6 +436,7 @@ + NO @@ -416,9 +449,10 @@ 2322 - {259, 14} + {259, 56} + @@ -430,7 +464,7 @@ - 6 + 38 @@ -470,7 +504,6 @@ 6 {509, 10000000} - {87, 0} @@ -509,9 +542,11 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA 256 - {{249, 1}, {11, 56}} + {{246, 1}, {14, 56}} + + NO 256 _doScroller: @@ -523,6 +558,8 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA {{-100, -100}, {87, 18}} + + NO 257 _doScroller: @@ -533,16 +570,20 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA {{79, 51}, {261, 58}} - + 133138 + 0.25 + 4 + 1 {350, 211} + NSView @@ -631,6 +672,86 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA 51 + + + fInfoSectionLabel + + + + 52 + + + + fWhereSectionLabel + + + + 53 + + + + fPiecesLabel + + + + 54 + + + + fHashLabel + + + + 55 + + + + fSecureLabel + + + + 56 + + + + fCreatorLabel + + + + 57 + + + + fDateCreatedLabel + + + + 58 + + + + fCommentLabel + + + + 59 + + + + fDataLocationLabel + + + + 60 + + + + fCommentScrollView + + + + 61 + @@ -990,7 +1111,7 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA - 51 + 61 @@ -998,16 +1119,34 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA InfoGeneralViewController NSViewController + NSTextField + NSScrollView NSTextView NSTextField + NSTextField NSTextField + NSTextField NSTextField + NSTextField NSTextField + NSTextField + NSTextField NSTextField + NSTextField NSButton NSTextField + NSTextField + NSTextField + + fCommentLabel + NSTextField + + + fCommentScrollView + NSScrollView + fCommentView NSTextView @@ -1016,22 +1155,46 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA fCreatorField NSTextField + + fCreatorLabel + NSTextField + fDataLocationField NSTextField + + fDataLocationLabel + NSTextField + fDateCreatedField NSTextField + + fDateCreatedLabel + NSTextField + fHashField NSTextField + + fHashLabel + NSTextField + + + fInfoSectionLabel + NSTextField + fPiecesField NSTextField + + fPiecesLabel + NSTextField + fRevealDataButton NSButton @@ -1040,6 +1203,14 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA fSecureField NSTextField + + fSecureLabel + NSTextField + + + fWhereSectionLabel + NSTextField + IBProjectSource @@ -1064,7 +1235,7 @@ AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA com.apple.InterfaceBuilder.CocoaPlugin.macosx - + YES 3