rename all references to default_button_index -> default_id to keep consistent with cancel_id
This commit is contained in:
parent
dfce803045
commit
ae5c6add11
7 changed files with 28 additions and 28 deletions
|
@ -54,7 +54,7 @@ namespace {
|
|||
NSAlert* CreateNSAlert(NativeWindow* parent_window,
|
||||
MessageBoxType type,
|
||||
const std::vector<std::string>& buttons,
|
||||
int default_button_index,
|
||||
int default_id,
|
||||
const std::string& title,
|
||||
const std::string& message,
|
||||
const std::string& detail) {
|
||||
|
@ -83,8 +83,8 @@ NSAlert* CreateNSAlert(NativeWindow* parent_window,
|
|||
NSButton* button = [alert addButtonWithTitle:title];
|
||||
[button setTag:i];
|
||||
|
||||
if (i == (size_t)default_button_index) {
|
||||
// focus the button at default_button_index if the user opted to do so.
|
||||
if (i == (size_t)default_id) {
|
||||
// focus the button at default_id if the user opted to do so.
|
||||
// The first button added gets set as the default selected.
|
||||
// So remove that default, and make the requested button the default
|
||||
[[[alert buttons] objectAtIndex:0] setKeyEquivalent:@""];
|
||||
|
@ -104,7 +104,7 @@ void SetReturnCode(int* ret_code, int result) {
|
|||
int ShowMessageBox(NativeWindow* parent_window,
|
||||
MessageBoxType type,
|
||||
const std::vector<std::string>& buttons,
|
||||
int default_button_index,
|
||||
int default_id,
|
||||
int cancel_id,
|
||||
int options,
|
||||
const std::string& title,
|
||||
|
@ -112,7 +112,7 @@ int ShowMessageBox(NativeWindow* parent_window,
|
|||
const std::string& detail,
|
||||
const gfx::ImageSkia& icon) {
|
||||
NSAlert* alert = CreateNSAlert(
|
||||
parent_window, type, buttons, default_button_index, title, message,
|
||||
parent_window, type, buttons, default_id, title, message,
|
||||
detail);
|
||||
|
||||
// Use runModal for synchronous alert without parent, since we don't have a
|
||||
|
@ -139,7 +139,7 @@ int ShowMessageBox(NativeWindow* parent_window,
|
|||
void ShowMessageBox(NativeWindow* parent_window,
|
||||
MessageBoxType type,
|
||||
const std::vector<std::string>& buttons,
|
||||
int default_button_index,
|
||||
int default_id,
|
||||
int cancel_id,
|
||||
int options,
|
||||
const std::string& title,
|
||||
|
@ -148,7 +148,7 @@ void ShowMessageBox(NativeWindow* parent_window,
|
|||
const gfx::ImageSkia& icon,
|
||||
const MessageBoxCallback& callback) {
|
||||
NSAlert* alert = CreateNSAlert(
|
||||
parent_window, type, buttons, default_button_index, title, message,
|
||||
parent_window, type, buttons, default_id, title, message,
|
||||
detail);
|
||||
ModalDelegate* delegate = [[ModalDelegate alloc] initWithCallback:callback
|
||||
andAlert:alert
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue