Changeset 5258


Ignore:
Timestamp:
Mar 16, 2008, 6:20:35 AM (14 years ago)
Author:
livings124
Message:

use a single xib file for all Stats window localizations

Location:
trunk
Files:
1 added
6 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r5255 r5258  
    9393                A232D29E0A70903E00973B12 /* Filter.png in Resources */ = {isa = PBXBuildFile; fileRef = A232D29D0A70903E00973B12 /* Filter.png */; };
    9494                A233BD330D8C6585007EE7B4 /* MessageWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A233BD320D8C6585007EE7B4 /* MessageWindow.xib */; };
     95                A233BD690D8CF2C7007EE7B4 /* StatsWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A233BD680D8CF2C7007EE7B4 /* StatsWindow.xib */; };
    9596                A234D0D20C79FB3600A82373 /* NSMenuAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A234D0D00C79FB3600A82373 /* NSMenuAdditions.m */; };
    9697                A2385DD40BFE06C800B24EF6 /* DragOverlayWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = A2385DD20BFE06C800B24EF6 /* DragOverlayWindow.m */; };
     
    111112                A257C1820CAD3003004E121C /* PeerTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = A257C1800CAD3003004E121C /* PeerTableView.m */; };
    112113                A25892640CF1F7E800CCCDDF /* StatsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A25892630CF1F7E800CCCDDF /* StatsWindowController.m */; };
    113                 A25892770CF1FCE800CCCDDF /* StatsWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A25892750CF1FCE800CCCDDF /* StatsWindow.xib */; };
    114114                A259317E0A73B2CC002F4FE7 /* TransmissionHelp in Resources */ = {isa = PBXBuildFile; fileRef = A259316A0A73B2CC002F4FE7 /* TransmissionHelp */; };
    115115                A25AFDE90D1038AD0092A1BA /* MenuLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = A25AFDE80D1038AD0092A1BA /* MenuLabel.m */; };
     
    457457                A223AA810D220CEB00840069 /* nl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nl; path = macosx/nl.lproj/MainMenu.xib; sourceTree = "<group>"; };
    458458                A223AA830D220CEB00840069 /* nl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nl; path = macosx/nl.lproj/PrefsWindow.xib; sourceTree = "<group>"; };
    459                 A223AA840D220CEB00840069 /* nl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = nl; path = macosx/nl.lproj/StatsWindow.xib; sourceTree = "<group>"; };
    460459                A223AAB60D22ECE800840069 /* it */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = it; path = macosx/it.lproj/Creator.xib; sourceTree = "<group>"; };
    461460                A223AAB70D22ECE800840069 /* it */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = it; path = macosx/it.lproj/InfoWindow.xib; sourceTree = "<group>"; };
    462461                A223AAB80D22ECE800840069 /* it */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = it; path = macosx/it.lproj/MainMenu.xib; sourceTree = "<group>"; };
    463462                A223AABA0D22ECE800840069 /* it */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = it; path = macosx/it.lproj/PrefsWindow.xib; sourceTree = "<group>"; };
    464                 A223AABB0D22ECE800840069 /* it */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = it; path = macosx/it.lproj/StatsWindow.xib; sourceTree = "<group>"; };
    465463                A2265F3F0B5EF5F40093DDA5 /* FileNameCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FileNameCell.h; path = macosx/FileNameCell.h; sourceTree = "<group>"; };
    466464                A2265F400B5EF5F40093DDA5 /* FileNameCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = FileNameCell.m; path = macosx/FileNameCell.m; sourceTree = "<group>"; };
     
    470468                A232D29D0A70903E00973B12 /* Filter.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Filter.png; path = macosx/Images/Filter.png; sourceTree = "<group>"; };
    471469                A233BD320D8C6585007EE7B4 /* MessageWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MessageWindow.xib; path = macosx/MessageWindow.xib; sourceTree = "<group>"; };
     470                A233BD680D8CF2C7007EE7B4 /* StatsWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = StatsWindow.xib; path = macosx/StatsWindow.xib; sourceTree = "<group>"; };
    472471                A234D0CF0C79FB3600A82373 /* NSMenuAdditions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = NSMenuAdditions.h; path = macosx/NSMenuAdditions.h; sourceTree = "<group>"; };
    473472                A234D0D00C79FB3600A82373 /* NSMenuAdditions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = NSMenuAdditions.m; path = macosx/NSMenuAdditions.m; sourceTree = "<group>"; };
     
    495494                A25892620CF1F7E800CCCDDF /* StatsWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StatsWindowController.h; path = macosx/StatsWindowController.h; sourceTree = "<group>"; };
    496495                A25892630CF1F7E800CCCDDF /* StatsWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = StatsWindowController.m; path = macosx/StatsWindowController.m; sourceTree = "<group>"; };
    497                 A25892760CF1FCE800CCCDDF /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = macosx/English.lproj/StatsWindow.xib; sourceTree = "<group>"; };
    498496                A259316A0A73B2CC002F4FE7 /* TransmissionHelp */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TransmissionHelp; path = macosx/TransmissionHelp; sourceTree = "<group>"; };
    499497                A25AFDE70D1038AD0092A1BA /* MenuLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MenuLabel.h; path = macosx/MenuLabel.h; sourceTree = "<group>"; };
     
    523521                A265A3300D25767700198AC8 /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = macosx/fr.lproj/MainMenu.xib; sourceTree = "<group>"; };
    524522                A265A3320D25767700198AC8 /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = macosx/fr.lproj/PrefsWindow.xib; sourceTree = "<group>"; };
    525                 A265A3330D25767700198AC8 /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = macosx/fr.lproj/StatsWindow.xib; sourceTree = "<group>"; };
    526523                A265A3BE0D25AE7800198AC8 /* es */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = es; path = macosx/es.lproj/Creator.xib; sourceTree = "<group>"; };
    527524                A265A3BF0D25AE7800198AC8 /* es */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = es; path = macosx/es.lproj/InfoWindow.xib; sourceTree = "<group>"; };
    528525                A265A3C00D25AE7800198AC8 /* es */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = es; path = macosx/es.lproj/MainMenu.xib; sourceTree = "<group>"; };
    529526                A265A3C20D25AE7800198AC8 /* es */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = es; path = macosx/es.lproj/PrefsWindow.xib; sourceTree = "<group>"; };
    530                 A265A3C30D25AE7800198AC8 /* es */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = es; path = macosx/es.lproj/StatsWindow.xib; sourceTree = "<group>"; };
    531527                A26AF1040D2855FC00FF7140 /* ru */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ru; path = macosx/ru.lproj/Creator.xib; sourceTree = "<group>"; };
    532528                A26AF1050D2855FC00FF7140 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = macosx/ru.lproj/InfoPlist.strings; sourceTree = "<group>"; };
     
    535531                A26AF1080D2855FC00FF7140 /* ru */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ru; path = macosx/ru.lproj/MainMenu.xib; sourceTree = "<group>"; };
    536532                A26AF10A0D2855FC00FF7140 /* ru */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ru; path = macosx/ru.lproj/PrefsWindow.xib; sourceTree = "<group>"; };
    537                 A26AF10B0D2855FC00FF7140 /* ru */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ru; path = macosx/ru.lproj/StatsWindow.xib; sourceTree = "<group>"; };
    538533                A26AF2180D2DA35A00FF7140 /* FileOutlineController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileOutlineController.h; path = macosx/FileOutlineController.h; sourceTree = "<group>"; };
    539534                A26AF2190D2DA35A00FF7140 /* FileOutlineController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FileOutlineController.m; path = macosx/FileOutlineController.m; sourceTree = "<group>"; };
     
    909904                                A29576110D11D8DD0093B167 /* InfoWindow.xib */,
    910905                                A29576010D11D63C0093B167 /* Creator.xib */,
    911                                 A25892750CF1FCE800CCCDDF /* StatsWindow.xib */,
    912906                                A26AF27C0D2DBDDF00FF7140 /* AddWindow.xib */,
    913907                                A233BD320D8C6585007EE7B4 /* MessageWindow.xib */,
     908                                A233BD680D8CF2C7007EE7B4 /* StatsWindow.xib */,
    914909                                A22180B50D148F0F007D09ED /* GroupsWindow.xib */,
    915910                                A231274B0D11D0B7003F9AFF /* AboutWindow.xib */,
     
    16321627                                A2F151250CD438DE001F3B0E /* InfoTabBack.png in Resources */,
    16331628                                A2F151260CD438DE001F3B0E /* InfoTabBackBlue.png in Resources */,
    1634                                 A25892770CF1FCE800CCCDDF /* StatsWindow.xib in Resources */,
    16351629                                A22D3AA60D00D1790079CFED /* Turtle.png in Resources */,
    16361630                                A22D3AA70D00D1790079CFED /* TurtleBlue.png in Resources */,
     
    16641658                                A2012AE20D77151D0056FD71 /* YingYangGroupTemplate.png in Resources */,
    16651659                                A233BD330D8C6585007EE7B4 /* MessageWindow.xib in Resources */,
     1660                                A233BD690D8CF2C7007EE7B4 /* StatsWindow.xib in Resources */,
    16661661                        );
    16671662                        runOnlyForDeploymentPostprocessing = 0;
     
    19861981                        sourceTree = "<group>";
    19871982                };
    1988                 A25892750CF1FCE800CCCDDF /* StatsWindow.xib */ = {
    1989                         isa = PBXVariantGroup;
    1990                         children = (
    1991                                 A25892760CF1FCE800CCCDDF /* English */,
    1992                                 A223AA840D220CEB00840069 /* nl */,
    1993                                 A223AABB0D22ECE800840069 /* it */,
    1994                                 A265A3330D25767700198AC8 /* fr */,
    1995                                 A265A3C30D25AE7800198AC8 /* es */,
    1996                                 A26AF10B0D2855FC00FF7140 /* ru */,
    1997                         );
    1998                         name = StatsWindow.xib;
    1999                         sourceTree = "<group>";
    2000                 };
    20011983                A26AF27C0D2DBDDF00FF7140 /* AddWindow.xib */ = {
    20021984                        isa = PBXVariantGroup;
  • trunk/macosx/StatsWindowController.h

    r4423 r5258  
    2929{
    3030    IBOutlet NSTextField * fUploadedField, * fUploadedAllField, * fDownloadedField, * fDownloadedAllField,
    31                         * fRatioField, * fRatioAllField, * fTimeField, * fTimeAllField, * fNumOpenedField;
     31                        * fRatioField, * fRatioAllField, * fTimeField, * fTimeAllField, * fNumOpenedField,
     32                        * fUploadedLabelField, * fDownloadedLabelField, * fRatioLabelField, * fTimeLabelField, * fNumOpenedLabelField;
    3233    NSTimer * fTimer;
    3334}
  • trunk/macosx/StatsWindowController.m

    r5091 r5258  
    5858    [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSModalPanelRunLoopMode];
    5959    [[NSRunLoop currentRunLoop] addTimer: fTimer forMode: NSEventTrackingRunLoopMode];
     60   
     61    //set label text
     62    [fUploadedLabelField setStringValue: NSLocalizedString(@"Uploaded:", "Stats window -> label")];
     63    [fDownloadedLabelField setStringValue: NSLocalizedString(@"Downloaded:", "Stats window -> label")];
     64    [fRatioLabelField setStringValue: NSLocalizedString(@"Ratio:", "Stats window -> label")];
     65    [fTimeLabelField setStringValue: NSLocalizedString(@"Running Time:", "Stats window -> label")];
     66    [fNumOpenedLabelField setStringValue: NSLocalizedString(@"Program Started:", "Stats window -> label")];
     67   
     68    //size all elements
     69    float oldWidth = [fUploadedLabelField frame].size.width;
     70   
     71    [fUploadedLabelField sizeToFit];
     72    [fDownloadedLabelField sizeToFit];
     73    [fRatioLabelField sizeToFit];
     74    [fTimeLabelField sizeToFit];
     75    [fNumOpenedLabelField sizeToFit];
     76   
     77    float maxWidth = MAX([fUploadedLabelField frame].size.width, [fDownloadedLabelField frame].size.width);
     78    maxWidth = MAX(maxWidth, [fRatioLabelField frame].size.width);
     79    maxWidth = MAX(maxWidth, [fTimeLabelField frame].size.width);
     80    maxWidth = MAX(maxWidth, [fNumOpenedLabelField frame].size.width);
     81   
     82    NSRect frame = [fUploadedLabelField frame];
     83    frame.size.width = maxWidth;
     84    [fUploadedLabelField setFrame: frame];
     85   
     86    frame = [fDownloadedLabelField frame];
     87    frame.size.width = maxWidth;
     88    [fDownloadedLabelField setFrame: frame];
     89   
     90    frame = [fRatioLabelField frame];
     91    frame.size.width = maxWidth;
     92    [fRatioLabelField setFrame: frame];
     93   
     94    frame = [fTimeLabelField frame];
     95    frame.size.width = maxWidth;
     96    [fTimeLabelField setFrame: frame];
     97   
     98    frame = [fNumOpenedLabelField frame];
     99    frame.size.width = maxWidth;
     100    [fNumOpenedLabelField setFrame: frame];
     101   
     102    //size fields to correspond with labels
     103    float change = maxWidth - oldWidth;
     104   
     105    frame = [fUploadedField frame];
     106    frame.size.width -= change;
     107    frame.origin.x += change;
     108    [fUploadedField setFrame: frame];
     109   
     110    frame = [fUploadedAllField frame];
     111    frame.size.width -= change;
     112    frame.origin.x += change;
     113    [fUploadedAllField setFrame: frame];
     114   
     115    frame = [fDownloadedField frame];
     116    frame.size.width -= change;
     117    frame.origin.x += change;
     118    [fDownloadedField setFrame: frame];
     119   
     120    frame = [fDownloadedAllField frame];
     121    frame.size.width -= change;
     122    frame.origin.x += change;
     123    [fDownloadedAllField setFrame: frame];
     124   
     125    frame = [fRatioField frame];
     126    frame.size.width -= change;
     127    frame.origin.x += change;
     128    [fRatioField setFrame: frame];
     129   
     130    frame = [fRatioAllField frame];
     131    frame.size.width -= change;
     132    frame.origin.x += change;
     133    [fRatioAllField setFrame: frame];
     134   
     135    frame = [fTimeField frame];
     136    frame.size.width -= change;
     137    frame.origin.x += change;
     138    [fTimeField setFrame: frame];
     139   
     140    frame = [fTimeAllField frame];
     141    frame.size.width -= change;
     142    frame.origin.x += change;
     143    [fTimeAllField setFrame: frame];
     144   
     145    frame = [fNumOpenedField frame];
     146    frame.size.width -= change;
     147    frame.origin.x += change;
     148    [fNumOpenedField setFrame: frame];
    60149}
    61150
Note: See TracChangeset for help on using the changeset viewer.