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
This commit is contained in:
stuart.morgan%alumni.case.edu 2007-12-13 21:51:19 +00:00
parent d7844803ff
commit 96d102b6f5
7 changed files with 119 additions and 4 deletions

View File

@ -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 = "<group>"; };
33C222850D106CDD00611936 /* PreferencesWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreferencesWindow.m; sourceTree = "<group>"; };
33F3B70A0C63F5F7007DFBD0 /* ScriptingSupport.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = ScriptingSupport.mm; path = src/appleevents/ScriptingSupport.mm; sourceTree = "<group>"; };
33FBAAF30C84D0A500DD459E /* NSString+Gecko.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "NSString+Gecko.h"; path = "src/extensions/NSString+Gecko.h"; sourceTree = "<group>"; };
33FBAAFA0C84D0CA00DD459E /* NSString+Gecko.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = "NSString+Gecko.mm"; path = "src/extensions/NSString+Gecko.mm"; sourceTree = "<group>"; };
@ -4503,6 +4509,8 @@
F53F21EC022B7C77010001CA /* MVPreferencePaneDefaults.plist */,
F53F21EF022B7C77010001CA /* MVPreferencesController.h */,
F53F21F0022B7C77010001CA /* MVPreferencesController.mm */,
33C222840D106CDD00611936 /* PreferencesWindow.h */,
33C222850D106CDD00611936 /* PreferencesWindow.m */,
);
name = "Prefs window";
sourceTree = "<group>";
@ -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;
};

View File

@ -12,7 +12,8 @@
mWindow = NSWindow;
};
SUPERCLASS = NSObject;
}
},
{CLASS = PreferencesWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; }
);
IBVersion = 1;
}

View File

@ -3,15 +3,15 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>100 32 356 240 0 0 1600 1002 </string>
<string>87 27 356 240 0 0 1440 878 </string>
<key>IBEditorPositions</key>
<dict>
<key>11</key>
<string>475 522 615 292 0 0 1600 1002 </string>
</dict>
<key>IBFramework Version</key>
<string>437.0</string>
<string>446.1</string>
<key>IBSystem Version</key>
<string>8C46</string>
<string>8S2167</string>
</dict>
</plist>

View File

@ -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)

View File

@ -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 <stuart.morgan@alumni.case.edu>
*
* 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 <Cocoa/Cocoa.h>
// Provides custom behaviors for the preferences window.
@interface PreferencesWindow : NSWindow {
}
@end

View File

@ -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 <stuart.morgan@alumni.case.edu>
*
* 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