mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 02:04:20 +00:00
Change all the runModal:... methods to return an NSInteger.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33352 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
91159aa357
commit
5d344a2b0a
5 changed files with 67 additions and 31 deletions
|
@ -1,3 +1,11 @@
|
|||
2011-06-19 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/AppKit/NSOpenPanel.h
|
||||
* Headers/AppKit/NSSavePanel.h
|
||||
* Source/NSSavePanel.m
|
||||
* Source/NSOpenPanel.m: Change all the runModal:... methods to
|
||||
return an NSInteger.
|
||||
|
||||
2011-06-19 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/NSTextView.m (-scrollRangeToVisible:): Fix to support scrolling
|
||||
|
|
|
@ -53,16 +53,16 @@
|
|||
+ (NSOpenPanel *) openPanel;
|
||||
|
||||
// Running an NSOpenPanel
|
||||
- (int) runModalForTypes: (NSArray *)fileTypes;
|
||||
- (int) runModalForDirectory: (NSString *)path
|
||||
file: (NSString *)name
|
||||
types: (NSArray *)fileTypes;
|
||||
- (NSInteger) runModalForTypes: (NSArray *)fileTypes;
|
||||
- (NSInteger) runModalForDirectory: (NSString *)path
|
||||
file: (NSString *)name
|
||||
types: (NSArray *)fileTypes;
|
||||
|
||||
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
||||
- (int) runModalForDirectory: (NSString *)path
|
||||
file: (NSString *)name
|
||||
types: (NSArray *)fileTypes
|
||||
relativeToWindow: (NSWindow*)window;
|
||||
- (NSInteger) runModalForDirectory: (NSString *)path
|
||||
file: (NSString *)name
|
||||
types: (NSArray *)fileTypes
|
||||
relativeToWindow: (NSWindow*)window;
|
||||
- (void) beginSheetForDirectory: (NSString *)path
|
||||
file: (NSString *)name
|
||||
types: (NSArray *)fileTypes
|
||||
|
@ -71,9 +71,16 @@
|
|||
didEndSelector: (SEL)didEndSelector
|
||||
contextInfo: (void *)contextInfo;
|
||||
#endif
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
||||
- (void) beginForDirectory: (NSString *)absoluteDirectoryPath
|
||||
file: (NSString *)filename
|
||||
types: (NSArray *)fileTypes
|
||||
modelessDelegate: (id)modelessDelegate
|
||||
didEndSelector: (SEL)didEndSelector
|
||||
contextInfo: (void *)contextInfo;
|
||||
#endif
|
||||
|
||||
- (NSArray *) filenames;
|
||||
|
||||
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
||||
- (NSArray *) URLs;
|
||||
#endif
|
||||
|
@ -83,7 +90,7 @@
|
|||
- (BOOL) canChooseFiles;
|
||||
- (void) setCanChooseDirectories: (BOOL)flag;
|
||||
- (void) setCanChooseFiles: (BOOL)flag;
|
||||
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_1, GS_API_LATEST)
|
||||
- (void) setResolvesAliases: (BOOL)flag;
|
||||
- (BOOL) resolvesAliases;
|
||||
#endif
|
||||
|
|
|
@ -114,15 +114,17 @@ enum {
|
|||
- (NSString *) nameFieldStringValue;
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
||||
- (void) setNameFieldLabel: (NSString *)label;
|
||||
- (NSString *) nameFieldLabel;
|
||||
- (void) setMessage: (NSString *)message;
|
||||
- (NSString *) message;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Hidding extensions
|
||||
*/
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
|
||||
- (void) setCanSelectHiddenExtension: (BOOL) flag;
|
||||
- (BOOL) canSelectHiddenExtension;
|
||||
- (BOOL) isExtensionHidden;
|
||||
|
@ -137,8 +139,8 @@ enum {
|
|||
/*
|
||||
* Setting Directory and File Type
|
||||
*/
|
||||
- (NSString *) requiredFileType;
|
||||
- (void) setDirectory: (NSString *)path;
|
||||
- (NSString *) requiredFileType;
|
||||
- (void) setRequiredFileType: (NSString *)fileType;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
||||
|
@ -161,13 +163,13 @@ enum {
|
|||
/*
|
||||
* Running the NSSavePanel
|
||||
*/
|
||||
- (int) runModalForDirectory: (NSString *)path file: (NSString *)filename;
|
||||
- (int) runModal;
|
||||
- (NSInteger) runModal;
|
||||
- (NSInteger) runModalForDirectory: (NSString *)path file: (NSString *)filename;
|
||||
|
||||
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
||||
- (int) runModalForDirectory: (NSString *)path
|
||||
file: (NSString *)filename
|
||||
relativeToWindow: (NSWindow*)window;
|
||||
- (NSInteger) runModalForDirectory: (NSString *)path
|
||||
file: (NSString *)filename
|
||||
relativeToWindow: (NSWindow*)window;
|
||||
- (void) beginSheetForDirectory: (NSString *)path
|
||||
file: (NSString *)filename
|
||||
modalForWindow: (NSWindow *)docWindow
|
||||
|
|
|
@ -448,7 +448,7 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
|
|||
types.</p>
|
||||
<p>See Also: -runModalForDirectory:file:types: and -allowedFileTypes</p>
|
||||
*/
|
||||
- (int) runModal
|
||||
- (NSInteger) runModal
|
||||
{
|
||||
return [self runModalForTypes: [self allowedFileTypes]];
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
|
|||
(or last selected), and filtering for files that have the specified types.</p>
|
||||
<p>See Also: -runModalForDirectory:file:types:</p>
|
||||
*/
|
||||
- (int) runModalForTypes: (NSArray *)fileTypes
|
||||
- (NSInteger) runModalForTypes: (NSArray *)fileTypes
|
||||
{
|
||||
return [self runModalForDirectory: nil
|
||||
file: @""
|
||||
|
@ -470,19 +470,19 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
|
|||
the open panel is the last directory selected.</p>
|
||||
<p>See Also: -runModalForTypes:</p>
|
||||
*/
|
||||
- (int) runModalForDirectory: (NSString *)path
|
||||
file: (NSString *)name
|
||||
types: (NSArray *)fileTypes
|
||||
- (NSInteger) runModalForDirectory: (NSString *)path
|
||||
file: (NSString *)name
|
||||
types: (NSArray *)fileTypes
|
||||
{
|
||||
[self _setupForTypes: fileTypes];
|
||||
return [self runModalForDirectory: path
|
||||
file: name];
|
||||
}
|
||||
|
||||
- (int) runModalForDirectory: (NSString *)path
|
||||
file: (NSString *)name
|
||||
types: (NSArray *)fileTypes
|
||||
relativeToWindow: (NSWindow*)window
|
||||
- (NSInteger) runModalForDirectory: (NSString *)path
|
||||
file: (NSString *)name
|
||||
types: (NSArray *)fileTypes
|
||||
relativeToWindow: (NSWindow*)window
|
||||
{
|
||||
[self _setupForTypes: fileTypes];
|
||||
return [self runModalForDirectory: path
|
||||
|
@ -507,6 +507,25 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
|
|||
contextInfo: contextInfo];
|
||||
}
|
||||
|
||||
- (void) beginForDirectory: (NSString *)path
|
||||
file: (NSString *)filename
|
||||
types: (NSArray *)fileTypes
|
||||
modelessDelegate: (id)modelessDelegate
|
||||
didEndSelector: (SEL)didEndSelector
|
||||
contextInfo: (void *)contextInfo
|
||||
{
|
||||
// FIXME: This should be modeless
|
||||
[self _setupForTypes: fileTypes];
|
||||
[self _setupForDirectory: path file: filename];
|
||||
if ([filename length] > 0)
|
||||
[_okButton setEnabled: YES];
|
||||
[NSApp beginSheet: self
|
||||
modalForWindow: nil
|
||||
modalDelegate: modelessDelegate
|
||||
didEndSelector: didEndSelector
|
||||
contextInfo: contextInfo];
|
||||
}
|
||||
|
||||
- (void) ok: (id)sender
|
||||
{
|
||||
NSMatrix *matrix = nil;
|
||||
|
|
|
@ -1094,7 +1094,7 @@ selectCellWithString: (NSString*)title
|
|||
NSCancelButton (if the user clicks the Cancel button).</p>
|
||||
<p>See Also: -runModalForDirectory:file:</p>
|
||||
*/
|
||||
- (int) runModal
|
||||
- (NSInteger) runModal
|
||||
{
|
||||
return [self runModalForDirectory: nil file: @""];
|
||||
}
|
||||
|
@ -1109,7 +1109,7 @@ selectCellWithString: (NSString*)title
|
|||
selected directory or as a last resort, the current working directory.</p>
|
||||
<p>See Also: -runModal</p>
|
||||
*/
|
||||
- (int) runModalForDirectory: (NSString*)path file: (NSString*)filename
|
||||
- (NSInteger) runModalForDirectory: (NSString*)path file: (NSString*)filename
|
||||
{
|
||||
[self _setupForDirectory: path file: filename];
|
||||
if ([filename length] > 0)
|
||||
|
@ -1117,9 +1117,9 @@ selectCellWithString: (NSString*)title
|
|||
return [NSApp runModalForWindow: self];
|
||||
}
|
||||
|
||||
- (int) runModalForDirectory: (NSString *)path
|
||||
file: (NSString *)filename
|
||||
relativeToWindow: (NSWindow*)window
|
||||
- (NSInteger) runModalForDirectory: (NSString *)path
|
||||
file: (NSString *)filename
|
||||
relativeToWindow: (NSWindow*)window
|
||||
{
|
||||
[self _setupForDirectory: path file: filename];
|
||||
if ([filename length] > 0)
|
||||
|
|
Loading…
Reference in a new issue