mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-13 14:13:02 +00:00
commit
07c911b995
15 changed files with 200 additions and 55 deletions
5
CODEOWNERS
Normal file
5
CODEOWNERS
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# These owners will be the default owners for everything in
|
||||||
|
# the repo. Unless a later match takes precedence,
|
||||||
|
# @global-owner1 and @global-owner2 will be requested for
|
||||||
|
# review when someone opens a pull request.
|
||||||
|
* @rmottola
|
31
ChangeLog
31
ChangeLog
|
@ -1,3 +1,34 @@
|
||||||
|
2021-08-18 Riccardo Mottola <rm@gnu.org>
|
||||||
|
|
||||||
|
* Modules/Editors/ProjectCenter/PCEditor.m
|
||||||
|
Turn off ligatures, both when setting up the editor as well as when
|
||||||
|
loading a file.
|
||||||
|
|
||||||
|
2021-08-18 Riccardo Mottola <rm@gnu.org>
|
||||||
|
|
||||||
|
* PCInfoContronoller.m
|
||||||
|
Center info panel correctly the first time on load.
|
||||||
|
|
||||||
|
2021-08-10 Gregory John Casamento <greg.casamento@gmail.com>
|
||||||
|
|
||||||
|
* Framework/PCEditorManager.m: Add method -gotoFile:atLine:
|
||||||
|
* Framework/PCProjectEditor.m: Add method openEditorForFilePath:windowed:
|
||||||
|
* Framework/PCProjectManager.m: Add method openFileAtPath:windowed:
|
||||||
|
* Headers/ProjectCenter/PCEditorManager.h
|
||||||
|
* Headers/ProjectCenter/PCProjectEditor.h
|
||||||
|
* Headers/ProjectCenter/PCProjectManager.h: Declarations for above methods.
|
||||||
|
* Modules/Debuggers/ProjectCenter/GDBWrapper.h
|
||||||
|
* Modules/Debuggers/ProjectCenter/GDBWrapper.m: Add code to pull
|
||||||
|
"thread-selected" dictionary when the debugger stops by using break/pause
|
||||||
|
or by using up or down. Code to syncronize editor with where the debugger
|
||||||
|
has stopped.
|
||||||
|
* Modules/Debuggers/ProjectCenter/PCDebugger.h
|
||||||
|
* Modules/Debuggers/ProjectCenter/PCDebugger.m: updateEditor method. This
|
||||||
|
method makes use of the gotoFile:atLine: method to get the file and show it
|
||||||
|
in the code editor and go to the line where it has stopped.
|
||||||
|
* Modules/Editors/ProjectCenter/PCEditor.m: Update internal editor
|
||||||
|
* Modules/Editors/ProjectCenter/PCEditorView.m: minor bugfixes.
|
||||||
|
|
||||||
2021-07-16 Riccardo Mottola <rm@gnu.org>
|
2021-07-16 Riccardo Mottola <rm@gnu.org>
|
||||||
|
|
||||||
* Modules/Debuggers/ProjectCenter/GDBWrapper.h
|
* Modules/Debuggers/ProjectCenter/GDBWrapper.h
|
||||||
|
|
|
@ -30,10 +30,12 @@
|
||||||
#import <ProjectCenter/PCBundleManager.h>
|
#import <ProjectCenter/PCBundleManager.h>
|
||||||
#import <ProjectCenter/PCEditorManager.h>
|
#import <ProjectCenter/PCEditorManager.h>
|
||||||
#import <ProjectCenter/PCProject.h>
|
#import <ProjectCenter/PCProject.h>
|
||||||
|
#import <ProjectCenter/PCProjectEditor.h>
|
||||||
#import <ProjectCenter/PCLogController.h>
|
#import <ProjectCenter/PCLogController.h>
|
||||||
#import <ProjectCenter/PCSaveModified.h>
|
#import <ProjectCenter/PCSaveModified.h>
|
||||||
|
|
||||||
|
#import <Protocols/CodeEditor.h>
|
||||||
|
|
||||||
#import "Modules/Preferences/Misc/PCMiscPrefs.h"
|
#import "Modules/Preferences/Misc/PCMiscPrefs.h"
|
||||||
|
|
||||||
NSString *PCEditorDidChangeFileNameNotification =
|
NSString *PCEditorDidChangeFileNameNotification =
|
||||||
|
@ -97,15 +99,6 @@ NSString *PCEditorDidResignActiveNotification =
|
||||||
selector:@selector(editorDidChangeFileName:)
|
selector:@selector(editorDidChangeFileName:)
|
||||||
name:PCEditorDidChangeFileNameNotification
|
name:PCEditorDidChangeFileNameNotification
|
||||||
object:nil];
|
object:nil];
|
||||||
|
|
||||||
// Debugger
|
|
||||||
[[NSNotificationCenter defaultCenter]
|
|
||||||
addObserver:self
|
|
||||||
selector:@selector(debuggerDidHitBreakpoint:)
|
|
||||||
name:PCProjectBreakpointNotification
|
|
||||||
object:nil];
|
|
||||||
|
|
||||||
// Preferences
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
@ -542,16 +535,15 @@ NSString *PCEditorDidResignActiveNotification =
|
||||||
[_editorsDict setObject:_editor forKey:_newFileName];
|
[_editorsDict setObject:_editor forKey:_newFileName];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)debuggerDidHitBreakpoint:(NSNotification *)aNotif
|
- (void)gotoFile: (NSString *)fileName atLine: (NSUInteger)line
|
||||||
{
|
{
|
||||||
id object = [aNotif object];
|
PCProject *project = [_projectManager rootActiveProject];
|
||||||
NSString *filePath = [object objectForKey: @"file"];
|
PCProjectEditor *pe = [project projectEditor];
|
||||||
NSString *line = [object objectForKey: @"line"];
|
|
||||||
id<CodeEditor> editor = [self openEditorForFile: filePath
|
id<CodeEditor> editor = [pe openEditorForFilePath: fileName windowed: NO];
|
||||||
editable: YES
|
|
||||||
windowed: NO];
|
// [self orderFrontEditorForFile:fileName];
|
||||||
[self orderFrontEditorForFile:filePath];
|
[editor scrollToLineNumber: line];
|
||||||
[editor scrollToLineNumber: [line integerValue]];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -177,6 +177,54 @@
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (id<CodeEditor>) openEditorForFilePath: (NSString *)filePath
|
||||||
|
windowed: (BOOL)windowed
|
||||||
|
{
|
||||||
|
PCProject *activeProject = [[_project projectManager] activeProject];
|
||||||
|
NSString *fileName = [filePath lastPathComponent];
|
||||||
|
BOOL editable = YES;
|
||||||
|
id<CodeEditor> editor = nil;
|
||||||
|
NSFileManager *mgr = [NSFileManager defaultManager];
|
||||||
|
|
||||||
|
NSLog(@"PCPE: fileName: %@, filePath: %@, project: %@",
|
||||||
|
fileName, filePath, [activeProject projectName]);
|
||||||
|
|
||||||
|
if (![mgr fileExistsAtPath: filePath])
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine if file should be opened for read only
|
||||||
|
if (![_project isEditableFile:fileName])
|
||||||
|
{
|
||||||
|
editable = NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the 'editor' var either by requesting already opened
|
||||||
|
// editor or by creating the new one.
|
||||||
|
editor = [self openEditorForFile:filePath
|
||||||
|
editable:editable
|
||||||
|
windowed:windowed];
|
||||||
|
if (!editor)
|
||||||
|
{
|
||||||
|
NSLog(@"We don't have editor for file: %@", fileName);
|
||||||
|
[self setActiveEditor: nil];
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Category path was changed by user's clicking inside browser.
|
||||||
|
// That's why new category path must be transfered to editor.
|
||||||
|
NSString *categoryPath = [NSString stringWithFormat: @"/Classes/%@/", fileName];
|
||||||
|
[editor setCategoryPath:categoryPath];
|
||||||
|
[self orderFrontEditorForFile:filePath];
|
||||||
|
|
||||||
|
// Reload last column because editor has just been loaded
|
||||||
|
[[_project projectBrowser] reloadLastColumnAndNotify:NO];
|
||||||
|
[editor fileStructureItemSelected:fileName];
|
||||||
|
|
||||||
|
return editor;
|
||||||
|
}
|
||||||
|
|
||||||
// Called by PCProjectBrowser
|
// Called by PCProjectBrowser
|
||||||
// categoryPath:
|
// categoryPath:
|
||||||
// 1. "/Classes/Class.m/- init"
|
// 1. "/Classes/Class.m/- init"
|
||||||
|
|
|
@ -1124,6 +1124,7 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
- (void)openFileAtPath:(NSString *)filePath
|
- (void)openFileAtPath:(NSString *)filePath
|
||||||
|
windowed:(BOOL)windowed
|
||||||
{
|
{
|
||||||
editorManager = [self editorManager];
|
editorManager = [self editorManager];
|
||||||
|
|
||||||
|
@ -1131,11 +1132,17 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
||||||
{
|
{
|
||||||
[editorManager openEditorForFile:filePath
|
[editorManager openEditorForFile:filePath
|
||||||
editable:YES
|
editable:YES
|
||||||
windowed:YES];
|
windowed:windowed];
|
||||||
[editorManager orderFrontEditorForFile:filePath];
|
[editorManager orderFrontEditorForFile:filePath];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)openFileAtPath:(NSString *)filePath
|
||||||
|
{
|
||||||
|
[self openFileAtPath: filePath windowed: YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void)openFile
|
- (void)openFile
|
||||||
{
|
{
|
||||||
NSArray *files = nil;
|
NSArray *files = nil;
|
||||||
|
|
|
@ -69,6 +69,7 @@
|
||||||
- (NSArray *)allEditors;
|
- (NSArray *)allEditors;
|
||||||
- (void)closeActiveEditor:(id)sender;
|
- (void)closeActiveEditor:(id)sender;
|
||||||
- (void)closeEditorForFile:(NSString *)file;
|
- (void)closeEditorForFile:(NSString *)file;
|
||||||
|
- (void)gotoFile: (NSString *)fileName atLine: (NSUInteger)line;
|
||||||
|
|
||||||
- (NSArray *)modifiedFiles;
|
- (NSArray *)modifiedFiles;
|
||||||
- (BOOL)hasModifiedFiles;
|
- (BOOL)hasModifiedFiles;
|
||||||
|
|
|
@ -67,6 +67,9 @@
|
||||||
|
|
||||||
- (BOOL)editorProvidesBrowserItemsForItem:(NSString *)item;
|
- (BOOL)editorProvidesBrowserItemsForItem:(NSString *)item;
|
||||||
|
|
||||||
|
- (id<CodeEditor>)openEditorForFilePath:(NSString *)categoryPath
|
||||||
|
windowed:(BOOL)windowed;
|
||||||
|
|
||||||
- (id<CodeEditor>)openEditorForCategoryPath:(NSString *)categoryPath
|
- (id<CodeEditor>)openEditorForCategoryPath:(NSString *)categoryPath
|
||||||
windowed:(BOOL)windowed;
|
windowed:(BOOL)windowed;
|
||||||
|
|
||||||
|
|
|
@ -164,6 +164,7 @@ extern NSString *PCActiveProjectDidChangeNotification;
|
||||||
|
|
||||||
// Also called by PCAppController
|
// Also called by PCAppController
|
||||||
- (void)openFileAtPath:(NSString *)filePath;
|
- (void)openFileAtPath:(NSString *)filePath;
|
||||||
|
- (void)openFileAtPath:(NSString *)filePath windowed: (BOOL)windowed;
|
||||||
- (void)openFile;
|
- (void)openFile;
|
||||||
- (void)newFile;
|
- (void)newFile;
|
||||||
- (BOOL)saveFile;
|
- (BOOL)saveFile;
|
||||||
|
|
|
@ -379,6 +379,29 @@
|
||||||
[debugger setLastLineNumberParsed: NSNotFound];
|
[debugger setLastLineNumberParsed: NSNotFound];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ([dictionaryName isEqualToString: @"thread-selected"])
|
||||||
|
{
|
||||||
|
NSDictionary *d = [dict objectForKey: @"frame"];
|
||||||
|
NSString *fileName;
|
||||||
|
NSString *lineNum;
|
||||||
|
|
||||||
|
fileName = [d objectForKey:@"fullname"];
|
||||||
|
lineNum = [d objectForKey:@"line"];
|
||||||
|
|
||||||
|
NSLog(@"parsed from GDB thread-selected: %@:%@", fileName, lineNum);
|
||||||
|
if (fileName != nil && lineNum != nil)
|
||||||
|
{
|
||||||
|
[debugger setLastFileNameParsed: fileName];
|
||||||
|
[debugger setLastLineNumberParsed: [lineNum intValue]];
|
||||||
|
[debugger updateEditor];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[debugger setLastFileNameParsed: nil];
|
||||||
|
[debugger setLastLineNumberParsed: NSNotFound];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -423,6 +446,7 @@
|
||||||
{
|
{
|
||||||
[debugger setLastFileNameParsed: fileName];
|
[debugger setLastFileNameParsed: fileName];
|
||||||
[debugger setLastLineNumberParsed: [lineNum intValue]];
|
[debugger setLastLineNumberParsed: [lineNum intValue]];
|
||||||
|
[debugger updateEditor];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -66,5 +66,6 @@ extern NSString *PCDBDebuggerStartedNotification;
|
||||||
- (void) setLastFileNameParsed: (NSString *)fname;
|
- (void) setLastFileNameParsed: (NSString *)fname;
|
||||||
- (NSUInteger)lastLineNumberParsed;
|
- (NSUInteger)lastLineNumberParsed;
|
||||||
- (void)setLastLineNumberParsed: (NSUInteger)num;
|
- (void)setLastLineNumberParsed: (NSUInteger)num;
|
||||||
|
- (void)updateEditor;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -33,6 +33,10 @@
|
||||||
#import "PCDebugger.h"
|
#import "PCDebugger.h"
|
||||||
#import "PCDebuggerView.h"
|
#import "PCDebuggerView.h"
|
||||||
|
|
||||||
|
#import <ProjectCenter/PCProjectManager.h>
|
||||||
|
#import <ProjectCenter/PCEditorManager.h>
|
||||||
|
#import "PCAppController.h"
|
||||||
|
|
||||||
#import "Modules/Preferences/EditorFSC/PCEditorFSCPrefs.h"
|
#import "Modules/Preferences/EditorFSC/PCEditorFSCPrefs.h"
|
||||||
#import "PCDebuggerWrapperProtocol.h"
|
#import "PCDebuggerWrapperProtocol.h"
|
||||||
#import "GDBWrapper.h"
|
#import "GDBWrapper.h"
|
||||||
|
@ -306,6 +310,15 @@ NSString *PCDBDebuggerStartedNotification = @"PCDBDebuggerStartedNotification";
|
||||||
lastLineNumberParsed = num;
|
lastLineNumberParsed = num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) updateEditor
|
||||||
|
{
|
||||||
|
PCAppController *controller = (PCAppController *)[NSApp delegate];
|
||||||
|
PCProjectManager *pm = [controller projectManager];
|
||||||
|
PCEditorManager *em = [pm editorManager];
|
||||||
|
[em gotoFile: lastFileNameParsed
|
||||||
|
atLine: lastLineNumberParsed];
|
||||||
|
}
|
||||||
|
|
||||||
// kill process
|
// kill process
|
||||||
- (void) interrupt
|
- (void) interrupt
|
||||||
{
|
{
|
||||||
|
|
|
@ -197,6 +197,7 @@
|
||||||
tSelCol, NSForegroundColorAttributeName,
|
tSelCol, NSForegroundColorAttributeName,
|
||||||
nil];
|
nil];
|
||||||
[ev setSelectedTextAttributes:selAttributes];
|
[ev setSelectedTextAttributes:selAttributes];
|
||||||
|
[ev turnOffLigatures:self];
|
||||||
|
|
||||||
// Activate undo
|
// Activate undo
|
||||||
[ev setAllowsUndo: YES];
|
[ev setAllowsUndo: YES];
|
||||||
|
@ -345,9 +346,13 @@
|
||||||
textBackground = readOnlyColor;
|
textBackground = readOnlyColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
textColor = [prefs colorForKey:EditorForegroundColor defaultValue:textColor];
|
||||||
|
|
||||||
[attributes setObject:font forKey:NSFontAttributeName];
|
[attributes setObject:font forKey:NSFontAttributeName];
|
||||||
[attributes setObject:textBackground forKey:NSBackgroundColorAttributeName];
|
[attributes setObject:textBackground forKey:NSBackgroundColorAttributeName];
|
||||||
[attributes setObject:[prefs colorForKey:EditorForegroundColor defaultValue:textColor] forKey:NSForegroundColorAttributeName];
|
[attributes setObject:textColor forKey:NSForegroundColorAttributeName];
|
||||||
|
[attributes setObject:[NSNumber numberWithInt: 0] // disable ligatures
|
||||||
|
forKey:NSLigatureAttributeName];
|
||||||
|
|
||||||
text = [NSString stringWithContentsOfFile:_path];
|
text = [NSString stringWithContentsOfFile:_path];
|
||||||
attributedString = [attributedString initWithString:text attributes:attributes];
|
attributedString = [attributedString initWithString:text attributes:attributes];
|
||||||
|
@ -790,7 +795,11 @@
|
||||||
|
|
||||||
// This is temporary
|
// This is temporary
|
||||||
ft = [NSFont userFixedPitchFontOfSize:0.0];
|
ft = [NSFont userFixedPitchFontOfSize:0.0];
|
||||||
at = [NSDictionary dictionaryWithObject:ft forKey:NSFontAttributeName];
|
at = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
|
ft, NSFontAttributeName,
|
||||||
|
[NSNumber numberWithInt: 0], NSLigatureAttributeName,
|
||||||
|
nil];
|
||||||
|
|
||||||
as = [[NSAttributedString alloc] initWithString:text attributes:at];
|
as = [[NSAttributedString alloc] initWithString:text attributes:at];
|
||||||
|
|
||||||
[self setIsEdited:NO];
|
[self setIsEdited:NO];
|
||||||
|
@ -985,15 +994,36 @@
|
||||||
if ([object isKindOfClass:[NSTextView class]])
|
if ([object isKindOfClass:[NSTextView class]])
|
||||||
{
|
{
|
||||||
NSTextView *tv = (NSTextView *)object;
|
NSTextView *tv = (NSTextView *)object;
|
||||||
NSArray *selArray;
|
NSString *str = [tv string];
|
||||||
NSRange lastSelection;
|
NSRange selection;
|
||||||
NSRange selRange;
|
NSUInteger selLine = NSNotFound;
|
||||||
NSUInteger selLine;
|
|
||||||
|
|
||||||
selArray = [tv selectedRanges];
|
// for speed reasons we cache [NSString characterAtIndex:index]
|
||||||
lastSelection = [[selArray lastObject] rangeValue];
|
SEL charAtIndexSel = @selector(characterAtIndex:);
|
||||||
NSLog(@"last selection is %@", [selArray lastObject]);
|
unichar (*charAtIndexFunc)(NSString *, SEL, NSUInteger);
|
||||||
[[tv string] getLineStart:NULL end:&selLine contentsEnd:NULL forRange:lastSelection];
|
charAtIndexFunc = (unichar (*)())[str methodForSelector:charAtIndexSel];
|
||||||
|
|
||||||
|
selection = [tv selectedRange];
|
||||||
|
// now we calculate given the selection the line count, splitting on \n
|
||||||
|
// calling lineRangeForRange / paragraphForRange does the same thing
|
||||||
|
// we want to avoid to scan the string twice
|
||||||
|
{
|
||||||
|
NSUInteger i;
|
||||||
|
unichar ch;
|
||||||
|
NSUInteger nlCount;
|
||||||
|
|
||||||
|
nlCount = 0;
|
||||||
|
for (i = 0; i < selection.location; i++)
|
||||||
|
{
|
||||||
|
// ch = [str characterAtIndex:i];
|
||||||
|
ch = (*charAtIndexFunc)(str, charAtIndexSel, i);
|
||||||
|
if (ch == (unichar)0x000A) // new line
|
||||||
|
nlCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
selLine = nlCount + 1;
|
||||||
|
}
|
||||||
|
NSLog(@"%u corresponds to %u", selection.location, selLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1121,6 +1151,8 @@
|
||||||
{
|
{
|
||||||
[_intEditorView goToLineNumber:lineNumber];
|
[_intEditorView goToLineNumber:lineNumber];
|
||||||
[_extEditorView goToLineNumber:lineNumber];
|
[_extEditorView goToLineNumber:lineNumber];
|
||||||
|
[_intEditorView centerSelectionInVisibleArea: self];
|
||||||
|
[_extEditorView centerSelectionInVisibleArea: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -183,7 +183,7 @@ static int ComputeIndentingOffset(NSString * string, unsigned int start)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"index: %i start: %i", index, line_start);
|
NSLog(@"index: %li start: %li", index, line_start);
|
||||||
|
|
||||||
return line_start > index ? index : line_start;
|
return line_start > index ? index : line_start;
|
||||||
}
|
}
|
||||||
|
@ -311,7 +311,7 @@ static int ComputeIndentingOffset(NSString * string, unsigned int start)
|
||||||
if (![wsCharSet characterIsMember:c])
|
if (![wsCharSet characterIsMember:c])
|
||||||
{
|
{
|
||||||
offset = offset - line_start;
|
offset = offset - line_start;
|
||||||
NSLog(@"offset: %i", offset);
|
NSLog(@"offset: %li", offset);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -328,7 +328,7 @@ static int ComputeIndentingOffset(NSString * string, unsigned int start)
|
||||||
|
|
||||||
// Get offset from BOL of previous line
|
// Get offset from BOL of previous line
|
||||||
// offset = ComputeIndentingOffset([self string], line_start-1);
|
// offset = ComputeIndentingOffset([self string], line_start-1);
|
||||||
NSLog(@"Indent offset: %i", offset);
|
NSLog(@"Indent offset: %li", offset);
|
||||||
|
|
||||||
// Replace current line whitespaces with new ones
|
// Replace current line whitespaces with new ones
|
||||||
indentString = [[NSMutableString alloc] initWithString:@""];
|
indentString = [[NSMutableString alloc] initWithString:@""];
|
||||||
|
|
|
@ -64,6 +64,8 @@
|
||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
{
|
{
|
||||||
|
RELEASE(infoController);
|
||||||
|
RELEASE(projectManager);
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,13 @@
|
||||||
|
|
||||||
infoDict = [NSDictionary dictionaryWithContentsOfFile:file];
|
infoDict = [NSDictionary dictionaryWithContentsOfFile:file];
|
||||||
RETAIN(infoDict);
|
RETAIN(infoDict);
|
||||||
|
|
||||||
|
if ([NSBundle loadNibNamed:@"Info" owner:self] == NO)
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
[versionField setStringValue:[NSString stringWithFormat:@"Version %@", [infoDict objectForKey:@"ApplicationRelease"]]];
|
||||||
|
[infoWindow center];
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
@ -56,29 +63,7 @@
|
||||||
|
|
||||||
- (void)showInfoWindow:(id)sender
|
- (void)showInfoWindow:(id)sender
|
||||||
{
|
{
|
||||||
if ([NSBundle loadNibNamed:@"Info" owner:self] == NO)
|
|
||||||
{
|
|
||||||
// PCLogError(self, @"error loading Menu NIB file!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
[infoWindow makeKeyAndOrderFront:self];
|
[infoWindow makeKeyAndOrderFront:self];
|
||||||
[versionField setStringValue:[NSString stringWithFormat:@"Version %@", [infoDict objectForKey:@"ApplicationRelease"]]];
|
|
||||||
|
|
||||||
/*#if defined(GNUSTEP)
|
|
||||||
if (!infoWindow)
|
|
||||||
{
|
|
||||||
infoWindow = [[GSInfoPanel alloc] initWithDictionary:infoDict];
|
|
||||||
}
|
|
||||||
|
|
||||||
[infoWindow setTitle:@"Info"];
|
|
||||||
[infoWindow center];
|
|
||||||
[infoWindow makeKeyAndOrderFront:self];
|
|
||||||
#else
|
|
||||||
NSRunAlertPanel(@"Info",
|
|
||||||
@"OPENSTEP has no support for GSInfoPanel",
|
|
||||||
@"OK",nil,nil,nil);
|
|
||||||
#endif*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in a new issue