From c9e50f64bc35ce58ca06a87fd91742b2d71f8c45 Mon Sep 17 00:00:00 2001 From: "joshmoz%gmail.com" Date: Fri, 14 Jan 2005 01:40:13 +0000 Subject: [PATCH] rename navigation pref pane to "General", also remove multiple pane view and default to "General". no bug, sr=pinkerton git-svn-id: svn://10.0.0.236/trunk@167703 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/camino/Camino.xcode/project.pbxproj | 156 +------ .../English.lproj/Localizable.strings | Bin 80 -> 74 bytes .../MVPreferences.nib/classes.nib | 23 +- .../English.lproj/MVPreferences.nib/info.nib | 13 +- .../MVPreferences.nib/keyedobjects.nib | Bin 4917 -> 4395 bytes .../preferences/MVPreferencePaneGroups.plist | 19 - .../src/preferences/MVPreferencesController.h | 6 - .../preferences/MVPreferencesController.mm | 109 +---- .../MVPreferencesGroupedIconView.h | 59 --- .../MVPreferencesGroupedIconView.m | 208 --------- .../MVPreferencesMultipleIconView.h | 64 --- .../MVPreferencesMultipleIconView.m | 434 ------------------ 12 files changed, 43 insertions(+), 1048 deletions(-) delete mode 100644 mozilla/camino/src/preferences/MVPreferencePaneGroups.plist delete mode 100644 mozilla/camino/src/preferences/MVPreferencesGroupedIconView.h delete mode 100644 mozilla/camino/src/preferences/MVPreferencesGroupedIconView.m delete mode 100644 mozilla/camino/src/preferences/MVPreferencesMultipleIconView.h delete mode 100644 mozilla/camino/src/preferences/MVPreferencesMultipleIconView.m diff --git a/mozilla/camino/Camino.xcode/project.pbxproj b/mozilla/camino/Camino.xcode/project.pbxproj index cf4587670f8..fd92e6ce9d3 100644 --- a/mozilla/camino/Camino.xcode/project.pbxproj +++ b/mozilla/camino/Camino.xcode/project.pbxproj @@ -222,7 +222,7 @@ }; 03C5AB1107722DFD00EAF77D = { isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; path = "Info-DownloadsPrefPane.plist"; refType = 4; sourceTree = ""; @@ -419,7 +419,7 @@ }; 03E2D8540771F73F00BD2443 = { isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; path = "Info-TabsPrefPane.plist"; refType = 4; sourceTree = ""; @@ -1197,7 +1197,7 @@ 3003B8AC044514E300B85BF3 = { fileEncoding = 30; isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; name = English; path = resources/localized/English.lproj/SearchURLList.plist; refType = 4; @@ -1307,7 +1307,7 @@ }; 3F22CC1303DF42A200026DCE = { isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; name = Charset.dict; path = resources/application/Charset.dict; refType = 4; @@ -1712,8 +1712,6 @@ 3F44ABDE05BDFB9E00CB4B08, 3F44ABDF05BDFB9E00CB4B08, 3F44ABE005BDFB9E00CB4B08, - 3F44ABE105BDFB9E00CB4B08, - 3F44ABE205BDFB9E00CB4B08, 3F44ABE305BDFB9E00CB4B08, 3F44ABE405BDFB9E00CB4B08, 3F44ABE505BDFB9E00CB4B08, @@ -1847,18 +1845,6 @@ settings = { }; }; - 3F44ABE105BDFB9E00CB4B08 = { - fileRef = F53F21F1022B7C77010001CA; - isa = PBXBuildFile; - settings = { - }; - }; - 3F44ABE205BDFB9E00CB4B08 = { - fileRef = F53F21F3022B7C77010001CA; - isa = PBXBuildFile; - settings = { - }; - }; 3F44ABE305BDFB9E00CB4B08 = { fileRef = F5BF71450231B8BC010001CA; isa = PBXBuildFile; @@ -2290,7 +2276,6 @@ 3F44AC3405BDFB9E00CB4B08, 3F44AC3505BDFB9E00CB4B08, 3F44AC3605BDFB9E00CB4B08, - 3F44AC3705BDFB9E00CB4B08, 3F44AC3805BDFB9E00CB4B08, 3F44AC3905BDFB9E00CB4B08, 3F8C00940681262400658CBC, @@ -2502,12 +2487,6 @@ settings = { }; }; - 3F44AC3705BDFB9E00CB4B08 = { - fileRef = F53F21ED022B7C77010001CA; - isa = PBXBuildFile; - settings = { - }; - }; 3F44AC3805BDFB9E00CB4B08 = { fileRef = F507A86103128A3D01026D5D; isa = PBXBuildFile; @@ -2875,8 +2854,6 @@ 3F44AC8A05BDFB9E00CB4B08, 3F44AC8B05BDFB9E00CB4B08, 3F44AC8C05BDFB9E00CB4B08, - 3F44AC8D05BDFB9E00CB4B08, - 3F44AC8E05BDFB9E00CB4B08, 3F44AC8F05BDFB9E00CB4B08, 3F44AC9005BDFB9E00CB4B08, 3F44AC9105BDFB9E00CB4B08, @@ -3013,18 +2990,6 @@ settings = { }; }; - 3F44AC8D05BDFB9E00CB4B08 = { - fileRef = F53F21F2022B7C77010001CA; - isa = PBXBuildFile; - settings = { - }; - }; - 3F44AC8E05BDFB9E00CB4B08 = { - fileRef = F53F21F4022B7C77010001CA; - isa = PBXBuildFile; - settings = { - }; - }; 3F44AC8F05BDFB9E00CB4B08 = { fileRef = F5BF71460231B8BC010001CA; isa = PBXBuildFile; @@ -4683,7 +4648,7 @@ }; 3F44AD8705BDFB9F00CB4B08 = { isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; path = "Info-Camino__Upgraded_.plist"; refType = 4; sourceTree = ""; @@ -4862,7 +4827,7 @@ }; 3F44AD9E05BDFB9F00CB4B08 = { isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; path = "Info-AppearancePrefPane__Upgraded_.plist"; refType = 4; sourceTree = ""; @@ -5033,7 +4998,7 @@ }; 3F44ADB205BDFBA000CB4B08 = { isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; path = "Info-NavigationPrefPane__Upgraded_.plist"; refType = 4; sourceTree = ""; @@ -5048,7 +5013,7 @@ }; 3F44ADC105BDFBA000CB4B08 = { isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; path = "Info-PersonalPrefPane__Upgraded_.plist"; refType = 4; sourceTree = ""; @@ -5234,7 +5199,7 @@ }; 3F44ADD905BDFBA000CB4B08 = { isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; path = "Info-PrivacyPrefPane__Upgraded_.plist"; refType = 4; sourceTree = ""; @@ -5422,7 +5387,7 @@ }; 3F44ADF005BDFBA000CB4B08 = { isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; path = "Info-SecurityPrefPane__Upgraded_.plist"; refType = 4; sourceTree = ""; @@ -5610,7 +5575,7 @@ }; 3F44AE0705BDFBA000CB4B08 = { isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; path = "Info-WebFeaturesPrefPane__Upgraded_.plist"; refType = 4; sourceTree = ""; @@ -5701,8 +5666,6 @@ 3F44AE1705BDFBA000CB4B08, 3F44AE1805BDFBA000CB4B08, 3F44AE1905BDFBA000CB4B08, - 3F44AE1A05BDFBA000CB4B08, - 3F44AE1B05BDFBA000CB4B08, 3F44AE1C05BDFBA000CB4B08, 3F44AE1D05BDFBA000CB4B08, 3F44AE1E05BDFBA000CB4B08, @@ -5836,18 +5799,6 @@ settings = { }; }; - 3F44AE1A05BDFBA000CB4B08 = { - fileRef = F53F21F1022B7C77010001CA; - isa = PBXBuildFile; - settings = { - }; - }; - 3F44AE1B05BDFBA000CB4B08 = { - fileRef = F53F21F3022B7C77010001CA; - isa = PBXBuildFile; - settings = { - }; - }; 3F44AE1C05BDFBA000CB4B08 = { fileRef = F5BF71450231B8BC010001CA; isa = PBXBuildFile; @@ -6279,7 +6230,6 @@ 3F44AE6D05BDFBA000CB4B08, 3F44AE6E05BDFBA000CB4B08, 3F44AE6F05BDFBA000CB4B08, - 3F44AE7005BDFBA000CB4B08, 3F44AE7105BDFBA000CB4B08, 3F44AE7205BDFBA000CB4B08, 3F8C00950681262400658CBC, @@ -6490,12 +6440,6 @@ settings = { }; }; - 3F44AE7005BDFBA000CB4B08 = { - fileRef = F53F21ED022B7C77010001CA; - isa = PBXBuildFile; - settings = { - }; - }; 3F44AE7105BDFBA000CB4B08 = { fileRef = F507A86103128A3D01026D5D; isa = PBXBuildFile; @@ -6863,8 +6807,6 @@ 3F44AEC305BDFBA000CB4B08, 3F44AEC405BDFBA000CB4B08, 3F44AEC505BDFBA000CB4B08, - 3F44AEC605BDFBA000CB4B08, - 3F44AEC705BDFBA000CB4B08, 3F44AEC805BDFBA000CB4B08, 3F44AEC905BDFBA000CB4B08, 3F44AECA05BDFBA000CB4B08, @@ -7000,18 +6942,6 @@ settings = { }; }; - 3F44AEC605BDFBA000CB4B08 = { - fileRef = F53F21F2022B7C77010001CA; - isa = PBXBuildFile; - settings = { - }; - }; - 3F44AEC705BDFBA000CB4B08 = { - fileRef = F53F21F4022B7C77010001CA; - isa = PBXBuildFile; - settings = { - }; - }; 3F44AEC805BDFBA000CB4B08 = { fileRef = F5BF71460231B8BC010001CA; isa = PBXBuildFile; @@ -8704,7 +8634,7 @@ }; 3F44AFC505BDFBA100CB4B08 = { isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; path = "Info-CaminoStatic__Upgraded_.plist"; refType = 4; sourceTree = ""; @@ -8811,7 +8741,7 @@ }; 3F44AFD305BDFBA100CB4B08 = { isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; path = "Info-AddressBookManager__Upgraded_.plist"; refType = 4; sourceTree = ""; @@ -9180,7 +9110,7 @@ 3FAA54C70587778700BBF630 = { fileEncoding = 30; isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; name = bookmarks.plist; path = resources/application/bookmarks.plist; refType = 2; @@ -12097,7 +12027,7 @@ }; F51B70B4026EC8A601A80166 = { isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; name = Camino.scriptSuite; path = resources/application/Camino.scriptSuite; refType = 2; @@ -12691,15 +12621,6 @@ refType = 2; sourceTree = SOURCE_ROOT; }; - F53F21ED022B7C77010001CA = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text.plist; - name = MVPreferencePaneGroups.plist; - path = src/preferences/MVPreferencePaneGroups.plist; - refType = 2; - sourceTree = SOURCE_ROOT; - }; F53F21EE022B7C77010001CA = { fileEncoding = 30; isa = PBXFileReference; @@ -12727,42 +12648,6 @@ refType = 2; sourceTree = SOURCE_ROOT; }; - F53F21F1022B7C77010001CA = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - name = MVPreferencesGroupedIconView.h; - path = src/preferences/MVPreferencesGroupedIconView.h; - refType = 2; - sourceTree = SOURCE_ROOT; - }; - F53F21F2022B7C77010001CA = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - name = MVPreferencesGroupedIconView.m; - path = src/preferences/MVPreferencesGroupedIconView.m; - refType = 2; - sourceTree = SOURCE_ROOT; - }; - F53F21F3022B7C77010001CA = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - name = MVPreferencesMultipleIconView.h; - path = src/preferences/MVPreferencesMultipleIconView.h; - refType = 2; - sourceTree = SOURCE_ROOT; - }; - F53F21F4022B7C77010001CA = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.objc; - name = MVPreferencesMultipleIconView.m; - path = src/preferences/MVPreferencesMultipleIconView.m; - refType = 2; - sourceTree = SOURCE_ROOT; - }; F540BD1A029ED15301026D5D = { isa = PBXFileReference; lastKnownFileType = image.tiff; @@ -13763,7 +13648,7 @@ F5949A47030D58A1014E8430 = { fileEncoding = 30; isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; path = xhtml11.dtd; refType = 4; sourceTree = ""; @@ -14241,7 +14126,7 @@ }; F5CA1A1A02D3956F01F34900 = { isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; name = English; path = resources/localized/English.lproj/Camino.scriptTerminology; refType = 2; @@ -14251,14 +14136,9 @@ children = ( F507A85303116EA401026D5D, F53F21EC022B7C77010001CA, - F53F21ED022B7C77010001CA, F507A86103128A3D01026D5D, F53F21EF022B7C77010001CA, F53F21F0022B7C77010001CA, - F53F21F1022B7C77010001CA, - F53F21F2022B7C77010001CA, - F53F21F3022B7C77010001CA, - F53F21F4022B7C77010001CA, ); isa = PBXGroup; name = "Prefs window"; @@ -15371,7 +15251,7 @@ F6BD64D501B3172601A962F7 = { fileEncoding = 30; isa = PBXFileReference; - lastKnownFileType = text.plist.xml; + lastKnownFileType = text.xml; name = platformHTMLBindings.xml; path = ../dist/Embed/res/builtin/platformHTMLBindings.xml; refType = 2; diff --git a/mozilla/camino/PreferencePanes/Navigation/English.lproj/Localizable.strings b/mozilla/camino/PreferencePanes/Navigation/English.lproj/Localizable.strings index 54ede8a6404f8e3aed647b9f2c673d30f71b4af6..d7ce0b8d2d66f5bf095be0d81fad8cb1f7e231e0 100644 GIT binary patch delta 24 dcmWIWnqV&M&XCHG2gF4Ti3~XmN(|NvTmVGU1eyQ< delta 30 icmeYYm|!mH$B@WS#*oR74x~$fbUs5KgA#)^0~Y{l`UUa; diff --git a/mozilla/camino/resources/localized/English.lproj/MVPreferences.nib/classes.nib b/mozilla/camino/resources/localized/English.lproj/MVPreferences.nib/classes.nib index aeac16577ff..aa41f002ed7 100644 --- a/mozilla/camino/resources/localized/English.lproj/MVPreferences.nib/classes.nib +++ b/mozilla/camino/resources/localized/English.lproj/MVPreferences.nib/classes.nib @@ -2,30 +2,11 @@ IBClasses = ( {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { - ACTIONS = {showAll = id; showPreferences = id; }; + ACTIONS = {showPreferences = id; }; CLASS = MVPreferencesController; LANGUAGE = ObjC; - OUTLETS = { - groupView = id; - loadingImageView = id; - loadingTextFeld = id; - loadingView = id; - multiView = id; - window = id; - }; + OUTLETS = {loadingImageView = id; loadingTextFeld = id; loadingView = id; window = id; }; SUPERCLASS = NSObject; - }, - { - CLASS = MVPreferencesGroupedIconView; - LANGUAGE = ObjC; - OUTLETS = {preferencesController = id; }; - SUPERCLASS = NSView; - }, - { - CLASS = MVPreferencesMultipleIconView; - LANGUAGE = ObjC; - OUTLETS = {preferencesController = id; }; - SUPERCLASS = NSView; } ); IBVersion = 1; diff --git a/mozilla/camino/resources/localized/English.lproj/MVPreferences.nib/info.nib b/mozilla/camino/resources/localized/English.lproj/MVPreferences.nib/info.nib index a918b911599..3391187db21 100644 --- a/mozilla/camino/resources/localized/English.lproj/MVPreferences.nib/info.nib +++ b/mozilla/camino/resources/localized/English.lproj/MVPreferences.nib/info.nib @@ -3,14 +3,15 @@ IBDocumentLocation - 22 42 356 240 0 0 1280 832 + 37 67 356 240 0 0 1920 1178 + IBEditorPositions + + 11 + 627 639 615 292 0 0 1920 1178 + IBFramework Version 364.0 - IBOpenObjects - - 7 - IBSystem Version - 7M34 + 7S215 diff --git a/mozilla/camino/resources/localized/English.lproj/MVPreferences.nib/keyedobjects.nib b/mozilla/camino/resources/localized/English.lproj/MVPreferences.nib/keyedobjects.nib index df184ea3e05512338ed8e7b9017d47a08a03e90a..c7394cf2aa4834c7687efbdf47f3bc373e5f6b77 100644 GIT binary patch delta 2395 zcmY*Z33!cH8h*cjUvI9R*ph1^gOnu1QZ$o9Vu@^S7TH9|%_2dY#9-9qP%~9#XnVEB zQcDswwzgWS+Qu?9H8p50V<}2ot)f(^QpKFy8&A#uKmY%q=R5EBe(!tEcm9U18(c4! z)=Y#63q8;a;pmHg7>H;LMKX#}f>M-WBA&zVF%>iLJZ9pLn1$K+Gv?wY`~{1#6r1oi z-o^XagO6|k|Hj8Si2vXaPU16sjxX^QZsG_0jQe;<8tG(^O##%LT2L!$M;-Ghm|WC_ zenY>dZWKnnD4ZfG3e)ii>PrLYX&OX>DVlyqaTHHOX*i`&Dy7jVa#K2GP!<(a36W9?ZoOJ&a-$1n^>AVwe&Ba!4?BzEhSf>fko6x>Kh1~QR_(HxPD9ONPo z`51!&j71^FVLXc9@m>=zrcU69a#Um|yL(nuSC&mGNzW|vOl1K_5rIfd!sI$k#Dhr-j4D>Z5pQ6H7=8PtlXwm>lrh`!-B$R z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j2^Ei>goCe~{+{kTt)J09(9h|g=-2cg z3^LqCdn43{GNO%#jA2H)G1i!3)zqs>3+t2%>A1Cxch|rUH3Kj&+cC=%?h!?tZr7M6=w~x60KBg zf>mf$ST)uvYm>Fb+GcIHnyhAPmvz88X}xb+J@6t-a1(Z*Q #import "MVPreferencesController.h" -#import "MVPreferencesMultipleIconView.h" -#import "MVPreferencesGroupedIconView.h" #import "ToolbarAdditions.h" #include "nsCOMPtr.h" @@ -45,11 +43,8 @@ #include "nsIPref.h" #include "CHBrowserService.h" -// #import "Defines.h" - static MVPreferencesController *sharedInstance = nil; -NSString *MVToolbarShowAllItemIdentifier = @"MVToolbarShowAllItem"; NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification"; @interface NSToolbar (NSToolbarPrivate) @@ -61,7 +56,6 @@ NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification"; - (IBAction) _selectPreferencePane:(id) sender; - (void) _resizeWindowForContentView:(NSView *) view; - (NSImage *) _imageForPaneBundle:(NSBundle *) bundle; -- (NSString *) _paletteLabelForPaneBundle:(NSBundle *) bundle; - (NSString *) _labelForPaneBundle:(NSBundle *) bundle; @end @@ -83,8 +77,9 @@ NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification"; for ( i = 0; i < [panes count]; i++ ) { bundle = [NSBundle bundleWithPath:[NSString stringWithFormat:@"%@/%@", bundlePath, [panes objectAtIndex:i]]]; [bundle load]; - if( bundle ) [panes replaceObjectAtIndex:i withObject:bundle]; - else { + if (bundle) { + [panes replaceObjectAtIndex:i withObject:bundle]; + } else { [panes removeObjectAtIndex:i]; i--; } @@ -114,27 +109,17 @@ NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification"; - (void) awakeFromNib { NSToolbar *toolbar = [[[NSToolbar alloc] initWithIdentifier:@"preferences.toolbar"] autorelease]; - NSArray *groups = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"MVPreferencePaneGroups" ofType:@"plist"]]; - - if( groups ) { - [groupView setPreferencePanes:panes]; - [groupView setPreferencePaneGroups:groups]; - mainView = groupView; - } else { - [multiView setPreferencePanes:panes]; - mainView = multiView; - } [window setDelegate:self]; + [window setFrameAutosaveName:@"CaminoPreferenceWindowFrame"]; - [toolbar setAllowsUserCustomization:YES]; - [toolbar setAutosavesConfiguration:YES]; + [toolbar setAllowsUserCustomization:NO]; + [toolbar setAutosavesConfiguration:NO]; [toolbar setDelegate:self]; - [toolbar setAlwaysCustomizableByDrag:YES]; + [toolbar setAlwaysCustomizableByDrag:NO]; [toolbar setShowsContextMenu:NO]; [window setToolbar:toolbar]; [toolbar setDisplayMode:NSToolbarDisplayModeIconAndLabel]; - [toolbar setIndexOfFirstMovableItem:2]; } - (NSWindow *) window @@ -151,40 +136,12 @@ NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification"; // the window visible. Too bad cocoa doesn't give us any notifications of this. CHBrowserService::InitEmbedding(); } - // If neither a pref pane nor the group pane is showing, then show the group pane + // If a pref pane is not showing, then show the general pane if (!currentPaneIdentifier && (![[window contentView] isEqual:mainView])) - [self showAll:nil]; + [self selectPreferencePaneByIdentifier:@"org.mozilla.chimera.preference.navigation"]; [window makeKeyAndOrderFront:nil]; } -- (IBAction) showAll:(id) sender -{ - if ( [[window contentView] isEqual:mainView] ) return; - if ( currentPaneIdentifier && [[loadedPanes objectForKey:currentPaneIdentifier] shouldUnselect] != NSUnselectNow ) { - /* more to handle later */ -#if DEBUG - NSLog(@"can't unselect current preferences pane"); -#endif - return; - } - [window setContentView:[[[NSView alloc] initWithFrame:[mainView frame]] autorelease]]; - - [window setTitle:[NSString stringWithFormat:NSLocalizedString( @"PrefsWindowTitleFormat", @"" ), [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"]]]; - [self _resizeWindowForContentView:mainView]; - - [[loadedPanes objectForKey:currentPaneIdentifier] willUnselect]; - [window setContentView:mainView]; - [[loadedPanes objectForKey:currentPaneIdentifier] didUnselect]; - - [currentPaneIdentifier autorelease]; - currentPaneIdentifier = nil; - - [window setInitialFirstResponder:mainView]; - [window makeFirstResponder:mainView]; - if ([NSToolbar instancesRespondToSelector:@selector(setSelectedItemIdentifier:)]) - [[window toolbar] setSelectedItemIdentifier:MVToolbarShowAllItemIdentifier]; -} - - (void) selectPreferencePaneByIdentifier:(NSString *) identifier { NSBundle *bundle = [NSBundle bundleWithIdentifier:identifier]; @@ -284,30 +241,19 @@ NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification"; willBeInsertedIntoToolbar:(BOOL) flag { NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier] autorelease]; - if ( [itemIdentifier isEqualToString:MVToolbarShowAllItemIdentifier] ) { - [toolbarItem setLabel:NSLocalizedString( @"ShowAllPrefItems", @"" )]; - [toolbarItem setImage:[NSImage imageNamed:@"NSApplicationIcon"]]; + NSBundle *bundle = [NSBundle bundleWithIdentifier:itemIdentifier]; + if (bundle) { + [toolbarItem setLabel:[self _labelForPaneBundle:bundle]]; + [toolbarItem setImage:[self _imageForPaneBundle:bundle]]; [toolbarItem setTarget:self]; - [toolbarItem setAction:@selector( showAll: )]; - } else { - NSBundle *bundle = [NSBundle bundleWithIdentifier:itemIdentifier]; - if( bundle ) { - [toolbarItem setLabel:[self _labelForPaneBundle:bundle]]; - [toolbarItem setPaletteLabel:[self _paletteLabelForPaneBundle:bundle]]; - [toolbarItem setImage:[self _imageForPaneBundle:bundle]]; - [toolbarItem setTarget:self]; - [toolbarItem setAction:@selector( _selectPreferencePane: )]; - } else toolbarItem = nil; - } + [toolbarItem setAction:@selector( _selectPreferencePane: )]; + } else toolbarItem = nil; return toolbarItem; } - (NSArray *) toolbarDefaultItemIdentifiers:(NSToolbar *) toolbar { - NSMutableArray *fixed = [NSMutableArray arrayWithObjects:MVToolbarShowAllItemIdentifier, NSToolbarSeparatorItemIdentifier, nil]; - NSArray *defaults = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"MVPreferencePaneDefaults" ofType:@"plist"]]; - [fixed addObjectsFromArray:defaults]; - return fixed; + return [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"MVPreferencePaneDefaults" ofType:@"plist"]]; } - (NSArray *) toolbarAllowedItemIdentifiers:(NSToolbar *) toolbar @@ -317,8 +263,6 @@ NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification"; id item = nil; while ( ( item = [enumerator nextObject] ) ) [items addObject:[item bundleIdentifier]]; - //[items addObject:MVToolbarShowAllItemIdentifier]; - [items addObject:NSToolbarSeparatorItemIdentifier]; return items; } @@ -330,7 +274,6 @@ NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification"; id item = nil; while ( ( item = [enumerator nextObject] ) ) [items addObject:[item bundleIdentifier]]; - [items addObject:MVToolbarShowAllItemIdentifier]; return items; } @@ -377,26 +320,6 @@ NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification"; return image; } -- (NSString *) _paletteLabelForPaneBundle:(NSBundle *) bundle -{ - NSString *label = nil; - NSMutableDictionary *cache = [paneInfo objectForKey:[bundle bundleIdentifier]]; - label = [[[cache objectForKey:@"MVPreferencePanePaletteLabel"] retain] autorelease]; - if ( ! label ) { - NSDictionary *info = [bundle infoDictionary]; - label = NSLocalizedStringFromTableInBundle(@"PreferencePanelLabel", nil, bundle, nil); - if ( [label isEqualToString:@"PreferencePanelLabel"] ) label = NSLocalizedStringFromTableInBundle( @"NSPrefPaneIconLabel", @"InfoPlist", bundle, nil ); - if ( [label isEqualToString:@"NSPrefPaneIconLabel"] ) label = [info objectForKey:@"NSPrefPaneIconLabel"]; - if ( ! label ) label = NSLocalizedStringFromTableInBundle( @"CFBundleName", @"InfoPlist", bundle, nil ); - if ( [label isEqualToString:@"CFBundleName"] ) label = [info objectForKey:@"CFBundleName"]; - if ( ! label ) label = [bundle bundleIdentifier]; - if ( ! cache ) [paneInfo setObject:[NSMutableDictionary dictionary] forKey:[bundle bundleIdentifier]]; - cache = [paneInfo objectForKey:[bundle bundleIdentifier]]; - if ( label ) [cache setObject:label forKey:@"MVPreferencePanePaletteLabel"]; - } - return label; -} - - (NSString *) _labelForPaneBundle:(NSBundle *) bundle { NSString *label = nil; diff --git a/mozilla/camino/src/preferences/MVPreferencesGroupedIconView.h b/mozilla/camino/src/preferences/MVPreferencesGroupedIconView.h deleted file mode 100644 index 3d9340b12d0..00000000000 --- a/mozilla/camino/src/preferences/MVPreferencesGroupedIconView.h +++ /dev/null @@ -1,59 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Chimera code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#import - -@class MVPreferencesController; - -extern const unsigned int groupViewHeight, multiIconViewYOffset; - -@interface MVPreferencesGroupedIconView : NSView -{ - IBOutlet MVPreferencesController *preferencesController; - NSBundle *selectedPane; - NSArray *preferencePanes, *preferencePaneGroups; - NSMutableArray *groupMultiIconViews; -} - -- (void) setPreferencesController:(MVPreferencesController *) newPreferencesController; - -- (void) setPreferencePanes:(NSArray *) newPreferencePanes; -- (NSArray *) preferencePanes; - -- (void) setPreferencePaneGroups:(NSArray *) newPreferencePaneGroups; -- (NSArray *) preferencePaneGroups; - -@end diff --git a/mozilla/camino/src/preferences/MVPreferencesGroupedIconView.m b/mozilla/camino/src/preferences/MVPreferencesGroupedIconView.m deleted file mode 100644 index f6a8f4739ef..00000000000 --- a/mozilla/camino/src/preferences/MVPreferencesGroupedIconView.m +++ /dev/null @@ -1,208 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Chimera code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#import "MVPreferencesGroupedIconView.h" -#import "MVPreferencesMultipleIconView.h" -#import "MVPreferencesController.h" - -@interface MVPreferencesMultipleIconView (MVPreferencesMultipleIconViewPrivate) -- (unsigned int) _numberOfRows; -@end - -@interface MVPreferencesGroupedIconView (MVPreferencesGroupedIconViewPrivate) - -- (unsigned int) _numberOfGroups; -- (void) _sizeToFit; -- (NSRect) _rectForGroupAtIndex:(unsigned int) index; -- (NSRect) _rectForGroupSeparatorAtIndex:(unsigned int) index; -- (void) _generateGroupViews; -- (void) _generateGroupViewAtIndex:(unsigned int) index; - -@end - -@implementation MVPreferencesGroupedIconView - -const unsigned int groupViewHeight = 95; -const unsigned int multiIconViewYOffset = 18; -const unsigned int sideGutterWidths = 15; -const unsigned int extraRowHeight = 69; - -- (id) initWithFrame:(NSRect) frame -{ - if( ( self = [super initWithFrame:frame] ) ) { - groupMultiIconViews = [[NSMutableArray array] retain]; - } - return self; -} - -- (void) drawRect:(NSRect) rect -{ - [self _generateGroupViews]; -} - -- (void) setPreferencesController:(MVPreferencesController *) newPreferencesController -{ - [preferencesController autorelease]; - preferencesController = [newPreferencesController retain]; - [self _sizeToFit]; - [self setNeedsDisplay:YES]; -} - -- (void) setPreferencePanes:(NSArray *) newPreferencePanes -{ - [preferencePanes autorelease]; - preferencePanes = [newPreferencePanes retain]; - [self _sizeToFit]; - [self setNeedsDisplay:YES]; -} - -- (NSArray *) preferencePanes -{ - return preferencePanes; -} - -- (void) setPreferencePaneGroups:(NSArray *) newPreferencePaneGroups -{ - [preferencePaneGroups autorelease]; - preferencePaneGroups = [newPreferencePaneGroups retain]; - [self _sizeToFit]; - [self setNeedsDisplay:YES]; -} - -- (NSArray *) preferencePaneGroups -{ - return preferencePaneGroups; -} - -- (BOOL) acceptsFirstResponder -{ - return YES; -} - -- (BOOL) becomeFirstResponder -{ - [[self window] makeFirstResponder:[self viewWithTag:0]]; - return YES; -} - -- (BOOL) resignFirstResponder -{ - return YES; -} - -- (BOOL) isFlipped -{ - return YES; -} - -- (BOOL) isOpaque -{ - return NO; -} -@end - -@implementation MVPreferencesGroupedIconView (MVPreferencesGroupedIconViewPrivate) -- (unsigned int) _numberOfGroups { - return [[self preferencePaneGroups] count]; -} - -- (void) _sizeToFit { - if( ! [self _numberOfGroups] ) return; - [self _generateGroupViews]; - [self setFrameSize:NSMakeSize( NSWidth( _bounds ), NSMaxY( [self _rectForGroupAtIndex:[self _numberOfGroups] - 1] ) ) ]; -} - -- (NSRect) _rectForGroupAtIndex:(unsigned int) index { - unsigned int extra = 0, groupIndex; - for( groupIndex = 0; groupIndex < index; groupIndex++ ) - extra += [[self viewWithTag:groupIndex] _numberOfRows] * extraRowHeight; - return NSMakeRect( 0., (index * groupViewHeight ) + multiIconViewYOffset + index + extra, NSWidth( [self frame] ), groupViewHeight ); -} - -- (NSRect) _rectForGroupSeparatorAtIndex:(unsigned int) index { - unsigned int extra = 0, groupIndex; - if( ! index ) return NSZeroRect; - for( groupIndex = 0; groupIndex < index; groupIndex++ ) - extra += [[self viewWithTag:groupIndex] _numberOfRows] * extraRowHeight; - return NSMakeRect( sideGutterWidths, ((index + 1) * groupViewHeight) - groupViewHeight + index + extra, NSWidth( [self frame] ) - (sideGutterWidths * 2), 1 ); -} - -- (void) _generateGroupViews { - unsigned int groupIndex, groupCount; - - groupCount = [self _numberOfGroups]; - for( groupIndex = 0; groupIndex < groupCount; groupIndex++ ) - [self _generateGroupViewAtIndex:groupIndex]; -} - -- (void) _generateGroupViewAtIndex:(unsigned int) index { - MVPreferencesMultipleIconView *multiIconView = nil; - NSString *identifier = [[preferencePaneGroups objectAtIndex:index] objectForKey:@"identifier"]; - NSString *name = NSLocalizedStringFromTable( identifier, @"MVPreferencePaneGroups", nil ); - NSDictionary *attributesDictionary; - unsigned nameHeight = 0; - - if( ! ( multiIconView = [self viewWithTag:index] ) ) { - NSMutableArray *panes = [NSMutableArray array]; - NSBox *sep = [[[NSBox alloc] initWithFrame:[self _rectForGroupSeparatorAtIndex:index]] autorelease]; - NSEnumerator *enumerator = [[[preferencePaneGroups objectAtIndex:index] objectForKey:@"panes"] objectEnumerator]; - id pane = nil, bundle = 0; - - multiIconView = [[[MVPreferencesMultipleIconView alloc] initWithFrame:[self _rectForGroupAtIndex:index]] autorelease]; - while( ( pane = [enumerator nextObject] ) ) { - bundle = [NSBundle bundleWithIdentifier:pane]; - if( bundle ) [panes addObject:bundle]; - } - - [multiIconView setPreferencesController:preferencesController]; - [multiIconView setPreferencePanes:panes]; - [multiIconView setTag:index]; - - [sep setBoxType:NSBoxSeparator]; - [sep setBorderType:NSBezelBorder]; - - [self addSubview:multiIconView]; - [self addSubview:sep]; -// if( ! index ) [[self window] makeFirstResponder:multiIconView]; - if( index - 1 >= 0 ) [[self viewWithTag:index - 1] setNextKeyView:multiIconView]; - if( index == [self _numberOfGroups] - 1 ) [multiIconView setNextKeyView:[self viewWithTag:0]]; - } - - attributesDictionary = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont boldSystemFontOfSize:13.], NSFontAttributeName, nil]; - nameHeight = [[NSFont boldSystemFontOfSize:13.] ascender]; - [name drawAtPoint:NSMakePoint( sideGutterWidths - 1, NSMinY( [multiIconView frame] ) - nameHeight - 1 ) withAttributes:attributesDictionary]; -} -@end diff --git a/mozilla/camino/src/preferences/MVPreferencesMultipleIconView.h b/mozilla/camino/src/preferences/MVPreferencesMultipleIconView.h deleted file mode 100644 index f742c60ea31..00000000000 --- a/mozilla/camino/src/preferences/MVPreferencesMultipleIconView.h +++ /dev/null @@ -1,64 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Chimera code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * David Hyatt - * Simon Fraser - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#import - -@class MVPreferencesController; - -extern const NSSize buttonSize, iconSize; -extern const unsigned int titleBaseline, iconBaseline, bottomBorder; - -@interface MVPreferencesMultipleIconView : NSView -{ - IBOutlet MVPreferencesController *preferencesController; - unsigned int pressedIconIndex, focusedIndex; - int tag; - NSBundle *selectedPane; - NSArray *preferencePanes; -} - -- (void) setPreferencesController:(MVPreferencesController *) newPreferencesController; - -- (void) setPreferencePanes:(NSArray *) newPreferencePanes; -- (NSArray *) preferencePanes; - -- (void) setSelectedPane:(NSBundle *) newSelectedClientRecord; - -- (int) tag; -- (void) setTag:(int) newTag; -@end diff --git a/mozilla/camino/src/preferences/MVPreferencesMultipleIconView.m b/mozilla/camino/src/preferences/MVPreferencesMultipleIconView.m deleted file mode 100644 index eea4300c273..00000000000 --- a/mozilla/camino/src/preferences/MVPreferencesMultipleIconView.m +++ /dev/null @@ -1,434 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Chimera code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#import "MVPreferencesMultipleIconView.h" -#import "MVPreferencesController.h" -#import "ImageAdditions.h" - -@interface MVPreferencesMultipleIconView (MVPreferencesMultipleIconViewPrivate) -- (void) _focusFirst; -- (void) _focusLast; -- (unsigned int) _iconsWide; -- (unsigned int) _numberOfIcons; -- (unsigned int) _numberOfRows; -- (BOOL) _isIconSelectedAtIndex:(unsigned int) index; -- (BOOL) _column:(unsigned int *) column andRow:(unsigned int *) row forIndex:(unsigned int) index; -- (NSRect) _boundsForIndex:(unsigned int) index; -- (BOOL) _iconImage:(NSImage **) image andName:(NSString **) name forIndex:(unsigned int) index; -- (BOOL) _iconImage:(NSImage **) image andName:(NSString **) name andIdentifier:(NSString **) identifier forIndex:(unsigned int) index; -- (void) _drawIconAtIndex:(unsigned int) index drawRect:(NSRect) drawRect; -- (void) _sizeToFit; -- (BOOL) _dragIconIndex:(unsigned int) index event:(NSEvent *) event; -- (BOOL) _dragIconImage:(NSImage *) iconImage andName:(NSString *) name event:(NSEvent *) event; -- (BOOL) _dragIconImage:(NSImage *) iconImage andName:(NSString *) name andIdentifier:(NSString *) identifier event:(NSEvent *) event; -@end - -@interface MVPreferencesController (MVPreferencesControllerPrivate) -- (IBAction) _selectPreferencePane:(id) sender; -- (void) _resizeWindowForContentView:(NSView *) view; -- (NSImage *) _imageForPaneBundle:(NSBundle *) bundle; -- (NSString *) _paletteLabelForPaneBundle:(NSBundle *) bundle; -- (NSString *) _labelForPaneBundle:(NSBundle *) bundle; -@end - -@implementation MVPreferencesMultipleIconView - -const NSSize buttonSize = { 81.0, 75.0 }; -const NSSize iconSize = { 32.0, 32.0 }; -const unsigned int titleBaseline = 15; -const unsigned int iconBaseline = 30; -const unsigned int bottomBorder = 15; - -- (id) initWithFrame:(NSRect) rect { - if( ( self = [super initWithFrame:rect] ) ) { - pressedIconIndex = NSNotFound; - focusedIndex = NSNotFound; - selectedPane = nil; - } - return self; -} - -- (void) setPreferencesController:(MVPreferencesController *) newPreferencesController { - [preferencesController autorelease]; - preferencesController = [newPreferencesController retain]; - [self setNeedsDisplay:YES]; -} - -- (void) setPreferencePanes:(NSArray *) newPreferencePanes { - [preferencePanes autorelease]; - preferencePanes = [newPreferencePanes retain]; - [self _sizeToFit]; - [self setNeedsDisplay:YES]; -} - -- (NSArray *) preferencePanes { - return preferencePanes; -} - -- (void) setSelectedPane:(NSBundle *) newSelectedPane { - selectedPane = newSelectedPane; - [self setNeedsDisplay:YES]; -} - -- (void) mouseDown:(NSEvent *) event { - NSPoint eventLocation; - NSRect slopRect; - const float dragSlop = 4.; - unsigned int index; - NSRect buttonRect; - BOOL mouseInBounds = NO; - - eventLocation = [self convertPoint:[event locationInWindow] fromView:nil]; - slopRect = NSInsetRect( NSMakeRect( eventLocation.x, eventLocation.y, 1., 1. ), -dragSlop, -dragSlop ); - - index = floor( eventLocation.x / buttonSize.width ) + ( floor( eventLocation.y / buttonSize.height ) * [self _iconsWide] ); - buttonRect = [self _boundsForIndex:index]; - if( index >= ( [self _iconsWide] * ( floor( eventLocation.y / buttonSize.height ) + 1 ) ) ) return; - if( ! NSWidth( buttonRect ) ) return; - - pressedIconIndex = index; - [self setNeedsDisplayInRect:[self _boundsForIndex:index]]; - - while( 1 ) { - NSEvent *nextEvent; - NSPoint nextEventLocation; - unsigned int newPressedIconIndex; - - nextEvent = [NSApp nextEventMatchingMask:NSLeftMouseDraggedMask|NSLeftMouseUpMask untilDate:[NSDate distantFuture] inMode:NSEventTrackingRunLoopMode dequeue:YES]; - - nextEventLocation = [self convertPoint:[nextEvent locationInWindow] fromView:nil]; - mouseInBounds = NSMouseInRect(nextEventLocation, buttonRect, [self isFlipped]); - newPressedIconIndex = ( mouseInBounds ? index : NSNotFound ); - if( newPressedIconIndex != pressedIconIndex ) { - pressedIconIndex = newPressedIconIndex; - [self setNeedsDisplayInRect:[self _boundsForIndex:pressedIconIndex]]; - } - - if( [nextEvent type] == NSLeftMouseUp ) break; - else if( ! NSMouseInRect( nextEventLocation, slopRect, NO ) ) { - if( [self _dragIconIndex:index event:event] ) { - mouseInBounds = NO; - break; - } - } - } - - pressedIconIndex = NSNotFound; - [self setNeedsDisplayInRect:[self _boundsForIndex:index]]; - - if( mouseInBounds ) - [preferencesController selectPreferencePaneByIdentifier:[[preferencePanes objectAtIndex:index] bundleIdentifier]]; -} - -#define kTabCharCode 9 -#define kShiftTabCharCode 25 -#define kSpaceCharCode 32 - -- (void) keyDown:(NSEvent *) theEvent { - NSView *nextView = nil; - if( [[theEvent charactersIgnoringModifiers] characterAtIndex:0] == kTabCharCode ) { - [self setKeyboardFocusRingNeedsDisplayInRect:[self _boundsForIndex:focusedIndex]]; - if( focusedIndex == NSNotFound && [self _numberOfIcons] ) focusedIndex = 0; - else if( ! ( [theEvent modifierFlags] & NSShiftKeyMask ) ) focusedIndex++; - if( focusedIndex >= [self _numberOfIcons] ) { - if( ( nextView = [self nextValidKeyView] ) ) { - [[self window] makeFirstResponder:nextView]; - focusedIndex = NSNotFound; - if( [nextView isKindOfClass:[MVPreferencesMultipleIconView class]] ) - [(MVPreferencesMultipleIconView *)nextView _focusFirst]; - } else focusedIndex = 0; - } - if( ! [self _numberOfIcons] ) focusedIndex = NSNotFound; - [self setNeedsDisplayInRect:[self _boundsForIndex:focusedIndex]]; - } else if( [[theEvent charactersIgnoringModifiers] characterAtIndex:0] == kShiftTabCharCode ) { - [self setKeyboardFocusRingNeedsDisplayInRect:[self _boundsForIndex:focusedIndex]]; - if( focusedIndex == NSNotFound && [self _numberOfIcons] ) focusedIndex = [self _numberOfIcons] - 1; - else if( [theEvent modifierFlags] & NSShiftKeyMask ) focusedIndex--; - if( (signed) focusedIndex < 0 && [self _numberOfIcons] ) { - if( ( nextView = [self previousValidKeyView] ) ) { - [[self window] makeFirstResponder:nextView]; - focusedIndex = NSNotFound; - if( [nextView isKindOfClass:[MVPreferencesMultipleIconView class]] ) - [(MVPreferencesMultipleIconView *)nextView _focusLast]; - } else focusedIndex = [self _numberOfIcons] - 1; - } - if( ! [self _numberOfIcons] ) focusedIndex = NSNotFound; - [self setNeedsDisplayInRect:[self _boundsForIndex:focusedIndex]]; - } else if( [[theEvent charactersIgnoringModifiers] characterAtIndex:0] == kSpaceCharCode ) { - if( focusedIndex != NSNotFound && focusedIndex < [self _numberOfIcons] && focusedIndex >= 0 ) { - [preferencesController selectPreferencePaneByIdentifier:[[preferencePanes objectAtIndex:focusedIndex] bundleIdentifier]]; - focusedIndex = NSNotFound; - } - } -} - -- (BOOL) acceptsFirstResponder { - return YES; -} - -- (BOOL) becomeFirstResponder { - focusedIndex = NSNotFound; - return YES; -} - -- (BOOL) resignFirstResponder { - [self setKeyboardFocusRingNeedsDisplayInRect:[self _boundsForIndex:focusedIndex]]; - focusedIndex = NSNotFound; - return YES; -} - -- (void) drawRect:(NSRect) rect { - unsigned int paneIndex, paneCount; - - paneCount = [self _numberOfIcons]; - for( paneIndex = 0; paneIndex < paneCount; paneIndex++ ) - [self _drawIconAtIndex:paneIndex drawRect:rect]; -} - -- (BOOL) isFlipped { - return YES; -} - -- (BOOL) isOpaque { - return NO; -} - -- (int) tag { - return tag; -} - -- (void) setTag:(int) newTag { - tag = newTag; -} - -- (NSDragOperation) draggingSourceOperationMaskForLocal:(BOOL) flag { - return NSDragOperationMove; -} - -- (void) draggedImage:(NSImage *)image endedAt:(NSPoint) screenPoint operation:(NSDragOperation) operation { -} - -- (BOOL) ignoreModifierKeysWhileDragging { - return YES; -} -@end - -@implementation MVPreferencesMultipleIconView (MVPreferencesMultipleIconViewPrivate) -- (void) _focusFirst { - focusedIndex = 0; - [self setNeedsDisplayInRect:[self _boundsForIndex:focusedIndex]]; -} - -- (void) _focusLast { - focusedIndex = [self _numberOfIcons] - 1; - [self setNeedsDisplayInRect:[self _boundsForIndex:focusedIndex]]; -} - -- (unsigned int) _iconsWide { - return NSWidth( [self bounds] ) / buttonSize.width; -} - -- (unsigned int) _numberOfIcons { - return [[self preferencePanes] count]; -} - -- (unsigned int) _numberOfRows { - unsigned int row = 0, column = 0; - if( ! [self _column:&column andRow:&row forIndex:[self _numberOfIcons] - 1] ) return 0; - return row; -} - -- (BOOL) _isIconSelectedAtIndex:(unsigned int) index { - return [[self preferencePanes] objectAtIndex:index] == selectedPane; -} - -- (BOOL) _column:(unsigned int *) column andRow:(unsigned int *) row forIndex:(unsigned int) index { - if( index >= [self _numberOfIcons] ) return NO; - - *row = index / [self _iconsWide]; - *column = index % [self _iconsWide]; - - return YES; -} - -- (NSRect) _boundsForIndex:(unsigned int) index { - unsigned int row = 0, column = 0, leftEdge = 0; - - if( ! [self _column:&column andRow:&row forIndex:index] ) return NSZeroRect; - - leftEdge = ( NSWidth( _bounds ) - ( [self _iconsWide] * buttonSize.width ) ) / 2. ; - - return NSMakeRect( ( column * buttonSize.width ) + leftEdge, row * buttonSize.height - (row * 6), buttonSize.width, buttonSize.height ); -} - -- (BOOL) _iconImage:(NSImage **) image andName:(NSString **) name forIndex:(unsigned int) index { - NSString *unused; - return [self _iconImage:image andName:name andIdentifier:&unused forIndex:index]; -} - -- (BOOL) _iconImage:(NSImage **) image andName:(NSString **) name andIdentifier:(NSString **) identifier forIndex:(unsigned int) index { - NSDictionary *info = nil; - NSBundle *pane = nil; - - if( index >= [self _numberOfIcons] ) return NO; - - pane = [[self preferencePanes] objectAtIndex:index]; - info = [pane infoDictionary]; - *image = [preferencesController _imageForPaneBundle:pane]; - *name = [preferencesController _paletteLabelForPaneBundle:pane]; - *identifier = [pane bundleIdentifier]; - - return YES; -} - -- (void) _drawIconAtIndex:(unsigned int) index drawRect:(NSRect) drawRect { - NSImage *image; - NSString *name; - unsigned int row, column; - NSPoint drawPoint; - float nameHeight; - NSRect buttonRect, destinationRect; - NSDictionary *attributesDictionary; - NSMutableParagraphStyle *paraStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort]; - - buttonRect = [self _boundsForIndex:index]; - if( ! NSIntersectsRect( buttonRect, drawRect ) ) return; - if( ! [self _iconImage:&image andName:&name forIndex:index] ) return; - if( ! [self _column:&column andRow:&row forIndex:index] ) return; - - // Draw dark gray rectangle around currently selected icon (for MultipleIconView) - if( [self _isIconSelectedAtIndex:index] ) { - [[NSColor colorWithCalibratedWhite:0.8 alpha:0.75] set]; - NSRectFillUsingOperation(buttonRect, NSCompositeSourceOver); - } - - if( focusedIndex == index ) { - CGContextSaveGState( context ); - NSSetFocusRingStyle( NSFocusRingAbove ); - } - - // Draw icon, dark if it is currently being pressed - destinationRect = NSIntegralRect( NSMakeRect( NSMidX( buttonRect) - iconSize.width / 2., NSMaxY( buttonRect ) - iconBaseline - iconSize.height, iconSize.width, iconSize.height ) ); - destinationRect.size = iconSize; - if( index != pressedIconIndex && image ) - [image drawFlippedInRect:destinationRect operation:NSCompositeSourceOver fraction:1.]; - else if( image ) - { - NSImage *darkImage; - NSSize darkImageSize; - - darkImage = [image copy]; - darkImageSize = [darkImage size]; - [darkImage lockFocus]; - { - [[NSColor blackColor] set]; - NSRectFillUsingOperation( NSMakeRect( 0., 0., darkImageSize.width, darkImageSize.height ), NSCompositeSourceIn ); - [darkImage unlockFocus]; - } - - [darkImage drawFlippedInRect:destinationRect operation:NSCompositeSourceOver fraction:1.]; - [image drawFlippedInRect:destinationRect operation:NSCompositeSourceOver fraction:.6666667]; - [darkImage release]; - } - if( focusedIndex == index ) - CGContextRestoreGState( context ); - - // Draw text - [paraStyle setAlignment:NSCenterTextAlignment]; - attributesDictionary = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont toolTipsFontOfSize:11.], NSFontAttributeName, paraStyle, NSParagraphStyleAttributeName, nil]; - nameHeight = [[NSFont toolTipsFontOfSize:11.] defaultLineHeightForFont]; - drawPoint = NSMakePoint( rint( buttonSize.width + 2 * NSMinX( buttonRect ) - NSWidth( _bounds ) - 1 ), rint( NSMaxY( buttonRect ) - titleBaseline - nameHeight ) ); - [name drawAtPoint:drawPoint withAttributes:attributesDictionary]; -} - -- (void) _sizeToFit { - if( ! [self preferencePanes] ) return; - [self setFrameSize:NSMakeSize( NSWidth( _bounds ), NSMaxY( [self _boundsForIndex:[self _numberOfIcons] - 1] ) + bottomBorder ) ]; -} - -- (BOOL) _dragIconIndex:(unsigned int) index event:(NSEvent *) event { - NSImage *iconImage; - NSString *name; - NSString *identifier; - - if( ! [self _iconImage:&iconImage andName:&name andIdentifier:&identifier forIndex:index] ) - return YES; - - return [self _dragIconImage:iconImage andName:name andIdentifier:identifier event:event]; -} - -- (BOOL) _dragIconImage:(NSImage *) iconImage andName:(NSString *) name event:(NSEvent *) event { - return [self _dragIconImage:iconImage andName:name andIdentifier:name event:event]; -} - -- (BOOL) _dragIconImage:(NSImage *) iconImage andName:(NSString *) name andIdentifier:(NSString *) identifier event:(NSEvent *) event { - NSImage *dragImage; - NSPasteboard *pasteboard; - NSPoint dragPoint, startPoint; - NSMutableParagraphStyle *paraStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - - dragImage = [[NSImage alloc] initWithSize:buttonSize]; - [dragImage lockFocus]; - { - float nameHeight; - NSSize nameSize; - NSDictionary *attributesDictionary; - - [iconImage drawInRect:NSMakeRect( buttonSize.width / 2. - iconSize.width / 2., iconBaseline, iconSize.width, iconSize.height ) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:.5]; - - [paraStyle setAlignment:NSCenterTextAlignment]; - attributesDictionary = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont toolTipsFontOfSize:11.], NSFontAttributeName, [[NSColor blackColor] colorWithAlphaComponent:.5], NSForegroundColorAttributeName, paraStyle, NSParagraphStyleAttributeName, nil]; - nameSize = [name sizeWithAttributes:attributesDictionary]; - nameHeight = [[NSFont toolTipsFontOfSize:11.] defaultLineHeightForFont]; - [name drawAtPoint:NSMakePoint( 0., nameHeight + titleBaseline - nameSize.height ) withAttributes:attributesDictionary]; - [dragImage unlockFocus]; - } - - pasteboard = [NSPasteboard pasteboardWithName:NSDragPboard]; - [pasteboard declareTypes:[NSArray arrayWithObject:@"NSToolbarIndividualItemDragType"] owner:nil]; - [pasteboard setString:identifier forType:@"NSToolbarItemIdentiferPboardType"]; - - dragPoint = [self convertPoint:[event locationInWindow] fromView:nil]; - startPoint = [self _boundsForIndex:[preferencePanes indexOfObject:[NSBundle bundleWithIdentifier:identifier]]].origin; - startPoint.y += buttonSize.height; - [self setNeedsDisplayInRect:[self _boundsForIndex:pressedIconIndex]]; - pressedIconIndex = NSNotFound; - [self dragImage:dragImage at:startPoint offset:NSZeroSize event:event pasteboard:pasteboard source:self slideBack:YES]; - - return YES; -} -@end \ No newline at end of file