Return correct values from Confirm[Check]Ex (int, not bool) and fix up

the buttons for the unknown cert in accordance with new constants for the
buttons (bug 155287)
This commit is contained in:
pinkerton%netscape.com 2002-07-03 14:42:18 +00:00
Родитель 477898cd80
Коммит a64c0b95d9
20 изменённых файлов: 82 добавлений и 66 удалений

2
camino/English.lproj/alert.nib/info.nib сгенерированный
Просмотреть файл

@ -8,7 +8,7 @@
<string>248.0</string>
<key>IBOpenObjects</key>
<array>
<integer>227</integer>
<integer>202</integer>
</array>
<key>IBSystem Version</key>
<string>5S60</string>

Двоичные данные
camino/English.lproj/alert.nib/objects.nib сгенерированный

Двоичный файл не отображается.

2
camino/alert.nib/info.nib сгенерированный
Просмотреть файл

@ -8,7 +8,7 @@
<string>248.0</string>
<key>IBOpenObjects</key>
<array>
<integer>227</integer>
<integer>202</integer>
</array>
<key>IBSystem Version</key>
<string>5S60</string>

Двоичные данные
camino/alert.nib/objects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -40,21 +40,23 @@
#include "nsIBadCertListener.h"
enum { kOKButton = 0, kCancelButton = 1, kOtherButton = 2 };
@implementation nsAlertController
- (IBAction)hitButton1:(id)sender
{
[NSApp stopModalWithCode:1];
[NSApp stopModalWithCode:kOKButton];
}
- (IBAction)hitButton2:(id)sender
{
[NSApp stopModalWithCode:2];
[NSApp stopModalWithCode:kCancelButton];
}
- (IBAction)hitButton3:(id)sender
{
[NSApp stopModalWithCode:3];
[NSApp stopModalWithCode:kOtherButton];
}
@ -96,7 +98,7 @@
[confirmPanel close];
return (result == 1);
return (result == kOKButton);
}
- (BOOL)confirmCheck:(NSWindow*)parent title:(NSString*)title text:(NSString*)text checkMsg:(NSString*)checkMsg checkValue:(BOOL*)checkValue
@ -112,7 +114,7 @@
*checkValue = ([confirmCheckPanelCheck state] == NSOnState);
[confirmCheckPanel close];
return (result == 1);
return (result == kOKButton);
}
- (int)confirmEx:(NSWindow*)parent title:(NSString*)title text:(NSString*)text
@ -129,7 +131,7 @@
[confirmPanel close];
return (result == 1);
return result;
}
- (int)confirmCheckEx:(NSWindow*)parent title:(NSString*)title text:(NSString*)text
@ -151,7 +153,7 @@
*checkValue = ([confirmCheckPanelCheck state] == NSOnState);
[confirmCheckPanel close];
return (result == 1);
return result;
}
- (BOOL)prompt:(NSWindow*)parent title:(NSString*)title text:(NSString*)text promptText:(NSMutableString*)promptText checkMsg:(NSString*)checkMsg checkValue:(BOOL*)checkValue doCheck:(BOOL)doCheck
@ -185,7 +187,7 @@
[promptPanel close];
return (result == 1);
return (result == kOKButton);
}
- (BOOL)promptUserNameAndPassword:(NSWindow*)parent title:(NSString*)title text:(NSString*)text userNameText:(NSMutableString*)userNameText passwordText:(NSMutableString*)passwordText checkMsg:(NSString*)checkMsg checkValue:(BOOL*)checkValue doCheck:(BOOL)doCheck
@ -230,7 +232,7 @@
[usernamePanel close];
return (result == 1);
return (result == kOKButton);
}
- (BOOL)promptPassword:(NSWindow*)parent title:(NSString*)title text:(NSString*)text passwordText:(NSMutableString*)passwordText checkMsg:(NSString*)checkMsg checkValue:(BOOL*)checkValue doCheck:(BOOL)doCheck
@ -264,7 +266,7 @@
[passwordPanel close];
return (result == 1);
return (result == kOKButton);
}
@ -273,7 +275,7 @@
int result = [NSApp runModalForWindow:postToInsecureFromSecurePanel relativeToWindow:parent];
[postToInsecureFromSecurePanel close];
return (result == 1);
return (result == kOKButton);
}
@ -282,7 +284,7 @@
int result = [NSApp runModalForWindow:securityMismatchPanel relativeToWindow:parent];
[securityMismatchPanel close];
return (result == 1);
return (result == kOKButton);
}
- (BOOL)expiredCert:(NSWindow*)parent
@ -290,12 +292,14 @@
int result = [NSApp runModalForWindow:expiredCertPanel relativeToWindow:parent];
[expiredCertPanel close];
return (result == 1);
return (result == kOKButton);
}
- (int)unknownCert:(NSWindow*)parent
{
// this dialog is a little backward, with "Stop" returning 0, and the default returning
// 1. That's just how nsIBadCertListener defines its constants. *shrug*
int result = [NSApp runModalForWindow:securityUnknownPanel relativeToWindow:parent];
[securityUnknownPanel close];

Просмотреть файл

@ -414,14 +414,14 @@ nsCocoaBrowserService::ConfirmEx(nsIDOMWindow *parent,
if (checkValue) {
BOOL valueBool = *checkValue ? YES : NO;
*buttonPressed = (PRInt32)[controller confirmCheckEx:window title:titleStr text:textStr
*buttonPressed = [controller confirmCheckEx:window title:titleStr text:textStr
button1: btn1Str button2: btn2Str button3: btn3Str
checkMsg:msgStr checkValue:&valueBool];
*checkValue = (valueBool == YES) ? PR_TRUE : PR_FALSE;
}
else {
*buttonPressed = (PRInt32)[controller confirmEx:window title:titleStr text:textStr
*buttonPressed = [controller confirmEx:window title:titleStr text:textStr
button1: btn1Str button2: btn2Str button3: btn3Str];
}

Просмотреть файл

@ -8,7 +8,7 @@
<string>248.0</string>
<key>IBOpenObjects</key>
<array>
<integer>227</integer>
<integer>202</integer>
</array>
<key>IBSystem Version</key>
<string>5S60</string>

Двоичные данные
camino/resources/localized/English.lproj/alert.nib/objects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -40,21 +40,23 @@
#include "nsIBadCertListener.h"
enum { kOKButton = 0, kCancelButton = 1, kOtherButton = 2 };
@implementation nsAlertController
- (IBAction)hitButton1:(id)sender
{
[NSApp stopModalWithCode:1];
[NSApp stopModalWithCode:kOKButton];
}
- (IBAction)hitButton2:(id)sender
{
[NSApp stopModalWithCode:2];
[NSApp stopModalWithCode:kCancelButton];
}
- (IBAction)hitButton3:(id)sender
{
[NSApp stopModalWithCode:3];
[NSApp stopModalWithCode:kOtherButton];
}
@ -96,7 +98,7 @@
[confirmPanel close];
return (result == 1);
return (result == kOKButton);
}
- (BOOL)confirmCheck:(NSWindow*)parent title:(NSString*)title text:(NSString*)text checkMsg:(NSString*)checkMsg checkValue:(BOOL*)checkValue
@ -112,7 +114,7 @@
*checkValue = ([confirmCheckPanelCheck state] == NSOnState);
[confirmCheckPanel close];
return (result == 1);
return (result == kOKButton);
}
- (int)confirmEx:(NSWindow*)parent title:(NSString*)title text:(NSString*)text
@ -129,7 +131,7 @@
[confirmPanel close];
return (result == 1);
return result;
}
- (int)confirmCheckEx:(NSWindow*)parent title:(NSString*)title text:(NSString*)text
@ -151,7 +153,7 @@
*checkValue = ([confirmCheckPanelCheck state] == NSOnState);
[confirmCheckPanel close];
return (result == 1);
return result;
}
- (BOOL)prompt:(NSWindow*)parent title:(NSString*)title text:(NSString*)text promptText:(NSMutableString*)promptText checkMsg:(NSString*)checkMsg checkValue:(BOOL*)checkValue doCheck:(BOOL)doCheck
@ -185,7 +187,7 @@
[promptPanel close];
return (result == 1);
return (result == kOKButton);
}
- (BOOL)promptUserNameAndPassword:(NSWindow*)parent title:(NSString*)title text:(NSString*)text userNameText:(NSMutableString*)userNameText passwordText:(NSMutableString*)passwordText checkMsg:(NSString*)checkMsg checkValue:(BOOL*)checkValue doCheck:(BOOL)doCheck
@ -230,7 +232,7 @@
[usernamePanel close];
return (result == 1);
return (result == kOKButton);
}
- (BOOL)promptPassword:(NSWindow*)parent title:(NSString*)title text:(NSString*)text passwordText:(NSMutableString*)passwordText checkMsg:(NSString*)checkMsg checkValue:(BOOL*)checkValue doCheck:(BOOL)doCheck
@ -264,7 +266,7 @@
[passwordPanel close];
return (result == 1);
return (result == kOKButton);
}
@ -273,7 +275,7 @@
int result = [NSApp runModalForWindow:postToInsecureFromSecurePanel relativeToWindow:parent];
[postToInsecureFromSecurePanel close];
return (result == 1);
return (result == kOKButton);
}
@ -282,7 +284,7 @@
int result = [NSApp runModalForWindow:securityMismatchPanel relativeToWindow:parent];
[securityMismatchPanel close];
return (result == 1);
return (result == kOKButton);
}
- (BOOL)expiredCert:(NSWindow*)parent
@ -290,12 +292,14 @@
int result = [NSApp runModalForWindow:expiredCertPanel relativeToWindow:parent];
[expiredCertPanel close];
return (result == 1);
return (result == kOKButton);
}
- (int)unknownCert:(NSWindow*)parent
{
// this dialog is a little backward, with "Stop" returning 0, and the default returning
// 1. That's just how nsIBadCertListener defines its constants. *shrug*
int result = [NSApp runModalForWindow:securityUnknownPanel relativeToWindow:parent];
[securityUnknownPanel close];

Просмотреть файл

@ -414,14 +414,14 @@ nsCocoaBrowserService::ConfirmEx(nsIDOMWindow *parent,
if (checkValue) {
BOOL valueBool = *checkValue ? YES : NO;
*buttonPressed = (PRInt32)[controller confirmCheckEx:window title:titleStr text:textStr
*buttonPressed = [controller confirmCheckEx:window title:titleStr text:textStr
button1: btn1Str button2: btn2Str button3: btn3Str
checkMsg:msgStr checkValue:&valueBool];
*checkValue = (valueBool == YES) ? PR_TRUE : PR_FALSE;
}
else {
*buttonPressed = (PRInt32)[controller confirmEx:window title:titleStr text:textStr
*buttonPressed = [controller confirmEx:window title:titleStr text:textStr
button1: btn1Str button2: btn2Str button3: btn3Str];
}

2
chimera/English.lproj/alert.nib/info.nib сгенерированный
Просмотреть файл

@ -8,7 +8,7 @@
<string>248.0</string>
<key>IBOpenObjects</key>
<array>
<integer>227</integer>
<integer>202</integer>
</array>
<key>IBSystem Version</key>
<string>5S60</string>

Двоичные данные
chimera/English.lproj/alert.nib/objects.nib сгенерированный

Двоичный файл не отображается.

2
chimera/alert.nib/info.nib сгенерированный
Просмотреть файл

@ -8,7 +8,7 @@
<string>248.0</string>
<key>IBOpenObjects</key>
<array>
<integer>227</integer>
<integer>202</integer>
</array>
<key>IBSystem Version</key>
<string>5S60</string>

Двоичные данные
chimera/alert.nib/objects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -40,21 +40,23 @@
#include "nsIBadCertListener.h"
enum { kOKButton = 0, kCancelButton = 1, kOtherButton = 2 };
@implementation nsAlertController
- (IBAction)hitButton1:(id)sender
{
[NSApp stopModalWithCode:1];
[NSApp stopModalWithCode:kOKButton];
}
- (IBAction)hitButton2:(id)sender
{
[NSApp stopModalWithCode:2];
[NSApp stopModalWithCode:kCancelButton];
}
- (IBAction)hitButton3:(id)sender
{
[NSApp stopModalWithCode:3];
[NSApp stopModalWithCode:kOtherButton];
}
@ -96,7 +98,7 @@
[confirmPanel close];
return (result == 1);
return (result == kOKButton);
}
- (BOOL)confirmCheck:(NSWindow*)parent title:(NSString*)title text:(NSString*)text checkMsg:(NSString*)checkMsg checkValue:(BOOL*)checkValue
@ -112,7 +114,7 @@
*checkValue = ([confirmCheckPanelCheck state] == NSOnState);
[confirmCheckPanel close];
return (result == 1);
return (result == kOKButton);
}
- (int)confirmEx:(NSWindow*)parent title:(NSString*)title text:(NSString*)text
@ -129,7 +131,7 @@
[confirmPanel close];
return (result == 1);
return result;
}
- (int)confirmCheckEx:(NSWindow*)parent title:(NSString*)title text:(NSString*)text
@ -151,7 +153,7 @@
*checkValue = ([confirmCheckPanelCheck state] == NSOnState);
[confirmCheckPanel close];
return (result == 1);
return result;
}
- (BOOL)prompt:(NSWindow*)parent title:(NSString*)title text:(NSString*)text promptText:(NSMutableString*)promptText checkMsg:(NSString*)checkMsg checkValue:(BOOL*)checkValue doCheck:(BOOL)doCheck
@ -185,7 +187,7 @@
[promptPanel close];
return (result == 1);
return (result == kOKButton);
}
- (BOOL)promptUserNameAndPassword:(NSWindow*)parent title:(NSString*)title text:(NSString*)text userNameText:(NSMutableString*)userNameText passwordText:(NSMutableString*)passwordText checkMsg:(NSString*)checkMsg checkValue:(BOOL*)checkValue doCheck:(BOOL)doCheck
@ -230,7 +232,7 @@
[usernamePanel close];
return (result == 1);
return (result == kOKButton);
}
- (BOOL)promptPassword:(NSWindow*)parent title:(NSString*)title text:(NSString*)text passwordText:(NSMutableString*)passwordText checkMsg:(NSString*)checkMsg checkValue:(BOOL*)checkValue doCheck:(BOOL)doCheck
@ -264,7 +266,7 @@
[passwordPanel close];
return (result == 1);
return (result == kOKButton);
}
@ -273,7 +275,7 @@
int result = [NSApp runModalForWindow:postToInsecureFromSecurePanel relativeToWindow:parent];
[postToInsecureFromSecurePanel close];
return (result == 1);
return (result == kOKButton);
}
@ -282,7 +284,7 @@
int result = [NSApp runModalForWindow:securityMismatchPanel relativeToWindow:parent];
[securityMismatchPanel close];
return (result == 1);
return (result == kOKButton);
}
- (BOOL)expiredCert:(NSWindow*)parent
@ -290,12 +292,14 @@
int result = [NSApp runModalForWindow:expiredCertPanel relativeToWindow:parent];
[expiredCertPanel close];
return (result == 1);
return (result == kOKButton);
}
- (int)unknownCert:(NSWindow*)parent
{
// this dialog is a little backward, with "Stop" returning 0, and the default returning
// 1. That's just how nsIBadCertListener defines its constants. *shrug*
int result = [NSApp runModalForWindow:securityUnknownPanel relativeToWindow:parent];
[securityUnknownPanel close];

Просмотреть файл

@ -414,14 +414,14 @@ nsCocoaBrowserService::ConfirmEx(nsIDOMWindow *parent,
if (checkValue) {
BOOL valueBool = *checkValue ? YES : NO;
*buttonPressed = (PRInt32)[controller confirmCheckEx:window title:titleStr text:textStr
*buttonPressed = [controller confirmCheckEx:window title:titleStr text:textStr
button1: btn1Str button2: btn2Str button3: btn3Str
checkMsg:msgStr checkValue:&valueBool];
*checkValue = (valueBool == YES) ? PR_TRUE : PR_FALSE;
}
else {
*buttonPressed = (PRInt32)[controller confirmEx:window title:titleStr text:textStr
*buttonPressed = [controller confirmEx:window title:titleStr text:textStr
button1: btn1Str button2: btn2Str button3: btn3Str];
}

Просмотреть файл

@ -8,7 +8,7 @@
<string>248.0</string>
<key>IBOpenObjects</key>
<array>
<integer>227</integer>
<integer>202</integer>
</array>
<key>IBSystem Version</key>
<string>5S60</string>

Двоичные данные
chimera/resources/localized/English.lproj/alert.nib/objects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -40,21 +40,23 @@
#include "nsIBadCertListener.h"
enum { kOKButton = 0, kCancelButton = 1, kOtherButton = 2 };
@implementation nsAlertController
- (IBAction)hitButton1:(id)sender
{
[NSApp stopModalWithCode:1];
[NSApp stopModalWithCode:kOKButton];
}
- (IBAction)hitButton2:(id)sender
{
[NSApp stopModalWithCode:2];
[NSApp stopModalWithCode:kCancelButton];
}
- (IBAction)hitButton3:(id)sender
{
[NSApp stopModalWithCode:3];
[NSApp stopModalWithCode:kOtherButton];
}
@ -96,7 +98,7 @@
[confirmPanel close];
return (result == 1);
return (result == kOKButton);
}
- (BOOL)confirmCheck:(NSWindow*)parent title:(NSString*)title text:(NSString*)text checkMsg:(NSString*)checkMsg checkValue:(BOOL*)checkValue
@ -112,7 +114,7 @@
*checkValue = ([confirmCheckPanelCheck state] == NSOnState);
[confirmCheckPanel close];
return (result == 1);
return (result == kOKButton);
}
- (int)confirmEx:(NSWindow*)parent title:(NSString*)title text:(NSString*)text
@ -129,7 +131,7 @@
[confirmPanel close];
return (result == 1);
return result;
}
- (int)confirmCheckEx:(NSWindow*)parent title:(NSString*)title text:(NSString*)text
@ -151,7 +153,7 @@
*checkValue = ([confirmCheckPanelCheck state] == NSOnState);
[confirmCheckPanel close];
return (result == 1);
return result;
}
- (BOOL)prompt:(NSWindow*)parent title:(NSString*)title text:(NSString*)text promptText:(NSMutableString*)promptText checkMsg:(NSString*)checkMsg checkValue:(BOOL*)checkValue doCheck:(BOOL)doCheck
@ -185,7 +187,7 @@
[promptPanel close];
return (result == 1);
return (result == kOKButton);
}
- (BOOL)promptUserNameAndPassword:(NSWindow*)parent title:(NSString*)title text:(NSString*)text userNameText:(NSMutableString*)userNameText passwordText:(NSMutableString*)passwordText checkMsg:(NSString*)checkMsg checkValue:(BOOL*)checkValue doCheck:(BOOL)doCheck
@ -230,7 +232,7 @@
[usernamePanel close];
return (result == 1);
return (result == kOKButton);
}
- (BOOL)promptPassword:(NSWindow*)parent title:(NSString*)title text:(NSString*)text passwordText:(NSMutableString*)passwordText checkMsg:(NSString*)checkMsg checkValue:(BOOL*)checkValue doCheck:(BOOL)doCheck
@ -264,7 +266,7 @@
[passwordPanel close];
return (result == 1);
return (result == kOKButton);
}
@ -273,7 +275,7 @@
int result = [NSApp runModalForWindow:postToInsecureFromSecurePanel relativeToWindow:parent];
[postToInsecureFromSecurePanel close];
return (result == 1);
return (result == kOKButton);
}
@ -282,7 +284,7 @@
int result = [NSApp runModalForWindow:securityMismatchPanel relativeToWindow:parent];
[securityMismatchPanel close];
return (result == 1);
return (result == kOKButton);
}
- (BOOL)expiredCert:(NSWindow*)parent
@ -290,12 +292,14 @@
int result = [NSApp runModalForWindow:expiredCertPanel relativeToWindow:parent];
[expiredCertPanel close];
return (result == 1);
return (result == kOKButton);
}
- (int)unknownCert:(NSWindow*)parent
{
// this dialog is a little backward, with "Stop" returning 0, and the default returning
// 1. That's just how nsIBadCertListener defines its constants. *shrug*
int result = [NSApp runModalForWindow:securityUnknownPanel relativeToWindow:parent];
[securityUnknownPanel close];

Просмотреть файл

@ -414,14 +414,14 @@ nsCocoaBrowserService::ConfirmEx(nsIDOMWindow *parent,
if (checkValue) {
BOOL valueBool = *checkValue ? YES : NO;
*buttonPressed = (PRInt32)[controller confirmCheckEx:window title:titleStr text:textStr
*buttonPressed = [controller confirmCheckEx:window title:titleStr text:textStr
button1: btn1Str button2: btn2Str button3: btn3Str
checkMsg:msgStr checkValue:&valueBool];
*checkValue = (valueBool == YES) ? PR_TRUE : PR_FALSE;
}
else {
*buttonPressed = (PRInt32)[controller confirmEx:window title:titleStr text:textStr
*buttonPressed = [controller confirmEx:window title:titleStr text:textStr
button1: btn1Str button2: btn2Str button3: btn3Str];
}