Adium

Changeset 17574

Show
Ignore:
Timestamp:
09/01/2006 04:15:22 AM (2 years ago)
Author:
catfish_man
Message:

Refs #3134. Adding code to allow us to remove contact list xtras from being default-visible, while not breaking them for people the use them. We still take the disk space hit for them, but it's only a few k so I don't think it's a big deal. Thanks to The_Tick for the idea.

Files:

Legend:

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

    r17568 r17574  
    11811181                638392F809D4D67A0067B9B7 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 638392F609D4D67A0067B9B7 /* Sparkle.framework */; }; 
    11821182                6383935009D4D6AA0067B9B7 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 638392F609D4D67A0067B9B7 /* Sparkle.framework */; }; 
     1183                63AF931A0AA81E2300B88299 /* Bright Blue.ListTheme in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91C90AA8102600B88299 /* Bright Blue.ListTheme */; }; 
     1184                63AF931B0AA81E2300B88299 /* Bright Green.ListTheme in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91CA0AA8102600B88299 /* Bright Green.ListTheme */; }; 
     1185                63AF931C0AA81E2300B88299 /* Bright Orange.ListTheme in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91CB0AA8102600B88299 /* Bright Orange.ListTheme */; }; 
     1186                63AF931D0AA81E2300B88299 /* Bright Pink.ListTheme in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91CC0AA8102600B88299 /* Bright Pink.ListTheme */; }; 
     1187                63AF931E0AA81E2300B88299 /* Large (iChat).ListLayout in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91CD0AA8102700B88299 /* Large (iChat).ListLayout */; }; 
     1188                63AF931F0AA81E2300B88299 /* Large (with service icons).ListLayout in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91CE0AA8102700B88299 /* Large (with service icons).ListLayout */; }; 
     1189                63AF93200AA81E2300B88299 /* Large.ListLayout in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91CF0AA8102700B88299 /* Large.ListLayout */; }; 
     1190                63AF93210AA81E2300B88299 /* Normal (with user icons).ListLayout in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91D00AA8102700B88299 /* Normal (with user icons).ListLayout */; }; 
     1191                63AF93220AA81E2300B88299 /* Normal.ListLayout in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91D10AA8102700B88299 /* Normal.ListLayout */; }; 
     1192                63AF93230AA81E2300B88299 /* Pastel Blue (White on Black).ListTheme in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91D20AA8102800B88299 /* Pastel Blue (White on Black).ListTheme */; }; 
     1193                63AF93240AA81E2300B88299 /* Pastel Blue.ListTheme in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91D30AA8102800B88299 /* Pastel Blue.ListTheme */; }; 
     1194                63AF93250AA81E2300B88299 /* Pastel Gray (White on Black).ListTheme in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91D40AA8102800B88299 /* Pastel Gray (White on Black).ListTheme */; }; 
     1195                63AF93260AA81E2300B88299 /* Pastel Gray.ListTheme in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91D50AA8102800B88299 /* Pastel Gray.ListTheme */; }; 
     1196                63AF93270AA81E2300B88299 /* Pastel Green (White on Black).ListTheme in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91D60AA8102800B88299 /* Pastel Green (White on Black).ListTheme */; }; 
     1197                63AF93280AA81E2300B88299 /* Pastel Green.ListTheme in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91D70AA8102800B88299 /* Pastel Green.ListTheme */; }; 
     1198                63AF93290AA81E2300B88299 /* Pastel Pink (White on Black).ListTheme in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91D80AA8102900B88299 /* Pastel Pink (White on Black).ListTheme */; }; 
     1199                63AF932A0AA81E2300B88299 /* Pastel Pink.ListTheme in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91D90AA8102900B88299 /* Pastel Pink.ListTheme */; }; 
     1200                63AF932B0AA81E2300B88299 /* Pure Black.ListTheme in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91DA0AA8102900B88299 /* Pure Black.ListTheme */; }; 
     1201                63AF932C0AA81E2300B88299 /* Pure White.ListTheme in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91DB0AA8102900B88299 /* Pure White.ListTheme */; }; 
     1202                63AF932D0AA81E2300B88299 /* Tiny (with user icons).ListLayout in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91DC0AA8102900B88299 /* Tiny (with user icons).ListLayout */; }; 
     1203                63AF932E0AA81E2300B88299 /* Tiny.ListLayout in CopyFiles */ = {isa = PBXBuildFile; fileRef = 63AF91DD0AA8102A00B88299 /* Tiny.ListLayout */; }; 
    11831204                63C120750910A0DD00C9DB57 /* DefaultXtraReadme.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 63C120740910A0DD00C9DB57 /* DefaultXtraReadme.rtf */; }; 
    11841205                63DEB88F09BD3FEC0026DC69 /* AIXtraPreviewImageController.h in Headers */ = {isa = PBXBuildFile; fileRef = 63DEB88D09BD3FEC0026DC69 /* AIXtraPreviewImageController.h */; }; 
     
    15901611                                4BF2EA40067CB7A200743318 /* Message Styles in CopyFiles */, 
    15911612                                4BB1E493067F2EAC00D1DB86 /* Scripts in CopyFiles */, 
     1613                        ); 
     1614                        runOnlyForDeploymentPostprocessing = 0; 
     1615                }; 
     1616                63AF93140AA81DD700B88299 /* CopyFiles */ = { 
     1617                        isa = PBXCopyFilesBuildPhase; 
     1618                        buildActionMask = 2147483647; 
     1619                        dstPath = OldListXtras; 
     1620                        dstSubfolderSpec = 7; 
     1621                        files = ( 
     1622                                63AF931A0AA81E2300B88299 /* Bright Blue.ListTheme in CopyFiles */, 
     1623                                63AF931B0AA81E2300B88299 /* Bright Green.ListTheme in CopyFiles */, 
     1624                                63AF931C0AA81E2300B88299 /* Bright Orange.ListTheme in CopyFiles */, 
     1625                                63AF931D0AA81E2300B88299 /* Bright Pink.ListTheme in CopyFiles */, 
     1626                                63AF931E0AA81E2300B88299 /* Large (iChat).ListLayout in CopyFiles */, 
     1627                                63AF931F0AA81E2300B88299 /* Large (with service icons).ListLayout in CopyFiles */, 
     1628                                63AF93200AA81E2300B88299 /* Large.ListLayout in CopyFiles */, 
     1629                                63AF93210AA81E2300B88299 /* Normal (with user icons).ListLayout in CopyFiles */, 
     1630                                63AF93220AA81E2300B88299 /* Normal.ListLayout in CopyFiles */, 
     1631                                63AF93230AA81E2300B88299 /* Pastel Blue (White on Black).ListTheme in CopyFiles */, 
     1632                                63AF93240AA81E2300B88299 /* Pastel Blue.ListTheme in CopyFiles */, 
     1633                                63AF93250AA81E2300B88299 /* Pastel Gray (White on Black).ListTheme in CopyFiles */, 
     1634                                63AF93260AA81E2300B88299 /* Pastel Gray.ListTheme in CopyFiles */, 
     1635                                63AF93270AA81E2300B88299 /* Pastel Green (White on Black).ListTheme in CopyFiles */, 
     1636                                63AF93280AA81E2300B88299 /* Pastel Green.ListTheme in CopyFiles */, 
     1637                                63AF93290AA81E2300B88299 /* Pastel Pink (White on Black).ListTheme in CopyFiles */, 
     1638                                63AF932A0AA81E2300B88299 /* Pastel Pink.ListTheme in CopyFiles */, 
     1639                                63AF932B0AA81E2300B88299 /* Pure Black.ListTheme in CopyFiles */, 
     1640                                63AF932C0AA81E2300B88299 /* Pure White.ListTheme in CopyFiles */, 
     1641                                63AF932D0AA81E2300B88299 /* Tiny (with user icons).ListLayout in CopyFiles */, 
     1642                                63AF932E0AA81E2300B88299 /* Tiny.ListLayout in CopyFiles */, 
    15921643                        ); 
    15931644                        runOnlyForDeploymentPostprocessing = 0; 
     
    34293480                636AB7F2087E2B6700A87670 /* AIDockBadger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AIDockBadger.m; sourceTree = "<group>"; }; 
    34303481                638392F609D4D67A0067B9B7 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = Frameworks/Sparkle.framework; sourceTree = "<group>"; }; 
     3482                63AF91C90AA8102600B88299 /* Bright Blue.ListTheme */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Bright Blue.ListTheme"; sourceTree = "<group>"; }; 
     3483                63AF91CA0AA8102600B88299 /* Bright Green.ListTheme */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Bright Green.ListTheme"; sourceTree = "<group>"; }; 
     3484                63AF91CB0AA8102600B88299 /* Bright Orange.ListTheme */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Bright Orange.ListTheme"; sourceTree = "<group>"; }; 
     3485                63AF91CC0AA8102600B88299 /* Bright Pink.ListTheme */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Bright Pink.ListTheme"; sourceTree = "<group>"; }; 
     3486                63AF91CD0AA8102700B88299 /* Large (iChat).ListLayout */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Large (iChat).ListLayout"; sourceTree = "<group>"; }; 
     3487                63AF91CE0AA8102700B88299 /* Large (with service icons).ListLayout */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Large (with service icons).ListLayout"; sourceTree = "<group>"; }; 
     3488                63AF91CF0AA8102700B88299 /* Large.ListLayout */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Large.ListLayout; sourceTree = "<group>"; }; 
     3489                63AF91D00AA8102700B88299 /* Normal (with user icons).ListLayout */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Normal (with user icons).ListLayout"; sourceTree = "<group>"; }; 
     3490                63AF91D10AA8102700B88299 /* Normal.ListLayout */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Normal.ListLayout; sourceTree = "<group>"; }; 
     3491                63AF91D20AA8102800B88299 /* Pastel Blue (White on Black).ListTheme */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Pastel Blue (White on Black).ListTheme"; sourceTree = "<group>"; }; 
     3492                63AF91D30AA8102800B88299 /* Pastel Blue.ListTheme */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Pastel Blue.ListTheme"; sourceTree = "<group>"; }; 
     3493                63AF91D40AA8102800B88299 /* Pastel Gray (White on Black).ListTheme */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Pastel Gray (White on Black).ListTheme"; sourceTree = "<group>"; }; 
     3494                63AF91D50AA8102800B88299 /* Pastel Gray.ListTheme */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Pastel Gray.ListTheme"; sourceTree = "<group>"; }; 
     3495                63AF91D60AA8102800B88299 /* Pastel Green (White on Black).ListTheme */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Pastel Green (White on Black).ListTheme"; sourceTree = "<group>"; }; 
     3496                63AF91D70AA8102800B88299 /* Pastel Green.ListTheme */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Pastel Green.ListTheme"; sourceTree = "<group>"; }; 
     3497                63AF91D80AA8102900B88299 /* Pastel Pink (White on Black).ListTheme */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Pastel Pink (White on Black).ListTheme"; sourceTree = "<group>"; }; 
     3498                63AF91D90AA8102900B88299 /* Pastel Pink.ListTheme */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Pastel Pink.ListTheme"; sourceTree = "<group>"; }; 
     3499                63AF91DA0AA8102900B88299 /* Pure Black.ListTheme */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Pure Black.ListTheme"; sourceTree = "<group>"; }; 
     3500                63AF91DB0AA8102900B88299 /* Pure White.ListTheme */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Pure White.ListTheme"; sourceTree = "<group>"; }; 
     3501                63AF91DC0AA8102900B88299 /* Tiny (with user icons).ListLayout */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = "Tiny (with user icons).ListLayout"; sourceTree = "<group>"; }; 
     3502                63AF91DD0AA8102A00B88299 /* Tiny.ListLayout */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Tiny.ListLayout; sourceTree = "<group>"; }; 
    34313503                63C120740910A0DD00C9DB57 /* DefaultXtraReadme.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = DefaultXtraReadme.rtf; path = Resources/DefaultXtraReadme.rtf; sourceTree = "<group>"; }; 
    34323504                63DEB88D09BD3FEC0026DC69 /* AIXtraPreviewImageController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AIXtraPreviewImageController.h; path = Source/AIXtraPreviewImageController.h; sourceTree = "<group>"; }; 
     
    63276399                        sourceTree = "<group>"; 
    63286400                }; 
     6401                63AF91C80AA80FE300B88299 /* OldListXtras */ = { 
     6402                        isa = PBXGroup; 
     6403                        children = ( 
     6404                                63AF91C90AA8102600B88299 /* Bright Blue.ListTheme */, 
     6405                                63AF91CA0AA8102600B88299 /* Bright Green.ListTheme */, 
     6406                                63AF91CB0AA8102600B88299 /* Bright Orange.ListTheme */, 
     6407                                63AF91CC0AA8102600B88299 /* Bright Pink.ListTheme */, 
     6408                                63AF91CD0AA8102700B88299 /* Large (iChat).ListLayout */, 
     6409                                63AF91CE0AA8102700B88299 /* Large (with service icons).ListLayout */, 
     6410                                63AF91CF0AA8102700B88299 /* Large.ListLayout */, 
     6411                                63AF91D00AA8102700B88299 /* Normal (with user icons).ListLayout */, 
     6412                                63AF91D10AA8102700B88299 /* Normal.ListLayout */, 
     6413                                63AF91D20AA8102800B88299 /* Pastel Blue (White on Black).ListTheme */, 
     6414                                63AF91D30AA8102800B88299 /* Pastel Blue.ListTheme */, 
     6415                                63AF91D40AA8102800B88299 /* Pastel Gray (White on Black).ListTheme */, 
     6416                                63AF91D50AA8102800B88299 /* Pastel Gray.ListTheme */, 
     6417                                63AF91D60AA8102800B88299 /* Pastel Green (White on Black).ListTheme */, 
     6418                                63AF91D70AA8102800B88299 /* Pastel Green.ListTheme */, 
     6419                                63AF91D80AA8102900B88299 /* Pastel Pink (White on Black).ListTheme */, 
     6420                                63AF91D90AA8102900B88299 /* Pastel Pink.ListTheme */, 
     6421                                63AF91DA0AA8102900B88299 /* Pure Black.ListTheme */, 
     6422                                63AF91DB0AA8102900B88299 /* Pure White.ListTheme */, 
     6423                                63AF91DC0AA8102900B88299 /* Tiny (with user icons).ListLayout */, 
     6424                                63AF91DD0AA8102A00B88299 /* Tiny.ListLayout */, 
     6425                        ); 
     6426                        name = OldListXtras; 
     6427                        path = Resources/OldListXtras; 
     6428                        sourceTree = "<group>"; 
     6429                }; 
    63296430                6E4D961006B73991005235E9 /* Join Chat Panel */ = { 
    63306431                        isa = PBXGroup; 
     
    68146915                        isa = PBXGroup; 
    68156916                        children = ( 
     6917                                63AF91C80AA80FE300B88299 /* OldListXtras */, 
    68166918                                63C120740910A0DD00C9DB57 /* DefaultXtraReadme.rtf */, 
    68176919                                34575E3807CBA88E004A4FFF /* MainMenu.nib */, 
     
    76627764                                F51BCD3E0A156281000FDC06 /* CopyFiles */, 
    76637765                                34BD9D5F053146CC000AB133 /* CopyFiles */, 
     7766                                63AF93140AA81DD700B88299 /* CopyFiles */, 
    76647767                                4BF2E91F067CB76300743318 /* CopyFiles */, 
    76657768                                34BD9D6A053146CC000AB133 /* CopyFiles */, 
  • trunk/Source/AIAdium.m

    r17521 r17574  
    4444#import <AIUtilities/AIApplicationAdditions.h> 
    4545#import <Adium/AIPathUtilities.h> 
     46#import "AIAppearancePreferences.h" 
    4647 
    4748#define ADIUM_TRAC_PAGE                                         @"http://trac.adiumx.com/" 
     
    259260        [preferenceController controllerDidLoad]; 
    260261        [debugController controllerDidLoad]; 
     262        //Safety for when we remove previously included list xtras 
     263        [AIAppearancePreferences migrateOldListSettingsIfNeeded]; 
    261264        [pool release]; 
    262265 
  • trunk/Source/AIAppearancePreferences.h

    r11747 r17574  
    4545} 
    4646 
     47//called by AIAdium at app launch. Moves an xtra from OldListXtras to the normal list xtras folder if the user has it selected. 
     48+ (void) migrateOldListSettingsIfNeeded; 
     49 
    4750- (IBAction)showAllDockIcons:(id)sender; 
    4851- (IBAction)customizeListLayout:(id)sender; 
  • trunk/Source/AIAppearancePreferences.m

    r17115 r17574  
    3434#import <Adium/ESPresetManagementController.h> 
    3535#import <Adium/ESPresetNameSheetController.h> 
     36 
     37#define OLD_LIST_SETTINGS_PATH [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"OldListXtras"] 
    3638 
    3739typedef enum { 
     
    436438//Contact list layout & theme ---------------------------------------------------------------------------------------- 
    437439#pragma mark Contact list layout & theme 
     440 
     441+ (void) migrateOldListSettingsIfNeeded 
     442{ 
     443        id<AIPreferenceController> prefController = [[AIObject sharedAdiumInstance] preferenceController]; 
     444        NSFileManager *manager = [NSFileManager defaultManager]; 
     445        NSString *theme = [NSString stringWithFormat:@"%@/%@/%@.%@",  
     446                                                        [[NSBundle mainBundle] resourcePath],  
     447                                                        LIST_THEME_FOLDER, 
     448                                                        [prefController preferenceForKey:KEY_LIST_THEME_NAME group:PREF_GROUP_APPEARANCE], 
     449                                                        LIST_THEME_EXTENSION]; 
     450        if(![manager fileExistsAtPath:theme]) 
     451        { 
     452                NSString *oldTheme = [OLD_LIST_SETTINGS_PATH stringByAppendingPathComponent:[theme lastPathComponent]]; 
     453                if([manager fileExistsAtPath:oldTheme]) 
     454                        [manager movePath:oldTheme toPath:theme handler:nil]; 
     455        } 
     456        NSString *layout = [NSString stringWithFormat:@"%@/%@/%@.%@",  
     457                                                        [[NSBundle mainBundle] resourcePath],  
     458                                                        LIST_THEME_FOLDER,  
     459                                                        [prefController preferenceForKey:KEY_LIST_LAYOUT_NAME group:PREF_GROUP_APPEARANCE], 
     460                                                        @"ListLayout"]; 
     461        if(![manager fileExistsAtPath:layout]) 
     462        { 
     463                NSString *oldLayout = [OLD_LIST_SETTINGS_PATH stringByAppendingPathComponent:[layout lastPathComponent]]; 
     464                if([manager fileExistsAtPath:oldLayout]) 
     465                        [manager movePath:oldLayout toPath:layout handler:nil]; 
     466        } 
     467} 
     468 
    438469/*! 
    439470 * @brief Create a new theme