diff --git a/camino/PreferencePanes/Security/English.lproj/Security.nib/classes.nib b/camino/PreferencePanes/Security/English.lproj/Security.nib/classes.nib index ebc34fa83064..aa11c0dd228a 100644 --- a/camino/PreferencePanes/Security/English.lproj/Security.nib/classes.nib +++ b/camino/PreferencePanes/Security/English.lproj/Security.nib/classes.nib @@ -14,6 +14,7 @@ }, { ACTIONS = { + clickCertificateSelectionBehavior = id; clickEnableLeaveEncrypted = id; clickEnableLoadLowGrade = id; clickEnableViewMixed = id; @@ -21,7 +22,12 @@ }; CLASS = OrgMozillaChimeraPreferenceSecurity; LANGUAGE = ObjC; - OUTLETS = {mLeaveEncrypted = NSButton; mLoadLowGrade = NSButton; mViewMixed = NSButton; }; + OUTLETS = { + mCertificateBehavior = NSMatrix; + mLeaveEncrypted = NSButton; + mLoadLowGrade = NSButton; + mViewMixed = NSButton; + }; SUPERCLASS = PreferencePaneBase; }, {CLASS = PreferencePaneBase; LANGUAGE = ObjC; SUPERCLASS = NSPreferencePane; } diff --git a/camino/PreferencePanes/Security/English.lproj/Security.nib/info.nib b/camino/PreferencePanes/Security/English.lproj/Security.nib/info.nib index 2c9a45f88451..7644e480beeb 100644 --- a/camino/PreferencePanes/Security/English.lproj/Security.nib/info.nib +++ b/camino/PreferencePanes/Security/English.lproj/Security.nib/info.nib @@ -3,10 +3,26 @@ IBDocumentLocation - 56 71 356 240 0 0 1600 1002 + 21 1 356 240 0 0 1024 746 IBFramework Version - 437.0 + 446.1 + IBOpenObjects + + 5 + IBSystem Version - 8C46 + 8I127 + IBUserGuides + + 5 + + guideLocations + + Vertical:297.000000 + + guidesLocked + + + diff --git a/camino/PreferencePanes/Security/English.lproj/Security.nib/objects.nib b/camino/PreferencePanes/Security/English.lproj/Security.nib/objects.nib index 27fa0f016592..d4b05dd95eaa 100644 Binary files a/camino/PreferencePanes/Security/English.lproj/Security.nib/objects.nib and b/camino/PreferencePanes/Security/English.lproj/Security.nib/objects.nib differ diff --git a/camino/PreferencePanes/Security/SecurityPane.h b/camino/PreferencePanes/Security/SecurityPane.h index 155521ad7c36..fbe49db3fde7 100644 --- a/camino/PreferencePanes/Security/SecurityPane.h +++ b/camino/PreferencePanes/Security/SecurityPane.h @@ -47,12 +47,15 @@ class nsIPref; IBOutlet NSButton* mLeaveEncrypted; IBOutlet NSButton* mLoadLowGrade; IBOutlet NSButton* mViewMixed; + + IBOutlet NSMatrix* mCertificateBehavior; } -(IBAction) clickEnableLeaveEncrypted:(id)sender; -(IBAction) clickEnableLoadLowGrade:(id)sender; -(IBAction) clickEnableViewMixed:(id)sender; +-(IBAction)clickCertificateSelectionBehavior:(id)sender; -(IBAction)showCertificates:(id)sender; @end diff --git a/camino/PreferencePanes/Security/SecurityPane.mm b/camino/PreferencePanes/Security/SecurityPane.mm index db95fd39b9ac..6a4fd7b25250 100644 --- a/camino/PreferencePanes/Security/SecurityPane.mm +++ b/camino/PreferencePanes/Security/SecurityPane.mm @@ -41,10 +41,11 @@ #include "nsIPref.h" // prefs for showing security dialogs -#define WEAK_SITE_PREF "security.warn_entering_weak" #define LEAVE_SITE_PREF "security.warn_leaving_secure" #define MIXEDCONTENT_PREF "security.warn_viewing_mixed" +const unsigned int kSelectAutomaticallyMatrixRowValue = 0; +const unsigned int kAskEveryTimeMatrixRowValue = 1; @implementation OrgMozillaChimeraPreferenceSecurity @@ -59,14 +60,20 @@ PRBool leaveEncrypted = PR_TRUE; mPrefService->GetBoolPref(LEAVE_SITE_PREF, &leaveEncrypted); [mLeaveEncrypted setState:(leaveEncrypted ? NSOnState : NSOffState)]; - - PRBool loadLowGrade = PR_TRUE; - mPrefService->GetBoolPref(WEAK_SITE_PREF, &loadLowGrade); - [mLoadLowGrade setState:(loadLowGrade ? NSOnState : NSOffState)]; PRBool viewMixed = PR_TRUE; mPrefService->GetBoolPref(MIXEDCONTENT_PREF, &viewMixed); [mViewMixed setState:(viewMixed ? NSOnState : NSOffState)]; + + BOOL gotPref; + NSString* certificateBehavior = [self getStringPref:"security.default_personal_cert" withSuccess:&gotPref]; + if (gotPref) { + if ([certificateBehavior isEqual:@"Select Automatically"]) + [mCertificateBehavior selectCellAtRow:kSelectAutomaticallyMatrixRowValue column:0]; + else if ([certificateBehavior isEqual:@"Ask Every Time"]) + [mCertificateBehavior selectCellAtRow:kAskEveryTimeMatrixRowValue column:0]; + } + } @@ -96,16 +103,21 @@ [self setPref:MIXEDCONTENT_PREF toBoolean:[sender state] == NSOnState]; } --(IBAction) clickEnableLoadLowGrade:(id)sender -{ - [self setPref:WEAK_SITE_PREF toBoolean:[sender state] == NSOnState]; -} - -(IBAction) clickEnableLeaveEncrypted:(id)sender { [self setPref:LEAVE_SITE_PREF toBoolean:[sender state] == NSOnState]; } +-(IBAction)clickCertificateSelectionBehavior:(id)sender +{ + unsigned int row = [mCertificateBehavior selectedRow]; + + if (row == kSelectAutomaticallyMatrixRowValue) + [self setPref:"security.default_personal_cert" toString:@"Select Automatically"]; + else // row == kAskEveryTimeMatrixRowValue + [self setPref:"security.default_personal_cert" toString:@"Ask Every Time"]; +} + -(IBAction)showCertificates:(id)sender { // we'll just fire off a notification and let the application show the UI