Cleanup of logging and new prefs section for archives.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@18637 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-02-21 18:48:48 +00:00
parent 2e59ae0924
commit a7bd9866f3
16 changed files with 134 additions and 61 deletions

View file

@ -1,3 +1,22 @@
2004-02-21 13:48 Gregory John Casamento <greg_casamento@yahoo.com>
* Defaults.plist: Add new default for "Archive
Compatibility" section in preferences.
* GormGeneralPref.[mh]: Added code for new section
* GormDocument.m: Remove NSLogs, make NSDebugLog
* GormInspectorsManager.m: Same
* GormMatrixEditor.m: Same
* GormSoundInspector.m: Same
* GormSplitViewEditor.m: Same
* GormViewWithSubviewsEditor.m: Same
* GormWindowEditor.m: Same
* Palettes/0Menus/GormMenuEditor.m: Same
* Palettes/1Windows/main.m: Same
* Palettes/2Controls/GormPopUpButtonEditor.m: Same
* Resources/GormPrefGeneral.gorm: New section for "Archive
Compatibility." This currently doesn't work since the
keyed archiving capability is not fully implemented.
2004-02-21 01:41 Gregory John Casamento <greg_casamento@yahoo.com>
* GormHeaderPref.m: Fixed header pre-loading.

View file

@ -4,4 +4,5 @@
ShowInspectors = YES;
HeaderList = ();
CellSizeWidth = 72;
ArchiveType = Typed;
}

View file

@ -2301,7 +2301,7 @@ static NSImage *classesImage = nil;
data = [aPasteboard dataForType: aType];
if (data == nil)
{
NSLog(@"Pasteboard %@ doesn't contain data of %@", aPasteboard, aType);
NSDebugLog(@"Pasteboard %@ doesn't contain data of %@", aPasteboard, aType);
return nil;
}
u = AUTORELEASE([[NSUnarchiver alloc] initForReadingWithData: data]);
@ -2502,7 +2502,7 @@ static NSImage *classesImage = nil;
if (object == nil)
{
NSLog(@"Attempt to set name for nil object");
NSDebugLog(@"Attempt to set name for nil object");
return;
}
if (aName == nil)
@ -2548,7 +2548,7 @@ static NSImage *classesImage = nil;
oldObject = [nameTable objectForKey: aName];
if (oldObject != nil)
{
NSLog(@"Attempt to re-use name '%@'", aName);
NSDebugLog(@"Attempt to re-use name '%@'", aName);
return;
}
oldName = [self nameForObject: object];
@ -2819,7 +2819,7 @@ static NSImage *classesImage = nil;
// move the old file to something...
if (![mgr movePath: documentPath toPath: saveFilePath handler: nil])
{
NSLog(@"Error moving old %@ file to %@",
NSDebugLog(@"Error moving old %@ file to %@",
documentPath, saveFilePath);
}
@ -2877,7 +2877,7 @@ static NSImage *classesImage = nil;
if (!copied)
{
NSLog(@"Could not find sound at path %@", object);
NSDebugLog(@"Could not find sound at path %@", object);
}
}
@ -2905,7 +2905,7 @@ static NSImage *classesImage = nil;
if (!copied)
{
NSLog(@"Could not find image at path %@", object);
NSDebugLog(@"Could not find image at path %@", object);
}
}
@ -3053,7 +3053,7 @@ static NSImage *classesImage = nil;
if (th == nil || tv == nil)
{
NSLog(@"fail 1 %@ %@ %@", [(NSTableColumn*)object headerCell], th, tv);
NSDebugLog(@"fail 1 %@ %@ %@", [(NSTableColumn*)object headerCell], th, tv);
*r = NSZeroRect;
return nil;
}
@ -3062,7 +3062,7 @@ static NSImage *classesImage = nil;
if (index == NSNotFound)
{
NSLog(@"fail 2");
NSDebugLog(@"fail 2");
*r = NSZeroRect;
return nil;
}

View file

@ -10,6 +10,7 @@
id backupButton;
id inspectorButton;
id palettesButton;
id archiveMatrix;
id _view;
}
@ -18,6 +19,7 @@
- (void) palettesAction: (id)sender;
- (void) inspectorAction: (id)sender;
- (void) backupAction: (id)sender;
- (void) archiveAction: (id)sender;
@end

View file

@ -5,12 +5,13 @@
#include <AppKit/NSButtonCell.h>
#include <AppKit/NSNibLoading.h>
#include <AppKit/NSWindow.h>
#include <AppKit/NSMatrix.h>
static NSString *SHOWPALETTES=@"ShowPalettes";
static NSString *SHOWINSPECTOR=@"ShowInspectors";
static NSString *BACKUPFILE=@"BackupFile";
static NSString *ARCTYPE=@"ArchiveType";
@implementation GormGeneralPref
@ -32,10 +33,32 @@ static NSString *BACKUPFILE=@"BackupFile";
//Defaults
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *arcType = [defaults stringForKey: ARCTYPE];
[inspectorButton setState: [defaults integerForKey: SHOWINSPECTOR]];
[palettesButton setState:[ defaults integerForKey: SHOWPALETTES]];
[backupButton setState:[ defaults integerForKey: BACKUPFILE]];
[palettesButton setState: [defaults integerForKey: SHOWPALETTES]];
[backupButton setState: [defaults integerForKey: BACKUPFILE]];
if([arcType isEqual: @"Typed"])
{
[archiveMatrix setState: NSOnState atRow: 0 column: 0];
[archiveMatrix setState: NSOffState atRow: 1 column: 0];
[archiveMatrix setState: NSOffState atRow: 2 column: 0];
}
else if([arcType isEqual: @"Keyed"])
{
[archiveMatrix setState: NSOffState atRow: 0 column: 0];
[archiveMatrix setState: NSOnState atRow: 1 column: 0];
[archiveMatrix setState: NSOffState atRow: 2 column: 0];
}
else if([arcType isEqual: @"Both"])
{
[archiveMatrix setState: NSOffState atRow: 0 column: 0];
[archiveMatrix setState: NSOffState atRow: 1 column: 0];
[archiveMatrix setState: NSOnState atRow: 2 column: 0];
}
}
return self;
@ -57,11 +80,12 @@ static NSString *BACKUPFILE=@"BackupFile";
{
if (sender != palettesButton)
return;
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:[palettesButton state] forKey:SHOWPALETTES];
[defaults synchronize];
}
else
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:[palettesButton state] forKey:SHOWPALETTES];
[defaults synchronize];
}
}
@ -69,11 +93,12 @@ static NSString *BACKUPFILE=@"BackupFile";
{
if (sender != inspectorButton)
return;
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:[inspectorButton state] forKey:SHOWINSPECTOR];
[defaults synchronize];
}
else
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:[inspectorButton state] forKey:SHOWINSPECTOR];
[defaults synchronize];
}
}
@ -81,11 +106,35 @@ static NSString *BACKUPFILE=@"BackupFile";
{
if (sender != backupButton)
return;
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:[backupButton state] forKey:BACKUPFILE];
[defaults synchronize];
}
else
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:[backupButton state] forKey:BACKUPFILE];
[defaults synchronize];
}
}
- (void) archiveAction: (id)sender
{
if (sender != archiveMatrix)
return;
else
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if([[archiveMatrix cellAtRow: 0 column: 0] state] == NSOnState)
{
[defaults setObject: @"Typed" forKey: ARCTYPE];
}
else if([[archiveMatrix cellAtRow: 1 column: 0] state] == NSOnState)
{
[defaults setObject: @"Keyed" forKey: ARCTYPE];
}
else if([[archiveMatrix cellAtRow: 2 column: 0] state] == NSOnState)
{
[defaults setObject: @"Both" forKey: ARCTYPE];
}
[defaults synchronize];
}
}
@end

View file

@ -506,7 +506,7 @@
while (inspector == nil && (obj = [obj superclass])
&& current == 0)
{
NSLog(@"Error loading %@ inspector", newInspector);
NSDebugLog(@"Error loading %@ inspector", newInspector);
newInspector = [obj inspectorClassName];
inspector = [NSClassFromString(newInspector) new];
}
@ -915,7 +915,7 @@ selectCellWithString: (NSString*)title
name = [[sender selectedCellInColumn: 0] stringValue];
if ([name isEqual: @"target"] == NO)
{
NSLog(@"cell selected in actions column without target");
NSDebugLog(@"cell selected in actions column without target");
}
if (row >= 0 && row < [actions count])
{

View file

@ -82,7 +82,7 @@
- (void) deleteSelection
{
NSLog(@"Cannot delete Matrix cell\n");
NSDebugLog(@"Cannot delete Matrix cell\n");
}
static BOOL done_editing;
@ -393,7 +393,7 @@ static BOOL done_editing;
{
if ((selectedRow != -1) && (selectedCol != -1))
{
NSLog(@"highlighting %@",
NSDebugLog(@"highlighting %@",
NSStringFromRect([_EO
cellFrameAtRow: selectedRow
column: selectedCol]));

View file

@ -113,7 +113,7 @@
- (void) play: (id)sender
{
NSLog(@"Play");
NSDebugLog(@"Play");
[_currentSound play];
}

View file

@ -63,7 +63,7 @@
NSEnumerator *enumerator;
NSView *sub;
NSLog(@"activating %@ GormSplitViewEditor %@", self, _EO);
NSDebugLog(@"activating %@ GormSplitViewEditor %@", self, _EO);
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(splitViewDidResizeSubviews:)
@ -75,10 +75,10 @@
while ((sub = [enumerator nextObject]) != nil)
{
NSLog(@"ac %@ editorForObject: %@", self, sub);
NSDebugLog(@"ac %@ editorForObject: %@", self, sub);
if ([sub isKindOfClass: [GormViewEditor class]] == NO)
{
NSLog(@"ac %@ yes", self);
NSDebugLog(@"ac %@ yes", self);
[document editorForObject: sub
inEditor: self
create: YES];

View file

@ -46,7 +46,7 @@
}
else
{
// NSLog(@"%@ close but already closed", self);
NSDebugLog(@"%@ close but already closed", self);
}
}

View file

@ -178,7 +178,7 @@
- (void) changeFont: (id)sender
{
NSLog(@"********* TELL pyr *********** changeFont");
NSDebugLog(@"********* TELL pyr *********** changeFont");
}
- (void) close
@ -213,7 +213,7 @@
- (void) copySelection
{
NSLog(@"********* TELL pyr *********** copySelection");
NSDebugLog(@"********* TELL pyr *********** copySelection");
}
- (void) deactivate
@ -248,7 +248,7 @@
*/
- (void) draggedImage: (NSImage*)i endedAt: (NSPoint)p deposited: (BOOL)f
{
NSLog(@"********* TELL pyr *********** draggedImage");
NSDebugLog(@"********* TELL pyr *********** draggedImage");
/*
* FIXME - handle this.
* Notification that a drag failed/succeeded.
@ -257,7 +257,7 @@
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)flag
{
NSLog(@"********* TELL pyr *********** draggingSourceOperationMaskForLocal");
NSDebugLog(@"********* TELL pyr *********** draggingSourceOperationMaskForLocal");
return NSDragOperationNone;
}
@ -273,7 +273,7 @@
- (void) drawSelection
{
NSLog(@"********* TELL pyr *********** drawSelection");
NSDebugLog(@"********* TELL pyr *********** drawSelection");
}
- (id<IBDocuments>) document
@ -338,7 +338,7 @@
- (id<IBEditors>) openSubeditorForObject: (id)anObject
{
NSLog(@"********* TELL pyr *********** openSubeditorForObject");
NSDebugLog(@"********* TELL pyr *********** openSubeditorForObject");
return nil;
}
@ -349,13 +349,13 @@
- (void) pasteInSelection
{
NSLog(@"********* TELL pyr *********** pasteInSelection");
NSDebugLog(@"********* TELL pyr *********** pasteInSelection");
// [self pasteInView: edit_view];
}
- (BOOL) performDragOperation: (id<NSDraggingInfo>)sender
{
NSLog(@"********* TELL pyr *********** performDragOperation");
NSDebugLog(@"********* TELL pyr *********** performDragOperation");
return NO;
}
@ -371,36 +371,36 @@
- (id) selectAllItems: (id)sender
{
NSLog(@"********* TELL pyr *********** selectAllItems");
NSDebugLog(@"********* TELL pyr *********** selectAllItems");
return nil;
}
- (unsigned) selectionCount
{
NSLog(@"********* TELL pyr *********** selectionCount");
NSDebugLog(@"********* TELL pyr *********** selectionCount");
return 0;
// return [selection count];
}
- (void) validateEditing
{
NSLog(@"********* TELL pyr *********** validateEditing");
NSDebugLog(@"********* TELL pyr *********** validateEditing");
}
- (void)windowDidBecomeMain: (id) aNotification
{
NSLog(@"windowDidBecomeMain %@", selection);
NSDebugLog(@"windowDidBecomeMain %@", selection);
if ([NSApp isConnecting] == NO)
{
[document setSelectionFromEditor: self];
NSLog(@"windowDidBecomeMain %@", selection);
NSDebugLog(@"windowDidBecomeMain %@", selection);
[self makeSelectionVisible: YES];
}
}
- (void)windowDidResignMain: (id) aNotification
{
NSLog(@"windowDidResignMain");
NSDebugLog(@"windowDidResignMain");
// [document setSelectionFromEditor: self];
[self makeSelectionVisible: NO];
}

View file

@ -175,7 +175,7 @@
tf = [[NSTextField alloc] initWithFrame: [self bounds]];
frame = (NSRect)[cell titleRectForBounds:
[rep rectOfItemAtIndex: pos]];
NSLog(@"cell %@ (%@)", cell, [cell stringValue]);
NSDebugLog(@"cell %@ (%@)", cell, [cell stringValue]);
frame.origin.y += 3;
frame.size.height -= 5;
frame.origin.x += 1;
@ -787,12 +787,12 @@
{
if ([edited _ownedByPopUp])
{
NSLog(@"owned by popup");
NSDebugLog(@"owned by popup");
[item setOnStateImage: nil];
[item setMixedStateImage: nil];
}
else
NSLog(@"not owned by popup");
NSDebugLog(@"not owned by popup");
[edited insertItem: item atIndex: pos++];
}
[edited sizeToFit];
@ -805,7 +805,7 @@
NSPoint loc = [sender draggingLocation];
int pos = [rep indexOfItemAtPoint: loc];
NSLog(@"Link at index: %d (%@)", pos, NSStringFromPoint(loc));
NSDebugLog(@"Link at index: %d (%@)", pos, NSStringFromPoint(loc));
if (pos >= 0)
{
id item = [edited itemAtIndex: pos];
@ -816,7 +816,7 @@ NSLog(@"Link at index: %d (%@)", pos, NSStringFromPoint(loc));
}
else
{
NSLog(@"Drop with unrecognized type (%@)!", dragType);
NSDebugLog(@"Drop with unrecognized type (%@)!", dragType);
dragType = nil;
return NO;
}

View file

@ -48,7 +48,6 @@
y = (screenRect.size.height - 300)/2;
NSRect windowRect = NSMakeRect(x,y,500,300);
// NSLog(@"Making window %@ on screen: %@",NSStringFromRect(windowRect),NSStringFromRect(screenRect));
w = [[GormNSWindow alloc] initWithContentRect: windowRect
styleMask: style
backing: NSBackingStoreRetained

View file

@ -120,13 +120,13 @@ Class _gormnspopupbuttonCellClass = 0;
@implementation GormPopUpButtonEditor
- (void) mouseDown: (NSEvent *)theEvent
{
// double-clicked -> let's edit
if (([theEvent clickCount] == 2) && [parent isOpened])
// double-clicked -> let's edit
{
[[_EO cell]
attachPopUpWithFrame: [_EO bounds]
inView: _editedObject];
NSLog(@"attach down");
NSDebugLog(@"attach down");
[[document openEditorForObject: [[_EO cell] menu]] activate];
}
else

View file

@ -138,7 +138,8 @@
"useStandardKerning:",
"useStandardLigatures:",
"yank:",
"zoom:"
"zoom:",
"archiveAction:"
);
Super = NSObject;
};
@ -146,13 +147,15 @@
Actions = (
"palettesAction:",
"inspectorAction:",
"backupAction:"
"backupAction:",
"archiveAction:"
);
Outlets = (
window,
palettesButton,
inspectorButton,
backupButton
backupButton,
archiveMatrix
);
Super = NSObject;
};