Skip to content

Commit 95db32a

Browse files
Deprecation fixes for NSOKButton, NSCancelButton
1 parent 9268dd2 commit 95db32a

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

trunk/Bricksmith/Source/Application/Document/LDrawDocument.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,7 @@ - (IBAction) exportSteps:(id)sender
16121612
NSInteger modelCounter = 0;
16131613
NSInteger counter = 0;
16141614

1615-
if(returnCode == NSOKButton)
1615+
if(returnCode == NSModalResponseOK)
16161616
{
16171617
saveURL = [exportPanel URL];
16181618
saveName = ([saveURL isFileURL] ? [saveURL path] : nil);
@@ -3070,11 +3070,11 @@ - (IBAction) addRelatedPartClicked:(id)sender
30703070
- (void) addMinifigure:(id)sender
30713071
{
30723072
MinifigureDialogController *minifigDialog = [MinifigureDialogController new];
3073-
NSInteger result = NSCancelButton;
3073+
NSInteger result = NSModalResponseCancel;
30743074
LDrawMPDModel *minifigure = nil;
30753075

30763076
result = [minifigDialog runModal];
3077-
if(result == NSOKButton)
3077+
if(result == NSModalResponseOK)
30783078
{
30793079
minifigure = [minifigDialog minifigure];
30803080
[self addModel:minifigure atIndex:NSNotFound preventNameCollisions:YES];

trunk/Bricksmith/Source/Application/General/DonationDialogController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ - (IBAction) donateButtonClicked:(id)sender
163163
//==============================================================================
164164
- (IBAction) laterButtonClicked:(id)sender
165165
{
166-
[NSApp stopModalWithCode:NSOKButton];
166+
[NSApp stopModalWithCode:NSModalResponseOK];
167167
[self close];
168168

169169
}//end laterButtonClicked

trunk/Bricksmith/Source/Application/General/MinifigureDialogController.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,13 @@ - (void) setMinifigureName:(NSString *)newName
276276

277277
//========== runModal ==========================================================
278278
//
279-
// Purpose: Displays the dialog, returing NSOKButton or NSCancelButton as
279+
// Purpose: Displays the dialog, returing NSModalResponseOK or NSModalResponseCancel as
280280
//appropriate.
281281
//
282282
//==============================================================================
283283
- (NSInteger) runModal
284284
{
285-
NSIntegerreturnCode = NSCancelButton;
285+
NSIntegerreturnCode = NSModalResponseCancel;
286286

287287
//set the values
288288
[self restoreFromPreferences];
@@ -306,7 +306,7 @@ - (NSInteger) runModal
306306
//==============================================================================
307307
- (IBAction) okButtonClicked:(id)sender
308308
{
309-
[NSApp stopModalWithCode:NSOKButton];
309+
[NSApp stopModalWithCode:NSModalResponseOK];
310310
[self.minifigureGeneratorPanel close];
311311
}//end okButtonClicked
312312

@@ -319,7 +319,7 @@ - (IBAction) okButtonClicked:(id)sender
319319
- (IBAction) cancelButtonClicked:(id)sender
320320
{
321321
[self.minifigureGeneratorPanel close];
322-
[NSApp stopModalWithCode:NSCancelButton];
322+
[NSApp stopModalWithCode:NSModalResponseCancel];
323323
}//end cancelButtonClicked
324324

325325

trunk/Bricksmith/Source/Application/General/PartChooserPanel.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,18 @@ - (NSString *) selectedPartName
7777

7878
//========== runModal ==========================================================
7979
//
80-
// Purpose: Displays the dialog, returing NSOKButton or NSCancelButton as
80+
// Purpose: Displays the dialog, returing NSModalResponseOK or NSModalResponseCancel as
8181
//appropriate.
8282
//
8383
//==============================================================================
8484
- (NSInteger) runModal
8585
{
86-
NSInteger returnCode = NSCancelButton;
86+
NSInteger returnCode = NSModalResponseCancel;
8787

8888
//Run the dialog.
8989
returnCode = [NSApp runModalForWindow:self];
9090

91-
if(returnCode == NSOKButton)
91+
if(returnCode == NSModalResponseOK)
9292
[self->partsBrowser addPartClicked:nil];
9393

9494
return returnCode;
@@ -104,7 +104,7 @@ - (NSInteger) runModal
104104
//==============================================================================
105105
- (IBAction) insertPartClicked:(id)sender
106106
{
107-
[NSApp stopModalWithCode:NSOKButton];
107+
[NSApp stopModalWithCode:NSModalResponseOK];
108108

109109
}//end insertPartClicked:
110110

@@ -116,7 +116,7 @@ - (IBAction) insertPartClicked:(id)sender
116116
//==============================================================================
117117
- (IBAction) cancelClicked:(id)sender
118118
{
119-
[NSApp stopModalWithCode:NSCancelButton];
119+
[NSApp stopModalWithCode:NSModalResponseCancel];
120120

121121
}//end cancelClicked:
122122

trunk/Bricksmith/Source/Application/General/PreferencesDialogController.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ - (IBAction)chooseLDrawFolder:(id)sender
438438
[folderChooser setPrompt:NSLocalizedString(@"Choose", nil)];
439439

440440
//Run the dialog.
441-
if([folderChooser runModal] == NSOKButton)
441+
if([folderChooser runModal] == NSModalResponseOK)
442442
{
443443
// Get the folder selected.
444444
NSURL*folderURL = [[folderChooser URLs] objectAtIndex:0];
@@ -661,7 +661,7 @@ - (IBAction)lsynthChooseExecutable:(id)sender
661661
[lsynthExecutableChooser setPrompt:NSLocalizedString(@"Choose", nil)];
662662

663663
//Run the dialog.
664-
if([lsynthExecutableChooser runModal] == NSOKButton)
664+
if([lsynthExecutableChooser runModal] == NSModalResponseOK)
665665
{
666666
// Get the file selected.
667667
NSURL*lsynthExecutableURL = [[lsynthExecutableChooser URLs] objectAtIndex:0];
@@ -699,7 +699,7 @@ - (IBAction)lsynthChooseConfiguration:(id)sender
699699
[lsynthConfigurationChooser setPrompt:NSLocalizedString(@"Choose", nil)];
700700

701701
//Run the dialog.
702-
if([lsynthConfigurationChooser runModal] == NSOKButton)
702+
if([lsynthConfigurationChooser runModal] == NSModalResponseOK)
703703
{
704704
// Get the file selected.
705705
NSURL*lsynthConfigurationURL = [[lsynthConfigurationChooser URLs] objectAtIndex:0];

0 commit comments

Comments
 (0)