Fix prefs not getting written out (patch from bfoucher@mac.com). Removing

smooth text menu item since the non-atsui version is so much faster, we
always want it on.
This commit is contained in:
pinkerton%netscape.com 2002-06-06 21:13:10 +00:00
parent cf6fe30a58
commit 28b955fa68
20 changed files with 46 additions and 178 deletions

View File

@ -3,13 +3,13 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>78 90 356 240 0 0 1152 746 </string>
<string>78 108 356 240 0 0 1152 848 </string>
<key>IBEditorPositions</key>
<dict>
<key>266</key>
<string>418 452 277 90 0 0 1152 746 </string>
<key>29</key>
<string>0 702 446 44 0 0 1152 746 </string>
<string>0 804 446 44 0 0 1152 848 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -34,6 +34,6 @@
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
<string>5S60</string>
</dict>
</plist>

Binary file not shown.

View File

@ -98,7 +98,6 @@ class BookmarksService;
-(IBAction) doStop:(id)aSender;
-(IBAction) biggerTextSize:(id)aSender;
-(IBAction) smallerTextSize:(id)aSender;
-(IBAction) toggleSmoothText:(id)aSender;
-(IBAction) viewSource:(id)aSender;
// Bookmarks menu actions.

View File

@ -64,7 +64,6 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
{
[super dealloc];
[mFindDialog release];
[mPreferenceManager release];
printf("Main controller died.\n");
}
@ -291,7 +290,14 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
mMenuBookmarks->RemoveObserver();
delete mMenuBookmarks;
mMenuBookmarks = nsnull;
// Release before calling TermEmbedding since we need to access XPCOM
// to save preferences
[mPreferenceManager release];
nsCocoaBrowserService::TermEmbedding();
[self autorelease];
}
// Bookmarks menu actions.
@ -402,28 +408,6 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
[[[mApplication mainWindow] windowController] smallerTextSize];
}
- (IBAction)toggleSmoothText:(id)aSender
{
// Grab the prefs service and just set the pref directly.
nsCOMPtr<nsIPrefBranch> pref(do_GetService("@mozilla.org/preferences-service;1"));
if (!pref)
return; // Something bad happened if we can't get prefs.
int mode;
pref->GetIntPref("nglayout.mac.renderingmode", &mode);
if (mode == 0) {
// Turn on ATSUI Quartz.
pref->SetIntPref("nglayout.mac.renderingmode", 1);
// Check the menu.
[aSender setState: NSOnState];
} else {
// Turn off ATSUI Quartz and use Quickdraw.
pref->SetIntPref("nglayout.mac.renderingmode", 0);
// Uncheck the menu.
[aSender setState: NSOffState];
}
}
-(IBAction) viewSource:(id)aSender
{
NSWindow* mainWindow = [mApplication mainWindow];
@ -431,25 +415,9 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
[[mainWindow windowController] viewSource: self];
}
static PRBool gSetupSmoothTextMenu = PR_FALSE;
-(BOOL)validateMenuItem: (id <NSMenuItem> )aMenuItem
{
// XXXDWH I should not be using strings here. Not localizable.
// SHould use tags instead.
if ([[aMenuItem title] isEqualToString: @"Smooth Text"] &&
!gSetupSmoothTextMenu) {
gSetupSmoothTextMenu = PR_TRUE;
// Grab the prefs service and just set the pref directly.
nsCOMPtr<nsIPrefBranch> pref(do_GetService("@mozilla.org/preferences-service;1"));
int mode;
pref->GetIntPref("nglayout.mac.renderingmode", &mode);
if (mode == 0)
[aMenuItem setState: NSOffState];
else
[aMenuItem setState: NSOnState];
}
return YES;
}

View File

@ -3,13 +3,13 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>78 90 356 240 0 0 1152 746 </string>
<string>78 108 356 240 0 0 1152 848 </string>
<key>IBEditorPositions</key>
<dict>
<key>266</key>
<string>418 452 277 90 0 0 1152 746 </string>
<key>29</key>
<string>0 702 446 44 0 0 1152 746 </string>
<string>0 804 446 44 0 0 1152 848 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -34,6 +34,6 @@
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
<string>5S60</string>
</dict>
</plist>

Binary file not shown.

View File

@ -3,13 +3,13 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>78 90 356 240 0 0 1152 746 </string>
<string>78 108 356 240 0 0 1152 848 </string>
<key>IBEditorPositions</key>
<dict>
<key>266</key>
<string>418 452 277 90 0 0 1152 746 </string>
<key>29</key>
<string>0 702 446 44 0 0 1152 746 </string>
<string>0 804 446 44 0 0 1152 848 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -34,6 +34,6 @@
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
<string>5S60</string>
</dict>
</plist>

View File

@ -98,7 +98,6 @@ class BookmarksService;
-(IBAction) doStop:(id)aSender;
-(IBAction) biggerTextSize:(id)aSender;
-(IBAction) smallerTextSize:(id)aSender;
-(IBAction) toggleSmoothText:(id)aSender;
-(IBAction) viewSource:(id)aSender;
// Bookmarks menu actions.

View File

@ -64,7 +64,6 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
{
[super dealloc];
[mFindDialog release];
[mPreferenceManager release];
printf("Main controller died.\n");
}
@ -291,7 +290,14 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
mMenuBookmarks->RemoveObserver();
delete mMenuBookmarks;
mMenuBookmarks = nsnull;
// Release before calling TermEmbedding since we need to access XPCOM
// to save preferences
[mPreferenceManager release];
nsCocoaBrowserService::TermEmbedding();
[self autorelease];
}
// Bookmarks menu actions.
@ -402,28 +408,6 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
[[[mApplication mainWindow] windowController] smallerTextSize];
}
- (IBAction)toggleSmoothText:(id)aSender
{
// Grab the prefs service and just set the pref directly.
nsCOMPtr<nsIPrefBranch> pref(do_GetService("@mozilla.org/preferences-service;1"));
if (!pref)
return; // Something bad happened if we can't get prefs.
int mode;
pref->GetIntPref("nglayout.mac.renderingmode", &mode);
if (mode == 0) {
// Turn on ATSUI Quartz.
pref->SetIntPref("nglayout.mac.renderingmode", 1);
// Check the menu.
[aSender setState: NSOnState];
} else {
// Turn off ATSUI Quartz and use Quickdraw.
pref->SetIntPref("nglayout.mac.renderingmode", 0);
// Uncheck the menu.
[aSender setState: NSOffState];
}
}
-(IBAction) viewSource:(id)aSender
{
NSWindow* mainWindow = [mApplication mainWindow];
@ -431,25 +415,9 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
[[mainWindow windowController] viewSource: self];
}
static PRBool gSetupSmoothTextMenu = PR_FALSE;
-(BOOL)validateMenuItem: (id <NSMenuItem> )aMenuItem
{
// XXXDWH I should not be using strings here. Not localizable.
// SHould use tags instead.
if ([[aMenuItem title] isEqualToString: @"Smooth Text"] &&
!gSetupSmoothTextMenu) {
gSetupSmoothTextMenu = PR_TRUE;
// Grab the prefs service and just set the pref directly.
nsCOMPtr<nsIPrefBranch> pref(do_GetService("@mozilla.org/preferences-service;1"));
int mode;
pref->GetIntPref("nglayout.mac.renderingmode", &mode);
if (mode == 0)
[aMenuItem setState: NSOffState];
else
[aMenuItem setState: NSOnState];
}
return YES;
}

View File

@ -3,13 +3,13 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>78 90 356 240 0 0 1152 746 </string>
<string>78 108 356 240 0 0 1152 848 </string>
<key>IBEditorPositions</key>
<dict>
<key>266</key>
<string>418 452 277 90 0 0 1152 746 </string>
<key>29</key>
<string>0 702 446 44 0 0 1152 746 </string>
<string>0 804 446 44 0 0 1152 848 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -34,6 +34,6 @@
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
<string>5S60</string>
</dict>
</plist>

Binary file not shown.

View File

@ -98,7 +98,6 @@ class BookmarksService;
-(IBAction) doStop:(id)aSender;
-(IBAction) biggerTextSize:(id)aSender;
-(IBAction) smallerTextSize:(id)aSender;
-(IBAction) toggleSmoothText:(id)aSender;
-(IBAction) viewSource:(id)aSender;
// Bookmarks menu actions.

View File

@ -64,7 +64,6 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
{
[super dealloc];
[mFindDialog release];
[mPreferenceManager release];
printf("Main controller died.\n");
}
@ -291,7 +290,14 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
mMenuBookmarks->RemoveObserver();
delete mMenuBookmarks;
mMenuBookmarks = nsnull;
// Release before calling TermEmbedding since we need to access XPCOM
// to save preferences
[mPreferenceManager release];
nsCocoaBrowserService::TermEmbedding();
[self autorelease];
}
// Bookmarks menu actions.
@ -402,28 +408,6 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
[[[mApplication mainWindow] windowController] smallerTextSize];
}
- (IBAction)toggleSmoothText:(id)aSender
{
// Grab the prefs service and just set the pref directly.
nsCOMPtr<nsIPrefBranch> pref(do_GetService("@mozilla.org/preferences-service;1"));
if (!pref)
return; // Something bad happened if we can't get prefs.
int mode;
pref->GetIntPref("nglayout.mac.renderingmode", &mode);
if (mode == 0) {
// Turn on ATSUI Quartz.
pref->SetIntPref("nglayout.mac.renderingmode", 1);
// Check the menu.
[aSender setState: NSOnState];
} else {
// Turn off ATSUI Quartz and use Quickdraw.
pref->SetIntPref("nglayout.mac.renderingmode", 0);
// Uncheck the menu.
[aSender setState: NSOffState];
}
}
-(IBAction) viewSource:(id)aSender
{
NSWindow* mainWindow = [mApplication mainWindow];
@ -431,25 +415,9 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
[[mainWindow windowController] viewSource: self];
}
static PRBool gSetupSmoothTextMenu = PR_FALSE;
-(BOOL)validateMenuItem: (id <NSMenuItem> )aMenuItem
{
// XXXDWH I should not be using strings here. Not localizable.
// SHould use tags instead.
if ([[aMenuItem title] isEqualToString: @"Smooth Text"] &&
!gSetupSmoothTextMenu) {
gSetupSmoothTextMenu = PR_TRUE;
// Grab the prefs service and just set the pref directly.
nsCOMPtr<nsIPrefBranch> pref(do_GetService("@mozilla.org/preferences-service;1"));
int mode;
pref->GetIntPref("nglayout.mac.renderingmode", &mode);
if (mode == 0)
[aMenuItem setState: NSOffState];
else
[aMenuItem setState: NSOnState];
}
return YES;
}

View File

@ -3,13 +3,13 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>78 90 356 240 0 0 1152 746 </string>
<string>78 108 356 240 0 0 1152 848 </string>
<key>IBEditorPositions</key>
<dict>
<key>266</key>
<string>418 452 277 90 0 0 1152 746 </string>
<key>29</key>
<string>0 702 446 44 0 0 1152 746 </string>
<string>0 804 446 44 0 0 1152 848 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -34,6 +34,6 @@
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
<string>5S60</string>
</dict>
</plist>

Binary file not shown.

View File

@ -3,13 +3,13 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>78 90 356 240 0 0 1152 746 </string>
<string>78 108 356 240 0 0 1152 848 </string>
<key>IBEditorPositions</key>
<dict>
<key>266</key>
<string>418 452 277 90 0 0 1152 746 </string>
<key>29</key>
<string>0 702 446 44 0 0 1152 746 </string>
<string>0 804 446 44 0 0 1152 848 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -34,6 +34,6 @@
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
<string>5S60</string>
</dict>
</plist>

View File

@ -98,7 +98,6 @@ class BookmarksService;
-(IBAction) doStop:(id)aSender;
-(IBAction) biggerTextSize:(id)aSender;
-(IBAction) smallerTextSize:(id)aSender;
-(IBAction) toggleSmoothText:(id)aSender;
-(IBAction) viewSource:(id)aSender;
// Bookmarks menu actions.

View File

@ -64,7 +64,6 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
{
[super dealloc];
[mFindDialog release];
[mPreferenceManager release];
printf("Main controller died.\n");
}
@ -291,7 +290,14 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
mMenuBookmarks->RemoveObserver();
delete mMenuBookmarks;
mMenuBookmarks = nsnull;
// Release before calling TermEmbedding since we need to access XPCOM
// to save preferences
[mPreferenceManager release];
nsCocoaBrowserService::TermEmbedding();
[self autorelease];
}
// Bookmarks menu actions.
@ -402,28 +408,6 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
[[[mApplication mainWindow] windowController] smallerTextSize];
}
- (IBAction)toggleSmoothText:(id)aSender
{
// Grab the prefs service and just set the pref directly.
nsCOMPtr<nsIPrefBranch> pref(do_GetService("@mozilla.org/preferences-service;1"));
if (!pref)
return; // Something bad happened if we can't get prefs.
int mode;
pref->GetIntPref("nglayout.mac.renderingmode", &mode);
if (mode == 0) {
// Turn on ATSUI Quartz.
pref->SetIntPref("nglayout.mac.renderingmode", 1);
// Check the menu.
[aSender setState: NSOnState];
} else {
// Turn off ATSUI Quartz and use Quickdraw.
pref->SetIntPref("nglayout.mac.renderingmode", 0);
// Uncheck the menu.
[aSender setState: NSOffState];
}
}
-(IBAction) viewSource:(id)aSender
{
NSWindow* mainWindow = [mApplication mainWindow];
@ -431,25 +415,9 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
[[mainWindow windowController] viewSource: self];
}
static PRBool gSetupSmoothTextMenu = PR_FALSE;
-(BOOL)validateMenuItem: (id <NSMenuItem> )aMenuItem
{
// XXXDWH I should not be using strings here. Not localizable.
// SHould use tags instead.
if ([[aMenuItem title] isEqualToString: @"Smooth Text"] &&
!gSetupSmoothTextMenu) {
gSetupSmoothTextMenu = PR_TRUE;
// Grab the prefs service and just set the pref directly.
nsCOMPtr<nsIPrefBranch> pref(do_GetService("@mozilla.org/preferences-service;1"));
int mode;
pref->GetIntPref("nglayout.mac.renderingmode", &mode);
if (mode == 0)
[aMenuItem setState: NSOffState];
else
[aMenuItem setState: NSOnState];
}
return YES;
}