mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
* English.lproj/Gorm.gorm: Remove delegate connection, since it's
manually set in the Gorm NSApplication subclass to self. * GormCore/GormDocumentController.[hm]: Added new method buildDocumentType: * GormCore/GormDocument.m: Added call to touch in setName: so that the document would be set as modified when the user alters the name of an object in the document. * GormCore/GormDocumentWindow.m: Remove methods preventing document window from assuming main/key status. * GormCore/GormPalettesManager.m: Remove methods allowing palette window to assume main/key status * Gorm.m: Added delegate methods to handle opening a document, if in a mode which requires a default document to be created. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@30417 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3846644d89
commit
2f64f6a5a5
9 changed files with 56 additions and 6 deletions
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
|||
2010-05-18 20:31-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* English.lproj/Gorm.gorm: Remove delegate connection, since it's
|
||||
manually set in the Gorm NSApplication subclass to self.
|
||||
* GormCore/GormDocumentController.[hm]: Added new method
|
||||
buildDocumentType:
|
||||
* GormCore/GormDocument.m: Added call to touch in setName: so that
|
||||
the document would be set as modified when the user alters
|
||||
the name of an object in the document.
|
||||
* GormCore/GormDocumentWindow.m: Remove methods preventing
|
||||
document window from assuming main/key status.
|
||||
* GormCore/GormPalettesManager.m: Remove methods allowing palette
|
||||
window to assume main/key status
|
||||
* Gorm.m: Added delegate methods to handle opening a document, if
|
||||
in a mode which requires a default document to be created.
|
||||
|
||||
2010-05-18 19:42-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Documentation/Gorm.texi
|
||||
|
|
Binary file not shown.
Binary file not shown.
16
Gorm.m
16
Gorm.m
|
@ -31,6 +31,7 @@
|
|||
#include <GormCore/GormSetNameController.h>
|
||||
#include <GormCore/GormFunctions.h>
|
||||
#include <GormCore/GormPluginManager.h>
|
||||
#include <GormCore/GormDocumentController.h>
|
||||
#include <GormCore/GormServer.h>
|
||||
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
|
@ -192,8 +193,21 @@
|
|||
}
|
||||
|
||||
- (BOOL)applicationShouldOpenUntitledFile: (NSApplication *)sender
|
||||
{
|
||||
if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) ==
|
||||
NSWindows95InterfaceStyle)
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void) applicationOpenUntitledFile: (id)sender
|
||||
{
|
||||
return YES;
|
||||
GormDocumentController *dc = [NSDocumentController sharedDocumentController];
|
||||
// open a new document and build an application type document by default...
|
||||
[dc newDocument: sender];
|
||||
}
|
||||
|
||||
- (void) applicationDidFinishLaunching: (NSApplication*)sender
|
||||
|
|
|
@ -2197,6 +2197,9 @@ static void _real_close(GormDocument *self,
|
|||
{
|
||||
RELEASE(oldName);
|
||||
}
|
||||
|
||||
// touch the document...
|
||||
[self touch];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
|
||||
#include <AppKit/NSDocumentController.h>
|
||||
|
||||
typedef enum {
|
||||
typedef enum
|
||||
{
|
||||
GormApplication = 0,
|
||||
GormEmpty = 1,
|
||||
GormInspector = 2,
|
||||
|
@ -40,8 +41,10 @@ typedef enum {
|
|||
|
||||
@interface GormDocumentController : NSDocumentController
|
||||
{
|
||||
// GormDocumentType _documentType;
|
||||
}
|
||||
|
||||
- (void) buildDocumentForType: (GormDocumentType)documentType;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
|
|
@ -52,13 +52,11 @@
|
|||
return result;
|
||||
}
|
||||
|
||||
- (void) newDocument: (id)sender
|
||||
- (void) buildDocumentForType: (GormDocumentType)documentType
|
||||
{
|
||||
GormDocument *doc = nil;
|
||||
GormDocumentType documentType = (GormDocumentType)[sender tag];
|
||||
|
||||
NSDebugLog(@"In gorm document controller...");
|
||||
[super newDocument: sender];
|
||||
doc = (GormDocument *)[[self documents] lastObject]; // get the latest document...
|
||||
|
||||
switch (documentType)
|
||||
|
@ -190,4 +188,16 @@
|
|||
[doc setFileType: @"GSGormFileType"];
|
||||
}
|
||||
|
||||
- (void) newDocument: (id)sender
|
||||
{
|
||||
GormDocumentType documentType = GormApplication;
|
||||
|
||||
if([sender respondsToSelector: @selector(tag)])
|
||||
{
|
||||
documentType = (GormDocumentType)[sender tag];
|
||||
}
|
||||
|
||||
[super newDocument: sender];
|
||||
[self buildDocumentForType: documentType];
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -29,10 +29,12 @@
|
|||
#include <AppKit/NSPasteboard.h>
|
||||
|
||||
@implementation GormDocumentWindow
|
||||
/*
|
||||
- (BOOL) canBecomeMainWindow
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
*/
|
||||
|
||||
- (void) setDocument:(id)document
|
||||
{
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
@end
|
||||
|
||||
@implementation GormPalettePanel
|
||||
/*
|
||||
- (BOOL) canBecomeKeyWindow
|
||||
{
|
||||
return NO;
|
||||
|
@ -46,6 +47,7 @@
|
|||
{
|
||||
return YES;
|
||||
}
|
||||
*/
|
||||
@end
|
||||
|
||||
@interface GormPaletteView : NSView
|
||||
|
|
Loading…
Reference in a new issue