Adium

Changeset 25554

Show
Ignore:
Timestamp:
11/09/2008 12:28:30 PM (2 months ago)
Author:
zacw
Message:

Patch from wixardy to make the about box scrollable. Fixes #9967.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Adium.xcodeproj/project.pbxproj

    r25539 r25554  
    11531153                4F1CB6420D640DA40073A1E6 /* info_segment.png in Resources */ = {isa = PBXBuildFile; fileRef = 4F1CB63E0D640DA40073A1E6 /* info_segment.png */; }; 
    11541154                4F1CB64C0D640F4F0073A1E6 /* ContactInfoInspector.nib in Resources */ = {isa = PBXBuildFile; fileRef = 4F1CB64B0D640F4F0073A1E6 /* ContactInfoInspector.nib */; }; 
     1155                5A1781860EC1215D00BA1E04 /* AIAutoScrollTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A1781850EC1215D00BA1E04 /* AIAutoScrollTextView.m */; }; 
    11551156                63093C2F0892143500F118D3 /* newContentThreeDigits.png in Resources */ = {isa = PBXBuildFile; fileRef = 63093C2D0892143500F118D3 /* newContentThreeDigits.png */; }; 
    11561157                63093C300892143500F118D3 /* newContentTwoDigits.png in Resources */ = {isa = PBXBuildFile; fileRef = 63093C2E0892143500F118D3 /* newContentTwoDigits.png */; }; 
     
    41114112                4F1CB63E0D640DA40073A1E6 /* info_segment.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = info_segment.png; path = Resources/info_segment.png; sourceTree = "<group>"; }; 
    41124113                4F1CB64B0D640F4F0073A1E6 /* ContactInfoInspector.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ContactInfoInspector.nib; path = Resources/ContactInfoInspector.nib; sourceTree = "<group>"; }; 
     4114                5A1781840EC1215D00BA1E04 /* AIAutoScrollTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIAutoScrollTextView.h; path = Source/AIAutoScrollTextView.h; sourceTree = "<group>"; }; 
     4115                5A1781850EC1215D00BA1E04 /* AIAutoScrollTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIAutoScrollTextView.m; path = Source/AIAutoScrollTextView.m; sourceTree = "<group>"; }; 
    41134116                63093C2D0892143500F118D3 /* newContentThreeDigits.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = newContentThreeDigits.png; sourceTree = "<group>"; }; 
    41144117                63093C2E0892143500F118D3 /* newContentTwoDigits.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = newContentTwoDigits.png; sourceTree = "<group>"; }; 
     
    76127615                        isa = PBXGroup; 
    76137616                        children = ( 
     7617                                5A1781840EC1215D00BA1E04 /* AIAutoScrollTextView.h */, 
     7618                                5A1781850EC1215D00BA1E04 /* AIAutoScrollTextView.m */, 
    76147619                                D3DA2E40052E65E400A8010B /* LNAboutBoxController.h */, 
    76157620                                D3DA2E3E052E65DE00A8010B /* LNAboutBoxController.m */, 
     
    97809785                                111DDF3A0E8E7D2F00114FCA /* AIAutomaticStatus.m in Sources */, 
    97819786                                632ADC150E9EDDCA00AB6817 /* PTKeyCodeTranslator.m in Sources */, 
     9787                                5A1781860EC1215D00BA1E04 /* AIAutoScrollTextView.m in Sources */, 
    97829788                        ); 
    97839789                        runOnlyForDeploymentPostprocessing = 0; 
  • trunk/Resources/AboutBox.nib/classes.nib

    r8554 r25554  
    1 
    2     IBClasses = ( 
    3         {CLASS = AILinkTextView; LANGUAGE = ObjC; SUPERCLASS = NSTextView; },  
    4         { 
    5             CLASS = AILocalizationButton;  
    6             LANGUAGE = ObjC;  
    7             OUTLETS = { 
    8                 "view_anchorToLeftSide" = NSView;  
    9                 "view_anchorToRightSide" = NSView;  
    10                 "window_anchorOnLeftSide" = NSWindow;  
    11                 "window_anchorOnRightSide" = NSWindow;  
    12             };  
    13             SUPERCLASS = NSButton;  
    14         },  
    15         { 
    16             CLASS = AILocalizationTextField;  
    17             LANGUAGE = ObjC;  
    18             OUTLETS = { 
    19                 "view_anchorToLeftSide" = NSView;  
    20                 "view_anchorToRightSide" = NSView;  
    21                 "window_anchorOnLeftSide" = NSWindow;  
    22                 "window_anchorOnRightSide" = NSWindow;  
    23             };  
    24             SUPERCLASS = NSTextField;  
    25         },  
    26         { 
    27             CLASS = AIWindowController;  
    28             LANGUAGE = ObjC;  
    29             SUPERCLASS = NSWindowController;  
    30         },  
    31         {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },  
    32         { 
    33             ACTIONS = { 
    34                 adiumDuckClicked = id;  
    35                 buildFieldClicked = id;  
    36                 closeWindow = id;  
    37                 hideLicense = id;  
    38                 showLicense = id;  
    39                 visitHomepage = id;  
    40             };  
    41             CLASS = LNAboutBoxController;  
    42             LANGUAGE = ObjC;  
    43             OUTLETS = { 
    44                 "button_buildButton" = NSButton;  
    45                 "button_duckIcon" = NSButton;  
    46                 "button_homepage" = NSButton;  
    47                 "button_license" = NSButton;  
    48                 "panel_licenseSheet" = NSPanel;  
    49                 "textField_version" = NSTextField;  
    50                 "textView_credits" = NSTextView;  
    51                 "textView_license" = NSTextView;  
    52             };  
    53             SUPERCLASS = AIWindowController;  
    54         } 
    55     );  
    56     IBVersion = 1;  
    57 
     1<?xml version="1.0" encoding="UTF-8"?> 
     2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
     3<plist version="1.0"> 
     4<dict> 
     5        <key>IBClasses</key> 
     6        <array> 
     7                <dict> 
     8                        <key>CLASS</key> 
     9                        <string>RBSplitView</string> 
     10                        <key>LANGUAGE</key> 
     11                        <string>ObjC</string> 
     12                        <key>OUTLETS</key> 
     13                        <dict> 
     14                                <key>delegate</key> 
     15                                <string>id</string> 
     16                        </dict> 
     17                        <key>SUPERCLASS</key> 
     18                        <string>RBSplitSubview</string> 
     19                </dict> 
     20                <dict> 
     21                        <key>CLASS</key> 
     22                        <string>NSTextField</string> 
     23                        <key>LANGUAGE</key> 
     24                        <string>ObjC</string> 
     25                        <key>SUPERCLASS</key> 
     26                        <string>NSControl</string> 
     27                </dict> 
     28                <dict> 
     29                        <key>CLASS</key> 
     30                        <string>RBSplitSubview</string> 
     31                        <key>LANGUAGE</key> 
     32                        <string>ObjC</string> 
     33                        <key>SUPERCLASS</key> 
     34                        <string>NSView</string> 
     35                </dict> 
     36                <dict> 
     37                        <key>CLASS</key> 
     38                        <string>NSWindowController</string> 
     39                        <key>LANGUAGE</key> 
     40                        <string>ObjC</string> 
     41                        <key>SUPERCLASS</key> 
     42                        <string>NSResponder</string> 
     43                </dict> 
     44                <dict> 
     45                        <key>ACTIONS</key> 
     46                        <dict> 
     47                                <key>adiumPrint</key> 
     48                                <string>id</string> 
     49                                <key>didAdjustSubviews</key> 
     50                                <string>RBSplitView</string> 
     51                                <key>prefsWindowWillClose</key> 
     52                                <string>SS_PrefsController</string> 
     53                                <key>toggleFindPanel</key> 
     54                                <string>id</string> 
     55                                <key>willAdjustSubviews</key> 
     56                                <string>RBSplitView</string> 
     57                        </dict> 
     58                        <key>CLASS</key> 
     59                        <string>NSObject</string> 
     60                        <key>LANGUAGE</key> 
     61                        <string>ObjC</string> 
     62                </dict> 
     63                <dict> 
     64                        <key>CLASS</key> 
     65                        <string>AILocalizationButton</string> 
     66                        <key>LANGUAGE</key> 
     67                        <string>ObjC</string> 
     68                        <key>OUTLETS</key> 
     69                        <dict> 
     70                                <key>view_anchorToLeftSide</key> 
     71                                <string>NSView</string> 
     72                                <key>view_anchorToRightSide</key> 
     73                                <string>NSView</string> 
     74                                <key>window_anchorOnLeftSide</key> 
     75                                <string>NSWindow</string> 
     76                                <key>window_anchorOnRightSide</key> 
     77                                <string>NSWindow</string> 
     78                        </dict> 
     79                        <key>SUPERCLASS</key> 
     80                        <string>NSButton</string> 
     81                </dict> 
     82                <dict> 
     83                        <key>CLASS</key> 
     84                        <string>NSWindow</string> 
     85                        <key>LANGUAGE</key> 
     86                        <string>ObjC</string> 
     87                        <key>SUPERCLASS</key> 
     88                        <string>NSResponder</string> 
     89                </dict> 
     90                <dict> 
     91                        <key>CLASS</key> 
     92                        <string>FirstResponder</string> 
     93                        <key>LANGUAGE</key> 
     94                        <string>ObjC</string> 
     95                        <key>SUPERCLASS</key> 
     96                        <string>NSObject</string> 
     97                </dict> 
     98                <dict> 
     99                        <key>CLASS</key> 
     100                        <string>NSButton</string> 
     101                        <key>LANGUAGE</key> 
     102                        <string>ObjC</string> 
     103                        <key>SUPERCLASS</key> 
     104                        <string>NSControl</string> 
     105                </dict> 
     106                <dict> 
     107                        <key>ACTIONS</key> 
     108                        <dict> 
     109                                <key>closeWindow</key> 
     110                                <string>id</string> 
     111                        </dict> 
     112                        <key>CLASS</key> 
     113                        <string>AIWindowController</string> 
     114                        <key>LANGUAGE</key> 
     115                        <string>ObjC</string> 
     116                        <key>SUPERCLASS</key> 
     117                        <string>NSWindowController</string> 
     118                </dict> 
     119                <dict> 
     120                        <key>ACTIONS</key> 
     121                        <dict> 
     122                                <key>adiumDuckClicked</key> 
     123                                <string>id</string> 
     124                                <key>buildFieldClicked</key> 
     125                                <string>id</string> 
     126                                <key>closeWindow</key> 
     127                                <string>id</string> 
     128                                <key>hideLicense</key> 
     129                                <string>id</string> 
     130                                <key>showLicense</key> 
     131                                <string>id</string> 
     132                                <key>visitHomepage</key> 
     133                                <string>id</string> 
     134                        </dict> 
     135                        <key>CLASS</key> 
     136                        <string>LNAboutBoxController</string> 
     137                        <key>LANGUAGE</key> 
     138                        <string>ObjC</string> 
     139                        <key>OUTLETS</key> 
     140                        <dict> 
     141                                <key>button_buildButton</key> 
     142                                <string>NSButton</string> 
     143                                <key>button_duckIcon</key> 
     144                                <string>NSButton</string> 
     145                                <key>button_homepage</key> 
     146                                <string>NSButton</string> 
     147                                <key>button_license</key> 
     148                                <string>NSButton</string> 
     149                                <key>panel_licenseSheet</key> 
     150                                <string>NSPanel</string> 
     151                                <key>textField_version</key> 
     152                                <string>NSTextField</string> 
     153                                <key>textView_credits</key> 
     154                                <string>AIAutoScrollTextView</string> 
     155                                <key>textView_license</key> 
     156                                <string>NSTextView</string> 
     157                        </dict> 
     158                        <key>SUPERCLASS</key> 
     159                        <string>AIWindowController</string> 
     160                </dict> 
     161                <dict> 
     162                        <key>CLASS</key> 
     163                        <string>NSButtonCell</string> 
     164                        <key>LANGUAGE</key> 
     165                        <string>ObjC</string> 
     166                        <key>SUPERCLASS</key> 
     167                        <string>NSActionCell</string> 
     168                </dict> 
     169                <dict> 
     170                        <key>CLASS</key> 
     171                        <string>SS_PrefsController</string> 
     172                        <key>LANGUAGE</key> 
     173                        <string>ObjC</string> 
     174                        <key>OUTLETS</key> 
     175                        <dict> 
     176                                <key>delegate</key> 
     177                                <string>id</string> 
     178                        </dict> 
     179                        <key>SUPERCLASS</key> 
     180                        <string>NSObject</string> 
     181                </dict> 
     182                <dict> 
     183                        <key>CLASS</key> 
     184                        <string>AIAutoScrollTextView</string> 
     185                        <key>LANGUAGE</key> 
     186                        <string>ObjC</string> 
     187                        <key>SUPERCLASS</key> 
     188                        <string>NSTextView</string> 
     189                </dict> 
     190        </array> 
     191        <key>IBVersion</key> 
     192        <string>1</string> 
     193</dict> 
     194</plist> 
  • trunk/Resources/AboutBox.nib/info.nib

    r19022 r25554  
    11<?xml version="1.0" encoding="UTF-8"?> 
    2 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
     2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
    33<plist version="1.0"> 
    44<dict> 
    5         <key>IBDocumentLocation</key> 
    6         <string>69 56 356 240 0 0 1280 832 </string> 
    75        <key>IBFramework Version</key> 
    8         <string>446.1</string> 
     6        <string>672</string> 
     7        <key>IBOldestOS</key> 
     8        <integer>5</integer> 
    99        <key>IBOpenObjects</key> 
    1010        <array> 
    11                 <integer>5</integer> 
     11                <integer>6</integer> 
    1212        </array> 
    1313        <key>IBSystem Version</key> 
    14         <string>8L127</string> 
    15         <key>IBUsesTextArchiving</key> 
    16         <true/
     14        <string>9F33</string> 
     15        <key>targetFramework</key> 
     16        <string>IBCocoaFramework</string
    1717</dict> 
    1818</plist> 
  • trunk/Source/LNAboutBoxController.h

    r24691 r25554  
    1616 
    1717#import <Adium/AIWindowController.h> 
     18#import "AIAutoScrollTextView.h" 
    1819 
    1920@interface LNAboutBoxController : AIWindowController { 
     
    2122        IBOutlet        NSTextView      *textView_license; 
    2223         
    23     IBOutlet   NSButton       *button_duckIcon; 
    24     IBOutlet   NSButton       *button_buildButton; 
    25         IBOutlet        NSButton        *button_homepage; 
    26         IBOutlet        NSButton        *button_license; 
    27     IBOutlet   NSTextField    *textField_version; 
    28     IBOutlet   NSTextView     *textView_credits; 
     24       IBOutlet        NSButton                               *button_duckIcon; 
     25       IBOutlet        NSButton                               *button_buildButton; 
     26        IBOutlet        NSButton                               *button_homepage; 
     27        IBOutlet        NSButton                               *button_license; 
     28       IBOutlet        NSTextField                            *textField_version; 
     29       IBOutlet        AIAutoScrollTextView   *textView_credits; 
    2930 
    3031        //Version and duck clicking 
    3132    NSInteger                                           numberOfDuckClicks, numberOfBuildFieldClicks; 
    32      
    33         //Scrolling 
    34     NSTimer                                     *scrollTimer; 
    35         NSTimer                                 *eventLoopScrollTimer; 
    36     CGFloat                                     scrollLocation; 
    37     NSInteger                                           maxScroll; 
    38     CGFloat                     scrollRate; 
    3933} 
    4034 
  • trunk/Source/LNAboutBoxController.m

    r25481 r25554  
    2626#define ABOUT_BOX_NIB           @"AboutBox" 
    2727#define ADIUM_SITE_LINK         AILocalizedString(@"http://www.adiumx.com/","Adium homepage. Only localize if a translated version of the page exists.") 
    28  
    29 #define ABOUT_SCROLL_FPS        30.0 
    30 #define ABOUT_SCROLL_RATE       1.0 
    3128 
    3229@interface LNAboutBoxController () 
     
    6663    creditsString = [[[NSAttributedString alloc] initWithPath:[[NSBundle mainBundle] pathForResource:@"Credits" ofType:@"rtf"] 
    6764                                                                                   documentAttributes:nil] autorelease]; 
    68     [[textView_credits textStorage] setAttributedString:creditsString]; 
    69     [[textView_credits enclosingScrollView] setLineScroll:0.0]; 
    70     [[textView_credits enclosingScrollView] setPageScroll:0.0]; 
    71         [[textView_credits enclosingScrollView] setVerticalScroller:nil]; 
    72      
    73     //Start scrolling     
    74     scrollLocation = 0;  
    75     scrollRate = ABOUT_SCROLL_RATE; 
    76     maxScroll = [[textView_credits textStorage] size].height - [[textView_credits enclosingScrollView] documentVisibleRect].size.height; 
    77     scrollTimer = [[NSTimer scheduledTimerWithTimeInterval:(1.0/ABOUT_SCROLL_FPS) 
    78                                                                                                         target:self 
    79                                                                                                   selector:@selector(scrollTimer:) 
    80                                                                                                   userInfo:nil 
    81                                                                                                    repeats:YES] retain]; 
    82         eventLoopScrollTimer = [[NSTimer timerWithTimeInterval:(1.0/ABOUT_SCROLL_FPS) 
    83                                                                                                    target:self 
    84                                                                                                  selector:@selector(scrollTimer:) 
    85                                                                                                  userInfo:nil 
    86                                                                                                   repeats:YES] retain]; 
    87     [[NSRunLoop currentRunLoop] addTimer:eventLoopScrollTimer forMode:NSEventTrackingRunLoopMode]; 
     65        [textView_credits loadText:creditsString]; 
    8866         
    8967    //Setup the build date / version 
     
    10482         
    10583    [sharedAboutBoxInstance autorelease]; sharedAboutBoxInstance = nil; 
    106     [scrollTimer invalidate]; [scrollTimer release]; scrollTimer = nil; 
    107         [eventLoopScrollTimer invalidate]; [eventLoopScrollTimer release]; eventLoopScrollTimer = nil; 
    10884} 
    10985 
     
    11490} 
    11591 
    116  
    117 //Scrolling Credits ---------------------------------------------------------------------------------------------------- 
    118 #pragma mark Scrolling Credits 
    119 //Scroll the credits 
    120 - (void)scrollTimer:(NSTimer *)scrollTimer 
    121 {     
    122         scrollLocation += scrollRate; 
    123          
    124         if (scrollLocation > maxScroll) scrollLocation = 0;     
    125         if (scrollLocation < 0) scrollLocation = maxScroll; 
    126          
    127         [textView_credits scrollPoint:NSMakePoint(0, scrollLocation)]; 
    128 
    129  
    130 //Receive the flags changed event for reversing the scroll direction via option 
     92//Receive the flags changed event for starting/stopping the automatic scroll via option 
    13193- (void)flagsChanged:(NSEvent *)theEvent 
    13294{ 
    13395    if ([theEvent optionKey]) { 
    134         scrollRate = -ABOUT_SCROLL_RATE; 
    135     } else if ([theEvent controlKey]) { 
    136         scrollRate = 0; 
    137     } else { 
    138         scrollRate = ABOUT_SCROLL_RATE;    
     96                [textView_credits toggleScrolling]; 
    13997    } 
    14098}