From 96d102b6f56e337a2b19e834500a9a50dd226aee Mon Sep 17 00:00:00 2001 From: "stuart.morgan%alumni.case.edu" Date: Thu, 13 Dec 2007 21:51:19 +0000 Subject: [PATCH] Camino only - Bug 405763: Prevent hiding of the preference window's toolbar. r/sr=mento git-svn-id: svn://10.0.0.236/trunk@240994 18797224-902f-48f8-a5cc-f745e15eee43 --- .../camino/Camino.xcodeproj/project.pbxproj | 13 +++++ .../MVPreferences.nib/classes.nib | 3 +- .../English.lproj/MVPreferences.nib/info.nib | 6 +-- .../MVPreferences.nib/keyedobjects.nib | Bin 5008 -> 5018 bytes .../preferences/MVPreferencesController.mm | 4 ++ .../src/preferences/PreferencesWindow.h | 46 ++++++++++++++++ .../src/preferences/PreferencesWindow.m | 51 ++++++++++++++++++ 7 files changed, 119 insertions(+), 4 deletions(-) create mode 100644 mozilla/camino/src/preferences/PreferencesWindow.h create mode 100644 mozilla/camino/src/preferences/PreferencesWindow.m diff --git a/mozilla/camino/Camino.xcodeproj/project.pbxproj b/mozilla/camino/Camino.xcodeproj/project.pbxproj index 1e99fdc6be0..c5a1ba2045a 100644 --- a/mozilla/camino/Camino.xcodeproj/project.pbxproj +++ b/mozilla/camino/Camino.xcodeproj/project.pbxproj @@ -287,6 +287,10 @@ 33B777E20C55890200A6D67F /* libmozlcms.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 33B777E10C5588E500A6D67F /* libmozlcms.a */; }; 33B778810C55C58500A6D67F /* libnssdbm3.dylib in Copy Security Libraries */ = {isa = PBXBuildFile; fileRef = 33B778800C55C57800A6D67F /* libnssdbm3.dylib */; }; 33B778820C55C59A00A6D67F /* libnssdbm3.dylib in Copy Security Libraries */ = {isa = PBXBuildFile; fileRef = 33B778800C55C57800A6D67F /* libnssdbm3.dylib */; }; + 33C222860D106CDD00611936 /* PreferencesWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 33C222840D106CDD00611936 /* PreferencesWindow.h */; }; + 33C222870D106CDD00611936 /* PreferencesWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 33C222850D106CDD00611936 /* PreferencesWindow.m */; }; + 33C222880D106CDD00611936 /* PreferencesWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 33C222840D106CDD00611936 /* PreferencesWindow.h */; }; + 33C222890D106CDD00611936 /* PreferencesWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 33C222850D106CDD00611936 /* PreferencesWindow.m */; }; 33F3B70B0C63F5F7007DFBD0 /* ScriptingSupport.mm in Sources */ = {isa = PBXBuildFile; fileRef = 33F3B70A0C63F5F7007DFBD0 /* ScriptingSupport.mm */; }; 33F3B70C0C63F5F7007DFBD0 /* ScriptingSupport.mm in Sources */ = {isa = PBXBuildFile; fileRef = 33F3B70A0C63F5F7007DFBD0 /* ScriptingSupport.mm */; }; 33FBAAF80C84D0AB00DD459E /* NSString+Gecko.h in Headers */ = {isa = PBXBuildFile; fileRef = 33FBAAF30C84D0A500DD459E /* NSString+Gecko.h */; }; @@ -2474,6 +2478,8 @@ 33B777950C55851800A6D67F /* libmozlcms.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libmozlcms.dylib; path = ../dist/bin/libmozlcms.dylib; sourceTree = SOURCE_ROOT; }; 33B777E10C5588E500A6D67F /* libmozlcms.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmozlcms.a; path = ../dist/lib/libmozlcms.a; sourceTree = SOURCE_ROOT; }; 33B778800C55C57800A6D67F /* libnssdbm3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libnssdbm3.dylib; path = ../dist/lib/libnssdbm3.dylib; sourceTree = SOURCE_ROOT; }; + 33C222840D106CDD00611936 /* PreferencesWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreferencesWindow.h; sourceTree = ""; }; + 33C222850D106CDD00611936 /* PreferencesWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreferencesWindow.m; sourceTree = ""; }; 33F3B70A0C63F5F7007DFBD0 /* ScriptingSupport.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = ScriptingSupport.mm; path = src/appleevents/ScriptingSupport.mm; sourceTree = ""; }; 33FBAAF30C84D0A500DD459E /* NSString+Gecko.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "NSString+Gecko.h"; path = "src/extensions/NSString+Gecko.h"; sourceTree = ""; }; 33FBAAFA0C84D0CA00DD459E /* NSString+Gecko.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = "NSString+Gecko.mm"; path = "src/extensions/NSString+Gecko.mm"; sourceTree = ""; }; @@ -4503,6 +4509,8 @@ F53F21EC022B7C77010001CA /* MVPreferencePaneDefaults.plist */, F53F21EF022B7C77010001CA /* MVPreferencesController.h */, F53F21F0022B7C77010001CA /* MVPreferencesController.mm */, + 33C222840D106CDD00611936 /* PreferencesWindow.h */, + 33C222850D106CDD00611936 /* PreferencesWindow.m */, ); name = "Prefs window"; sourceTree = ""; @@ -4764,6 +4772,7 @@ 337F2BA40CA200D100572F7D /* ContentDispatchChooser.h in Headers */, DE70BE710CBC7CB400C1CC63 /* ToolbarScriptItem.h in Headers */, 7B06E8140D0DC83B0032E38A /* PreferencePaneBase.h in Headers */, + 33C222860D106CDD00611936 /* PreferencesWindow.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4935,6 +4944,7 @@ 337F2BA60CA200D100572F7D /* ContentDispatchChooser.h in Headers */, DE70BE730CBC7CB400C1CC63 /* ToolbarScriptItem.h in Headers */, 7B06E8150D0DC8800032E38A /* PreferencePaneBase.h in Headers */, + 33C222880D106CDD00611936 /* PreferencesWindow.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -5203,6 +5213,7 @@ ProjectRef = 7B64B7BA0CCFD9F50098406C /* Sparkle.xcodeproj */; }, ); + projectRoot = ""; targets = ( 7BDD26CC0D0DC2BA00BA05C6 /* Camino */, 7BDD26E30D0DC30600BA05C6 /* CaminoStatic */, @@ -5807,6 +5818,7 @@ 337F2BA50CA200D100572F7D /* ContentDispatchChooser.mm in Sources */, DE70BE700CBC7CB400C1CC63 /* ToolbarScriptItem.mm in Sources */, 7B06E8160D0DC8C20032E38A /* PreferencePaneBase.mm in Sources */, + 33C222870D106CDD00611936 /* PreferencesWindow.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -5973,6 +5985,7 @@ 337F2BA70CA200D100572F7D /* ContentDispatchChooser.mm in Sources */, DE70BE720CBC7CB400C1CC63 /* ToolbarScriptItem.mm in Sources */, 7B06E8170D0DC8DC0032E38A /* PreferencePaneBase.mm in Sources */, + 33C222890D106CDD00611936 /* PreferencesWindow.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 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 42dd0f10df9..290cca02de2 100644 --- a/mozilla/camino/resources/localized/English.lproj/MVPreferences.nib/classes.nib +++ b/mozilla/camino/resources/localized/English.lproj/MVPreferences.nib/classes.nib @@ -12,7 +12,8 @@ mWindow = NSWindow; }; SUPERCLASS = NSObject; - } + }, + {CLASS = PreferencesWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; } ); IBVersion = 1; } \ No newline at end of file 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 c8d190b4c58..5f5001f5e9a 100644 --- a/mozilla/camino/resources/localized/English.lproj/MVPreferences.nib/info.nib +++ b/mozilla/camino/resources/localized/English.lproj/MVPreferences.nib/info.nib @@ -3,15 +3,15 @@ IBDocumentLocation - 100 32 356 240 0 0 1600 1002 + 87 27 356 240 0 0 1440 878 IBEditorPositions 11 475 522 615 292 0 0 1600 1002 IBFramework Version - 437.0 + 446.1 IBSystem Version - 8C46 + 8S2167 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 8f82161a80693efa8dd4d36ac8b42b60c7ad7b5a..784c589565a8bd1dba8a59cf2ebf4c0bff3f0016 100644 GIT binary patch delta 985 zcmXYreN5DK9LIk@ne!f3C4|fCM0`f$Gor%k_GSf^RES;W>kd@Ugcaq@Up{SSL zuRn@fA;^gWP01d_hoVd9$?S6JR-?IQM2tDsgQ=NGPdJxW>nH1<_deTepV#}{=Iiz) z?=jQOGsYkNOU$>Xz#~@1ib(K@U?f=ocrco{nm#bq9gF#ky#DP)-q@VdQs>BVY^~Av?#;wo7cU&FwtfN_b)VD!;>ejhh*8SenCfCX?H%zcLmWnP#i` z%W1v1{$siM=pG)!r9+GU$tXmp9c1BZ-rc zKex&#H!3IF28{~G)?tJk>r%(M()QRZCY$r@EN5G`Z8_&nmR0S}rTo znrRVBSk!X&hjqRgM;K}3K{?2a3XvZzLRF|5tw#~mh&H1ws1?g00H%KozNDh-XNgsKi93#g`iVTrq zGD1elSu#d0kjvx>`IY=mGpU#Q=v=yhE~Ja-y>tmJrNUk7V#F*EnXFUA}Kx;DKR95#fTUcXT`XMnJ+TBd4LtqQ7o)u`g?d9_pRQ%BVCxJs!L>Qi+}ji{g0&*~R7u6~1bP>>Bd;DtOW zfEh3oWiIIPeU`bK|Ab%-Ovf$&Fao3S1Du2NFs_*vT4}8_wA-cKdYbm=EInQ4>RWZbzD<`TN?gUcn{<=js$+V) deoi;*7j(N$=nlP4_vroluzowS(Uoha{sXBd5HSD% delta 947 zcmW-aeN5DK9LIkLe7~RXOf2LsSz~GVsbs{YHh9+TsKCn2U9bXYSCP3&6Tz2m;ZgX&+GMi?+SH<`YJp* z)htd%v*CEWfASv$5M{x~}+HF7v;+ z0Snc_*y>2=(ZF3#tc|Qs?!w|^27_~BR*hBd#u}`}*6ps;>uQ6pzQ~=db0)cA;p95? zZl=Hu6}dA!88nqXW>2@L*%NKBLw1QRZLjUK{rzzh^dxfrCOHI&m-t8lxt82O%E_Ii zkwi(1tRid3CbFG$lHH`2d`wP}^W-n`FP%X1XpolB3R*{-=n5L4Q5vI<(5LApx|z1o zt+bc+(~syN9id;+ujz4mf}WzM=@~jk&(YuL1t^9&Fdy!Q<&cO%Gql2XXonXd30<%g zUWVPU2lm2#con+g5cI)eNWlQ4Ap=7&3?pz7&cIpt5q@Th`B^@j&aP*r>_&DoyM>jp za<+io#;RB?TgH~NM%Khuun3E?7<-0&z`kV{x#2T-CBL6P#MdQwoVW6J{tDmA_wfU~ zhrhv7{6jv#zv8F)7{4SekuM6x6cH3tMX{JB%0-iC78}Jju|sr=9`U+3DBcuri9Yd; zI3m*Gq&O?a#P8xyaasH$#-)-znJ1^nQduTzc%QNtibCtl4HdO_$ke_M6v|PkIYIss8}Ti2rQ> diff --git a/mozilla/camino/src/preferences/MVPreferencesController.mm b/mozilla/camino/src/preferences/MVPreferencesController.mm index c164bfef56a..b9410a5e350 100644 --- a/mozilla/camino/src/preferences/MVPreferencesController.mm +++ b/mozilla/camino/src/preferences/MVPreferencesController.mm @@ -162,6 +162,10 @@ static NSString* const CacheInfoPaneSeenKey = @"MVPreferencePaneSeen"; // N [toolbar setAlwaysCustomizableByDrag:NO]; [toolbar setShowsContextMenu:NO]; [mWindow setToolbar:toolbar]; + [toolbar setVisible:YES]; + + // Prevent hiding the toolbar. + [mWindow setShowsToolbarButton:NO]; // save/restore the top-left window frame (because our size changes confuse the standard frame saving) // (Cocoa will ensure that the window isn't placed totally offscreen) diff --git a/mozilla/camino/src/preferences/PreferencesWindow.h b/mozilla/camino/src/preferences/PreferencesWindow.h new file mode 100644 index 00000000000..e146d205e14 --- /dev/null +++ b/mozilla/camino/src/preferences/PreferencesWindow.h @@ -0,0 +1,46 @@ +/* ***** 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 Camino code. + * + * The Initial Developer of the Original Code is + * Stuart Morgan. + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Stuart Morgan + * + * 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 + + +// Provides custom behaviors for the preferences window. +@interface PreferencesWindow : NSWindow { + +} + +@end diff --git a/mozilla/camino/src/preferences/PreferencesWindow.m b/mozilla/camino/src/preferences/PreferencesWindow.m new file mode 100644 index 00000000000..e5cbe684cad --- /dev/null +++ b/mozilla/camino/src/preferences/PreferencesWindow.m @@ -0,0 +1,51 @@ +/* ***** 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 Camino code. + * + * The Initial Developer of the Original Code is + * Stuart Morgan. + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Stuart Morgan + * + * 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 "PreferencesWindow.h" + + +@implementation PreferencesWindow + +- (BOOL)validateMenuItem:(NSMenuItem *)menuItem +{ + // Disable toolbar toggling + if ([menuItem action] == @selector(toggleToolbarShown:)) + return NO; + return [super validateMenuItem:menuItem]; +} + +@end